1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./entry.VfXgiKkI.css"])))=>i.map(i=>d[i]); 2import{i8 as _n,fV as Dr,i9 as cg,bm as hg,aP as fg,dl as pg,bb as gg,da as mg,aT as yg,aU as _g,aV as su,cR as vg,b4 as or,b5 as Tg}from"./C0l3ak4x.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"f2535d841cdd2b4a49d7fb72025d6267e58b2144"};var e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="94d949b4-ec02-4bb3-8838-65615c77d7e2",s._sentryDebugIdIdentifier="sentry-dbid-94d949b4-ec02-4bb3-8838-65615c77d7e2")}catch{}})();var xa,ru;function Un(){if(ru)return xa;ru=1;var s;return typeof window<"u"?s=window:typeof _n<"u"?s=_n:typeof self<"u"?s=self:s={},xa=s,xa}var bg=Un();const D=Dr(bg),Sg={},xg=Object.freeze(Object.defineProperty({__proto__:null,default:Sg},Symbol.toStringTag,{value:"Module"})),Eg=cg(xg);var Ea,nu;function Nd(){if(nu)return Ea;nu=1;var s=typeof _n<"u"?_n:typeof window<"u"?window:{},e=Eg,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),Ea=t,Ea}var Cg=Nd();const ie=Dr(Cg);var ln={exports:{}},Ca={exports:{}},au;function Ag(){return au||(au=1,(function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s.exports.__esModule=!0,s.exports.default=s.exports,e.apply(null,arguments)}s.exports=e,s.exports.__esModule=!0,s.exports.default=s.exports})(Ca)),Ca.exports}var Aa,ou;function Dg(){if(ou)return Aa;ou=1,Aa=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var i=s.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return Aa}var Da,lu;function wg(){if(lu)return Da;lu=1;function s(r,n){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||n){a&&(r=a);var l=0;return function(){return l>=r.length?{done:!0}:{done:!1,value:r[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(r,n){if(r){if(typeof r=="string")return t(r,n);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,n)}}function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var a=0,l=new Array(n);a<n;a++)l[a]=r[a];return l}var i=(function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=r.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(l,d){this.typeToInterceptorsMap_.has(l)||this.typeToInterceptorsMap_.set(l,new Set);
vendor: 6,394 bytes, lines 3-4
3var f=this.typeToInterceptorsMap_.get(l);return f.has(d)?!1:(f.add(d),!0)},n.removeInterceptor=function(l,d){var f=this.typeToInterceptorsMap_.get(l);return f&&f.has(d)?(f.delete(d),!0):!1},n.clearInterceptorsByType=function(l){var d=this.typeToInterceptorsMap_.get(l);return d?(this.typeToInterceptorsMap_.delete(l),this.typeToInterceptorsMap_.set(l,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(l){return this.typeToInterceptorsMap_.get(l)||new Set},n.execute=function(l,d){for(var f=this.getForType(l),m=s(f),y;!(y=m()).done;){var k=y.value;try{d=k(d)}catch{}}return d},r})();return Da=i,Da}var wa,uu;function kg(){if(uu)return wa;uu=1;var s=(function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(n){this.maxAttempts_=n},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(n){this.delayFactor_=n},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(n){this.fuzzFactor_=n},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(n){this.initialDelay_=n},i.createRetry=function(n){var a=n===void 0?{}:n,l=a.maxAttempts,d=a.delayFactor,f=a.fuzzFactor,m=a.initialDelay;return new e({maxAttempts:l||this.maxAttempts_,delayFactor:d||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:m||this.initialDelay_})},t})(),e=(function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},i.getCurrentDelay=function(){return this.currentDelay_},i.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},i.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},i.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t})();return wa=s,wa}var ka,du;function Ig(){if(du)return ka;du=1;var s=Un(),e=function(r,n){return n===void 0&&(n=!1),function(a,l,d){if(a){r(a);return}if(l.statusCode>=400&&l.statusCode<=599){var f=d;if(n)if(s.TextDecoder){var m=t(l.headers&&l.headers["content-type"]);try{f=new TextDecoder(m).decode(d)}catch{}}else f=String.fromCharCode.apply(null,new Uint8Array(d));r({cause:f});return}r(null,d)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),l=a[0],d=a[1];return l.trim()==="charset"?d.trim():r},"utf-8")}return ka=e,ka}var cu;function Pg(){if(cu)return ln.exports;cu=1;var s=Un(),e=Ag(),t=Dg(),i=wg(),r=kg();f.httpHandler=Ig(),f.requestInterceptorsStorage=new i,f.responseInterceptorsStorage=new i,f.retryManager=new r;var n=function(O){var v={};return O&&O.trim().split(` 4`).forEach(function(P){var B=P.indexOf(":"),N=P.slice(0,B).trim().toLowerCase(),L=P.slice(B+1).trim();typeof v[N]>"u"?v[N]=L:Array.isArray(v[N])?v[N].push(L):v[N]=[v[N],L]}),v};ln.exports=f,ln.exports.default=f,f.XMLHttpRequest=s.XMLHttpRequest||k,f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){f[E==="delete"?"del":E]=function(O,v,P){return v=d(O,v,P),v.method=E.toUpperCase(),m(v)}});function a(E,O){for(var v=0;v<E.length;v++)O(E[v])}function l(E){for(var O in E)if(E.hasOwnProperty(O))return!1;return!0}function d(E,O,v){var P=E;return t(O)?(v=O,typeof E=="string"&&(P={uri:E})):P=e({},O,{uri:E}),P.callback=v,P}function f(E,O,v){return O=d(E,O,v),m(O)}function m(E){if(typeof E.callback>"u")throw new Error("callback argument missing");if(E.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var O={uri:E.uri||E.url,headers:E.headers||{},body:E.body,metadata:E.metadata||{},retry:E.retry,timeout:E.timeout},v=f.requestInterceptorsStorage.execute(E.requestType,O);E.uri=v.uri,E.headers=v.headers,E.body=v.body,E.metadata=v.metadata,E.retry=v.retry,E.timeout=v.timeout}var P=!1,B=function(Z,J,te){P||(P=!0,E.callback(Z,J,te))};function N(){q.readyState===4&&!f.responseInterceptorsStorage.getIsEnabled()&&setTimeout(j,0)}function L(){var Y=void 0;if(q.response?Y=q.response:Y=q.responseText||y(q),W)try{Y=JSON.parse(Y)}catch{}return Y}function V(Y){if(clearTimeout(ee),clearTimeout(E.retryTimeout),Y instanceof Error||(Y=new Error(""+(Y||"Unknown XMLHttpRequest Error"))),Y.statusCode=0,!H&&f.retryManager.getIsEnabled()&&E.retry&&E.retry.shouldRetry()){E.retryTimeout=setTimeout(function(){E.retry.moveToNextAttempt(),E.xhr=q,m(E)},E.retry.getCurrentFuzzedDelay());return}if(E.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var Z={headers:se.headers||{},body:se.body,responseUrl:q.responseURL,responseType:q.responseType},J=f.responseInterceptorsStorage.execute(E.requestType,Z);se.body=J.body,se.headers=J.headers}return B(Y,se)}function j(){if(!H){var Y;clearTimeout(ee),clearTimeout(E.retryTimeout),E.useXDR&&q.status===void 0?Y=200:Y=q.status===1223?204:q.status;var Z=se,J=null;if(Y!==0?(Z={body:L(),statusCode:Y,method:C,headers:{},url:T,rawRequest:q},q.getAllResponseHeaders&&(Z.headers=n(q.getAllResponseHeaders()))):J=new Error("Internal XMLHttpRequest Error"),E.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var te={headers:Z.headers||{},body:Z.body,responseUrl:q.responseURL,responseType:q.responseType},oe=f.responseInterceptorsStorage.execute(E.requestType,te);Z.body=oe.body,Z.headers=oe.headers}return B(J,Z,Z.body)}}var q=E.xhr||null;q||(E.cors||E.useXDR?q=new f.XDomainRequest:q=new f.XMLHttpRequest);var R,H,T=q.url=E.uri||E.url,C=q.method=E.method||"GET",U=E.body||E.data,K=q.headers=E.headers||{},$=!!E.sync,W=!1,ee,se={body:void 0,headers:{},statusCode:0,method:C,url:T,rawRequest:q};
4if("json"in E&&E.json!==!1&&(W=!0,K.accept||K.Accept||(K.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(K["content-type"]||K["Content-Type"]||(K["Content-Type"]="application/json"),U=JSON.stringify(E.json===!0?U:E.json))),q.onreadystatechange=N,q.onload=j,q.onerror=V,q.onprogress=function(){},q.onabort=function(){H=!0,clearTimeout(E.retryTimeout)},q.ontimeout=V,q.open(C,T,!$,E.username,E.password),$||(q.withCredentials=!!E.withCredentials),!$&&E.timeout>0&&(ee=setTimeout(function(){if(!H){H=!0,q.abort("timeout");var Y=new Error("XMLHttpRequest timeout");Y.code="ETIMEDOUT",V(Y)}},E.timeout)),q.setRequestHeader)for(R in K)K.hasOwnProperty(R)&&q.setRequestHeader(R,K[R]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(q.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(q),q.send(U||null),q}function y(E){try{if(E.responseType==="document")return E.responseXML;var O=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!O)return E.responseXML}catch{}return null}function k(){}return ln.exports}var Lg=Pg();const Bd=Dr(Lg);var Ia={exports:{}},Pa,hu;function Og(){if(hu)return Pa;hu=1;var s=Nd(),e=Object.create||(function(){function T(){}return function(C){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return T.prototype=C,new T}})();function t(T,C){this.name="ParsingError",this.code=T.code,this.message=C||T.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(T){function C(K,$,W,ee){return(K|0)*3600+($|0)*60+(W|0)+(ee|0)/1e3}var U=T.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return U?U[3]?C(U[1],U[2],U[3].replace(":",""),U[4]):U[1]>59?C(U[1],U[2],0,U[4]):C(0,U[1],U[2],U[4]):null}function r(){this.values=e(null)}r.prototype={set:function(T,C){!this.get(T)&&C!==""&&(this.values[T]=C)},get:function(T,C,U){return U?this.has(T)?this.values[T]:C[U]:this.has(T)?this.values[T]:C},has:function(T){return T in this.values},alt:function(T,C,U){for(var K=0;K<U.length;++K)if(C===U[K]){this.set(T,C);break}},integer:function(T,C){/^-?\d+$/.test(C)&&this.set(T,parseInt(C,10))},percent:function(T,C){return C.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(C=parseFloat(C),C>=0&&C<=100)?(this.set(T,C),!0):!1}};function n(T,C,U,K){var $=K?T.split(K):[T];
vendor: 17,934 bytes, lines 4-11
4for(var W in $)if(typeof $[W]=="string"){var ee=$[W].split(U);if(ee.length===2){var se=ee[0].trim(),Y=ee[1].trim();C(se,Y)}}}function a(T,C,U){var K=T;function $(){var se=i(T);if(se===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+K);return T=T.replace(/^[^\sa-zA-Z-]+/,""),se}function W(se,Y){var Z=new r;n(se,function(J,te){switch(J){case"region":for(var oe=U.length-1;oe>=0;oe--)if(U[oe].id===te){Z.set(J,U[oe].region);break}break;case"vertical":Z.alt(J,te,["rl","lr"]);break;case"line":var me=te.split(","),de=me[0];Z.integer(J,de),Z.percent(J,de)&&Z.set("snapToLines",!1),Z.alt(J,de,["auto"]),me.length===2&&Z.alt("lineAlign",me[1],["start","center","end"]);break;case"position":me=te.split(","),Z.percent(J,me[0]),me.length===2&&Z.alt("positionAlign",me[1],["start","center","end"]);break;case"size":Z.percent(J,te);break;case"align":Z.alt(J,te,["start","center","end","left","right"]);break}},/:/,/\s/),Y.region=Z.get("region",null),Y.vertical=Z.get("vertical","");try{Y.line=Z.get("line","auto")}catch{}Y.lineAlign=Z.get("lineAlign","start"),Y.snapToLines=Z.get("snapToLines",!0),Y.size=Z.get("size",100);try{Y.align=Z.get("align","center")}catch{Y.align=Z.get("align","middle")}try{Y.position=Z.get("position","auto")}catch{Y.position=Z.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Y.align)}Y.positionAlign=Z.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Y.align)}function ee(){T=T.replace(/^\s+/,"")}if(ee(),C.startTime=$(),ee(),T.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+K);T=T.substr(3),ee(),C.endTime=$(),ee(),W(T,C)}var l=s.createElement&&s.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},f={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},m={v:"title",lang:"lang"},y={rt:"ruby"};function k(T,C){function U(){if(!C)return null;function de(pe){return C=C.substr(pe.length),pe}var xe=C.match(/^([^<]*)(<[^>]*>?)?/);return de(xe[1]?xe[1]:xe[2])}function K(de){return l.innerHTML=de,de=l.textContent,l.textContent="",de}function $(de,xe){return!y[xe.localName]||y[xe.localName]===de.localName}function W(de,xe){var pe=d[de];if(!pe)return null;var Ae=T.document.createElement(pe),Je=m[de];return Je&&xe&&(Ae[Je]=xe.trim()),Ae}for(var ee=T.document.createElement("div"),se=ee,Y,Z=[];(Y=U())!==null;){if(Y[0]==="<"){if(Y[1]==="/"){Z.length&&Z[Z.length-1]===Y.substr(2).replace(">","")&&(Z.pop(),se=se.parentNode);continue}var J=i(Y.substr(1,Y.length-2)),te;if(J){te=T.document.createProcessingInstruction("timestamp",J),se.appendChild(te);continue}var oe=Y.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!oe||(te=W(oe[1],oe[3]),!te)||!$(se,te))continue;if(oe[2]){var me=oe[2].split(".");me.forEach(function(de){var xe=/^bg_/.test(de),pe=xe?de.slice(3):de;if(f.hasOwnProperty(pe)){var Ae=xe?"background-color":"color",Je=f[pe];te.style[Ae]=Je}}),te.className=me.join(" ")}Z.push(oe[1]),se.appendChild(te),se=te;continue}se.appendChild(T.document.createTextNode(K(Y)))}return ee}var E=[[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 O(T){for(var C=0;C<E.length;C++){var U=E[C];if(T>=U[0]&&T<=U[1])return!0}return!1}function v(T){var C=[],U="",K;if(!T||!T.childNodes)return"ltr";function $(se,Y){for(var Z=Y.childNodes.length-1;Z>=0;Z--)se.push(Y.childNodes[Z])}function W(se){if(!se||!se.length)return null;var Y=se.pop(),Z=Y.textContent||Y.innerText;if(Z){var J=Z.match(/^.*(\n|\r)/);return J?(se.length=0,J[0]):Z}if(Y.tagName==="ruby")return W(se);if(Y.childNodes)return $(se,Y),W(se)}for($(C,T);U=W(C);)for(var ee=0;ee<U.length;ee++)if(K=U.charCodeAt(ee),O(K))return"rtl";return"ltr"}function P(T){if(typeof T.line=="number"&&(T.snapToLines||T.line>=0&&T.line<=100))return T.line;if(!T.track||!T.track.textTrackList||!T.track.textTrackList.mediaElement)return-1;for(var C=T.track,U=C.textTrackList,K=0,$=0;$<U.length&&U[$]!==C;$++)U[$].mode==="showing"&&K++;return++K*-1}function B(){}B.prototype.applyStyles=function(T,C){C=C||this.div;for(var U in T)T.hasOwnProperty(U)&&(C.style[U]=T[U])},B.prototype.formatStyle=function(T,C){return T===0?0:T+C};function N(T,C,U){B.call(this),this.cue=C,this.cueDiv=k(T,C.text);var K={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(K,this.cueDiv),this.div=T.document.createElement("div"),K={direction:v(this.cueDiv),writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:C.align==="middle"?"center":C.align,font:U.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(K),this.div.appendChild(this.cueDiv);var $=0;switch(C.positionAlign){case"start":case"line-left":$=C.position;break;case"center":$=C.position-C.size/2;break;case"end":case"line-right":$=C.position-C.size;break}C.vertical===""?this.applyStyles({left:this.formatStyle($,"%"),width:this.formatStyle(C.size,"%")}):this.applyStyles({top:this.formatStyle($,"%"),height:this.formatStyle(C.size,"%")}),this.move=function(W){this.applyStyles({top:this.formatStyle(W.top,"px"),bottom:this.formatStyle(W.bottom,"px"),left:this.formatStyle(W.left,"px"),right:this.formatStyle(W.right,"px"),height:this.formatStyle(W.height,"px"),width:this.formatStyle(W.width,"px")})}}N.prototype=e(B.prototype),N.prototype.constructor=N;function L(T){var C,U,K,$;if(T.div){U=T.div.offsetHeight,K=T.div.offsetWidth,$=T.div.offsetTop;var W=(W=T.div.childNodes)&&(W=W[0])&&W.getClientRects&&W.getClientRects();T=T.div.getBoundingClientRect(),C=W?Math.max(W[0]&&W[0].height||0,T.height/W.length):0}this.left=T.left,this.right=T.right,this.top=T.top||$,this.height=T.height||U,this.bottom=T.bottom||$+(T.height||U),this.width=T.width||K,this.lineHeight=C!==void 0?C:T.lineHeight}L.prototype.move=function(T,C){switch(C=C!==void 0?C:this.lineHeight,T){case"+x":this.left+=C,this.right+=C;break;case"-x":this.left-=C,this.right-=C;break;case"+y":this.top+=C,this.bottom+=C;break;case"-y":this.top-=C,this.bottom-=C;break}},L.prototype.overlaps=function(T){return this.left<T.right&&this.right>T.left&&this.top<T.bottom&&this.bottom>T.top},L.prototype.overlapsAny=function(T){for(var C=0;C<T.length;C++)if(this.overlaps(T[C]))return!0;return!1},L.prototype.within=function(T){return this.top>=T.top&&this.bottom<=T.bottom&&this.left>=T.left&&this.right<=T.right},L.prototype.overlapsOppositeAxis=function(T,C){switch(C){case"+x":return this.left<T.left;case"-x":return this.right>T.right;case"+y":return this.top<T.top;case"-y":return this.bottom>T.bottom}},L.prototype.intersectPercentage=function(T){var C=Math.max(0,Math.min(this.right,T.right)-Math.max(this.left,T.left)),U=Math.max(0,Math.min(this.bottom,T.bottom)-Math.max(this.top,T.top)),K=C*U;return K/(this.height*this.width)},L.prototype.toCSSCompatValues=function(T){return{top:this.top-T.top,bottom:T.bottom-this.bottom,left:this.left-T.left,right:T.right-this.right,height:this.height,width:this.width}},L.getSimpleBoxPosition=function(T){var C=T.div?T.div.offsetHeight:T.tagName?T.offsetHeight:0,U=T.div?T.div.offsetWidth:T.tagName?T.offsetWidth:0,K=T.div?T.div.offsetTop:T.tagName?T.offsetTop:0;T=T.div?T.div.getBoundingClientRect():T.tagName?T.getBoundingClientRect():T;var $={left:T.left,right:T.right,top:T.top||K,height:T.height||C,bottom:T.bottom||K+(T.height||C),width:T.width||U};return $};function V(T,C,U,K){function $(pe,Ae){for(var Je,Qe=new L(pe),rt=1,mt=0;mt<Ae.length;mt++){for(;pe.overlapsOppositeAxis(U,Ae[mt])||pe.within(U)&&pe.overlapsAny(K);)pe.move(Ae[mt]);if(pe.within(U))return pe;var Gt=pe.intersectPercentage(U);rt>Gt&&(Je=new L(pe),rt=Gt),pe=new L(Qe)}return Je||Qe}var W=new L(C),ee=C.cue,se=P(ee),Y=[];if(ee.snapToLines){var Z;switch(ee.vertical){case"":Y=["+y","-y"],Z="height";break;case"rl":Y=["+x","-x"],Z="width";break;case"lr":Y=["-x","+x"],Z="width";break}var J=W.lineHeight,te=J*Math.round(se),oe=U[Z]+J,me=Y[0];Math.abs(te)>oe&&(te=te<0?-1:1,te*=Math.ceil(oe/J)*J),se<0&&(te+=ee.vertical===""?U.height:U.width,Y=Y.reverse()),W.move(me,te)}else{var de=W.lineHeight/U.height*100;switch(ee.lineAlign){case"center":se-=de/2;break;case"end":se-=de;break}switch(ee.vertical){case"":C.applyStyles({top:C.formatStyle(se,"%")});break;case"rl":C.applyStyles({left:C.formatStyle(se,"%")});break;case"lr":C.applyStyles({right:C.formatStyle(se,"%")});break}Y=["+y","-x","+x","-y"],W=new L(C)}var xe=$(W,Y);C.move(xe.toCSSCompatValues(U))}function j(){}j.StringDecoder=function(){return{decode:function(T){if(!T)return"";if(typeof T!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(T))}}},j.convertCueToDOMTree=function(T,C){return!T||!C?null:k(T,C)};var q=.05,R="sans-serif",H="1.5%";return j.processCues=function(T,C,U){if(!T||!C||!U)return null;for(;U.firstChild;)U.removeChild(U.firstChild);var K=T.document.createElement("div");K.style.position="absolute",K.style.left="0",K.style.right="0",K.style.top="0",K.style.bottom="0",K.style.margin=H,U.appendChild(K);function $(J){for(var te=0;te<J.length;te++)if(J[te].hasBeenReset||!J[te].displayState)return!0;return!1}if(!$(C)){for(var W=0;W<C.length;W++)K.appendChild(C[W].displayState);return}var ee=[],se=L.getSimpleBoxPosition(K),Y=Math.round(se.height*q*100)/100,Z={font:Y+"px "+R};(function(){for(var J,te,oe=0;oe<C.length;oe++)te=C[oe],J=new N(T,te,Z),K.appendChild(J.div),V(T,J,se,ee),te.displayState=J.div,ee.push(L.getSimpleBoxPosition(J))})()},j.Parser=function(T,C,U){U||(U=C,C={}),C||(C={}),this.window=T,this.vttjs=C,this.state="INITIAL",this.buffer="",this.decoder=U||new TextDecoder("utf8"),this.regionList=[]},j.Parser.prototype={reportOrThrowError:function(T){if(T instanceof t)this.onparsingerror&&this.onparsingerror(T);else throw T},parse:function(T){var C=this;T&&(C.buffer+=C.decoder.decode(T,{stream:!0}));function U(){for(var J=C.buffer,te=0;te<J.length&&J[te]!=="\r"&&J[te]!==` 5`;)++te;var oe=J.substr(0,te);return J[te]==="\r"&&++te,J[te]===` 6`&&++te,C.buffer=J.substr(te),oe}function K(J){var te=new r;if(n(J,function(me,de){switch(me){case"id":te.set(me,de);break;case"width":te.percent(me,de);break;case"lines":te.integer(me,de);break;case"regionanchor":case"viewportanchor":var xe=de.split(",");if(xe.length!==2)break;var pe=new r;if(pe.percent("x",xe[0]),pe.percent("y",xe[1]),!pe.has("x")||!pe.has("y"))break;te.set(me+"X",pe.get("x")),te.set(me+"Y",pe.get("y"));break;case"scroll":te.alt(me,de,["up"]);break}},/=/,/\s/),te.has("id")){var oe=new(C.vttjs.VTTRegion||C.window.VTTRegion);oe.width=te.get("width",100),oe.lines=te.get("lines",3),oe.regionAnchorX=te.get("regionanchorX",0),oe.regionAnchorY=te.get("regionanchorY",100),oe.viewportAnchorX=te.get("viewportanchorX",0),oe.viewportAnchorY=te.get("viewportanchorY",100),oe.scroll=te.get("scroll",""),C.onregion&&C.onregion(oe),C.regionList.push({id:te.get("id"),region:oe})}}function $(J){var te=new r;n(J,function(oe,me){switch(oe){case"MPEGT":te.integer(oe+"S",me);break;case"LOCA":te.set(oe+"L",i(me));break}},/[^\d]:/,/,/),C.ontimestampmap&&C.ontimestampmap({MPEGTS:te.get("MPEGTS"),LOCAL:te.get("LOCAL")})}function W(J){J.match(/X-TIMESTAMP-MAP/)?n(J,function(te,oe){te==="X-TIMESTAMP-MAP"&&$(oe)},/=/):n(J,function(te,oe){te==="Region"&&K(oe)},/:/)}try{var ee;if(C.state==="INITIAL"){if(!/\r\n|\n/.test(C.buffer))return this;ee=U();var se=ee.match(/^WEBVTT([ \t].*)?$/);if(!se||!se[0])throw new t(t.Errors.BadSignature);C.state="HEADER"}for(var Y=!1;C.buffer;){if(!/\r\n|\n/.test(C.buffer))return this;switch(Y?Y=!1:ee=U(),C.state){case"HEADER":/:/.test(ee)?W(ee):ee||(C.state="ID");continue;case"NOTE":ee||(C.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(ee)){C.state="NOTE";break}if(!ee)continue;C.cue=new(C.vttjs.VTTCue||C.window.VTTCue)(0,0,"");try{C.cue.align="center"}catch{C.cue.align="middle"}if(C.state="CUE",ee.indexOf("-->")===-1){C.cue.id=ee;continue}case"CUE":try{a(ee,C.cue,C.regionList)}catch(J){C.reportOrThrowError(J),C.cue=null,C.state="BADCUE";continue}C.state="CUETEXT";continue;case"CUETEXT":var Z=ee.indexOf("-->")!==-1;if(!ee||Z&&(Y=!0)){C.oncue&&C.oncue(C.cue),C.cue=null,C.state="ID";continue}C.cue.text&&(C.cue.text+=` 7`),C.cue.text+=ee.replace(/\u2028/g,` 8`).replace(/u2029/g,` 9`);continue;case"BADCUE":ee||(C.state="ID");continue}}}catch(J){C.reportOrThrowError(J),C.state==="CUETEXT"&&C.cue&&C.oncue&&C.oncue(C.cue),C.cue=null,C.state=C.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var T=this;try{if(T.buffer+=T.decoder.decode(),(T.cue||T.state==="HEADER")&&(T.buffer+=` 10 11`,T.parse()),T.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(C){T.reportOrThrowError(C)}return T.onflush&&T.onflush(),this}},Pa=j,Pa}var La,fu;function Rg(){if(fu)return La;fu=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){if(typeof a!="string")return!1;var l=e[a.toLowerCase()];return l?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var l=t[a.toLowerCase()];return l?a.toLowerCase():!1}function n(a,l,d){this.hasBeenReset=!1;var f="",m=!1,y=a,k=l,E=d,O=null,v="",P=!0,B="auto",N="start",L="auto",V="auto",j=100,q="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return f},set:function(R){f=""+R}},pauseOnExit:{enumerable:!0,get:function(){return m},set:function(R){m=!!R}},startTime:{enumerable:!0,get:function(){return y},set:function(R){if(typeof R!="number")throw new TypeError("Start time must be set to a number.");y=R,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return k},set:function(R){if(typeof R!="number")throw new TypeError("End time must be set to a number.");k=R,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return E},set:function(R){E=""+R,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return O},set:function(R){O=R,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return v},set:function(R){var H=i(R);if(H===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");v=H,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return P},set:function(R){P=!!R,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return B},set:function(R){if(typeof R!="number"&&R!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");B=R,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return N},set:function(R){var H=r(R);H?(N=H,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return L},set:function(R){if(R<0||R>100)throw new Error("Position must be between 0 and 100.");L=R,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return V},set:function(R){var H=r(R);H?(V=H,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return j},set:function(R){if(R<0||R>100)throw new Error("Size must be between 0 and 100.");j=R,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return q},set:function(R){var H=r(R);if(!H)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");q=H,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},La=n,La}var Oa,pu;function Mg(){if(pu)return Oa;pu=1;var s={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var n=s[r.toLowerCase()];return n?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,l=100,d=0,f=100,m="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return l},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");l=y}},regionAnchorX:{enumerable:!0,get:function(){return a}
11,set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");f=y}},viewportAnchorX:{enumerable:!0,get:function(){return d},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");d=y}},scroll:{enumerable:!0,get:function(){return m},set:function(y){var k=e(y);k===!1?console.warn("Scroll: an invalid or illegal string was specified."):m=k}}})}return Oa=i,Oa}var gu;function Ng(){if(gu)return Ia.exports;gu=1;var s=Un(),e=Ia.exports={WebVTT:Og(),VTTCue:Rg(),VTTRegion:Mg()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),Ia.exports}var Bg=Ng();const mu=Dr(Bg);function Ke(){return Ke=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},Ke.apply(null,arguments)}var yu="https://example.com",jn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var i=/^\/\//.test(e),r=!D.location&&!/\/\//i.test(e);e=new D.URL(e,D.location||yu);var n=new URL(t,e);return r?n.href.slice(yu.length):i?n.href.slice(n.protocol.length):n.href},Lo=(function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var l=Array.prototype.slice.call(arguments,1),d=r.length,f=0;f<d;++f)r[f].apply(this,l)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s})(),Fg=function(e){return D.atob?D.atob(e):Buffer.from(e,"base64").toString("binary")};function Fd(s){for(var e=Fg(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}class Ug extends Lo{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(` 12`);t>-1;t=this.buffer.indexOf(` 13`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const jg=" ",Ra=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},qg=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},ct=function(s){const e={};if(!s)return e;const t=s.split(qg());let i=t.length,r;for(;i--;)t[i]!==""&&(r=/([^=]*)=(.*)/.exec(t[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},_u=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class $g extends Lo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const l=a(e);return l===e?n:n.concat([l])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){i=Ke(Ra(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(i={type:"tag",tagType:"map"},t[1]){const a=ct(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=Ra(a.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=ct(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=_u(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ct(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){i={type:"tag",tagType:"program-date-time"}
vendor: 16,551 bytes, line 13
13,t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ct(t[1]),i.attributes.IV&&(i.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ct(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"skip"},i.attributes=ct(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(jg)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=ct(t[1]),["DURATION"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=Ra(i.attributes.BYTERANGE)),this.trigger("data",i);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"server-control"},i.attributes=ct(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part-inf"},i.attributes=ct(t[1]),["PART-TARGET"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"preload-hint"},i.attributes=ct(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(i.attributes.hasOwnProperty(a)){i.attributes[a]=parseInt(i.attributes[a],10);const l=a==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[l]=i.attributes[a],delete i.attributes[a]}}),this.trigger("data",i);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"rendition-report"},i.attributes=ct(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseInt(i.attributes[a],10))}),this.trigger("data",i);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=ct(t[1]),["ID","CLASS"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=String(i.attributes[l]))}),["START-DATE","END-DATE"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=new Date(i.attributes[l]))}),["DURATION","PLANNED-DURATION"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=parseFloat(i.attributes[l]))}),["END-ON-NEXT"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=/YES/i.test(i.attributes[l]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(l){i.attributes.hasOwnProperty(l)&&(i.attributes[l]=i.attributes[l].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const l in i.attributes){if(!a.test(l))continue;const d=/[0-9A-Fa-f]{6}/g.test(i.attributes[l]),f=/^\d+(\.\d+)?$/.test(i.attributes[l]);i.attributes[l]=d?i.attributes[l].toString(16):f?parseFloat(i.attributes[l]):String(i.attributes[l])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){i={type:"tag",tagType:"content-steering"},i.attributes=ct(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"i-frame-playlist"},i.attributes=ct(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=_u(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){i={type:"tag",tagType:"define"},i.attributes=ct(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:r}){typeof i!="function"&&(i=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}}const Vg=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Di=function(s){const e={};return Object.keys(s).forEach(function(t){e[Vg(t)]=s[t]}),e},Ma=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&t*3,d=i&&i*2;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]<l&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${l})`}),e[n]=l),i&&!e.hasOwnProperty(a)&&(e[a]=i*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),i&&e[a]<d&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${d}).`}),e[a]=d)};class Hg extends Lo{constructor(e={}){super(),this.lineStream=new Ug,this.parseStream=new $g,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let r={},n,a,l=!1;const d=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let y=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let k=0,E=0;const O={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(v){let P,B;if(t.manifest.definitions){for(const N in t.manifest.definitions)if(v.uri&&(v.uri=v.uri.replace(`{$${N}}`,t.manifest.definitions[N])),v.attributes)for(const L in v.attributes)typeof v.attributes[L]=="string"&&(v.attributes[L]=v.attributes[L].replace(`{$${N}}`,t.manifest.definitions[N]))}({tag(){({version(){v.version&&(this.manifest.version=v.version)},"allow-cache"(){this.manifest.allowCache=v.allowed,"allowed"in v||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const N={};"length"in v&&(r.byterange=N,N.length=v.length,"offset"in v||(v.offset=k)),"offset"in v&&(r.byterange=N,N.offset=v.offset),k=N.offset+N.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),v.title&&(r.title=v.title),v.duration>0&&(r.duration=v.duration),v.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!v.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(v.attributes.METHOD==="NONE"){a=null;return}if(!v.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(v.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:v.attributes};return}if(v.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:v.attributes.URI};return}if(v.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(v.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(v.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),v.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(v.attributes.KEYID&&v.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:v.attributes.KEYFORMAT,keyId:v.attributes.KEYID.substring(2)},pssh:Fd(v.attributes.URI.split(",")[1])};return}v.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:v.attributes.METHOD||"AES-128",uri:v.attributes.URI},typeof v.attributes.IV<"u"&&(a.iv=v.attributes.IV)},"media-sequence"(){if(!isFinite(v.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+v.number});return}this.manifest.mediaSequence=v.number},"discontinuity-sequence"(){if(!isFinite(v.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+v.number});return}this.manifest.discontinuitySequence=v.number,y=v.number},"playlist-type"(){if(!/VOD|EVENT/.test(v.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+v.playlist});return}this.manifest.playlistType=v.playlistType},map(){n={},v.uri&&(n.uri=v.uri),v.byterange&&(n.byterange=v.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!v.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Ke(r.attributes,v.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(v.attributes&&v.attributes.TYPE&&v.attributes["GROUP-ID"]&&v.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const N=this.manifest.mediaGroups[v.attributes.TYPE];N[v.attributes["GROUP-ID"]]=N[v.attributes["GROUP-ID"]]||{},P=N[v.attributes["GROUP-ID"]],B={default:/yes/i.test(v.attributes.DEFAULT)},B.default?B.autoselect=!0:B.autoselect=/yes/i.test(v.attributes.AUTOSELECT),v.attributes.LANGUAGE&&(B.language=v.attributes.LANGUAGE),v.attributes.URI&&(B.uri=v.attributes.URI),v.attributes["INSTREAM-ID"]&&(B.instreamId=v.attributes["INSTREAM-ID"]),v.attributes.CHARACTERISTICS&&(B.characteristics=v.attributes.CHARACTERISTICS),v.attributes.FORCED&&(B.forced=/yes/i.test(v.attributes.FORCED)),P[v.attributes.NAME]=B},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=v.dateTimeString,this.manifest.dateTimeObject=v.dateTimeObject),r.dateTimeString=v.dateTimeString,r.dateTimeObject=v.dateTimeObject;const{lastProgramDateTime:N}=this;this.lastProgramDateTime=new Date(v.dateTimeString).getTime(),N===null&&this.manifest.segments.reduceRight((L,V)=>(V.programDateTime=L-V.duration*1e3,V.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(v.duration)||v.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+v.duration});return}this.manifest.targetDuration=v.duration,Ma.call(this,this.manifest)},start(){if(!v.attributes||isNaN(v.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:v.attributes["TIME-OFFSET"],precise:v.attributes.PRECISE}},"cue-out"(){r.cueOut=v.data},"cue-out-cont"(){r.cueOutCont=v.data},"cue-in"(){r.cueIn=v.data},skip(){this.manifest.skip=Di(v.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",v.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;const N=this.manifest.segments.length,L=Di(v.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=E),E=L.byterange.offset+L.byterange.length);const V=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${V} for segment #${N}`,v.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((j,q)=>{j.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${q} lacks required attribute(s): LAST-PART`})})},"server-control"(){const N=this.manifest.serverControl=Di(v.attributes);N.hasOwnProperty("canBlockReload")||(N.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ma.call(this,this.manifest),N.canSkipDateranges&&!N.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const N=this.manifest.segments.length,L=Di(v.attributes),V=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=V?E:0,V&&(E=L.byterange.offset+L.byterange.length)));const j=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${j} for segment #${N}`,v.attributes,["TYPE","URI"]),!!L.type)for(let q=0;q<r.preloadHints.length-1;q++){const R=r.preloadHints[q];R.type&&R.type===L.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${j} for segment #${N} has the same TYPE ${L.type} as preload hint #${q}`})}},"rendition-report"(){const N=Di(v.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(N);const L=this.manifest.renditionReports.length-1,V=["LAST-MSN","URI"];l&&V.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${L}`,v.attributes,V)},"part-inf"(){this.manifest.partInf=Di(v.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",v.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Ma.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Di(v.attributes));const N=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${N}`,v.attributes,["ID","START-DATE"]);const L=this.manifest.dateRanges[N];L.endDate&&L.startDate&&new Date(L.endDate)<new Date(L.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),L.duration&&L.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),L.plannedDuration&&L.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const V=!!L.endOnNext;if(V&&!L.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
13=YES attribute must have a CLASS attribute"}),V&&(L.duration||L.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),L.duration&&L.endDate){const q=L.startDate.getTime()+L.duration*1e3;this.manifest.dateRanges[N].endDate=new Date(q)}if(!O[L.id])O[L.id]=L;else{for(const q in O[L.id])if(L[q]&&JSON.stringify(O[L.id][q])!==JSON.stringify(L[q])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const j=this.manifest.dateRanges.findIndex(q=>q.id===L.id);this.manifest.dateRanges[j]=Ke(this.manifest.dateRanges[j],L),O[L.id]=Ke(O[L.id],L),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Di(v.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",v.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const N=(L,V)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=V};if("QUERYPARAM"in v.attributes){if("NAME"in v.attributes||"IMPORT"in v.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const L=this.params.get(v.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${v.attributes.QUERYPARAM}`});return}N(v.attributes.QUERYPARAM,decodeURIComponent(L));return}if("NAME"in v.attributes){if("IMPORT"in v.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in v.attributes)||typeof v.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${v.attributes.NAME}`});return}N(v.attributes.NAME,v.attributes.VALUE);return}if("IMPORT"in v.attributes){if(!this.mainDefinitions[v.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${v.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}N(v.attributes.IMPORT,this.mainDefinitions[v.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:v.attributes,uri:v.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",v.attributes,["BANDWIDTH","URI"])}}[v.tagType]||d).call(t)},uri(){r.uri=v.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=y,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){v.segment?(r.custom=r.custom||{},r.custom[v.customType]=v.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[v.customType]=v.data)}})[v.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const r=[];i.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(` 14`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Wi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},zg=["video","audio","text"],vu=["Video","Audio","Text"],Ud=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Zt=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;zg.forEach(function(a){var l=Wi[a].exec(r.toLowerCase());if(!(!l||l.length<=1)){n=a;var d=r.substring(0,l[1].length),f=r.replace(d,"");i.push({type:d,details:f,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},Wg=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Zt(n.playlists[0].attributes.CODECS)}return null},jd=function(e){return e===void 0&&(e=""),Wi.audio.test(e.trim().toLowerCase())},Gg=function(e){return e===void 0&&(e=""),Wi.text.test(e.trim().toLowerCase())},Cs=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Ud(n.trim())}),i="video";t.length===1&&jd(t[0])?i="audio":t.length===1&&Gg(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Wi.mp4.test(n)})?r="mp4":t.every(function(n){return Wi.webm.test(n)})?r="webm":t.every(function(n){return Wi.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},mr=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),D.MediaSource&&D.MediaSource.isTypeSupp
vendor: 4,517 bytes, line 14
14orted&&D.MediaSource.isTypeSupported(Cs(e))||t&&D.ManagedMediaSource&&D.ManagedMediaSource.isTypeSupported&&D.ManagedMediaSource.isTypeSupported(Cs(e))||!1},Na=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<vu.length;i++){var r=vu[i];if(Wi["muxer"+r].test(t))return!0}return!1})},Tu="mp4a.40.2",Xg="avc1.4d400d",Kg=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Yg=/^application\/dash\+xml/i,qd=function(e){return Kg.test(e)?"hls":Yg.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Qg=function(e){return e.toString(2).length},Jg=function(e){return Math.ceil(Qg(e)/8)},$d=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Zg=function(e){return $d(e)},fe=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Zg(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},nt=D.BigInt||Number,so=[nt("0x1"),nt("0x100"),nt("0x10000"),nt("0x1000000"),nt("0x100000000"),nt("0x10000000000"),nt("0x1000000000000"),nt("0x100000000000000"),nt("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var em=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,l=a===void 0?!1:a;e=fe(e);var d=l?"reduce":"reduceRight",f=e[d]?e[d]:Array.prototype[d],m=f.call(e,function(k,E,O){var v=l?O:Math.abs(O+1-e.length);return k+nt(E)*so[v]},nt(0));if(n){var y=so[e.length]/nt(2)-nt(1);m=nt(m),m>y&&(m-=y,m-=y,m-=nt(2))}return Number(m)},tm=function(e,t){var i={},r=i.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=nt(e);for(var a=Jg(e),l=new Uint8Array(new ArrayBuffer(a)),d=0;d<a;d++){var f=n?d:Math.abs(d+1-l.length);l[f]=Number(e/so[d]&nt(255)),e<0&&(l[f]=Math.abs(~l[f]),l[f]-=d===0?1:2)}return l},Vd=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},im=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(l){return l&&(l.byteLength||l.length)&&typeof l!="string"}),t.length<=1)return fe(t[0]);var r=t.reduce(function(l,d,f){return l+(d.byteLength||d.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(l){l=fe(l),n.set(l,a),a+=l.byteLength}),n},je=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,l=r.mask,d=l===void 0?[]:l;e=fe(e),t=fe(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(m,y){var k=d[y]?d[y]&e[a+y]:e[a+y];return m===k})},sm=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var l=e.mediaGroups[r][n][a];i(l,r,n,a)}})},lr={},Qt={},ji={},bu;function qn(){if(bu)return ji;bu=1;function s(n,a,l){if(l===void 0&&(l=Array.prototype),n&&typeof l.find=="function")return l.find.call(n,a);for(var d=0;d<n.length;d++)if(Object.prototype.hasOwnProperty.call(n,d)){var f=n[d];if(a.call(void 0,f,d,n))return f}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(n[l]=a[l]);return n}var i=e({HTML:"text/html",isHTML:function(n){return n===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return ji.assign=t,ji.find=s,ji.freeze=e,ji.MIME_TYPE=i,ji.NAMESPACE=r,ji}var Su;function Hd(){if(Su)return Qt;Su=1;var s=qn(),e=s.find,t=s.NAMESPACE;function i(_){return _!==""}function r(_){return _?_.split(/[\t\n\f\r ]+/).filter(i):[]}function n(_,b){return _.hasOwnProperty(b)||(_[b]=!0),_}function a(_){if(!_)return[];var b=r(_);return Object.keys(b.reduce(n,{}))}function l(_){return function(b){return _&&_.indexOf(b)!==-1}}function d(_,b){for(var I in _)Object.prototype.hasOwnProperty.call(_,I)&&(b[I]=_[I
14])}function f(_,b){var I=_.prototype;if(!(I instanceof b)){let G=function(){};G.prototype=b.prototype,G=new G,d(I,G),_.prototype=I=G}I.constructor!=_&&(typeof _!="function"&&console.error("unknown Class:"+_),I.constructor=_)}var m={},y=m.ELEMENT_NODE=1,k=m.ATTRIBUTE_NODE=2,E=m.TEXT_NODE=3,O=m.CDATA_SECTION_NODE=4,v=m.ENTITY_REFERENCE_NODE=5,P=m.ENTITY_NODE=6,B=m.PROCESSING_INSTRUCTION_NODE=7,N=m.COMMENT_NODE=8,L=m.DOCUMENT_NODE=9,V=m.DOCUMENT_TYPE_NODE=10,j=m.DOCUMENT_FRAGMENT_NODE=11,q=m.NOTATION_NODE=12,R={},H={};R.INDEX_SIZE_ERR=(H[1]="Index size error",1),R.DOMSTRING_SIZE_ERR=(H[2]="DOMString size error",2);var T=R.HIERARCHY_REQUEST_ERR=(H[3]="Hierarchy request error",3);R.WRONG_DOCUMENT_ERR=(H[4]="Wrong document",4);var C=R.INVALID_CHARACTER_ERR=(H[5]="Invalid character",5);R.NO_DATA_ALLOWED_ERR=(H[6]="No data allowed",6),R.NO_MODIFICATION_ALLOWED_ERR=(H[7]="No modification allowed",7);var U=R.NOT_FOUND_ERR=(H[8]="Not found",8);R.NOT_SUPPORTED_ERR=(H[9]="Not supported",9);var K=R.INUSE_ATTRIBUTE_ERR=(H[10]="Attribute in use",10),$=R.INVALID_STATE_ERR=(H[11]="Invalid state",11);R.SYNTAX_ERR=(H[12]="Syntax error",12),R.INVALID_MODIFICATION_ERR=(H[13]="Invalid modification",13),R.NAMESPACE_ERR=(H[14]="Invalid namespace",14),R.INVALID_ACCESS_ERR=(H[15]="Invalid access",15);function W(_,b){if(b instanceof Error)var I=b;else I=this,Error.call(this,H[_]),this.message=H[_],Error.captureStackTrace&&Error.captureStackTrace(this,W);return I.code=_,b&&(this.message=this.message+": "+b),I}W.prototype=Error.prototype,d(R,W);function ee(){}ee.prototype={length:0,item:function(_){return _>=0&&_<this.length?this[_]:null},toString:function(_,b,I){for(var G=!!I&&!!I.requireWellFormed,ne=[],ce=0;ce<this.length;ce++)Vs(this[ce],ne,_,b,null,G);return ne.join("")},filter:function(_){return Array.prototype.filter.call(this,_)},indexOf:function(_){return Array.prototype.indexOf.call(this,_)}};function se(_,b){this._node=_,this._refresh=b,Y(this)}function Y(_){var b=_._node._inc||_._node.ownerDocument._inc;if(_._inc!==b){var I=_._refresh(_._node);if(Ur(_,"length",I.length),!_.$$length||I.length<_.$$length)for(var G=I.length;G in _;G++)Object.prototype.hasOwnProperty.call(_,G)&&delete _[G];d(I,_),_._inc=b}}se.prototype.item=function(_){return Y(this),this[_]||null},f(se,ee);function Z(){}function J(_,b){for(var I=_.length;I--;)if(_[I]===b)return I}function te(_,b,I,G){if(G?b[J(b,G)]=I:b[b.length++]=I,_){I.ownerElement=_;var ne=_.ownerDocument;ne&&(G&&rt(ne,_,G),Qe(ne,_,I))}}function oe(_,b,I){var G=J(b,I);if(G>=0){for(var ne=b.length-1;G<ne;)b[G]=b[++G];if(b.length=ne,_){var ce=_.ownerDocument;ce&&(rt(ce,_,I),I.ownerElement=null)}}else throw new W(U,new Error(_.tagName+"@"+I))}Z.prototype={length:0,item:ee.prototype.item,getNamedItem:function(_){for(var b=this.length;b--;){var I=this[b];if(I.nodeName==_)return I}},setNamedItem:function(_){var b=_.ownerElement;if(b&&b!=this._ownerElement)throw new W(K);var I=this.getNamedItem(_.nodeName);return te(this._ownerElement,this,_,I),I},setNamedItemNS:function(_){var b=_.ownerElement,I;if(b&&b!=this._ownerElement)throw new W(K);return I=this.getNamedItemNS(_.namespaceURI,_.localName),te(this._ownerElement,this,_,I),I},removeNamedItem:function(_){var b=this.getNamedItem(_);return oe(this._ownerElement,this,b),b},removeNamedItemNS:function(_,b){var I=this.getNamedItemNS(_,b);return oe(this._ownerElement,this,I),I},getNamedItemNS:function(_,b){for(var I=this.length;I--;){var G=this[I];if(G.localName==b&&G.namespaceURI==_)return G}return null}};function me(){}me.prototype={hasFeature:function(_,b){return!0},createDocument:function(_,b,I){var G=new Je;if(G.implementation=this,G.childNodes=new ee,G.doctype=I||null,I&&G.appendChild(I),b){var ne=G.createElementNS(_,b);G.appendChild(ne)}return G},createDocumentType:function(_,b,I){var G=new Bi;return G.name=_,G.nodeName=_,G.publicId=b||"",G.systemId=I||"",G}};function de(){}de.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(_,b){return We(this,_,b)},replaceChild:function(_,b){We(this,_,b,Re),b&&this.removeChild(b)},removeChild:function(_){return Gt(this,_)},appendChild:function(_){return this.insertBefore(_,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(_){return Fr(this.ownerDocument||this,this,_)},normalize:function(){Ae(this,null,{enter:function(_){for(var b=_.firstChild;b;){var I=b.nextSibling;I!==null&&I.nodeType===E&&b.nodeType===E?(_.removeChild(I),b.appendData(I.data)):b=I}return!0}})},isSupported:function(_,b){return this.ownerDocument.implementation.hasFeature(_,b)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(_){for(var b=this;b;){var I=b._nsMap;
vendor: 13,051 bytes, line 14
14if(I){for(var G in I)if(Object.prototype.hasOwnProperty.call(I,G)&&I[G]===_)return G}b=b.nodeType==k?b.ownerDocument:b.parentNode}return null},lookupNamespaceURI:function(_){for(var b=this;b;){var I=b._nsMap;if(I&&Object.prototype.hasOwnProperty.call(I,_))return I[_];b=b.nodeType==k?b.ownerDocument:b.parentNode}return null},isDefaultNamespace:function(_){var b=this.lookupPrefix(_);return b==null}};function xe(_){return _=="<"&&"<"||_==">"&&">"||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}d(m,de),d(m,de.prototype);function pe(_,b){return Ae(_,null,{enter:function(I){return b(I)?Ae.STOP:!0}})===Ae.STOP}function Ae(_,b,I){for(var G=[{node:_,context:b,phase:Ae.ENTER}];G.length>0;){var ne=G.pop();if(ne.phase===Ae.ENTER){var ce=I.enter(ne.node,ne.context);if(ce===Ae.STOP)return Ae.STOP;if(G.push({node:ne.node,context:ce,phase:Ae.EXIT}),ce==null)continue;for(var re=ne.node.lastChild;re;)G.push({node:re,context:ce,phase:Ae.ENTER}),re=re.previousSibling}else I.exit&&I.exit(ne.node,ne.context)}}Ae.STOP=Symbol("walkDOM.STOP"),Ae.ENTER=0,Ae.EXIT=1;function Je(){this.ownerDocument=this}function Qe(_,b,I){_&&_._inc++;var G=I.namespaceURI;G===t.XMLNS&&(b._nsMap[I.prefix?I.localName:""]=I.value)}function rt(_,b,I,G){_&&_._inc++;var ne=I.namespaceURI;ne===t.XMLNS&&delete b._nsMap[I.prefix?I.localName:""]}function mt(_,b,I){if(_&&_._inc){_._inc++;var G=b.childNodes;if(I)G[G.length++]=I;else{for(var ne=b.firstChild,ce=0;ne;)G[ce++]=ne,ne=ne.nextSibling;G.length=ce,delete G[G.length]}}}function Gt(_,b){var I=b.previousSibling,G=b.nextSibling;return I?I.nextSibling=G:_.firstChild=G,G?G.previousSibling=I:_.lastChild=I,b.parentNode=null,b.previousSibling=null,b.nextSibling=null,mt(_.ownerDocument,_),b}function Zi(_){return _&&(_.nodeType===de.DOCUMENT_NODE||_.nodeType===de.DOCUMENT_FRAGMENT_NODE||_.nodeType===de.ELEMENT_NODE)}function es(_){return _&&(at(_)||ze(_)||Be(_)||_.nodeType===de.DOCUMENT_FRAGMENT_NODE||_.nodeType===de.COMMENT_NODE||_.nodeType===de.PROCESSING_INSTRUCTION_NODE)}function Be(_){return _&&_.nodeType===de.DOCUMENT_TYPE_NODE}function at(_){return _&&_.nodeType===de.ELEMENT_NODE}function ze(_){return _&&_.nodeType===de.TEXT_NODE}function Mi(_,b){var I=_.childNodes||[];if(e(I,at)||Be(b))return!1;var G=e(I,Be);return!(b&&G&&I.indexOf(G)>I.indexOf(b))}function xt(_,b){var I=_.childNodes||[];function G(ce){return at(ce)&&ce!==b}if(e(I,G))return!1;var ne=e(I,Be);return!(b&&ne&&I.indexOf(ne)>I.indexOf(b))}function li(_,b,I){if(!Zi(_))throw new W(T,"Unexpected parent node type "+_.nodeType);if(I&&I.parentNode!==_)throw new W(U,"child not in parent");if(!es(b)||Be(b)&&_.nodeType!==de.DOCUMENT_NODE)throw new W(T,"Unexpected node type "+b.nodeType+" for parent node type "+_.nodeType)}function Ce(_,b,I){var G=_.childNodes||[],ne=b.childNodes||[];if(b.nodeType===de.DOCUMENT_FRAGMENT_NODE){var ce=ne.filter(at);if(ce.length>1||e(ne,ze))throw new W(T,"More than one element or text in fragment");if(ce.length===1&&!Mi(_,I))throw new W(T,"Element in fragment can not be inserted before doctype")}if(at(b)&&!Mi(_,I))throw new W(T,"Only one element can be added and only after doctype");if(Be(b)){if(e(G,Be))throw new W(T,"Only one doctype is allowed");var re=e(G,at);if(I&&G.indexOf(re)<G.indexOf(I))throw new W(T,"Doctype can only be inserted before an element");if(!I&&re)throw new W(T,"Doctype can not be appended since element is present")}}function Re(_,b,I){var G=_.childNodes||[],ne=b.childNodes||[];if(b.nodeType===de.DOCUMENT_FRAGMENT_NODE){var ce=ne.filter(at);if(ce.length>1||e(ne,ze))throw new W(T,"More than one element or text in fragment");if(ce.length===1&&!xt(_,I))throw new W(T,"Element in fragment can not be inserted before doctype")}if(at(b)&&!xt(_,I))throw new W(T,"Only one element can be added and only after doctype");if(Be(b)){if(e(G,function(Ge){return Be(Ge)&&Ge!==I}))throw new W(T,"Only one doctype is allowed");var re=e(G,at);if(I&&G.indexOf(re)<G.indexOf(I))throw new W(T,"Doctype can only be inserted before an element")}}function We(_,b,I,G){li(_,b,I),_.nodeType===de.DOCUMENT_NODE&&(G||Ce)(_,b,I);var ne=b.parentNode;if(ne&&ne.removeChild(b),b.nodeType===j){var ce=b.firstChild;if(ce==null)return b;var re=b.lastChild}else ce=re=b;var Oe=I?I.previousSibling:_.lastChild;ce.previousSibling=Oe,re.nextSibling=I,Oe?Oe.nextSibling=ce:_.firstChild=ce,I==null?_.lastChild=re:I.previousSibling=re;do{ce.parentNode=_;var Ge=_.ownerDocument||_;ui(ce,Ge)}while(ce!==re&&(ce=ce.nextSibling));return mt(_.ownerDocument||_,_),b.nodeType==j&&(b.firstChild=b.lastChild=null),b}function ui(_,b){if(_.ownerDocument!==b){if(_.ownerDocument=b,_.nodeType===y&&_.attributes)for(var I=0;I<_.attributes.length;I++){var G=_.attributes.item(I);G&&(G.ownerDocument=b)}for(var ne=_.firstChild;ne;)ui(ne,b),ne=ne.nextSibling}}function qs(_,b){b.parentNode&&b.parentNode.removeChild(b),b.parentNode=_,b.previousSibling=_.lastChild,b.nextSibling=null,b.previousSibling?b.previousSibling.nextSibling=b:_.firstChild=b,_.lastChild=b,mt(_.ownerDocument,_,b);var I=_.ownerDocument||_;return ui(b,I),b}Je.prototype={nodeName:"#document",nodeType:L,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,b){if(_.nodeType==j){for(var I=_.firstChild;I;){var G=I.nextSibling;this.insertBefore(I,b),I=G}return _}return We(this,_,b),ui(_,this),this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),Gt(this,_)},replaceChild:function(_,b){We(this,_,b,Re),ui(_,this),b&&this.removeChild(b),at(_)&&(this.documentElement=_)},importNode:function(_,b){return oa(this,_,b)},getElementById:function(_){var b=null;return pe(this.documentElement,function(I){if(I.nodeType==y&&I.getAttribute("id")==_)return b=I,!0}),b},getElementsByClassName:function(_){var b=a(_);return new se(this,function(I){var G=[];return b.length>0&&pe(I.documentElement,function(ne){if(ne!==I&&ne.nodeType===y){var ce=ne.getAttribute("class");if(ce){var re=_===ce;if(!re){var Oe=a(ce);re=b.every(l(Oe))}re&&G.push(ne)}}}),G})},createElement:function(_){var b=new Ft;b.ownerDocument=this,b.nodeName=_,b.tagName=_,b.localName=_,b.childNodes=new ee;var I=b.attributes=new Z;return I._ownerElement=b,b},createDocumentFragment:function(){var _=new ss;return _.ownerDocument=this,_.childNodes=new ee,_},createTextNode:function(_){var b=new Ni;return b.ownerDocument=this,b.appendData(_),b},createComment:function(_){var b=new ts;return b.ownerDocument=this,b.appendData(_),b},createCDATASection:function(_){if(_.indexOf("]]>")!==-1)throw new W(C,'data contains "]]>"');var b=new is;return b.ownerDocument=this,b.appendData(_),b},createProcessingInstruction:function(_,b){var I=new $s;return I.ownerDocument=this,I.tagName=I.nodeName=I.target=_,I.nodeValue=I.data=b,I},createAttribute:function(_){var b=new vi;return b.ownerDocument=this,b.name=_,b.nodeName=_,b.localName=_,b.specified=!0,b},createEntityReference:function(_){var b=new Ti;return b.ownerDocument=this,b.nodeName=_,b},createElementNS:function(_,b){var I=new Ft,G=b.split(":"),ne=I.attributes=new Z;return I.childNodes=new ee,I.ownerDocument=this,I.nodeName=b,I.tagName=b,I.namespaceURI=_,G.length==2?(I.prefix=G[0],I.localName=G[1]):I.localName=b,ne._ownerElement=I,I},createAttributeNS:function(_,b){var I=new vi,G=b.split(":");return I.ownerDocument=this,I.nodeName=b,I.name=b,I.namespaceURI=_,I.specified=!0,G.length==2?(I.prefix=G[0],I.localName=G[1]):I.localName=b,I}},f(Je,de);function Ft(){this._nsMap={}}Ft.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var b=this.getAttributeNode(_);return b&&b.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,b){var I=this.ownerDocument.createAttribute(_);I.value=I.nodeValue=""+b,this.setAttributeNode(I)},removeAttribute:function(_){var b=this.getAttributeNode(_);b&&this.removeAttributeNode(b)},appendChild:function(_){return _.nodeType===j?this.insertBefore(_,null):qs(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,b){var I=this.getAttributeNodeNS(_,b);I&&this.removeAttributeNode(I)},hasAttributeNS:function(_,b){return this.getAttributeNodeNS(_,b)!=null},getAttributeNS:function(_,b){var I=this.getAttributeNodeNS(_,b);return I&&I.value||""},setAttributeNS:function(_,b,I){var G=this.ownerDocument.createAttributeNS(_,b);G.value=G.nodeValue=""+I,this.setAttributeNode(G)},getAttributeNodeNS:function(_,b){return this.attributes.getNamedItemNS(_,b)},getElementsByTagName:function(_){return new se(this,function(b){var I=[];return pe(b,function(G){G!==b&&G.nodeType==y&&(_==="*"||G.tagName==_)&&I.push(G)}),I})},getElementsByTagNameNS:function(_,b){return new se(this,function(I){var G=[];return pe(I,function(ne){ne!==I&&ne.nodeType===y&&(_==="*"||ne.namespaceURI===_)&&(b==="*"||ne.localName==b)&&G.push(ne)}),G})}},Je.prototype.getElementsByTagName=Ft.prototype.getElementsByTagName,Je.prototype.getElementsByTagNameNS=Ft.prototype.getElementsByTagNameNS,f(Ft,de);function vi(){}vi.prototype.nodeType=k,f(vi,de);function Xt(){}Xt.prototype={data:"",substringData:function(_,b){return this.data.substring(_,_+b)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,b){this.replaceData(_,0,b)},appendChild:function(_){throw new Error(H[T])},deleteData:function(_,b){this.replaceData(_,b,"")},replaceData:function(_,b,I){var G=this.data.substring(0,_),ne=this.data.substring(_+b);I=G+I+ne,this.nodeValue=this.data=I,this.length=I.length}},f(Xt,de);function Ni(){}Ni.prototype={nodeName:"#text",nodeType:E,splitText:function(_){var b=this.data,I=b.substring(_);b=b.substring(0,_),this.data=this.nodeValue=b,this.length=b.length;var G=this.ownerDocument.createTextNode(I);return this.parentNode&&this.parentNode.insertBefore(G,this.nextSibling),G}},f(Ni,Xt);function ts(){}ts.prototype={nodeName:"#comment",nodeType:N},f(ts,Xt);function is(){}is.prototype={nodeName:"#cdata-section",nodeType:O},f(is,Xt);function Bi(){}Bi.prototype.nodeType=V,f(Bi,de);function Pe(){}Pe.prototype.nodeType=q,f(Pe,de);function Rr(){}Rr.prototype.nodeType=P,f(Rr,de);function Ti(){}Ti.prototype.nodeType=v,f(Ti,de);function ss(){}ss.prototype.nodeName="#document-fragment",ss.prototype.nodeType=j,f(ss,de);function $s(){}$s.prototype.nodeType=B,f($s,de);function Mr(){}Mr.prototype.serializeToString=function(_,b,I,G){return Nr.call(_,b,I,G)},de.prototype.toString=Nr;function Nr(_,b,I){var G=!!I&&!!I.requireWellFormed,ne=[],ce=this.nodeType==9&&this.documentElement||this,re=ce.prefix,Oe=ce.namespaceURI;if(Oe&&re==null){var re=ce.lookupPrefix(Oe);if(re==null)var Ge=[{namespace:Oe,prefix:null}]}return Vs(this,ne,_,b,Ge,G),ne.join("")}function Br(_,b,I){var G=_.prefix||"",ne=_.namespaceURI;if(!ne||G==="xml"&&ne===t.XML||ne===t.XMLNS)return!1;for(var ce=I.length;ce--;){var re=I[ce];if(re.prefix===G)return re.namespace!==ne}return!0}function rs(_,b,I){_.push(" ",b,'="',I.replace(/[<>&"\t\n\r]/g,xe),'"')}function Vs(_,b,I,G,ne,ce){ne||(ne=[]),Ae(_,{ns:ne,isHTML:I},{enter:function(re,Oe){var Ge=Oe.ns,Ze=Oe.isHTML;if(G)if(re=G(re),re){if(typeof re=="string")return b.push(re),null}else return null;switch(re.nodeType){case y:var Ue=re.attributes,ns=Ue.length,Kt=re.tagName;Ze=t.isHTML(re.namespaceURI)||Ze;var Et=Kt;if(!Ze&&!re.prefix&&re.namespaceURI){for(var yt,di=0;di<Ue.length;di++)if(Ue.item(di).name==="xmlns"){yt=Ue.item(di).value;break}if(!yt)for(var Ee=Ge.length-1;Ee>=0;Ee--){var ci=Ge[Ee];if(ci.prefix===""&&ci.namespace===re.namespaceURI){yt=ci.namespace;break}}if(yt!==re.namespaceURI)for(var Ee=Ge.length-1;Ee>=0;Ee--){var ci=Ge[Ee];if(ci.namespace===re.namespaceURI){ci.prefix&&(Et=ci.prefix+":"+Kt);break}}}b.push("<",Et);for(var Ct=Ge.slice(),Lt=0;Lt<ns;Lt++){var At=Ue.item(Lt);At.prefix=="xmlns"?Ct.push({prefix:At.localName,namespace:At.value}):At.nodeName=="xmlns"&&Ct.push({prefix:"",namespace:At.value})}for(var Lt=0;Lt<ns;Lt++){var At=Ue.item(Lt);if(Br(At,Ze,Ct)){var Ut=At.prefix||"",De=At.namespaceURI;rs(b,Ut?"xmlns:"+Ut:"xmlns",De),Ct.push({prefix:Ut,namespace:De})}var bi=G?G(At):At;bi&&(typeof bi=="string"?b.push(bi):rs(b,bi.name,bi.value))}if(Kt===Et&&Br(re,Ze,Ct)){var Si=re.prefix||"",De=re.namespaceURI;rs(b,Si?"xmlns:"+Si:"xmlns",De),Ct.push({prefix:Si,namespace:De})}var hi=re.firstChild;if(hi||Ze&&!/^(?:meta|link|img|br|hr|input)$/i.test(Kt)){if(b.push(">"),Ze&&/^script$/i.test(Kt)){for(;hi;)hi.data?b.push(hi.data):Vs(hi,b,Ze,G,Ct.slice(),ce),hi=hi.nextSibling;return b.push("</",Kt,">"),null}return{ns:Ct,isHTML:Ze,tag:Et}}else return b.push("/>"),null;case L:case j:return{ns:Ge.slice(),isHTML:Ze,tag:null};case k:return rs(b,re.name,re.value),null;case E:return b.push(re.data.replace(/[<&>]/g,xe)),null;case O:if(ce&&re.data.indexOf("]]>")!==-1)throw new W($,'The CDATASection data contains "]]>"');
14return b.push("<![CDATA[",re.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case N:if(ce&&re.data.indexOf("-->")!==-1)throw new W($,'The comment node data contains "-->"');return b.push("<!--",re.data,"-->"),null;case V:if(ce){if(re.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(re.publicId))throw new W($,"DocumentType publicId is not a valid PubidLiteral");if(re.systemId&&!/^("[^"]*"|'[^']*')$/.test(re.systemId))throw new W($,"DocumentType systemId is not a valid SystemLiteral");if(re.internalSubset&&re.internalSubset.indexOf("]>")!==-1)throw new W($,'DocumentType internalSubset contains "]>"')}var jr=re.publicId,xi=re.systemId;if(b.push("<!DOCTYPE ",re.name),jr)b.push(" PUBLIC ",jr),xi&&xi!="."&&b.push(" ",xi),b.push(">");else if(xi&&xi!=".")b.push(" SYSTEM ",xi,">");else{var Hs=re.internalSubset;Hs&&b.push(" [",Hs,"]"),b.push(">")}return null;case B:if(ce&&re.data.indexOf("?>")!==-1)throw new W($,'The ProcessingInstruction data contains "?>"');return b.push("<?",re.target," ",re.data,"?>"),null;case v:return b.push("&",re.nodeName,";"),null;default:return b.push("??",re.nodeName),null}},exit:function(re,Oe){Oe&&Oe.tag&&b.push("</",Oe.tag,">")}})}function oa(_,b,I){var G;return Ae(b,null,{enter:function(ne,ce){var re=ne.cloneNode(!1);re.ownerDocument=_,re.parentNode=null,ce===null?G=re:ce.appendChild(re);var Oe=ne.nodeType===k||I;return Oe?re:null}}),G}function Fr(_,b,I){var G;return Ae(b,null,{enter:function(ne,ce){var re=new ne.constructor;for(var Oe in ne)if(Object.prototype.hasOwnProperty.call(ne,Oe)){var Ge=ne[Oe];typeof Ge!="object"&&Ge!=re[Oe]&&(re[Oe]=Ge)}ne.childNodes&&(re.childNodes=new ee),re.ownerDocument=_;var Ze=I;switch(re.nodeType){case y:var Ue=ne.attributes,ns=re.attributes=new Z,Kt=Ue.length;ns._ownerElement=re;for(var Et=0;Et<Kt;Et++)re.setAttributeNode(Fr(_,Ue.item(Et),!0));break;case k:Ze=!0}return ce!==null?ce.appendChild(re):G=re,Ze?re:null}}),G}function Ur(_,b,I){_[b]=I}try{Object.defineProperty&&(Object.defineProperty(se.prototype,"length",{get:function(){return Y(this),this.$$length}}),Object.defineProperty(de.prototype,"textContent",{get:function(){if(this.nodeType===y||this.nodeType===j){var _=[];return Ae(this,null,{enter:function(b){if(b.nodeType===y||b.nodeType===j)return!0;if(b.nodeType===B||b.nodeType===N)return null;_.push(b.nodeValue)}}),_.join("")}return this.nodeValue},set:function(_){switch(this.nodeType){case y:case j:for(;this.firstChild;)this.removeChild(this.firstChild);(_||String(_))&&this.appendChild(this.ownerDocument.createTextNode(_));break;default:this.data=_,this.value=_,this.nodeValue=_}}}),Ur=function(_,b,I){_["$$"+b]=I})}catch{}return Qt.DocumentType=Bi,Qt.DOMException=W,Qt.DOMImplementation=me,Qt.Element=Ft,Qt.Node=de,Qt.NodeList=ee,Qt.walkDOM=Ae,Qt.XMLSerializer=Mr,Qt}var ur={},Ba={},xu;function rm(){return xu||(xu=1,(function(s){var e=qn().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e
vendor: 14,815 bytes, line 14
14({Aacute:"Ã",aacute:"á",Abreve:"Ä",abreve:"Ä",ac:"â¾",acd:"â¿",acE:"â¾Ì³",Acirc:"Ã",acirc:"â",acute:"´",Acy:"Ð",acy:"а",AElig:"Ã",aelig:"æ",af:"â¡",Afr:"ð",afr:"ð",Agrave:"Ã",agrave:"à ",alefsym:"âµ",aleph:"âµ",Alpha:"Î",alpha:"α",Amacr:"Ä",amacr:"Ä",amalg:"⨿",AMP:"&",amp:"&",And:"â©",and:"â§",andand:"â©",andd:"â©",andslope:"â©",andv:"â©",ang:"â ",ange:"⦤",angle:"â ",angmsd:"â¡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"â¦",angmsdag:"⦮",angmsdah:"⦯",angrt:"â",angrtvb:"â¾",angrtvbd:"â¦",angsph:"â¢",angst:"Ã
",angzarr:"â¼",Aogon:"Ä",aogon:"Ä
",Aopf:"ð¸",aopf:"ð",ap:"â",apacir:"⩯",apE:"â©°",ape:"â",apid:"â",apos:"'",ApplyFunction:"â¡",approx:"â",approxeq:"â",Aring:"Ã
",aring:"Ã¥",Ascr:"ð",ascr:"ð¶",Assign:"â",ast:"*",asymp:"â",asympeq:"â",Atilde:"Ã",atilde:"ã",Auml:"Ã",auml:"ä",awconint:"â³",awint:"â¨",backcong:"â",backepsilon:"϶",backprime:"âµ",backsim:"â½",backsimeq:"â",Backslash:"â",Barv:"â«§",barvee:"â½",Barwed:"â",barwed:"â
",barwedge:"â
",bbrk:"âµ",bbrktbrk:"â¶",bcong:"â",Bcy:"Ð",bcy:"б",bdquo:"â",becaus:"âµ",Because:"âµ",because:"âµ",bemptyv:"⦰",bepsi:"϶",bernou:"â¬",Bernoullis:"â¬",Beta:"Î",beta:"β",beth:"â¶",between:"â¬",Bfr:"ð
",bfr:"ð",bigcap:"â",bigcirc:"â¯",bigcup:"â",bigodot:"â¨",bigoplus:"â¨",bigotimes:"â¨",bigsqcup:"â¨",bigstar:"â
",bigtriangledown:"â½",bigtriangleup:"â³",biguplus:"â¨",bigvee:"â",bigwedge:"â",bkarow:"â¤",blacklozenge:"â§«",blacksquare:"âª",blacktriangle:"â´",blacktriangledown:"â¾",blacktriangleleft:"â",blacktriangleright:"â¸",blank:"â£",blk12:"â",blk14:"â",blk34:"â",block:"â",bne:"=â¥",bnequiv:"â¡â¥",bNot:"â«",bnot:"â",Bopf:"ð¹",bopf:"ð",bot:"â¥",bottom:"â¥",bowtie:"â",boxbox:"â§",boxDL:"â",boxDl:"â",boxdL:"â",boxdl:"â",boxDR:"â",boxDr:"â",boxdR:"â",boxdr:"â",boxH:"â",boxh:"â",boxHD:"â¦",boxHd:"â¤",boxhD:"â¥",boxhd:"â¬",boxHU:"â©",boxHu:"â§",boxhU:"â¨",boxhu:"â´",boxminus:"â",boxplus:"â",boxtimes:"â ",boxUL:"â",boxUl:"â",boxuL:"â",boxul:"â",boxUR:"â",boxUr:"â",boxuR:"â",boxur:"â",boxV:"â",boxv:"â",boxVH:"â¬",boxVh:"â«",boxvH:"âª",boxvh:"â¼",boxVL:"â£",boxVl:"â¢",boxvL:"â¡",boxvl:"â¤",boxVR:"â ",boxVr:"â",boxvR:"â",boxvr:"â",bprime:"âµ",Breve:"Ë",breve:"Ë",brvbar:"¦",Bscr:"â¬",bscr:"ð·",bsemi:"â",bsim:"â½",bsime:"â",bsol:"\\",bsolb:"â§
",bsolhsub:"â",bull:"â¢",bullet:"â¢",bump:"â",bumpE:"⪮",bumpe:"â",Bumpeq:"â",bumpeq:"â",Cacute:"Ä",cacute:"Ä",Cap:"â",cap:"â©",capand:"â©",capbrcup:"â©",capcap:"â©",capcup:"â©",capdot:"â©",CapitalDifferentialD:"â
",caps:"â©ï¸",caret:"â",caron:"Ë",Cayleys:"â",ccaps:"â©",Ccaron:"Ä",ccaron:"Ä",Ccedil:"Ã",ccedil:"ç",Ccirc:"Ä",ccirc:"Ä",Cconint:"â°",ccups:"â©",ccupssm:"â©",Cdot:"Ä",cdot:"Ä",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"â",cfr:"ð ",CHcy:"Ч",chcy:"Ñ",check:"â",checkmark:"â",Chi:"Χ",chi:"Ï",cir:"â",circ:"Ë",circeq:"â",circlearrowleft:"âº",circlearrowright:"â»",circledast:"â",circledcirc:"â",circleddash:"â",CircleDot:"â",circledR:"®",circledS:"â",CircleMinus:"â",CirclePlus:"â",CircleTimes:"â",cirE:"â§",cire:"â",cirfnint:"â¨",cirmid:"⫯",cirscir:"â§",ClockwiseContourIntegral:"â²",CloseCurlyDoubleQuote:"â",CloseCurlyQuote:"â",clubs:"â£",clubsuit:"â£",Colon:"â·",colon:":",Colone:"â©´",colone:"â",coloneq:"â",comma:",",commat:"@",comp:"â",compfn:"â",complement:"â",complexes:"â",cong:"â
",congdot:"â©",Congruent:"â¡",Conint:"â¯",conint:"â®",ContourIntegral:"â®",Copf:"â",copf:"ð",coprod:"â",Coproduct:"â",COPY:"©",copy:"©",copysr:"â",CounterClockwiseContourIntegral:"â³",crarr:"âµ",Cross:"⨯",cross:"â",Cscr:"ð",cscr:"ð¸",csub:"â«",csube:"â«",csup:"â«",csupe:"â«",ctdot:"â¯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"â",cuesc:"â",cularr:"â¶",cularrp:"⤽",Cup:"â",cup:"âª",cupbrcap:"â©",CupCap:"â",cupcap:"â©",cupcup:"â©",cupdot:"â",cupor:"â©
",cups:"âªï¸",curarr:"â·",curarrm:"⤼",curlyeqprec:"â",curlyeqsucc:"â",curlyvee:"â",curlywedge:"â",curren:"¤",curvearrowleft:"â¶",curvearrowright:"â·",cuvee:"â",cuwed:"â",cwconint:"â²",cwint:"â±",cylcty:"â",Dagger:"â¡",dagger:"â ",daleth:"â¸",Darr:"â¡",dArr:"â",darr:"â",dash:"â",Dashv:"⫤",dashv:"â£",dbkarow:"â¤",dblac:"Ë",Dcaron:"Ä",dcaron:"Ä",Dcy:"Ð",dcy:"д",DD:"â
",dd:"â
",ddagger:"â¡",ddarr:"â",DDotrahd:"â¤",ddotseq:"â©·",deg:"°",Del:"â",Delta:"Î",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"ð",dfr:"ð¡",dHar:"⥥",dharl:"â",dharr:"â",DiacriticalAcute:"´",DiacriticalDot:"Ë",DiacriticalDoubleAcute:"Ë",DiacriticalGrave:"`",DiacriticalTilde:"Ë",diam:"â",Diamond:"â",diamond:"â",diamondsuit:"â¦",diams:"â¦",die:"¨",DifferentialD:"â
",digamma:"Ï",disin:"â²",div:"÷",divide:"÷",divideontimes:"â",divonx:"â",DJcy:"Ð",djcy:"Ñ",dlcorn:"â",dlcrop:"â",dollar:"$",Dopf:"ð»",dopf:"ð",Dot:"¨",dot:"Ë",DotDot:"â",doteq:"â",doteqdot:"â",DotEqual:"â",dotminus:"â¸",dotplus:"â",dotsquare:"â¡",doublebarwedge:"â",DoubleContourIntegral:"â¯",DoubleDot:"¨",DoubleDownArrow:"â",DoubleLeftArrow:"â",DoubleLeftRightArrow:"â",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"â¸",DoubleLongLeftRightArrow:"âº",DoubleLongRightArrow:"â¹",DoubleRightArrow:"â",DoubleRightTee:"â¨",DoubleUpArrow:"â",DoubleUpDownArrow:"â",DoubleVerticalBar:"â¥",DownArrow:"â",Downarrow:"â",downarrow:"â",DownArrowBar:"â¤",DownArrowUpArrow:"âµ",DownBreve:"Ì",downdownarrows:"â",downharpoonleft:"â",downharpoonright:"â",DownLeftRightVector:"â¥",DownLeftTeeVector:"â¥",DownLeftVector:"â½",DownLeftVectorBar:"â¥",DownRightTeeVector:"â¥",DownRightVector:"â",DownRightVectorBar:"â¥",DownTee:"â¤",DownTeeArrow:"â§",drbkarow:"â¤",drcorn:"â",drcrop:"â",Dscr:"ð",dscr:"ð¹",DScy:"Ð
",dscy:"Ñ",dsol:"â§¶",Dstrok:"Ä",dstrok:"Ä",dtdot:"â±",dtri:"â¿",dtrif:"â¾",duarr:"âµ",duhar:"⥯",dwangle:"⦦",DZcy:"Ð",dzcy:"Ñ",dzigrarr:"â¿",Eacute:"Ã",eacute:"é",easter:"â©®",Ecaron:"Ä",ecaron:"Ä",ecir:"â",Ecirc:"Ã",ecirc:"ê",ecolon:"â",Ecy:"Ð",ecy:"Ñ",eDDot:"â©·",Edot:"Ä",eDot:"â",edot:"Ä",ee:"â
",efDot:"â",Efr:"ð",efr:"ð¢",eg:"âª",Egrave:"Ã",egrave:"è",egs:"âª",egsdot:"âª",el:"âª",Element:"â",elinters:"â§",ell:"â",els:"âª",elsdot:"âª",Emacr:"Ä",emacr:"Ä",empty:"â
",emptyset:"â
",EmptySmallSquare:"â»",emptyv:"â
",EmptyVerySmallSquare:"â«",emsp:"â",emsp13:"â",emsp14:"â
",ENG:"Å",eng:"Å",ensp:"â",Eogon:"Ä",eogon:"Ä",Eopf:"ð¼",eopf:"ð",epar:"â",eparsl:"â§£",eplus:"⩱",epsi:"ε",Epsilon:"Î",epsilon:"ε",epsiv:"ϵ",eqcirc:"â",eqcolon:"â",eqsim:"â",eqslantgtr:"âª",eqslantless:"âª",Equal:"⩵",equals:"=",EqualTilde:"â",equest:"â",Equilibrium:"â",equiv:"â¡",equivDD:"⩸",eqvparsl:"â§¥",erarr:"⥱",erDot:"â",Escr:"â°",escr:"â¯",esdot:"â",Esim:"⩳",esim:"â",Eta:"Î",eta:"η",ETH:"Ã",eth:"ð",Euml:"Ã",euml:"ë",euro:"â¬",excl:"!",exist:"â",Exists:"â",expectation:"â°",ExponentialE:"â
",exponentiale:"â
",fallingdotseq:"â",Fcy:"Ф",fcy:"Ñ",female:"â",ffilig:"ï¬",fflig:"ï¬",ffllig:"ï¬",Ffr:"ð",ffr:"ð£",filig:"ï¬",FilledSmallSquare:"â¼",FilledVerySmallSquare:"âª",fjlig:"fj",flat:"â",fllig:"ï¬",fltns:"â±",fnof:"Æ",Fopf:"ð½",fopf:"ð",ForAll:"â",forall:"â",fork:"â",forkv:"â«",Fouriertrf:"â±",fpartint:"â¨",frac12:"½",frac13:"â
",frac14:"¼",frac15:"â
",frac16:"â
",frac18:"â
",frac23:"â
",frac25:"â
",frac34:"¾",frac35:"â
",frac38:"â
",frac45:"â
",frac56:"â
",frac58:"â
",frac78:"â
",frasl:"â",frown:"â¢",Fscr:"â±",fscr:"ð»",gacute:"ǵ",Gamma:"Î",gamma:"γ",Gammad:"Ï",gammad:"Ï",gap:"âª",Gbreve:"Ä",gbreve:"Ä",Gcedil:"Ä¢",Gcirc:"Ä",gcirc:"Ä",Gcy:"Ð",gcy:"г",Gdot:"Ä ",gdot:"Ä¡",gE:"â§",ge:"â¥",gEl:"âª",gel:"â",geq:"â¥",geqq:"â§",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"âª",gesdoto:"âª",gesdotol:"âª",gesl:"âï¸",gesles:"âª",Gfr:"ð",gfr:"ð¤",Gg:"â",gg:"â«",ggg:"â",gimel:"â·",GJcy:"Ð",gjcy:"Ñ",gl:"â·",gla:"⪥",glE:"âª",glj:"⪤",gnap:"âª",gnapprox:"âª",gnE:"â©",gne:"âª",gneq:"âª",gneqq:"â©",gnsim:"â§",Gopf:"ð¾",gopf:"ð",grave:"`",GreaterEqual:"â¥",GreaterEqualLess:"â",GreaterFullEqual:"â§",GreaterGreater:"⪢",GreaterLess:"â·",GreaterSlantEqual:"⩾",GreaterTilde:"â³",Gscr:"ð¢",gscr:"â",gsim:"â³",gsime:"âª",gsiml:"âª",Gt:"â«",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"â",gtlPar:"â¦",gtquest:"⩼",gtrapprox:"âª",gtrarr:"⥸",gtrdot:"â",gtreqless:"â",gtreqqless:"âª",gtrless:"â·",gtrsim:"â³",gvertneqq:"â©ï¸",gvnE:"â©ï¸",Hacek:"Ë",hairsp:"â",half:"½",hamilt:"â",HARDcy:"Ъ",hardcy:"Ñ",hArr:"â",harr:"â",harrcir:"â¥",harrw:"â",Hat:"^",hbar:"â",Hcirc:"Ĥ",hcirc:"Ä¥",hearts:"â¥",heartsuit:"â¥",hellip:"â¦",hercon:"â¹",Hfr:"â",hfr:"ð¥",HilbertSpace:"â",hksearow:"⤥",hkswarow:"⤦",hoarr:"â¿",homtht:"â»",hookleftarrow:"â©",hookrightarrow:"âª",Hopf:"â",hopf:"ð",horbar:"â",HorizontalLine:"â",Hscr:"â",hscr:"ð½",hslash:"â",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"â",HumpEqual:"â",hybull:"â",hyphen:"â",Iacute:"Ã",iacute:"Ã",ic:"â£",Icirc:"Ã",icirc:"î",Icy:"Ð",icy:"и",Idot:"İ",IEcy:"Ð",iecy:"е",iexcl:"¡",iff:"â",Ifr:"â",ifr:"ð¦",Igrave:"Ã",igrave:"ì",ii:"â
",iiiint:"â¨",iiint:"â",iinfin:"â§",iiota:"â©",IJlig:"IJ",ijlig:"ij",Im:"â",Imacr:"Ī",imacr:"Ä«",image:"â",ImaginaryI:"â
",imagline:"â",imagpart:"â",imath:"ı",imof:"â·",imped:"Ƶ",Implies:"â",in:"â",incare:"â
",infin:"â",infintie:"â§",inodot:"ı",Int:"â¬",int:"â«",intcal:"âº",integers:"â¤",Integral:"â«",intercal:"âº",Intersection:"â",intlarhk:"â¨",intprod:"⨼",InvisibleComma:"â£",InvisibleTimes:"â¢",IOcy:"Ð",iocy:"Ñ",Iogon:"Ä®",iogon:"į",Iopf:"ð",iopf:"ð",Iota:"Î",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"â",iscr:"ð¾",isin:"â",isindot:"âµ",isinE:"â¹",isins:"â´",isinsv:"â³",isinv:"â",it:"â¢",Itilde:"Ĩ",itilde:"Ä©",Iukcy:"Ð",iukcy:"Ñ",Iuml:"Ã",iuml:"ï",Jcirc:"Ä´",jcirc:"ĵ",Jcy:"Ð",jcy:"й",Jfr:"ð",jfr:"ð§",jmath:"È·",Jopf:"ð",jopf:"ð",Jscr:"ð¥",jscr:"ð¿",Jsercy:"Ð",jsercy:"Ñ",Jukcy:"Ð",jukcy:"Ñ",Kappa:"Î",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"Ä·",Kcy:"Ð",kcy:"к",Kfr:"ð",kfr:"ð¨",kgreen:"ĸ",KHcy:"Ð¥",khcy:"Ñ
",KJcy:"Ð",kjcy:"Ñ",Kopf:"ð",kopf:"ð",Kscr:"ð¦",kscr:"ð",lAarr:"â",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"â",Lambda:"Î",lambda:"λ",Lang:"âª",lang:"â¨",langd:"â¦",langle:"â¨",lap:"âª
",Laplacetrf:"â",laquo:"«",Larr:"â",lArr:"â",larr:"â",larrb:"â¤",larrbfs:"â¤",larrfs:"â¤",larrhk:"â©",larrlp:"â«",larrpl:"⤹",larrsim:"⥳",larrtl:"â¢",lat:"⪫",lAtail:"â¤",latail:"â¤",late:"âª",lates:"âªï¸",lBarr:"â¤",lbarr:"â¤",lbbrk:"â²",lbrace:"{",lbrack:"[",lbrke:"â¦",lbrksld:"â¦",lbrkslu:"â¦",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ä»",lcedil:"ļ",lceil:"â",lcub:"{",Lcy:"Ð",lcy:"л",ldca:"⤶",ldquo:"â",ldquor:"â",ldrdhar:"⥧",ldrushar:"â¥",ldsh:"â²",lE:"â¦",le:"â¤",LeftAngleBracket:"â¨",LeftArrow:"â",Leftarrow:"â",leftarrow:"â",LeftArrowBar:"â¤",LeftArrowRightArrow:"â",leftarrowtail:"â¢",LeftCeiling:"â",LeftDoubleBracket:"â¦",LeftDownTeeVector:"⥡",LeftDownVector:"â",LeftDownVectorBar:"â¥",LeftFloor:"â",leftharpoondown:"â½",leftharpoonup:"â¼",leftleftarrows:"â",LeftRightArrow:"â",Leftrightarrow:"â",leftrightarrow:"â",leftrightarrows:"â",leftrightharpoons:"â",leftrightsquigarrow:"â",LeftRightVector:"â¥",LeftTee:"â£",LeftTeeArrow:"â¤",LeftTeeVector:"â¥",leftthreetimes:"â",LeftTriangle:"â²",LeftTriangleBar:"â§",LeftTriangleEqual:"â´",LeftUpDownVector:"â¥",LeftUpTeeVector:"⥠",LeftUpVector:"â¿",LeftUpVectorBar:"â¥",LeftVector:"â¼",LeftVectorBar:"â¥",lEg:"âª",leg:"â",leq:"â¤",leqq:"â¦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"â©¿",lesdoto:"âª",lesdotor:"âª",lesg:"âï¸",lesges:"âª",lessapprox:"âª
",lessdot:"â",lesseqgtr:"â",lesseqqgtr:"âª",LessEqualGreater:"â",LessFullEqual:"â¦",LessGreater:"â¶",lessgtr:"â¶",LessLess:"⪡",lesssim:"â²",LessSlantEqual:"⩽",LessTilde:"â²",lfisht:"⥼",lfloor:"â",Lfr:"ð",lfr:"ð©",lg:"â¶",lgE:"âª",lHar:"⥢",lhard:"â½",lharu:"â¼",lharul:"⥪",lhblk:"â",LJcy:"Ð",ljcy:"Ñ",Ll:"â",ll:"âª",llarr:"â",llcorner:"â",Lleftarrow:"â",llhard:"⥫",lltri:"âº",Lmidot:"Ä¿",lmidot:"Å",lmoust:"â°",lmoustache:"â°",lnap:"âª",lnapprox:"âª",lnE:"â¨",lne:"âª",lneq:"âª",lneqq:"â¨",lnsim:"â¦",loang:"â¬",loarr:"â½",lobrk:"â¦",LongLeftArrow:"âµ",Longleftarrow:"â¸",longleftarrow:"âµ",LongLeftRightArrow:"â·",Longleftrightarrow:"âº",longleftrightarrow:"â·",longmapsto:"â¼",LongRightArrow:"â¶",Longrightarrow:"â¹",longrightarrow:"â¶",looparrowleft:"â«",looparrowright:"â¬",lopar:"â¦
",Lopf:"ð",lopf:"ð",loplus:"â¨",lotimes:"⨴",lowast:"â",lowbar:"_",LowerLeftArrow:"â",LowerRightArrow:"â",loz:"â",lozenge:"â",lozf:"â§«",lpar:"(",lparlt:"â¦",lrarr:"â",lrcorner:"â",lrhar:"â",lrhard:"â¥",lrm:"â",lrtri:"â¿",lsaquo:"â¹",Lscr:"â",lscr:"ð",Lsh:"â°",lsh:"â°",lsim:"â²",lsime:"âª",lsimg:"âª",lsqb:"[",lsquo:"â",lsquor:"â",Lstrok:"Å",lstrok:"Å",Lt:"âª",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"â",lthree:"â",ltimes:"â",ltlarr:"⥶",ltquest:"â©»",ltri:"â",ltrie:"â´",ltrif:"â",ltrPar:"â¦",lurdshar:"â¥",luruhar:"⥦",lvertneqq:"â¨ï¸",lvnE:"â¨ï¸",macr:"¯",male:"â",malt:"â ",maltese:"â ",Map:"â¤
",map:"â¦",mapsto:"â¦",mapstodown:"â§",mapstoleft:"â¤",mapstoup:"â¥",marker:"â®",mcomma:"⨩",Mcy:"Ð",mcy:"м",mdash:"â",mDDot:"âº",measuredangle:"â¡",MediumSpace:"â",Mellintrf:"â³",Mfr:"ð",mfr:"ðª",mho:"â§",micro:"µ",mid:"â£",midast:"*",midcir:"â«°",middot:"·",minus:"â",minusb:"â",minusd:"â¸",minusdu:"⨪",MinusPlus:"â",mlcp:"â«",mldr:"â¦",mnplus:"â",models:"â§",Mopf:"ð",mopf:"ð",mp:"â",Mscr:"â³",mscr:"ð",mstpos:"â¾",Mu:"Î",mu:"μ",multimap:"â¸",mumap:"â¸",nabla:"â",Nacute:"Å",nacute:"Å",nang:"â â",nap:"â",napE:"⩰̸",napid:"â̸",napos:"Å",napprox:"â",natur:"â®",natural:"â®",naturals:"â",nbsp:" ",nbump:"â̸",nbumpe:"â̸",ncap:"â©",Ncaron:"Å",ncaron:"Å",Ncedil:"Å
",ncedil:"Å",ncong:"â",ncongdot:"â©Ì¸",ncup:"â©",Ncy:"Ð",ncy:"н",ndash:"â",ne:"â ",nearhk:"⤤",neArr:"â",nearr:"â",nearrow:"â",nedot:"â̸",NegativeMediumSpace:"â",NegativeThickSpace:"â",NegativeThinSpace:"â",NegativeVeryThinSpace:"â",nequiv:"â¢",nesear:"⤨",nesim:"â̸",NestedGreaterGreater:"â«",NestedLessLess:"âª",NewLine:
14` 15`
vendor: 9,925 bytes, line 15
15,nexist:"â",nexists:"â",Nfr:"ð",nfr:"ð«",ngE:"â§Ì¸",nge:"â±",ngeq:"â±",ngeqq:"â§Ì¸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"â̸",ngsim:"âµ",nGt:"â«â",ngt:"â¯",ngtr:"â¯",nGtv:"â«Ì¸",nhArr:"â",nharr:"â®",nhpar:"⫲",ni:"â",nis:"â¼",nisd:"âº",niv:"â",NJcy:"Ð",njcy:"Ñ",nlArr:"â",nlarr:"â",nldr:"â¥",nlE:"â¦Ì¸",nle:"â°",nLeftarrow:"â",nleftarrow:"â",nLeftrightarrow:"â",nleftrightarrow:"â®",nleq:"â°",nleqq:"â¦Ì¸",nleqslant:"⩽̸",nles:"⩽̸",nless:"â®",nLl:"â̸",nlsim:"â´",nLt:"âªâ",nlt:"â®",nltri:"âª",nltrie:"â¬",nLtv:"âªÌ¸",nmid:"â¤",NoBreak:"â ",NonBreakingSpace:" ",Nopf:"â",nopf:"ð",Not:"⫬",not:"¬",NotCongruent:"â¢",NotCupCap:"â",NotDoubleVerticalBar:"â¦",NotElement:"â",NotEqual:"â ",NotEqualTilde:"â̸",NotExists:"â",NotGreater:"â¯",NotGreaterEqual:"â±",NotGreaterFullEqual:"â§Ì¸",NotGreaterGreater:"â«Ì¸",NotGreaterLess:"â¹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"âµ",NotHumpDownHump:"â̸",NotHumpEqual:"â̸",notin:"â",notindot:"âµÌ¸",notinE:"â¹Ì¸",notinva:"â",notinvb:"â·",notinvc:"â¶",NotLeftTriangle:"âª",NotLeftTriangleBar:"â§Ì¸",NotLeftTriangleEqual:"â¬",NotLess:"â®",NotLessEqual:"â°",NotLessGreater:"â¸",NotLessLess:"âªÌ¸",NotLessSlantEqual:"⩽̸",NotLessTilde:"â´",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"â",notniva:"â",notnivb:"â¾",notnivc:"â½",NotPrecedes:"â",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"â ",NotReverseElement:"â",NotRightTriangle:"â«",NotRightTriangleBar:"â§Ì¸",NotRightTriangleEqual:"â",NotSquareSubset:"â̸",NotSquareSubsetEqual:"â¢",NotSquareSuperset:"â̸",NotSquareSupersetEqual:"â£",NotSubset:"ââ",NotSubsetEqual:"â",NotSucceeds:"â",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"â¡",NotSucceedsTilde:"â¿Ì¸",NotSuperset:"ââ",NotSupersetEqual:"â",NotTilde:"â",NotTildeEqual:"â",NotTildeFullEqual:"â",NotTildeTilde:"â",NotVerticalBar:"â¤",npar:"â¦",nparallel:"â¦",nparsl:"⫽â¥",npart:"â̸",npolint:"â¨",npr:"â",nprcue:"â ",npre:"⪯̸",nprec:"â",npreceq:"⪯̸",nrArr:"â",nrarr:"â",nrarrc:"⤳̸",nrarrw:"â̸",nRightarrow:"â",nrightarrow:"â",nrtri:"â«",nrtrie:"â",nsc:"â",nsccue:"â¡",nsce:"⪰̸",Nscr:"ð©",nscr:"ð",nshortmid:"â¤",nshortparallel:"â¦",nsim:"â",nsime:"â",nsimeq:"â",nsmid:"â¤",nspar:"â¦",nsqsube:"â¢",nsqsupe:"â£",nsub:"â",nsubE:"â«
̸",nsube:"â",nsubset:"ââ",nsubseteq:"â",nsubseteqq:"â«
̸",nsucc:"â",nsucceq:"⪰̸",nsup:"â
",nsupE:"â«Ì¸",nsupe:"â",nsupset:"ââ",nsupseteq:"â",nsupseteqq:"â«Ì¸",ntgl:"â¹",Ntilde:"Ã",ntilde:"ñ",ntlg:"â¸",ntriangleleft:"âª",ntrianglelefteq:"â¬",ntriangleright:"â«",ntrianglerighteq:"â",Nu:"Î",nu:"ν",num:"#",numero:"â",numsp:"â",nvap:"ââ",nVDash:"â¯",nVdash:"â®",nvDash:"â",nvdash:"â¬",nvge:"â¥â",nvgt:">â",nvHarr:"â¤",nvinfin:"â§",nvlArr:"â¤",nvle:"â¤â",nvlt:"<â",nvltrie:"â´â",nvrArr:"â¤",nvrtrie:"âµâ",nvsim:"â¼â",nwarhk:"⤣",nwArr:"â",nwarr:"â",nwarrow:"â",nwnear:"⤧",Oacute:"Ã",oacute:"ó",oast:"â",ocir:"â",Ocirc:"Ã",ocirc:"ô",Ocy:"Ð",ocy:"о",odash:"â",Odblac:"Å",odblac:"Å",odiv:"⨸",odot:"â",odsold:"⦼",OElig:"Å",oelig:"Å",ofcir:"⦿",Ofr:"ð",ofr:"ð¬",ogon:"Ë",Ograve:"Ã",ograve:"ò",ogt:"â§",ohbar:"⦵",ohm:"Ω",oint:"â®",olarr:"âº",olcir:"⦾",olcross:"⦻",oline:"â¾",olt:"â§",Omacr:"Å",omacr:"Å",Omega:"Ω",omega:"Ï",Omicron:"Î",omicron:"ο",omid:"⦶",ominus:"â",Oopf:"ð",oopf:"ð ",opar:"⦷",OpenCurlyDoubleQuote:"â",OpenCurlyQuote:"â",operp:"⦹",oplus:"â",Or:"â©",or:"â¨",orarr:"â»",ord:"â©",order:"â´",orderof:"â´",ordf:"ª",ordm:"º",origof:"â¶",oror:"â©",orslope:"â©",orv:"â©",oS:"â",Oscr:"ðª",oscr:"â´",Oslash:"Ã",oslash:"ø",osol:"â",Otilde:"Ã",otilde:"õ",Otimes:"⨷",otimes:"â",otimesas:"⨶",Ouml:"Ã",ouml:"ö",ovbar:"â½",OverBar:"â¾",OverBrace:"â",OverBracket:"â´",OverParenthesis:"â",par:"â¥",para:"¶",parallel:"â¥",parsim:"⫳",parsl:"⫽",part:"â",PartialD:"â",Pcy:"Ð",pcy:"п",percnt:"%",period:".",permil:"â°",perp:"â¥",pertenk:"â±",Pfr:"ð",pfr:"ð",Phi:"Φ",phi:"Ï",phiv:"Ï",phmmat:"â³",phone:"â",Pi:"Î ",pi:"Ï",pitchfork:"â",piv:"Ï",planck:"â",planckh:"â",plankv:"â",plus:"+",plusacir:"⨣",plusb:"â",pluscir:"⨢",plusdo:"â",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"â",pointint:"â¨",Popf:"â",popf:"ð¡",pound:"£",Pr:"⪻",pr:"âº",prap:"⪷",prcue:"â¼",prE:"⪳",pre:"⪯",prec:"âº",precapprox:"⪷",preccurlyeq:"â¼",Precedes:"âº",PrecedesEqual:"⪯",PrecedesSlantEqual:"â¼",PrecedesTilde:"â¾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"â¨",precsim:"â¾",Prime:"â³",prime:"â²",primes:"â",prnap:"⪹",prnE:"⪵",prnsim:"â¨",prod:"â",Product:"â",profalar:"â®",profline:"â",profsurf:"â",prop:"â",Proportion:"â·",Proportional:"â",propto:"â",prsim:"â¾",prurel:"â°",Pscr:"ð«",pscr:"ð
",Psi:"Ψ",psi:"Ï",puncsp:"â",Qfr:"ð",qfr:"ð®",qint:"â¨",Qopf:"â",qopf:"ð¢",qprime:"â",Qscr:"ð¬",qscr:"ð",quaternions:"â",quatint:"â¨",quest:"?",questeq:"â",QUOT:'"',quot:'"',rAarr:"â",race:"â½Ì±",Racute:"Å",racute:"Å",radic:"â",raemptyv:"⦳",Rang:"â«",rang:"â©",rangd:"â¦",range:"⦥",rangle:"â©",raquo:"»",Rarr:"â ",rArr:"â",rarr:"â",rarrap:"⥵",rarrb:"â¥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"â¤",rarrhk:"âª",rarrlp:"â¬",rarrpl:"â¥
",rarrsim:"⥴",Rarrtl:"â¤",rarrtl:"â£",rarrw:"â",rAtail:"â¤",ratail:"â¤",ratio:"â¶",rationals:"â",RBarr:"â¤",rBarr:"â¤",rbarr:"â¤",rbbrk:"â³",rbrace:"}",rbrack:"]",rbrke:"â¦",rbrksld:"â¦",rbrkslu:"â¦",Rcaron:"Å",rcaron:"Å",Rcedil:"Å",rcedil:"Å",rceil:"â",rcub:"}",Rcy:"Ð ",rcy:"Ñ",rdca:"⤷",rdldhar:"⥩",rdquo:"â",rdquor:"â",rdsh:"â³",Re:"â",real:"â",realine:"â",realpart:"â",reals:"â",rect:"â",REG:"®",reg:"®",ReverseElement:"â",ReverseEquilibrium:"â",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"â",Rfr:"â",rfr:"ð¯",rHar:"⥤",rhard:"â",rharu:"â",rharul:"⥬",Rho:"Ρ",rho:"Ï",rhov:"ϱ",RightAngleBracket:"â©",RightArrow:"â",Rightarrow:"â",rightarrow:"â",RightArrowBar:"â¥",RightArrowLeftArrow:"â",rightarrowtail:"â£",RightCeiling:"â",RightDoubleBracket:"â§",RightDownTeeVector:"â¥",RightDownVector:"â",RightDownVectorBar:"â¥",RightFloor:"â",rightharpoondown:"â",rightharpoonup:"â",rightleftarrows:"â",rightleftharpoons:"â",rightrightarrows:"â",rightsquigarrow:"â",RightTee:"â¢",RightTeeArrow:"â¦",RightTeeVector:"â¥",rightthreetimes:"â",RightTriangle:"â³",RightTriangleBar:"â§",RightTriangleEqual:"âµ",RightUpDownVector:"â¥",RightUpTeeVector:"â¥",RightUpVector:"â¾",RightUpVectorBar:"â¥",RightVector:"â",RightVectorBar:"â¥",ring:"Ë",risingdotseq:"â",rlarr:"â",rlhar:"â",rlm:"â",rmoust:"â±",rmoustache:"â±",rnmid:"â«®",roang:"â",roarr:"â¾",robrk:"â§",ropar:"â¦",Ropf:"â",ropf:"ð£",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"â¦",rppolint:"â¨",rrarr:"â",Rrightarrow:"â",rsaquo:"âº",Rscr:"â",rscr:"ð",Rsh:"â±",rsh:"â±",rsqb:"]",rsquo:"â",rsquor:"â",rthree:"â",rtimes:"â",rtri:"â¹",rtrie:"âµ",rtrif:"â¸",rtriltri:"â§",RuleDelayed:"â§´",ruluhar:"⥨",rx:"â",Sacute:"Å",sacute:"Å",sbquo:"â",Sc:"⪼",sc:"â»",scap:"⪸",Scaron:"Å ",scaron:"Å¡",sccue:"â½",scE:"⪴",sce:"⪰",Scedil:"Å",scedil:"Å",Scirc:"Å",scirc:"Å",scnap:"⪺",scnE:"⪶",scnsim:"â©",scpolint:"â¨",scsim:"â¿",Scy:"С",scy:"Ñ",sdot:"â
",sdotb:"â¡",sdote:"⩦",searhk:"⤥",seArr:"â",searr:"â",searrow:"â",sect:"§",semi:";",seswar:"⤩",setminus:"â",setmn:"â",sext:"â¶",Sfr:"ð",sfr:"ð°",sfrown:"â¢",sharp:"â¯",SHCHcy:"Щ",shchcy:"Ñ",SHcy:"Ш",shcy:"Ñ",ShortDownArrow:"â",ShortLeftArrow:"â",shortmid:"â£",shortparallel:"â¥",ShortRightArrow:"â",ShortUpArrow:"â",shy:"Â",Sigma:"Σ",sigma:"Ï",sigmaf:"Ï",sigmav:"Ï",sim:"â¼",simdot:"⩪",sime:"â",simeq:"â",simg:"âª",simgE:"⪠",siml:"âª",simlE:"âª",simne:"â",simplus:"⨤",simrarr:"⥲",slarr:"â",SmallCircle:"â",smallsetminus:"â",smashp:"⨳",smeparsl:"⧤",smid:"â£",smile:"â£",smt:"⪪",smte:"⪬",smtes:"⪬ï¸",SOFTcy:"Ь",softcy:"Ñ",sol:"/",solb:"â§",solbar:"â¿",Sopf:"ð",sopf:"ð¤",spades:"â ",spadesuit:"â ",spar:"â¥",sqcap:"â",sqcaps:"âï¸",sqcup:"â",sqcups:"âï¸",Sqrt:"â",sqsub:"â",sqsube:"â",sqsubset:"â",sqsubseteq:"â",sqsup:"â",sqsupe:"â",sqsupset:"â",sqsupseteq:"â",squ:"â¡",Square:"â¡",square:"â¡",SquareIntersection:"â",SquareSubset:"â",SquareSubsetEqual:"â",SquareSuperset:"â",SquareSupersetEqual:"â",SquareUnion:"â",squarf:"âª",squf:"âª",srarr:"â",Sscr:"ð®",sscr:"ð",ssetmn:"â",ssmile:"â£",sstarf:"â",Star:"â",star:"â",starf:"â
",straightepsilon:"ϵ",straightphi:"Ï",strns:"¯",Sub:"â",sub:"â",subdot:"⪽",subE:"â«
",sube:"â",subedot:"â«",submult:"â«",subnE:"â«",subne:"â",subplus:"⪿",subrarr:"⥹",Subset:"â",subset:"â",subseteq:"â",subseteqq:"â«
",SubsetEqual:"â",subsetneq:"â",subsetneqq:"â«",subsim:"â«",subsub:"â«",subsup:"â«",succ:"â»",succapprox:"⪸",succcurlyeq:"â½",Succeeds:"â»",SucceedsEqual:"⪰",SucceedsSlantEqual:"â½",SucceedsTilde:"â¿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"â©",succsim:"â¿",SuchThat:"â",Sum:"â",sum:"â",sung:"âª",Sup:"â",sup:"â",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"â«",supE:"â«",supe:"â",supedot:"â«",Superset:"â",SupersetEqual:"â",suphsol:"â",suphsub:"â«",suplarr:"⥻",supmult:"â«",supnE:"â«",supne:"â",supplus:"â«",Supset:"â",supset:"â",supseteq:"â",supseteqq:"â«",supsetneq:"â",supsetneqq:"â«",supsim:"â«",supsub:"â«",supsup:"â«",swarhk:"⤦",swArr:"â",swarr:"â",swarrow:"â",swnwar:"⤪",szlig:"Ã",Tab:"
15 ",target:"â",Tau:"Τ",tau:"Ï",tbrk:"â´",Tcaron:"Ť",tcaron:"Å¥",Tcedil:"Å¢",tcedil:"Å£",Tcy:"Т",tcy:"Ñ",tdot:"â",telrec:"â",Tfr:"ð",tfr:"ð±",there4:"â´",Therefore:"â´",therefore:"â´",Theta:"Î",theta:"θ",thetasym:"Ï",thetav:"Ï",thickapprox:"â",thicksim:"â¼",ThickSpace:"ââ",thinsp:"â",ThinSpace:"â",thkap:"â",thksim:"â¼",THORN:"Ã",thorn:"þ",Tilde:"â¼",tilde:"Ë",TildeEqual:"â",TildeFullEqual:"â
",TildeTilde:"â",times:"Ã",timesb:"â ",timesbar:"⨱",timesd:"⨰",tint:"â",toea:"⤨",top:"â¤",topbot:"â¶",topcir:"⫱",Topf:"ð",topf:"ð¥",topfork:"â«",tosa:"⤩",tprime:"â´",TRADE:"â¢",trade:"â¢",triangle:"âµ",triangledown:"â¿",triangleleft:"â",trianglelefteq:"â´",triangleq:"â",triangleright:"â¹",trianglerighteq:"âµ",tridot:"â¬",trie:"â",triminus:"⨺",TripleDot:"â",triplus:"⨹",trisb:"â§",tritime:"⨻",trpezium:"â¢",Tscr:"ð¯",tscr:"ð",TScy:"Ц",tscy:"Ñ",TSHcy:"Ð",tshcy:"Ñ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"â¬",twoheadleftarrow:"â",twoheadrightarrow:"â ",Uacute:"Ã",uacute:"ú",Uarr:"â",uArr:"â",uarr:"â",Uarrocir:"â¥",Ubrcy:"Ð",ubrcy:"Ñ",Ubreve:"Ŭ",ubreve:"Å",Ucirc:"Ã",ucirc:"û",Ucy:"У",ucy:"Ñ",udarr:"â
",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"ð",ufr:"ð²",Ugrave:"Ã",ugrave:"ù",uHar:"⥣",uharl:"â¿",uharr:"â¾",uhblk:"â",ulcorn:"â",ulcorner:"â",ulcrop:"â",ultri:"â¸",Umacr:"Ū",umacr:"Å«",uml:"¨",UnderBar:"_",UnderBrace:"â",UnderBracket:"âµ",UnderParenthesis:"â",Union:"â",UnionPlus:"â",Uogon:"Ų",uogon:"ų",Uopf:"ð",uopf:"ð¦",UpArrow:"â",Uparrow:"â",uparrow:"â",UpArrowBar:"â¤",UpArrowDownArrow:"â
",UpDownArrow:"â",Updownarrow:"â",updownarrow:"â",UpEquilibrium:"⥮",upharpoonleft:"â¿",upharpoonright:"â¾",uplus:"â",UpperLeftArrow:"â",UpperRightArrow:"â",Upsi:"Ï",upsi:"Ï
",upsih:"Ï",Upsilon:"Î¥",upsilon:"Ï
",UpTee:"â¥",UpTeeArrow:"â¥",upuparrows:"â",urcorn:"â",urcorner:"â",urcrop:"â",Uring:"Å®",uring:"ů",urtri:"â¹",Uscr:"ð°",uscr:"ð",utdot:"â°",Utilde:"Ũ",utilde:"Å©",utri:"âµ",utrif:"â´",uuarr:"â",Uuml:"Ã",uuml:"ü",uwangle:"⦧",vangrt:"â¦",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"â
",varphi:"Ï",varpi:"Ï",varpropto:"â",vArr:"â",varr:"â",varrho:"ϱ",varsigma:"Ï",varsubsetneq:"âï¸",varsubsetneqq:"â«ï¸",varsupsetneq:"âï¸",varsupsetneqq:"â«ï¸",vartheta:"Ï",vartriangleleft:"â²",vartriangleright:"â³",Vbar:"â««",vBar:"⫨",vBarv:"â«©",Vcy:"Ð",vcy:"в",VDash:"â«",Vdash:"â©",vDash:"â¨",vdash:"â¢",Vdashl:"⫦",Vee:"â",vee:"â¨",veebar:"â»",veeeq:"â",vellip:"â®",Verbar:"â",verbar:"|",Vert:"â",vert:"|",VerticalBar:"â£",VerticalLine:"|",VerticalSeparator:"â",VerticalTilde:"â",VeryThinSpace:"â",Vfr:"ð",vfr:"ð³",vltri:"â²",vnsub:"ââ",vnsup:"ââ",Vopf:"ð",vopf:"ð§",vprop:"â",vrtri:"â³",Vscr:"ð±",vscr:"ð",vsubnE:"â«ï¸",vsubne:"âï¸",vsupnE:"â«ï¸",vsupne:"âï¸",Vvdash:"âª",vzigzag:"â¦",Wcirc:"Å´",wcirc:"ŵ",wedbar:"â©",Wedge:"â",wedge:"â§",wedgeq:"â",weierp:"â",Wfr:"ð",wfr:"ð´",Wopf:"ð",wopf:"ð¨",wp:"â",wr:"â",wreath:"â",Wscr:"ð²",wscr:"ð",xcap:"â",xcirc:"â¯",xcup:"â",xdtri:"â½",Xfr:"ð",xfr:"ðµ",xhArr:"âº",xharr:"â·",Xi:"Î",xi:"ξ",xlArr:"â¸",xlarr:"âµ",xmap:"â¼",xnis:"â»",xodot:"â¨",Xopf:"ð",xopf:"ð©",xoplus:"â¨",xotime:"â¨",xrArr:"â¹",xrarr:"â¶",Xscr:"ð³",xscr:"ð",xsqcup:"â¨",xuplus:"â¨",xutri:"â³",xvee:"â",xwedge:"â",Yacute:"Ã",yacute:"ý",YAcy:"Я",yacy:"Ñ",Ycirc:"Ŷ",ycirc:"Å·",Ycy:"Ы",ycy:"Ñ",yen:"Â¥",Yfr:"ð",yfr:"ð¶",YIcy:"Ð",yicy:"Ñ",Yopf:"ð",yopf:"ðª",Yscr:"ð´",yscr:"ð",YUcy:"Ю",yucy:"Ñ",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"Ð",zcy:"з",Zdot:"Å»",zdot:"ż",zeetrf:"â¨",ZeroWidthSpace:"â",Zeta:"Î",zeta:"ζ",Zfr:"â¨",zfr:"ð·",ZHcy:"Ð",zhcy:"ж",zigrarr:"â",Zopf:"â¤",zopf:"ð«",Zscr:"ðµ",zscr:"ð",zwj:"â",zwnj:"â"}),s.entityMap=s.HTML_ENTITIES})(Ba)),Ba}var un={},Eu;
vendor: 5,347 bytes, line 15
15function nm(){if(Eu)return un;Eu=1;var s=qn().NAMESPACE,e=/[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]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,l=3,d=4,f=5,m=6,y=7;function k(T,C){this.message=T,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,k)}k.prototype=new Error,k.prototype.name=k.name;function E(){}E.prototype={parse:function(T,C,U){var K=this.domBuilder;K.startDocument(),V(C,C={}),O(T,C,U,K,this.errorHandler),K.endDocument()}};function O(T,C,U,K,$){function W(Re){if(Re>65535){Re-=65536;var We=55296+(Re>>10),ui=56320+(Re&1023);return String.fromCharCode(We,ui)}else return String.fromCharCode(Re)}function ee(Re){var We=Re.slice(1,-1);return Object.hasOwnProperty.call(U,We)?U[We]:We.charAt(0)==="#"?W(parseInt(We.substr(1).replace("x","0x"))):($.error("entity not found:"+Re),Re)}function se(Re){if(Re>xe){var We=T.substring(xe,Re).replace(/&#?\w+;/g,ee);oe&&Y(xe),K.characters(We,0,Re-xe),xe=Re}}function Y(Re,We){for(;Re>=J&&(We=te.exec(T));)Z=We.index,J=Z+We[0].length,oe.lineNumber++;oe.columnNumber=Re-Z+1}for(var Z=0,J=0,te=/.*(?:\r\n?|\n)|.*$/g,oe=K.locator,me=[{currentNSMap:C}],de={},xe=0;;){try{var pe=T.indexOf("<",xe);if(pe<0){if(!T.substr(xe).match(/^\s*$/)){var Ae=K.doc,Je=Ae.createTextNode(T.substr(xe));Ae.appendChild(Je),K.currentElement=Je}return}switch(pe>xe&&se(pe),T.charAt(pe+1)){case"/":var ze=T.indexOf(">",pe+3),Qe=T.substring(pe+2,ze).replace(/[ \t\n\r]+$/g,""),rt=me.pop();ze<0?(Qe=T.substring(pe+2).replace(/[\s<].*/,""),$.error("end tag name: "+Qe+" is not complete:"+rt.tagName),ze=pe+1+Qe.length):Qe.match(/\s</)&&(Qe=Qe.replace(/[\s<].*/,""),$.error("end tag name: "+Qe+" maybe not complete"),ze=pe+1+Qe.length);var mt=rt.localNSMap,Gt=rt.tagName==Qe,Zi=Gt||rt.tagName&&rt.tagName.toLowerCase()==Qe.toLowerCase();if(Zi){if(K.endElement(rt.uri,rt.localName,Qe),mt)for(var es in mt)Object.prototype.hasOwnProperty.call(mt,es)&&K.endPrefixMapping(es);Gt||$.fatalError("end tag name: "+Qe+" is not match the current start tagName:"+rt.tagName)}else me.push(rt);ze++;break;case"?":oe&&Y(pe),ze=q(T,pe,K);break;case"!":oe&&Y(pe),ze=j(T,pe,K,$);break;default:oe&&Y(pe);var Be=new R,at=me[me.length-1].currentNSMap,ze=P(T,pe,Be,at,ee,$),Mi=Be.length;if(!Be.closed&&L(T,ze,Be.tagName,de)&&(Be.closed=!0,U.nbsp||$.warning("unclosed xml attribute")),oe&&Mi){for(var xt=v(oe,{}),li=0;li<Mi;li++){var Ce=Be[li];Y(Ce.offset),Ce.locator=v(oe,{})}K.locator=xt,B(Be,K,at)&&me.push(Be),K.locator=oe}else B(Be,K,at)&&me.push(Be);s.isHTML(Be.uri)&&!Be.closed?ze=N(T,ze,Be.tagName,ee,K):ze++}}catch(Re){if(Re instanceof k)throw Re;$.error("element parse error: "+Re),ze=-1}ze>xe?xe=ze:se(Math.max(pe,xe)+1)}}function v(T,C){return C.lineNumber=T.lineNumber,C.columnNumber=T.columnNumber,C}function P(T,C,U,K,$,W){function ee(oe,me,de){U.attributeNames.hasOwnProperty(oe)&&W.fatalError("Attribute "+oe+" redefined"),U.addValue(oe,me.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,$),de)}for(var se,Y,Z=++C,J=r;;){var te=T.charAt(Z);switch(te){case"=":if(J===n)se=T.slice(C,Z),J=l;else if(J===a)J=l;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(J===l||J===n)if(J===n&&(W.warning('attribute value must after "="'),se=T.slice(C,Z)),C=Z+1,Z=T.indexOf(te,C),Z>0)Y=T.slice(C,Z),ee(se,Y,C-1),J=f;else throw new Error("attribute value no end '"+te+"' match");else if(J==d)Y=T.slice(C,Z),ee(se,Y,C),W.warning('attribute "'+se+'" missed start quot('+te+")!!"),C=Z+1,J=f;else throw new Error('attribute value must after "="');break;case"/":switch(J){case r:U.setTagName(T.slice(C,Z));case f:case m:case y:J=y,U.closed=!0;case d:case n:break;case a:U.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return W.error("unexpected end of input"),J==r&&U.setTagName(T.slice(C,Z)),Z;case">":switch(J){case r:U.setTagName(T.slice(C,Z));case f:case m:case y:break;case d:case n:Y=T.slice(C,Z),Y.slice(-1)==="/"&&(U.closed=!0,Y=Y.slice(0,-1));case a:J===a&&(Y=se),J==d?(W.warning('attribute "'+Y+'" missed quot(")!'),ee(se,Y,C)):((!s.isHTML(K[""])||!Y.match(/^(?:disabled|checked|selected)$/i))&&W.warning('attribute "'+Y+'" missed value!! "'+Y+'" instead!!'),ee(Y,Y,C));break;case l:throw new Error("attribute value missed!!")}return Z;case"Â":te=" ";default:if(te<=" ")switch(J){case r:U.setTagName(T.slice(C,Z)),J=m;break;case n:se=T.slice(C,Z),J=a;break;case d:var Y=T.slice(C,Z);W.warning('attribute "'+Y+'" missed quot(")!!'),ee(se,Y,C);case f:J=m;break}else switch(J){case a:U.tagName,(!s.isHTML(K[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&W.warning('attribute "'+se+'" missed value!! "'+se+'" instead2!!'),ee(se,se,C),C=Z,J=n;break;case f:W.warning('attribute space is required"'+se+'"!!');case m:J=n,C=Z;break;case l:J=d,C=Z;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Z++}}function B(T,C,U){for(var K=T.tagName,$=null,te=T.length;te--;){var W=T[te],ee=W.qName,se=W.value,oe=ee.indexOf(":");if(oe>0)var Y=W.prefix=ee.slice(0,oe),Z=ee.slice(oe+1),J=Y==="xmlns"&&Z;else Z=ee,Y=null,J=ee==="xmlns"&&"";W.localName=Z,J!==!1&&($==null&&($={},V(U,U={}
vendor: 6,031 bytes, lines 15-18
15)),U[J]=$[J]=se,W.uri=s.XMLNS,C.startPrefixMapping(J,se))}for(var te=T.length;te--;){W=T[te];var Y=W.prefix;Y&&(Y==="xml"&&(W.uri=s.XML),Y!=="xmlns"&&(W.uri=U[Y||""]))}var oe=K.indexOf(":");oe>0?(Y=T.prefix=K.slice(0,oe),Z=T.localName=K.slice(oe+1)):(Y=null,Z=T.localName=K);var me=T.uri=U[Y||""];if(C.startElement(me,Z,K,T),T.closed){if(C.endElement(me,Z,K),$)for(Y in $)Object.prototype.hasOwnProperty.call($,Y)&&C.endPrefixMapping(Y)}else return T.currentNSMap=U,T.localNSMap=$,!0}function N(T,C,U,K,$){if(/^(?:script|textarea)$/i.test(U)){var W=T.indexOf("</"+U+">",C),ee=T.substring(C+1,W);if(/[&<]/.test(ee))return/^script$/i.test(U)?($.characters(ee,0,ee.length),W):(ee=ee.replace(/&#?\w+;/g,K),$.characters(ee,0,ee.length),W)}return C+1}function L(T,C,U,K){var $=K[U];return $==null&&($=T.lastIndexOf("</"+U+">"),$<C&&($=T.lastIndexOf("</"+U)),K[U]=$),$<C}function V(T,C){for(var U in T)Object.prototype.hasOwnProperty.call(T,U)&&(C[U]=T[U])}function j(T,C,U,K){var $=T.charAt(C+2);switch($){case"-":if(T.charAt(C+3)==="-"){var W=T.indexOf("-->",C+4);return W>C?(U.comment(T,C+4,W-C-4),W+3):(K.error("Unclosed comment"),-1)}else return-1;default:if(T.substr(C+3,6)=="CDATA["){var W=T.indexOf("]]>",C+9);return U.startCDATA(),U.characters(T,C+9,W-C-9),U.endCDATA(),W+3}var ee=H(T,C),se=ee.length;if(se>1&&/!doctype/i.test(ee[0][0])){var Y=ee[1][0],Z=!1,J=!1;se>3&&(/^public$/i.test(ee[2][0])?(Z=ee[3][0],J=se>4&&ee[4][0]):/^system$/i.test(ee[2][0])&&(J=ee[3][0]));var te=ee[se-1];return U.startDTD(Y,Z,J),U.endDTD(),te.index+te[0].length}}return-1}function q(T,C,U){var K=T.indexOf("?>",C);if(K){var $=T.substring(C,K).match(/^<\?(\S*)\s*([\s\S]*?)$/);return $?($[0].length,U.processingInstruction($[1],$[2]),K+2):-1}return-1}function R(){this.attributeNames={}}R.prototype={setTagName:function(T){if(!i.test(T))throw new Error("invalid tagName:"+T);this.tagName=T},addValue:function(T,C,U){if(!i.test(T))throw new Error("invalid attribute:"+T);this.attributeNames[T]=this.length,this[this.length++]={qName:T,value:C,offset:U}},length:0,getLocalName:function(T){return this[T].localName},getLocator:function(T){return this[T].locator},getQName:function(T){return this[T].qName},getURI:function(T){return this[T].uri},getValue:function(T){return this[T].value}};function H(T,C){var U,K=[],$=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for($.lastIndex=C,$.exec(T);U=$.exec(T);)if(K.push(U),U[1])return K}return un.XMLReader=E,un.ParseError=k,un}var Cu;function am(){if(Cu)return ur;Cu=1;var s=qn(),e=Hd(),t=rm(),i=nm(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,l=i.XMLReader;function d(P){return P.replace(/\r[\n\u0085]/g,` 16`).replace(/[\r\u0085\u2028]/g,` 17`)}function f(P){this.options=P||{locator:{}}}f.prototype.parseFromString=function(P,B){var N=this.options,L=new l,V=N.domBuilder||new y,j=N.errorHandler,q=N.locator,R=N.xmlns||{},H=/\/x?html?$/.test(B),T=H?t.HTML_ENTITIES:t.XML_ENTITIES;q&&V.setDocumentLocator(q),L.errorHandler=m(j,V,q),L.domBuilder=N.domBuilder||V,H&&(R[""]=n.HTML),R.xml=R.xml||n.XML;var C=N.normalizeLineEndings||d;return P&&typeof P=="string"?L.parse(C(P),R,T):L.errorHandler.error("invalid doc source"),V.doc};function m(P,B,N){if(!P){if(B instanceof y)return B;P=B}var L={},V=P instanceof Function;N=N||{};function j(q){var R=P[q];!R&&V&&(R=P.length==2?function(H){P(q,H)}:P),L[q]=R&&function(H){R("[xmldom "+q+"] "+H+E(N))}||function(){}}return j("warning"),j("error"),j("fatalError"),L}function y(){this.cdata=!1}function k(P,B){B.lineNumber=P.lineNumber,B.columnNumber=P.columnNumber}y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(P,B,N,L){var V=this.doc,j=V.createElementNS(P,N||B),q=L.length;v(this,j),this.currentElement=j,this.locator&&k(this.locator,j);for(var R=0;R<q;R++){var P=L.getURI(R),H=L.getValue(R),N=L.getQName(R),T=V.createAttributeNS(P,N);this.locator&&k(L.getLocator(R),T),T.value=T.nodeValue=H,j.setAttributeNode(T)}},endElement:function(P,B,N){var L=this.currentElement;L.tagName,this.currentElement=L.parentNode},startPrefixMapping:function(P,B){},endPrefixMapping:function(P){},processingInstruction:function(P,B){var N=this.doc.createProcessingInstruction(P,B);this.locator&&k(this.locator,N),v(this,N)},ignorableWhitespace:function(P,B,N){},characters:function(P,B,N){if(P=O.apply(this,arguments),P){if(this.cdata)var L=this.doc.createCDATASection(P);else var L=this.doc.createTextNode(P);this.currentElement?this.currentElement.appendChild(L):/^\s*$/.test(P)&&this.doc.appendChild(L),this.locator&&k(this.locator,L)}},skippedEntity:function(P){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(P){(this.locator=P)&&(P.lineNumber=0)},comment:function(P,B,N){P=O.apply(this,arguments);var L=this.doc.createComment(P);this.locator&&k(this.locator,L),v(this,L)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(P,B,N){var L=this.doc.implementation;if(L&&L.createDocumentType){var V=L.createDocumentType(P,B,N);this.locator&&k(this.locator,V),v(this,V),this.doc.doctype=V}},warning:function(P){console.warn("[xmldom warning] "+P,E(this.locator))},error:function(P){console.error("[xmldom error] "+P,E(this.locator))},fatalError:function(P){throw new a(P,this.locator)}};function E(P){if(P)return` 18@`+(P.systemId||"")+"#[line:"+P.lineNumber+",col:"+P.columnNumber+"]"}function O(P,B,N){return typeof P=="string"?P.substr(B,N):P.length>=B+N||B?new java.lang.String(P,B,N)+"":P}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(P){y.prototype[P]=function(){return null}});function v(P,B){P.currentElement?P.currentElement.appendChild(B):P.doc.appendChild(B)}return ur.__DOMHandler=y,ur.normalizeLineEndings=d,ur.DOMParser=f,ur}var Au;function om(){if(Au)return lr;Au=1;var s=Hd();return lr.DOMImplementation=s.DOMImplementation,lr.XMLSerializer
vendor: 20,204 bytes, line 18
18=s.XMLSerializer,lr.DOMParser=am().DOMParser,lr}var lm=om();const Du=s=>!!s&&typeof s=="object",it=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):Du(e[i])&&Du(t[i])?e[i]=it(e[i],t[i]):e[i]=t[i]}),e),{}),zd=s=>Object.keys(s).map(e=>s[e]),um=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},As=s=>s.reduce((e,t)=>e.concat(t),[]),Wd=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},dm=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),cm=(s,e)=>zd(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var Ds={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Sr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:jn(s||"",e)};if(t||i){const a=(t||i).split("-");let l=D.BigInt?D.BigInt(a[0]):parseInt(a[0],10),d=D.BigInt?D.BigInt(a[1]):parseInt(a[1],10);l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l)),d<Number.MAX_SAFE_INTEGER&&typeof d=="bigint"&&(d=Number(d));let f;typeof d=="bigint"||typeof l=="bigint"?f=D.BigInt(d)-D.BigInt(l)+D.BigInt(1):f=d-l+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:l}}return r},hm=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},wu=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),fm={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=wu(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:d=1/0}=s,f=wu(s.endNumber),m=(e+t)/1e3,y=i+a,E=m+l-y,O=Math.ceil(E*r/n),v=Math.floor((m-y-d)*r/n),P=Math.floor((m-y)*r/n);return{start:Math.max(0,v),end:typeof f=="number"?f:Math.min(O,P)}}},pm=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},Oo=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:l}=fm[e](s),d=um(a,l).map(pm(s));if(e==="static"){const f=d.length-1,m=typeof r=="number"?r:n;d[f].duration=m-t/i*f}return d},Gd=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:l=0,duration:d}=s;if(!e)throw new Error(Ds.NO_BASE_URL);const f=Sr({baseUrl:e,source:t.sourceURL,range:t.range}),m=Sr({baseUrl:e,source:e,indexRange:r});if(m.map=f,d){const y=Oo(s);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else i&&(m.duration=i,m.timeline=n);return m.presentationTime=a||n,m.number=l,[m]},Ro=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,l=a.offset+a.length,d=e.timescale,f=e.references.filter(P=>P.referenceType!==1),m=[],y=s.endList?"static":"dynamic",k=s.sidx.timeline;let E=k,O=s.mediaSequence||0,v;typeof e.firstOffset=="bigint"?v=D.BigInt(l)+e.firstOffset:v=l+e.firstOffset;for(let P=0;P<f.length;P++){const B=e.references[P],N=B.referencedSize,L=B.subsegmentDuration;let V;typeof v=="bigint"?V=v+D.BigInt(N)-D.BigInt(1):V=v+N-1;const j=`${v}-${V}`,R=Gd({baseUrl:t,timescale:d,timeline:n,periodStart:k,presentationTime:E,number:O,duration:L,sourceDuration:r,indexRange:j,type:y})[0];i&&(R.map=i),m.push(R),typeof v=="bigint"?v+=D.BigInt(N):v+=N,E+=L/d,O++}return s.segments=m,s},gm=["AUDIO","SUBTITLES"],mm=1/60,Xd=s=>cm(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),ym=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},ku=s=>{let e=[];return sm(s,gm,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},Iu=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},_m=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:d}){return d===i.timeline});const r=ym(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(d){return Math.abs(d.presentationTime-n.presentationTime)<mm});if(a===-1){Iu({playlist:i,mediaSequence:r.mediaSequence+r.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!r.segments.length&&i.timeline>r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),Iu({playlist:i,mediaSequence:r.segments[a].number})})},vm=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(ku(s)),i=e.playlists.concat(ku(e));return e.timelineStarts=Xd([s.timelineStarts,e.timelineStarts]),_m({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},$n=s=>s&&s.uri+"-"+hm(s.byterange),Fa=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=zd(i.reduce((n,a)=>{const l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=dm(i.segments||[],"discontinuity"),i))},Mo=(s,e)=>{const t=$n(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Ro(s,i,s.sidx.resolvedUri),s},Tm=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Mo(s[t],e);return s},bm=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const l={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(l.contentProtection=s.contentProtection),s.serviceLocation&&(l.attributes.serviceLocation=s.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},Sm=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},xm=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const l=a.attributes.role&&a.attributes.role.value||"",d=a.attributes.lang||"";let f=a.attributes.label||"main";if(d&&!a.attributes.label){const y=l?` (${l})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:d,autoselect:!0,default:l==="main",playlists:[],uri:""});const m=Mo(bm(a,t),e);return n[f].playlists.push(m),typeof i>"u"&&l==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(r)[0];r[n].default=!0}return r},Em=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Mo(Sm(i),e)),t},{}),Cm=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),Am=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},Dm=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",wm=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",km=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",Im=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},Pu=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],Pm=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:l,suggestedPresentationDelay:d,minimumUpdatePeriod:f}=s[0].attributes,m=Fa(s.filter(Dm)).map(Am),y=Fa(s.filter(wm)),k=Fa(s.filter(km)),E=s.map(V=>V.attributes.captionServices).filter(Boolean),O={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Tm(m,i)};f>=0&&(O.minimumUpdatePeriod=f*1e3),e&&(O.locations=e),t&&(O.contentSteering=t),l==="dynamic"&&(O.suggestedPresentationDelay=d),n&&n.length>0&&(O.eventStream=n);const v=O.playlists.length===0,P=y.length?xm(y,i,v):null,B=k.length?Em(k,i):null,N=m.concat(Pu(P),Pu(B)),L=N.map(({timelineStarts:V})=>V);return O.timelineStarts=Xd(L),Im(N,O.timelineStarts),P&&(O.mediaGroups.AUDIO.audio=P),B&&(O.mediaGroups.SUBTITLES.subs=B),E.length&&(O.mediaGroups["CLOSED-CAPTIONS"].cc=Cm(E)),r?vm({oldManifest:r,newManifest:O}):O},Lm=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:d=0}=s,f=(i+r)/1e3,m=n+l,k=f+d-m;return Math.ceil((k*a-e)/t)},Kd=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:l=1,periodStart:d}=s,f=[];let m=-1;for(let y=0;y<e.length;y++){const k=e[y],E=k.d,O=k.r||0,v=k.t||0;m<0&&(m=v),v&&v>m&&(m=v);let P;if(O<0){const L=y+1;L===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?P=Lm(s,m,E):P=(n*a-m)/E:P=(e[L].t-m)/E}else P=O+1;const B=l+f.length+P;let N=l+f.length;for(;N<B;)f.push({number:N,duration:E/a,time:m,timeline:d}),m+=E,N++}return f},Om=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Rm=s=>(e,t,i,r)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(i?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},Lu=(s,e)=>s.replace(Om,Rm(e)),Mm=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?Oo(s):Kd(s,e),Nm=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=Sr({baseUrl:s.baseUrl,source:Lu(i.sourceURL,t),range:i.range});return Mm(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const l=Lu(s.media||"",t),d=s.timescale||1,f=s.presentationTimeOffset||0,m=s.periodStart+(a.time-f)/d;return{uri:l,timeline:a.timeline,duration:a.duration,resolvedUri:jn(s.baseUrl||"",l),map:r,number:a.number,presentationTime:m}})},Bm=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=Sr({baseUrl:t,source:i.sourceURL,range:i.range}),n=Sr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Fm=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(Ds.SEGMENT_TIME_UNSPECIFIED);const n=i.map(d=>Bm(s,d));let a;return t&&(a=Oo(s)),e&&(a=Kd(s,e)),a.map((d,f)=>{if(n[f]){const m=n[f],y=s.timescale||1,k=s.presentationTimeOffset||0;return m.timeline=d.timeline,m.duration=d.duration,m.number=d.number,m.presentationTime=r+(d.time-k)/y,m}}).filter(d=>d)},Um=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=Nm,t=it(s,e.template)):e.base?(i=Gd,t=it(s,e.base)):e.list&&(i=Fm,t=it(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},jm=s=>s.map(Um),qe=(s,e)=>Wd(s.childNodes).filter(({tagName:t})=>t===e),wr=s=>s.textContent.trim(),qm=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),us=s=>{const l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!l)return 0;const[d,f,m,y,k,E]=l.slice(1);return parseFloat(d||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(k||0)*60+parseFloat(E||0)},$m=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),Ou={mediaPresentationDuration(s){return us(s)},availabilityStartTime(s){return $m(s)/1e3},minimumUpdatePeriod(s){return us(s)},suggestedPresentationDelay(s){return us(s)},type(s){return s},timeShiftBufferDepth(s){return us(s)},start(s){return us(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return qm(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?us(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},Ye=s=>s&&s.attributes?Wd(s.attributes).reduce((e,t)=>{const i=Ou[t.name]||Ou.DEFAULT;return e[t.name]=i(t.value),e},{}):{},Vm={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Vn=(s,e)=>e.length?As(s.map(function(t){return e.map(function(i){const r=wr(i),n=jn(t.baseUrl,r),a=it(Ye(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,No=s=>{const e=qe(s,"SegmentTemplate")[0],t=qe(s,"SegmentList")[0],i=t&&qe(t,"SegmentURL").map(y=>it({tag:"SegmentURL"},Ye(y))),r=qe(s,"SegmentBase")[0],n=t||e,a=n&&qe(n,"SegmentTimeline")[0],l=t||r||e,d=l&&qe(l,"Initialization")[0],f=e&&Ye(e);f&&d?f.initialization=d&&Ye(d):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&qe(a,"S").map(y=>Ye(y)),list:t&&it(Ye(t),{segmentUrls:i,initialization:Ye(d)}),base:r&&it(Ye(r),{initialization:Ye(d)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},Hm=(s,e,t)=>i=>{const r=qe(i,"BaseURL"),n=Vn(e,r),a=it(s,Ye(i)),l=No(i);return n.map(d=>({segmentInfo:it(t,l),attributes:it(a,d)}))},zm=s=>s.reduce((e,t)=>{const i=Ye(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=Vm[i.schemeIdUri];if(r){e[r]={attributes:i};const n=qe(t,"cenc:pssh")[0];if(n){const a=wr(n);e[r].pssh=a&&Fd(a)}}return e},{}),Wm=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let i,r;return r=t,/^CC\d=/.test(t)?[i,r]=t.split("="):/^CC\d$/.test(t)&&(i=t),{channel:i,language:r}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");i.channel=r,i.language=t,n.split(",").forEach(a=>{const[l,d]=a.split(":");l==="lang"?i.language=d:l==="er"?i.easyReader=Number(d):l==="war"?i.aspectRatio=Number(d):l==="3D"&&(i["3D"]=Number(d))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},Gm=s=>As(qe(s.node,"EventStream").map(e=>{const t=Ye(e),i=t.schemeIdUri;return qe(e,"Event").map(r=>{const n=Ye(r),a=n.presentationTime||0,l=t.timescale||1,d=n.duration||0,f=a/l+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:f,end:f+d/l,messageData:wr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),Xm=(s,e,t)=>i=>{const r=Ye(i),n=Vn(e,qe(i,"BaseURL")),a=qe(i,"Role")[0],l={role:Ye(a)};let d=it(s,r,l);const f=qe(i,"Accessibility")[0],m=Wm(Ye(f));m&&(d=it(d,{captionServices:m}));const y=qe(i,"Label")[0];if(y&&y.childNodes.length){const P=y.childNodes[0].nodeValue.trim();d=it(d,{label:P})}const k=zm(qe(i,"ContentProtection"));Object.keys(k).length&&(d=it(d,{contentProtection:k}));const E=No(i),O=qe(i,"Representation"),v=it(t,E);return As(O.map(Hm(d,n,v)))},Km=(s,e)=>(t,i)=>{const r=Vn(e,qe(t.node,"BaseURL")),n=it(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=qe(t.node,"AdaptationSet"),l=No(t.node);return As(a.map(Xm(n,r,l)))},Ym=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=it({serverURL:wr(s[0])},Ye(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Qm=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,Jm=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=qe(s,"Period");if(!a.length)throw new Error(Ds.INVALID_NUMBER_OF_PERIOD);const l=qe(s,"Location"),d=Ye(s),f=Vn([{baseUrl:t}],qe(s,"BaseURL")),m=qe(s,"ContentSteering");d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=i,d.clientOffset=r,l.length&&(d.locations=l.map(wr));const y=[];return a.forEach((k,E)=>{const O=Ye(k),v=y[E-1];O.start=Qm({attributes:O,priorPeriodAttributes:v?v.attributes:null,mpdType:d.type}),y.push({node:k,attributes:O})}),{locations:d.locations,contentSteeringInfo:Ym(m,n),representationInfo:As(y.map(Km(d,f))),eventStream:As(y.map(Gm))}},Yd=s=>{if(s==="")throw new Error(Ds.DASH_EMPTY_MANIFEST);const e=new lm.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(Ds.DASH_INVALID_XML);return i},Zm=s=>{const e=qe(s,"UTCTiming")[0];if(!e)return null;const t=Ye(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.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":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(Ds.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},e0=(s,e={})=>{const t=Jm(Yd(s),e),i=jm(t.representationInfo);return Pm({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},t0=s=>Zm(Yd(s));var Ua,Ru;function i0(){if(Ru)return Ua;Ru=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?
18Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return Ua={getUint64:e,MAX_UINT32:s},Ua}var ja,Mu;function s0(){if(Mu)return ja;Mu=1;var s=i0().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return ja=e,ja}var r0=s0();const n0=Dr(r0);var a0=fe([73,68,51]),o0=function(e,t){t===void 0&&(t=0),e=fe(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},fr=function s(e,t){return t===void 0&&(t=0),e=fe(e),e.length-t<10||!je(e,a0,{offset:t})?t:(t+=o0(e,t),s(e,t))},Nu=function(e){return typeof e=="string"?Vd(e):e},l0=function(e){return Array.isArray(e)?e.map(function(t){return Nu(t)}):[Nu(e)]},u0=function s(e,t,i){i===void 0&&(i=!1),t=l0(t),e=fe(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,l=e.subarray(n+4,n+8);if(a===0)break;var d=n+a;if(d>e.length){if(i)break;d=e.length}var f=e.subarray(n+8,d);je(l,t[0])&&(t.length===1?r.push(f):r.push.apply(r,s(f,t.slice(1),i))),n=d}return r},dn={EBML:fe([26,69,223,163]),DocType:fe([66,130]),Segment:fe([24,83,128,103]),SegmentInfo:fe([21,73,169,102]),Tracks:fe([22,84,174,107]),Track:fe([174]),TrackNumber:fe([215]),DefaultDuration:fe([35,227,131]),TrackEntry:fe([174]),TrackType:fe([131]),FlagDefault:fe([136]),CodecID:fe([134]),CodecPrivate:fe([99,162]),VideoTrack:fe([224]),AudioTrack:fe([225]),Cluster:fe([31,67,182,117]),Timestamp:fe([231]),TimestampScale:fe([42,215,177]),BlockGroup:fe([160]),BlockDuration:fe([155]),Block:fe([161]
vendor: 5,669 bytes, line 18
18),SimpleBlock:fe([163])},ro=[128,64,32,16,8,4,2,1],d0=function(e){for(var t=1,i=0;i<ro.length&&!(e&ro[i]);i++)t++;return t},vn=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=d0(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=ro[n-1]),{length:n,value:em(a,{signed:r}),bytes:a}},Bu=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?tm(e):e},c0=function(e){return Array.isArray(e)?e.map(function(t){return Bu(t)}):[Bu(e)]},h0=function s(e,t,i){if(i>=t.length)return t.length;var r=vn(t,i,!1);if(je(e.bytes,r.bytes))return i;var n=vn(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Fu=function s(e,t){t=c0(t),e=fe(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=vn(e,r,!1),a=vn(e,r+n.length),l=r+n.length+a.length;a.value===127&&(a.value=h0(n,e,l),a.value!==e.length&&(a.value-=l));var d=l+a.value>e.length?e.length:l+a.value,f=e.subarray(l,d);je(t[0],n.bytes)&&(t.length===1?i.push(f):i=i.concat(s(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return i},f0=fe([0,0,0,1]),p0=fe([0,0,1]),g0=fe([0,0,3]),m0=function(e){for(var t=[],i=1;i<e.length-2;)je(e.subarray(i,i+3),g0)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},Qd=function(e,t,i,r){e=fe(e),i=[].concat(i);for(var n=0,a,l=0;n<e.length&&(l<r||a);){var d=void 0;if(je(e.subarray(n),f0)?d=4:je(e.subarray(n),p0)&&(d=3),!d){n++;continue}if(l++,a)return m0(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+d]&31:t==="h265"&&(f=e[n+d]>>1&63),i.indexOf(f)!==-1&&(a=n+d),n+=d+(t==="h264"?1:2)}return e.subarray(0,0)},y0=function(e,t,i){return Qd(e,"h264",t,i)},_0=function(e,t,i){return Qd(e,"h265",t,i)},ht={webm:fe([119,101,98,109]),matroska:fe([109,97,116,114,111,115,107,97]),flac:fe([102,76,97,67]),ogg:fe([79,103,103,83]),ac3:fe([11,119]),riff:fe([82,73,70,70]),avi:fe([65,86,73]),wav:fe([87,65,86,69]),"3gp":fe([102,116,121,112,51,103]),mp4:fe([102,116,121,112]),fmp4:fe([115,116,121,112]),mov:fe([102,116,121,112,113,116]),moov:fe([109,111,111,118]),moof:fe([109,111,111,102])},ws={aac:function(e){var t=fr(e);return je(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=fr(e);return je(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Fu(e,[dn.EBML,dn.DocType])[0];return je(t,ht.webm)},mkv:function(e){var t=Fu(e,[dn.EBML,dn.DocType])[0];return je(t,ht.matroska)},mp4:function(e){if(ws["3gp"](e)||ws.mov(e))return!1;if(je(e,ht.mp4,{offset:4})||je(e,ht.fmp4,{offset:4})||je(e,ht.moof,{offset:4})||je(e,ht.moov,{offset:4}))return!0},mov:function(e){return je(e,ht.mov,{offset:4})},"3gp":function(e){return je(e,ht["3gp"],{offset:4})},ac3:function(e){var t=fr(e);return je(e,ht.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=fr(e);return je(e,ht.flac,{offset:t})},ogg:function(e){return je(e,ht.ogg)},avi:function(e){return je(e,ht.riff)&&je(e,ht.avi,{offset:8})},wav:function(e){return je(e,ht.riff)&&je(e,ht.wav,{offset:8})},h264:function(e){return y0(e,7,3).length},h265:function(e){return _0(e,[32,33],3).length}},no=Object.keys(ws).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);no.forEach(function(s){var e=ws[s];ws[s]=function(t){return e(fe(t))}});var v0=ws,Bo=function(e){e=fe(e);for(var t=0;t<no.length;t++){var i=no[t];if(v0[i](e))return i}return""},T0=function(e){return u0(e,["moof"]).length>0},qa,Uu;function b0(){if(Uu)return qa;Uu=1;var s=9e4,e,t,i,r,n,a,l;return e=function(d){return d*s},t=function(d,f){return d*f},i=function(d){return d/s},r=function(d,f){return d/f},n=function(d,f){return e(r(d,f))},a=function(d,f){return t(i(d),f)},l=function(d,f,m){return i(m?d:d-f)},qa={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:l},qa}var Hi=b0();var ao="8.23.7";const gi={},Li=function(s,e){return gi[s]=gi[s]||[],e&&(gi[s]=gi[s].concat(e)),gi[s]},S0=function(s,e){Li(s,e)},Jd=function(s,e){const t=Li(s).indexOf(e);return t<=-1?!1:(gi[s]=gi[s].slice(),gi[s].splice(t,1),!0)},x0=function(s,e){Li(s,[].concat(e).map(t=>{const i=(...r)=>(Jd(s,i),t(...r));return i}))},Tn={prefixed:!0},gn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],ju=gn[0];let pr;for(let s=0;s<gn.length;s++)if(gn[s][1]in ie){pr=gn[s];break}if(pr){for(let s=0;s<pr.length;s++)Tn[ju[s]]=pr[s];Tn.prefixed=pr[0]!==ju[0]}let _t=[];const E0=(s,e,t)=>(i,r,n)=>{const a=e.levels[r],l=new RegExp(`^(${a})$`);let d=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(d=`%c${s}`,n.unshift(t)),n.unshift(d+":"),_t){_t.push([].concat(n));const m=_t.length-1e3;_t.splice(0,m>0?m:0)}if(!D.console)return;let f=D.console[i];!f&&i==="debug"&&(f=D.console.info||D.console.log),!(!f||!a||!l.test(i))&&f[Array.isArray(n)?"apply":"call"](D.console,n)};function oo(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=E0(s,n,t),n.createLogger=(a,l,d)=>{const f=l!==void 0?l:e,m=d!==void 0?d:t,y=`${s} ${f} ${a}`;return oo(y,f,m)},n.createNewLogger=(a,l,d)=>oo(a,l,d),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=a=>
18{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);i=a}return i},n.history=()=>_t?[].concat(_t):[],n.history.filter=a=>(_t||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{_t&&(_t.length=0)},n.history.disable=()=>{_t!==null&&(_t.length=0,_t=null)},n.history.enable=()=>{_t===null&&(_t=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const Te=oo("VIDEOJS"),Zd=Te.createLogger,C0=Object.prototype.toString,ec=function(s){return ni(s)?Object.keys(s):[]};function ms(s,e){ec(s).forEach(t=>e(s[t],t))}function tc(s,e,t=0){return ec(s).reduce((i,r)=>e(i,s[r],r),t)}function ni(s){return!!s&&typeof s=="object"}function ks(s){return ni(s)&&C0.call(s)==="[object Object]"&&s.constructor===Object}function Le(...s){const e={};return s.forEach(t=>{t&&ms(t,(i,r)=>{if(!ks(i)){e[r]=i;return}ks(e[r])||(e[r]={}),e[r]=Le(e[r],i)})}),e}function ic(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function Hn(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var A0=Object.freeze({__proto__:null,each:ms,reduce:tc,isObject:ni,isPlain:ks,merge:Le,values:ic,defineLazyProperty:Hn});let Fo=!1,sc=null,zt=!1,rc,nc=!1,ys=!1,_s=!1,ai=!1,Uo=null,zn=null;const D0=!!(D.cast&&D.cast.framework&&D.cast.framework.CastReceiverContext);let ac=null,bn=!1,Wn=!1,Sn=!1,Gn=!1,xn=!1,En=!1,Cn=!1;const xr=!!(Rs()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),wi=D.navigator&&D.navigator.userAgentData;wi&&wi.platform&&wi.brands&&(zt=wi.platform==="Android",ys=!!wi.brands.find(s=>s.brand==="Microsoft Edge"),_s=!!wi.brands.find(s=>s.brand==="Chromium"),ai=!ys&&_s,Uo=zn=(wi.brands.find(s=>s.brand==="Chromium")||{}).version||null,Wn=wi.platform==="Windows");if(!_s){const s=D.navigator&&D.navigator.userAgent||"";Fo=/iPod/i.test(s),sc=(function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null})(),zt=/Android/i.test(s),rc=(function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null})(),nc=/Firefox/i.test(s),ys=/Edg/i.test(s),_s=/Chrome/i.test(s)||/CriOS/i.test(s),ai=!ys&&_s,Uo=zn=(function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null})(),ac=(function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t})(),xn=/Tizen/i.test(s),En=/Web0S/i.test(s),Cn=xn||En,bn=/Safari/i.test(s)&&!ai&&!zt&&!ys&&!Cn,Wn=/Windows/i.test(s),Sn=/iPad/i.test(s)||bn&&xr&&!/iPhone/i.test(s),Gn=/iPhone/i.test(s)&&!Sn}const ot=Gn||Sn||Fo,Xn=(bn||ot)&&!ai;var oc=Object.freeze({__proto__:null,get IS_IPOD(){return Fo},get IOS_VERSION(){return sc},get IS_ANDROID(){return zt},get ANDROID_VERSION(){return rc},get IS_FIREFOX(){return nc},get IS_EDGE(){return ys},get IS_CHROMIUM(){return _s},get IS_CHROME(){return ai},get CHROMIUM_VERSION(){return Uo},get CHROME_VERSION(){return zn},IS_CHROMECAST_RECEIVER:D0,get IE_VERSION(){return ac},get IS_SAFARI(){return bn},get IS_WINDOWS(){return Wn},get IS_IPAD(){return Sn},get IS_IPHONE(){return Gn},get IS_TIZEN(){return xn},get IS_WEBOS(){return En},get IS_SMART_TV(){return Cn},TOUCH_ENABLED:xr,IS_IOS:ot,IS_ANY_SAFARI:Xn});function qu(s){return typeof s=="string"&&!!s.trim()}function w0(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Rs(){return ie===D.document}function Ms(s){return ni(s)&&s.nodeType===1}function lc(){try{return D.parent!==D.self}catch{return!0}}function uc(s){return function(e,t){if(!qu(e))return ie[s](null);qu(t)&&(t=ie.querySelector(t));const i=Ms(t)?t:ie;return i[s]&&i[s](e)}}function ge(s="div",e={},t={},i){const r=ie.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Ri(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&jo(r,i),r}function Ri(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function lo(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function yr(s,e){return w0(e),s.classList.contains(e)}function Gi(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Kn(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Te.warn("removeClass was called with an element that doesn't exist"),null)}function dc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEac
18h(i=>s.classList.toggle(i,t)),s}function cc(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function Ii(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function hc(s,e){return s.getAttribute(e)}function Is(s,e,t){s.setAttribute(e,t)}function Yn(s,e){s.removeAttribute(e)}function fc(){ie.body.focus(),ie.onselectstart=function(){return!1}}function pc(){ie.onselectstart=function(){return!0}}function Ps(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Ls(s,"height"))),t.width||(t.width=parseFloat(Ls(s,"width"))),t}}function Er(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==ie[Tn.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Qn(s,e){const t={x:0,y:0};if(ot){let m=s;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=Ls(m,"transform");
vendor: 37,730 bytes, line 18
18if(/^matrix/.test(y)){const k=y.slice(7,-1).split(/,\s/).map(Number);t.x+=k[4],t.y+=k[5]}else if(/^matrix3d/.test(y)){const k=y.slice(9,-1).split(/,\s/).map(Number);t.x+=k[12],t.y+=k[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&D.WebKitCSSMatrix){const k=D.getComputedStyle(m.assignedSlot.parentElement).transform,E=new D.WebKitCSSMatrix(k);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const i={},r=Er(e.target),n=Er(s),a=n.width,l=n.height;let d=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,d=e.changedTouches[0].pageY+n.top,ot&&(f-=t.x,d-=t.y)),i.y=1-Math.max(0,Math.min(1,d/l)),i.x=Math.max(0,Math.min(1,f/a)),i}function gc(s){return ni(s)&&s.nodeType===3}function Jn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function mc(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Ms(e)||gc(e))return e;if(typeof e=="string"&&/\S/.test(e))return ie.createTextNode(e)}).filter(e=>e)}function jo(s,e){return mc(e).forEach(t=>s.appendChild(t)),s}function yc(s,e){return jo(Jn(s),e)}function Cr(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const Oi=uc("querySelector"),_c=uc("querySelectorAll");function Ls(s,e){if(!s||!e)return"";if(typeof D.getComputedStyle=="function"){let t;try{t=D.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function vc(s){[...ie.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=ie.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const i=ie.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var Tc=Object.freeze({__proto__:null,isReal:Rs,isEl:Ms,isInFrame:lc,createEl:ge,textContent:Ri,prependTo:lo,hasClass:yr,addClass:Gi,removeClass:Kn,toggleClass:dc,setAttributes:cc,getAttributes:Ii,getAttribute:hc,setAttribute:Is,removeAttribute:Yn,blockTextSelection:fc,unblockTextSelection:pc,getBoundingClientRect:Ps,findPosition:Er,getPointerPosition:Qn,isTextNode:gc,emptyEl:Jn,normalizeContent:mc,appendContent:jo,insertContent:yc,isSingleLeftClick:Cr,$:Oi,$$:_c,computedStyle:Ls,copyStyleSheetsToWindow:vc});let bc=!1,uo;const k0=function(){if(uo.options.autoSetup===!1)return;const s=Array.prototype.slice.call(ie.getElementsByTagName("video")),e=Array.prototype.slice.call(ie.getElementsByTagName("audio")),t=Array.prototype.slice.call(ie.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r<n;r++){const a=i[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&uo(a);else{co(1);break}}else bc||co(1)};function co(s,e){Rs()&&(e&&(uo=e),D.setTimeout(k0,s))}function ho(){bc=!0,D.removeEventListener("load",ho)}Rs()&&(ie.readyState==="complete"?ho():D.addEventListener("load",ho));const Sc=function(s){const e=ie.createElement("style");return e.className=s,e},xc=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var pt=new WeakMap;const I0=3;let P0=I0;function Mt(){return P0++}function $u(s,e){if(!pt.has(s))return;const t=pt.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&pt.delete(s)}function qo(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Zn(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||D.event;s={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in i)r.includes(n)||n==="returnValue"&&i.preventDefault||(s[n]=i[n]);if(s.target||(s.target=s.srcElement||ie),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=ie.documentElement,a=ie.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let cn;const L0=function(){if(typeof cn!="boolean"){cn=!1;try{const s=Object.defineProperty({},"passive",{get(){cn=!0}});D.addEventListener("test",null,s),D.removeEventListener("test",null,s)}catch{}}return cn},O0=["touchstart","touchmove"];function It(s,e,t){if(Array.isArray(e))return qo(It,s,e,t);pt.has(s)||pt.set(s,{});const i=pt.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=Mt()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Zn(r);const a=i.handlers[r.type];if(a){const l=a.slice(0);for(let d=0,f=l.length;d<f&&!r.isImmediatePropagationStopped();d++)try{l[d].call(s,r,n)}catch(m){Te.error(m)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;L0()&&O0.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function lt(s,e,t){if(!pt.has(s))return;const i=pt.get(s);if(!i.handlers)return;if(Array.isArray(e))return qo(lt,s,e,t);const r=function(a,l){i.handlers[l]=[],$u(a,l)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n){if(!t){r(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);$u(s,e)}}function Ns(s,e,t){const i=pt.has(s)?pt.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Zn(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Ns.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){pt.has(e.target)||pt.set(e.target,{});const n=pt.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function ea(s,e,t){if(Array.isArray(e))return qo(ea,s,e,t);const i=function(){lt(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Mt(),It(s,e,i)}function $o(s,e,t){const i=function(){lt(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||Mt(),It(s,e,i)}var R0=Object.freeze({__proto__:null,fixEvent:Zn,on:It,off:lt,trigger:Ns,one:ea,any:$o});const Nt=30,Me=function(s,e,t){e.guid||(e.guid=Mt());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},oi=function(s,e){let t=D.performance.now();return function(...r){const n=D.performance.now();n-t>=e&&(s(...r),t=n)}},Ec=function(s,e,t,i=D){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const l=this,d=arguments;let f=function(){r=null,f=null,t||s.apply(l,d)};!r&&t&&s.apply(l,d),i.clearTimeout(r),r=i.setTimeout(f,e)};return a.cancel=n,a};var M0=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Nt,bind_:Me,throttle:oi,debounce:Ec});let dr;class Pt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},It(this,e,t),this.addEventListener=i}off(e,t){lt(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},ea(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},$o(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Zn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ns(this,e)}queueTrigger(e){dr||(dr=new Map);const t=e.type||e;let i=dr.get(this);i||(i=new Map,dr.set(this,i));const r=i.get(t);i.delete(t),D.clearTimeout(r);const n=D.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,dr.delete(this)),this.trigger(e)},0);i.set(t,n)}}Pt.prototype.allowedEvents_={};Pt.prototype.addEventListener=Pt.prototype.on;Pt.prototype.removeEventListener=Pt.prototype.off;Pt.prototype.dispatchEvent=Pt.prototype.trigger;const ta=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,yi=s=>s instanceof Pt||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),N0=(s,e)=>{yi(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},fo=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,An=(s,e,t)=>{if(!s||!s.nodeName&&!yi(s))throw new Error(`Invalid target for ${ta(e)}#${t}; must be a DOM node or evented object.`)},Cc=(s,e,t)=>{if(!fo(s))throw new Error(`Invalid event type for ${ta(e)}#${t}; must be a non-empty string or array.`)},Ac=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${ta(e)}#${t}; must be a function.`)},$a=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),An(r,s,t),Cc(n,s,t),Ac(a,s,t),a=Me(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},qi=(s,e,t,i)=>{An(s,s,e),s.nodeName?R0[e](s,t,i):s[e](t,i)},B0={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=$a(this,s,"on");if(qi(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,qi(this,"on","dispose",n),qi(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=$a(this,s,"one");if(e)qi(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,qi(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=$a(this,s,"any");if(e)qi(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,qi(t,"any",i,n)}},off(s,e,t){if(!s||fo(s))lt(this.eventBusEl_,s,e);else{const i=s,r=e;An(i,this,"off"),Cc(r,this,"off"),Ac(t,this,"off"),t=Me(this,t),this.off("dispose",t),i.nodeName?(lt(i,r,t),lt(i,"dispose",t)):yi(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){An(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!fo(t))throw new Error(`Invalid event type for ${ta(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ns(this.eventBusEl_,s,e)}};function Vo(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=ge("span",{className:"vjs-event-bus"});return Object.assign(s,B0),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&pt.has(i)&&pt.delete(i)}),D.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const F0={state:{},setState(s){typeof s=="function"&&(s=s());let e;return ms(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&yi(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function Dc(s,e){return Object.assign(s,F0),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&yi(s)&&s.on("statechanged",s.handleStateChanged),s}const _r=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},He=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},wc=function(s,e){return He(s)===He(e)};var U0=Object.freeze({__proto__:null,toLowerCase:_r,toTitleCase:He,titleCaseEquals:wc});class X{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Le({},this.options_),t=this.options_=Le(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${Mt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Vo(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Dc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Le(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ge(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],l=r&&r.split("-")[0],d=n&&n[l];let f=i;return a&&a[e]?f=a[e]:d&&d[e]&&(f=d[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(m,y){const k=t[y-1];let E=k;return typeof k>"u"&&(E=m),E})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",r=ge("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=ie.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=ie.createElementNS(i,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},i=this.children_.length){let r,n;if(typeof e=="string"){n=He(e);const a=t.componentClass||n;t.name=n;const l=X.getComponent(a);if(!l)throw new Error(`Component ${a} does not exist`);if(typeof l!="function")return null;r=new l(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&He(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[_r(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[i+1]&&(this.children_[i+1].el_?a=this.children_[i+1].el_:Ms(this.children_[i+1])&&(a=this.children_[i+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[He(e.name())]=null,this.childNameIndex_[_r(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const l=a.name;let d=a.opts;if(t[l]!==void 0&&(d=t[l]),d===!1)return;d===!0&&(d={}),d.playerOptions=this.options_.playerOptions;const f=this.addChild(l,d);f&&(this[l]=f)};let r;const n=X.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,d;return typeof a=="string"?(l=a,d=e[l]||this.options_[l]||{}):(l=a.name,d=a),{name:l,opts:d}}).filter(a=>{const l=X.getComponent(a.opts.componentClass||He(a.name));return l&&!n.isTech(l)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Oi(e,t||this.contentEl())}$$(e,t){return _c(e,t||this.contentEl())}hasClass(e){return yr(this.el_,e)}addClass(...e){Gi(this.el_,...e)}removeClass(...e){Kn(this.el_,...e)}toggleClass(e,t){dc(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return hc(this.el_,e)}setAttribute(e,t){Is(this.el_,e,t)}removeAttribute(e){Yn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+He(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ls(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${He(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=D.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){const d=l.touches[0].pageX-t.pageX,f=l.touches[0].pageY-t.pageY;Math.sqrt(d*d+f*f)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&D.performance.now()-e<r&&(l.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Me(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=Me(this,e),this.clearTimersOnDispose_(),i=D.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),D.clearTimeout(e)),e}setInterval(e,t){e=Me(this,e),this.clearTimersOnDispose_();const i=D.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),D.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Me(this,e),t=D.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Me(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),D.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=D.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||D.getComputedStyle(n).height==="0px"||D.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(ie.documentElement.clientWidth||D.innerWidth)||a.y<0||a.y>(ie.documentElement.clientHeight||D.innerHeight))return!1;let l=ie.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(l.parentNode)l=l.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=X.getComponent("Tech"),r=i&&i.isTech(t),n=X===t||X.prototype.isPrototypeOf(t.prototype);if(r||!n){let l;throw r?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=He(e),X.components_||(X.components_={});const a=X.getComponent("Player");if(e==="Player"&&a&&a.players){const l=a.players,d=Object.keys(l);if(l&&d.length>0){for(let f=0;f<d.length;f++)if(l[d[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return X.components_[e]=t,X.components_[_r(e)]=t,t}static getComponent(e){if(!(!e||!X.components_))return X.components_[e]}}X.registerComponent("Component",X);function j0(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Vu(s,e,t,i){return j0(s,i,t.length-1),t[i][e]}function Va(s){let e;return s===void 0||s.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:Vu.bind(null,"start",0,s),end:Vu.bind(null,"end",1,s)},D.Symbol&&D.Symbol.iterator&&(e[D.Symbol.iterator]=()=>(s||[]).values()),e}function Ht(s,e){return Array.isArray(s)?Va(s):s===void 0||e===void 0?Va():Va([[s,e]])}const kc=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Ho=kc;function Ic(s){Ho=s}function Pc(){Ho=kc}function Qi(s,e=s){return Ho(s,e)}var q0=Object.freeze({__proto__:null,createTimeRanges:Ht,createTimeRange:Ht,setFormatTime:Ic,resetFormatTime:Pc,formatTime:Qi});function Lc(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Ht(0,0));for(let n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Ve(s){if(s instanceof Ve)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:ni(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ve.defaultMessages[this.code]||"")}Ve.prototype.code=0;Ve.prototype.message="";Ve.prototype.status=null;Ve.prototype.metadata=null;Ve.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ve.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."};Ve.MEDIA_ERR_CUSTOM=0;Ve.prototype.MEDIA_ERR_CUSTOM=0;Ve.MEDIA_ERR_ABORTED=1;Ve.prototype.MEDIA_ERR_ABORTED=1;Ve.MEDIA_ERR_NETWORK=2;Ve.prototype.MEDIA_ERR_NETWORK=2;Ve.MEDIA_ERR_DECODE=3;Ve.prototype.MEDIA_ERR_DECODE=3;Ve.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Ve.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Ve.MEDIA_ERR_ENCRYPTED=5;Ve.prototype.MEDIA_ERR_ENCRYPTED=5;function vr(s){return s!=null&&typeof s.then=="function"}function ti(s){vr(s)&&s.then(null,e=>{})}const po=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>(s[i]&&(t[i]=s[i]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},$0=function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=po(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(s.textTracks(),function(r){return t.indexOf(r)===-1}).map(po))},V0=function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()};var go={textTracksToJson:$0,jsonToTextTracks:V0,trackToJson:po};const Ha="vjs-modal-dialog";class Bs extends X{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ge("div",{className:`${Ha}-content`},{role:"document"}),this.descEl_=ge("p",{className:`${Ha}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Ri(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ha} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),yc(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Jn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=ie.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(i===t[n]){r=n;break}ie.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof D.HTMLAnchorElement||t instanceof D.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof D.HTMLInputElement||t instanceof D.HTMLSelectElement||t instanceof D.HTMLTextAreaElement||t instanceof D.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof D.HTMLIFrameElement||t instanceof D.HTMLObjectElement||t instanceof D.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}Bs.prototype.options_={pauseOnOpen:!0,temporary:!0};X.registerComponent("ModalDialog",Bs);class Ji extends Pt{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},yi(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Ji.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in Ji.prototype.allowedEvents_)Ji.prototype["on"+s]=null;const za=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};class Oc extends Ji{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){za(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&za(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,za(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Wa=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};class Rc extends Ji{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Wa(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Wa(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Wa(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class zo extends Ji{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class H0{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class Dn{constructor(e){Dn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(i=t;i<r;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const z0={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},W0={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},G0={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Hu={disabled:"disabled",hidden:"hidden",showing:"showing"};class Wo extends Pt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Mt(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}}const Go=function(s){return new URL(s,ie.baseURI)},Mc=function(s){return new URL(s,ie.baseURI).href},Xo=function(s){if(typeof s=="string"){const t=s.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},ia=function(s,e=D.location){return Go(s).origin!==e.origin};var X0=Object.freeze({__proto__:null,parseUrl:Go,getAbsoluteURL:Mc,getFileExtension:Xo,isCrossOrigin:ia});const zu=function(s,e){const t=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed(`Text Track parsing errors for ${e.src}
18`),i.forEach(r=>Te.error(r)),D.console&&D.console.groupEnd&&D.console.groupEnd()),t.flush()},Wu=function(s,e){const t={uri:s},i=ia(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Bd(t,Me(this,function(n,a,l){if(n)return Te.error(n,a);e.loaded_=!0,typeof D.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],d=>{if(d.type==="vttjserror"){Te.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return zu(l,e)}):zu(l,e)}))};class kr extends Wo{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Le(e,{kind:G0[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Hu[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new Dn(this.cues_),a=new Dn(this.activeCues_);let l=!1;this.timeupdateHandler=Me(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const d=()=>{this.stopTracking()};this.tech_.one("dispose",d),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(f){Hu[f]&&i!==f&&(i=f,!this.preload_&&i!=="disabled"&&this.cues.length===0&&Wu(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),m=[];for(let y=0,k=this.cues.length;y<k;y++){const E=this.cues[y];E.startTime<=f&&E.endTime>=f&&m.push(E)}if(l=!1,m.length!==this.activeCues_.length)l=!0;else for(let y=0;y<m.length;y++)this.activeCues_.indexOf(m[y])===-1&&(l=!0);return this.activeCues_=m,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&Wu(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new D.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return go.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}kr.prototype.allowedEvents_={cuechange:"cuechange"};class Nc extends Wo{constructor(e={}){const t=Le(e,{kind:W0[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Bc extends Wo{constructor(e={}){const t=Le(e,{kind:z0[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class _i extends Pt{constructor(e={}){super();let t;const i=new kr(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=_i.NONE,i.addEventListener("loadeddata",()=>{t=_i.LOADED,this.trigger({type:"load",target:this})})}}_i.prototype.allowedEvents_={load:"load"};_i.NONE=0;_i.LOADING=1;_i.LOADED=2;_i.ERROR=3;
vendor: 4,393 bytes, line 18
18const Rt={audio:{ListClass:Oc,TrackClass:Nc,capitalName:"Audio"},video:{ListClass:Rc,TrackClass:Bc,capitalName:"Video"},text:{ListClass:zo,TrackClass:kr,capitalName:"Text"}};Object.keys(Rt).forEach(function(s){Rt[s].getterName=`${s}Tracks`,Rt[s].privateName=`${s}Tracks_`});const Os={remoteText:{ListClass:zo,TrackClass:kr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:H0,TrackClass:_i,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ft=Object.assign({},Rt,Os);Os.names=Object.keys(Os);Rt.names=Object.keys(Rt);ft.names=[].concat(Os.names).concat(Rt.names);function K0(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ft.text.TrackClass(r);return n.addTrack(a),a}class ye extends X{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),ft.names.forEach(i=>{const r=ft[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new ft.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Me(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ht(0,0)}bufferedPercent(){return Lc(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Rt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Ve(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ht(0,0):Ht()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}
vendor: 5,886 bytes, line 18
18initTrackListeners(){Rt.names.forEach(e=>{const t=Rt[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!D.WebVTT)if(ie.body.contains(this.el())){if(!this.options_["vtt.js"]&&ks(mu)&&Object.keys(mu).length>0){this.trigger("vttjsloaded");return}const e=ie.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=l=>e.addTrack(l.track),r=l=>e.removeTrack(l.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;l<e.length;l++){const d=e[l];d.removeEventListener("cuechange",n),d.mode==="showing"&&d.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let l=0;l<e.length;l++)e[l].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return K0(this,e,t,i)}createRemoteTextTrack(e){const t=Le(e,{tech:this});return new Os.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Mt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return ye.canPlayType(e.type)}static isTech(e){return e.prototype instanceof ye||e instanceof ye||e===ye}static registerTech(e,t){if(ye.techs_||(ye.techs_={}),!ye.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!ye.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!ye.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=He(e),ye.techs_[e]=t,ye.techs_[_r(e)]=t,e!=="Tech"&&ye.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(ye.techs_&&ye.techs_[e])return ye.techs_[e];if(e=He(e),D&&D.videojs&&D.videojs[e])return Te.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),D.videojs[e]}}}ft.names.forEach(function(s){const e=ft[s];ye.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});ye.prototype.featuresVolumeControl=!0;ye.prototype.featuresMuteControl=!0;ye.prototype.featuresFullscreenResize=!1;ye.prototype.featuresPlaybackRate=!1;ye.prototype.featuresProgressEvents=!1;ye.prototype.featuresSourceset=!1;ye.prototype.featuresTimeupdateEvents=!1;ye.prototype.featuresNativeTextTracks=!1;ye.prototype.featuresVideoFrameCallback=!1;ye.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){let r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){const i=s.sourceHandlers||[];let r;for(let n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){const r=s.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){const r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(t){const i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:Te.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};X.registerComponent("Tech",ye);ye.registerTech("Tech",ye);ye.defaultTechOrder_=[];const Xi={},wn={},kn={};function Y0(s,e){Xi[s]=Xi[s]||[],Xi[s].push(e)}function Q0(s,e,t){s.setTimeout(()=>$i(e,Xi[e.type],t,s),1)}
vendor: 2,274 bytes, line 18
18function J0(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function Z0(s,e,t){return s.reduceRight(Ko(t),e[t]())}function ey(s,e,t,i){return e[t](s.reduce(Ko(t),i))}function Gu(s,e,t,i=null){const r="call"+He(t),n=s.reduce(Ko(r),i),a=n===kn,l=a?null:e[t](n);return sy(s,t,l,a),l}const ty={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},iy={setCurrentTime:1,setMuted:1,setVolume:1},Xu={play:1,pause:1};function Ko(s){return(e,t)=>e===kn?kn:t[s]?t[s](e):e}function sy(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function ry(s){wn.hasOwnProperty(s.id())&&delete wn[s.id()]}function ny(s,e){const t=wn[s.id()];let i=null;if(t==null)return i=e(s),wn[s.id()]=[[e,i]],i;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(i=a)}return i===null&&(i=e(s),t.push([e,i])),i}function $i(s={},e=[],t,i,r=[],n=!1){const[a,...l]=e;if(typeof a=="string")$i(s,Xi[a],t,i,r,n);else if(a){const d=ny(i,a);if(!d.setSource)return r.push(d),$i(s,l,t,i,r,n);d.setSource(Object.assign({},s),function(f,m){if(f)return $i(s,l,t,i,r,n);r.push(d),$i(m,s.type===m.type?l:Xi[m.type],t,i,r,n)})}else l.length?$i(s,l,t,i,r,n):n?t(s,r):$i(s,Xi["*"],t,i,r,!0)}const ay={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},In=function(s=""){const e=Xo(s);return ay[e.toLowerCase()]||""},oy=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r<i.length;r++){const n=i[r];if(n.type&&n.src&&n.src===e)return n.type}return In(e)},Fc=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=Fc(t),Array.isArray(t)?e=e.concat(t):ni(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[Ku({src:s})]:ni(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[Ku(s)]:s=[];return s};function Ku(s){if(!s.type){const e=In(s.src);e&&(s.type=e)}return s}var ly
vendor: 17,606 bytes, lines 18-160
18=`<svg xmlns="http://www.w3.org/2000/svg"> 19 <defs> 20 <symbol viewBox="0 0 48 48" id="vjs-icon-play"> 21 <path d="M16 10v28l22-14z"></path> 22 </symbol> 23 <symbol viewBox="0 0 48 48" id="vjs-icon-pause"> 24 <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path> 25 </symbol> 26 <symbol viewBox="0 0 48 48" id="vjs-icon-audio"> 27 <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path> 28 </symbol> 29 <symbol viewBox="0 0 48 48" id="vjs-icon-captions"> 30 <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path> 31 </symbol> 32 <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles"> 33 <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path> 34 </symbol> 35 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter"> 36 <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path> 37 </symbol> 38 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit"> 39 <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path> 40 </symbol> 41 <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle"> 42 <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 43 </symbol> 44 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute"> 45 <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path> 46 </symbol> 47 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low"> 48 <path d="M14 18v12h8l10 10V8L22 18h-8z"></path> 49 </symbol> 50 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium"> 51 <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path> 52 </symbol> 53 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high"> 54 <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path> 55 </symbol> 56 <symbol viewBox="0 0 48 48" id="vjs-icon-spinner"> 57 <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path> 58 </symbol> 59 <symbol viewBox="0 0 24 24" id="vjs-icon-hd"> 60 <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path> 61 </symbol> 62 <symbol viewBox="0 0 48 48" id="vjs-icon-chapters"> 63 <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path> 64 </symbol> 65 <symbol viewBox="0 0 40 40" id="vjs-icon-downloading"> 66 <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path> 67 </symbol> 68 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download"> 69 <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path> 70 </symbol> 71 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done"> 72 <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path> 73 </symbol> 74 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off"> 75 <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path> 76 </symbol> 77 <symbol viewBox="0 0 48 48" id="vjs-icon-share"> 78 <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path> 79 </symbol> 80 <symbol viewBox="0 0 48 48" id="vjs-icon-cog"> 81 <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path> 82 </symbol> 83 <symbol viewBox="0 0 48 48" id="vjs-icon-square"> 84 <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path> 85 </symbol> 86 <symbol viewBox="0 0 48 48" id="vjs-icon-circle"> 87 <circle cx="24" cy="24" r="20"></circle> 88 </symbol> 89 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline"> 90 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 91 </symbol> 92 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle"> 93 <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path> 94 </symbol> 95 <symbol viewBox="0 0 48 48" id="vjs-icon-cancel"> 96 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path> 97 </symbol> 98 <symbol viewBox="0 0 48 48" id="vjs-icon-replay"> 99 <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path> 100 </symbol> 101 <symbol viewBox="0 0 48 48" id="vjs-icon-repeat"> 102 <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path> 103 </symbol> 104 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5"> 105 <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path> 106 </symbol> 107 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10"> 108 <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path> 109 </symbol> 110 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30"> 111 <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path> 112 </symbol> 113 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5"> 114 <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path> 115 </symbol> 116 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10"> 117 <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path> 118 </symbol> 119 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30"> 120 <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path> 121 </symbol> 122 <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description"> 123 <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g> 124 </symbol> 125 <symbol viewBox="0 0 48 48" id="vjs-icon-next-item"> 126 <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path> 127 </symbol> 128 <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item"> 129 <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path> 130 </symbol> 131 <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle"> 132 <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path> 133 </symbol> 134 <symbol viewBox="0 0 48 48" id="vjs-icon-cast"> 135 <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path> 136 </symbol> 137 <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter"> 138 <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path> 139 </symbol> 140 <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit"> 141 <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path> 142 <path fill="none" d="M-1-3h24v24H-1z"></path> 143 </symbol> 144 <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook"> 145 <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path> 146 </symbol> 147 <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin"> 148 <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path> 149 </symbol> 150 <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter"> 151 <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/> 152 </symbol> 153 <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr"> 154 <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path> 155 </symbol> 156 <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest"> 157 <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path> 158 </symbol> 159 </defs> 160</svg>`
vendor: 15,405 bytes, line 160
160;const Yu=xn?10009:En?461:8,ds={codes:{play:415,pause:19,ff:417,rw:412,back:Yu},names:{415:"play",19:"pause",417:"ff",412:"rw",[Yu]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},Qu=5;class uy extends Pt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(ds.isEventKey(t,"play")||ds.isEventKey(t,"pause")||ds.isEventKey(t,"ff")||ds.isEventKey(t,"rw")){t.preventDefault();const i=ds.getEventName(t);this.performMediaAction_(i)}else ds.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Qu);break;case"rw":this.userSeek_(this.player_.currentTime()-Qu);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((l,d)=>{t.push({name:()=>"ModalButton"+(d+1),el:()=>l,getPositions:()=>{const f=l.getBoundingClientRect(),m={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},y={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:m,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>l.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r<i.children.length;r++){const n=i.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents)if(i.el()===t)return i}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const l=a.getPositions().center,d=this.calculateDistance_(e,l,i);d<r&&(r=d,n=a)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(i){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class dy extends X{constructor(e,t,i){const r=Le({createEl:!1},t);if(super(e,r,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const l=He(a[n]);let d=ye.getTech(l);if(l||(d=X.getComponent(l)),d&&d.isSupported()){e.loadTech_(l);break}}else e.src(t.playerOptions.sources)}}X.registerComponent("MediaLoader",dy);class sa extends X{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Te.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ge("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,Ri(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}X.registerComponent("ClickableComponent",sa);class mo extends sa{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ge("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(ge("picture",{className:"vjs-poster",tabIndex:-1},{},ge("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?ti(this.player_.play()):this.player_.pause())}}mo.prototype.crossorigin=mo.prototype.crossOrigin;X.registerComponent("PosterImage",mo);const Ot="#222",Ju="#ccc",cy={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 Ga(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Jt(s,e,t){try{s.style[e]=t}catch{return}}function Zu(s){return s?`${s}px`:""}class hy extends X{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Me(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=D.screen.orientation||D,l=D.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));const d=this.options_.playerOptions.tracks||[];for(let f=0;f<d.length;f++)this.player_.addRemoteTextTrack(d[f],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let r,n,a;for(let l=0;l<t.length;l++){const d=t[l];i&&i.enabled&&i.language&&i.language===d.language&&d.kind in e?d.kind===i.kind?a=d:a||(a=d):i&&!i.enabled?(a=null,r=null,n=null):d.default&&(d.kind==="descriptions"&&!r?r=d:d.kind in e&&!n&&(n=d))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let l=0;l<e.length;++l){const d=e[l];d.mode==="showing"&&a.push(d)}this.updateForTrack(a);return}let i=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?i=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!(D.CSS!==void 0&&D.CSS.supports("inset","10px"))){const a=this.el_,l=a.querySelectorAll(".vjs-text-track-cue"),d=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",Jt(a,"position","relative"),Jt(a,"height",f-d+"px"),Jt(a,"top","unset"),Cn?Jt(a,"bottom",f+"px"):Jt(a,"bottom","0px"),l.length>0&&l.forEach(m=>{if(m.style.inset){const y=m.style.inset.split(" ");y.length===3&&Object.assign(m.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!(D.CSS!==void 0&&D.CSS.supports("inset-inline: 10px")))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Jt(this.el_,"insetInline",Zu(n)),Jt(this.el_,"insetBlock",Zu(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Jt(a.firstChild,"color",Ga(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Jt(a.firstChild,"backgroundColor",Ga(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Jt(a,"backgroundColor",Ga(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Ot}, 2px 2px 4px ${Ot}, 2px 2px 5px ${Ot}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Ot}, 2px 2px ${Ot}, 3px 3px ${Ot}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ju}, 0 1px ${Ju}, -1px -1px ${Ot}
160, 0 -1px ${Ot}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Ot}, 0 0 4px ${Ot}, 0 0 4px ${Ot}, 0 0 4px ${Ot}`)),t.fontPercent&&t.fontPercent!==1){const l=D.parseFloat(a.style.fontSize);a.style.fontSize=l*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=cy[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof D.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}D.WebVTT.processCues(D,t,this.el_);for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;Gi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&Is(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}X.registerComponent("TextTrackDisplay",hy);class fy extends X{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ge("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}X.registerComponent("LoadingSpinner",fy);class ut extends sa{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=ge(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const i=this.constructor.name;return Te.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),X.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}X.registerComponent("Button",ut);class Uc extends ut{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){ti(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();vr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Uc.prototype.controlText_="Play Video";X.registerComponent("BigPlayButton",Uc);class py extends ut{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}X.registerComponent("CloseButton",py);class jc extends ut{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?ti(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}jc.prototype.controlText_="Play";X.registerComponent("PlayToggle",jc);class Fs extends X{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ge("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}Â `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ge("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Qi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Te.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=ie.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Fs.prototype.labelText_="Time";Fs.prototype.controlText_="Time";X.registerComponent("TimeDisplay",Fs);class Yo extends Fs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"&&e.target.pendingSeekTime()!==null?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Yo.prototype.labelText_="Current Time";Yo.prototype.controlText_="Current Time";X.registerComponent("CurrentTimeDisplay",Yo);class Qo extends Fs{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);
vendor: 8,619 bytes, line 160
160this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Qo.prototype.labelText_="Duration";Qo.prototype.controlText_="Duration";X.registerComponent("DurationDisplay",Qo);class gy extends X{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}}X.registerComponent("TimeDivider",gy);class Jo extends Fs{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ge("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}Jo.prototype.labelText_="Remaining Time";Jo.prototype.controlText_="Remaining Time";X.registerComponent("RemainingTimeDisplay",Jo);class my extends X{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ge("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ge("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}Â `})),this.contentEl_.appendChild(ie.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}X.registerComponent("LiveDisplay",my);class qc extends ut{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ge("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}qc.prototype.controlText_="Seek to live, currently playing live";X.registerComponent("SeekToLive",qc);function Ir(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var yy=Object.freeze({__proto__:null,clamp:Ir});class Zo extends X{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!ai&&e.preventDefault(),fc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;pc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Ir(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Qn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}X.registerComponent("Slider",Zo);const Xa=(s,e)=>Ir(s/e*100,0,100).toFixed(2)+"%";class _y extends X{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ge("span",{className:"vjs-control-text"}),i=ge("span",{textContent:this.localize("Loaded")}),r=ie.createTextNode(": ");return this.percentageEl_=ge("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=Xa(n,r);this.percent_!==l&&(this.el_.style.width=l,Ri(this.percentageEl_,l),this.percent_=l);for(let d=0;d<i.length;d++){const f=i.start(d),m=i.end(d);let y=a[d];y||(y=this.el_.appendChild(ge()),a[d]=y),!(y.dataset.start===f&&y.dataset.end===m)&&(y.dataset.start=f,y.dataset.end=m,y.style.left=Xa(f,n),y.style.width=Xa(m-f,n))}for(let d=a.length;d>i.length;d--)this.el_.removeChild(a[d-1]);a.length=i.length})}}X.registerComponent("LoadProgressBar",_y);class vy extends X{constructor(e,t){super(e,t),this.update=oi(Me(this,this.update),Nt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=Er(this.el_),n=Ps(this.player_.el()),a=e.width*t;if(!n||!r)return;let l=e.left-n.left+a,d=e.width-a+(n.right-e.right);d||(d=e.width-a,l=a);let f=r.width/2;l<f?f+=f-l:d<f&&(f=d),f<0?f=0:f>
vendor: 4,472 bytes, line 160
160r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(i)}write(e){Ri(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const l=this.player_.liveTracker.liveWindow(),d=l-t*l;n=(d<1?"":"-")+Qi(d,l)}else n=Qi(i,a);this.update(e,t,n),r&&r()})}}X.registerComponent("TimeTooltip",vy);class el extends X{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=oi(Me(this,this.update),Nt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){const r=this.getChild("timeTooltip");if(!r)return;const n=i&&i.target&&typeof i.target.pendingSeekTime=="function"?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,n)}}el.prototype.options_={children:[]};!ot&&!zt&&el.prototype.options_.children.push("timeTooltip");X.registerComponent("PlayProgressBar",el);class $c extends X{constructor(e,t){super(e,t),this.update=oi(Me(this,this.update),Nt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}$c.prototype.options_={children:["timeTooltip"]};X.registerComponent("MouseTimeDisplay",$c);class ra extends Zo{constructor(e,t){t=Le(ra.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(ot||zt)||e.options_.disableSeekWhileScrubbingOnSTV;(!ot&&!zt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Me(this,this.update),this.update=oi(this.update_,Nt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie&&"visibilityState"in ie&&this.on(ie,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(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())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Nt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(ie.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Qi(i,n),Qi(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Ps(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;
vendor: 4,281 bytes, line 160
160return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Cr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Cr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),l=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=l&&(i=l),i<=a&&(i=a+.1),i===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?ti(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie&&"visibilityState"in ie&&this.off(ie,"visibilitychange",this.toggleVisibility_),super.dispose()}}ra.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};X.registerComponent("SeekBar",ra);class Vc extends X{constructor(e,t){super(e,t),this.handleMouseMove=oi(Me(this,this.handleMouseMove),Nt),this.throttledHandleMouseSeek=oi(Me(this,this.handleMouseSeek),Nt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=Er(n);let l=Qn(n,e).x;
160l=Ir(l,0,1),r&&r.update(a,l),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&ti(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Vc.prototype.options_={children:["seekBar"]};X.registerComponent("ProgressControl",Vc);class Hc extends ut{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){ie.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in D?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof ie.exitPictureInPicture=="function"&&super.show()}}Hc.prototype.controlText_="Picture-in-Picture";X.registerComponent("PictureInPictureToggle",Hc);class zc extends ut{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),ie[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}zc.prototype.controlText_="Fullscreen";X.registerComponent("FullscreenToggle",zc);const Ty=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class by extends X{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});
vendor: 4,335 bytes, line 160
160return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}X.registerComponent("VolumeLevel",by);class Sy extends X{constructor(e,t){super(e,t),this.update=oi(Me(this,this.update),Nt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Ps(this.el_),a=Ps(this.player_.el()),l=e.width*t;if(!a||!n)return;const d=e.left-a.left+l,f=e.width-l+(a.right-e.right);let m=n.width/2;d<m?m+=m-d:f<m&&(m=f),m<0?m=0:m>n.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){Ri(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}}X.registerComponent("VolumeLevelTooltip",Sy);class Wc extends X{constructor(e,t){super(e,t),this.update=oi(Me(this,this.update),Nt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Wc.prototype.options_={children:["volumeLevelTooltip"]};X.registerComponent("MouseVolumeLevelDisplay",Wc);class na extends Zo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Cr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Ps(i),n=this.vertical();let a=Qn(i,e);a=n?a.y:a.x,a=Ir(a,0,1),t.update(r,a,n)}Cr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}na.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ot&&!zt&&na.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");na.prototype.playerEvent="volumechange";X.registerComponent("VolumeBar",na);class Gc extends X{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||ks(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),Ty(this,e),this.throttledHandleMouseMove=oi(Me(this,this.handleMouseMove),Nt),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Gc.prototype.options_={children:["volumeBar"]};
vendor: 4,300 bytes, line 160
160X.registerComponent("VolumeControl",Gc);const xy=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};class Xc extends ut{constructor(e,t){super(e,t),xy(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ot&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Kn(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Gi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Xc.prototype.controlText_="Mute";X.registerComponent("MuteToggle",Xc);class Kc extends X{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||ks(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),It(ie,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),lt(ie,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Kc.prototype.options_={children:["muteToggle","volumeControl"]};X.registerComponent("VolumePanel",Kc);class Yc extends ut{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Yc.prototype.controlText_="Skip Forward";X.registerComponent("SkipForward",Yc);class Qc extends ut{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1}
160 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Qc.prototype.controlText_="Skip Backward";X.registerComponent("SkipBackward",Qc);class Jc extends X{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof X&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof X&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ge(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),It(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||ie.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}X.registerComponent("Menu",Jc);class tl extends X{constructor(e,t={}){super(e,t),this.menuButton_=new ut(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=ut.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),It(ie,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Jc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ge("li",{className:"vjs-menu-title",textContent:He(this.options_.title),tabIndex:-1}),i=new X(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=ut.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),lt(ie,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ot&&lc())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
160se"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}X.registerComponent("MenuButton",tl);class il extends tl{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=Me(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}}X.registerComponent("TrackButton",il);class Pr extends sa{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=ge("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}X.registerComponent("MenuItem",Pr);class Lr extends Pr{constructor(e,t){const i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...l)=>{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof D.Event!="object")try{l=new D.Event("change")}catch{}l||(l=ie.createEvent("Event"),l.initEvent("change",!0,!0)),r.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let r=0;r<i.length;r++){const n=i[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}X.registerComponent("TextTrackMenuItem",Lr);class Zc extends Lr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}X.registerComponent("OffTextTrackMenuItem",Zc);class Us extends il{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Lr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Zc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}}X.registerComponent("TextTrackButton",Us);class eh extends Pr{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}X.registerComponent("ChaptersTrackMenuItem",eh);class sl extends Us{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>
vendor: 38,768 bytes, lines 160-161
160{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(He(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){const n=t[i],a=new eh(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}sl.prototype.kind_="chapters";sl.prototype.controlText_="Chapters";X.registerComponent("ChaptersButton",sl);class rl extends Us{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=Me(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}rl.prototype.kind_="descriptions";rl.prototype.controlText_="Descriptions";X.registerComponent("DescriptionsButton",rl);class nl extends Us{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}nl.prototype.kind_="subtitles";nl.prototype.controlText_="Subtitles";X.registerComponent("SubtitlesButton",nl);class al extends Lr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}X.registerComponent("CaptionSettingsMenuItem",al);class ol extends Us{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new al(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}ol.prototype.kind_="captions";ol.prototype.controlText_="Captions";X.registerComponent("CaptionsButton",ol);class th extends Lr{createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}X.registerComponent("SubsCapsMenuItem",th);class ll extends Us{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(He(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new al(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,th),e}}ll.prototype.kinds_=["captions","subtitles"];ll.prototype.controlText_="Subtitles";X.registerComponent("SubsCapsButton",ll);class ih extends Pr{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ge("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ge("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}X.registerComponent("AudioTrackMenuItem",ih);class sh extends il{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];e.push(new ih(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}sh.prototype.controlText_="Audio Track";X.registerComponent("AudioTrackButton",sh);class ul extends Pr{constructor(e,t){const i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ul.prototype.contentElType="button";X.registerComponent("PlaybackRateMenuItem",ul);class rh extends tl{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ge("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new ul(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}rh.prototype.controlText_="Playback Rate";X.registerComponent("PlaybackRateMenuButton",rh);class nh extends X{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}X.registerComponent("Spacer",nh);class Ey extends nh{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}}X.registerComponent("CustomControlSpacer",Ey);class ah extends X{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}ah.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};X.registerComponent("ControlBar",ah);class oh extends Bs{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}oh.prototype.options_=Object.assign({},Bs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});X.registerComponent("ErrorDisplay",oh);class lh extends X{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ge("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Mt()}`)+"-"+t[1].replace(/\W+/g,""),r=ge("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),r}))}}X.registerComponent("TextTrackSelect",lh);class Ki extends X{constructor(e,t={}){super(e,t);const i=ge("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],l=a.className,d=a.id.replace("%s",this.options_.id_);let f=null;const m=`vjs_select_${Mt()}`;if(this.options_.type==="colors"){f=ge("span",{className:l});const k=ge("label",{id:d,className:"vjs-label",textContent:this.localize(a.label)});k.setAttribute("for",m),f.appendChild(k)}const y=new lh(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:d});this.addChild(y),this.options_.type==="colors"&&(f.appendChild(y.el()),this.el().appendChild(f))}}createEl(){return ge("fieldset",{className:this.options_.className})}}X.registerComponent("TextTrackFieldset",Ki);class uh extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ki(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ki(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ki(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-colors"})}}X.registerComponent("TextTrackSettingsColors",uh);class dh extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ki(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ki(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ki(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ge("div",{className:"vjs-track-settings-font"})}}X.registerComponent("TextTrackSettingsFont",dh);class ch extends X{constructor(e,t={}){super(e,t);const i=new ut(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const r=this.localize("Done"),n=new ut(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return ge("div",{className:"vjs-track-settings-controls"})}}X.registerComponent("TrackSettingsControls",ch);const Ka="vjs-text-track-settings",ed=["#000","Black"],td=["#00F","Blue"],id=["#0FF","Cyan"],sd=["#0F0","Green"],rd=["#F0F","Magenta"],nd=["#F00","Red"],ad=["#FFF","White"],od=["#FF0","Yellow"],Ya=["1","Opaque"],Qa=["0.5","Semi-Transparent"],ld=["0","Transparent"],Pi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ed,ad,nd,sd,td,od,rd,id],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ya,Qa,ld],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ad,ed,nd,sd,td,od,rd,id],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ya,Qa],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[ld,Qa,Ya],className:"vjs-window-opacity vjs-opacity"}};Pi.windowColor.options=Pi.backgroundColor.options;function hh(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function Cy(s,e){const t=s.options[s.options.selectedIndex].value;return hh(t,e)}function Ay(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(hh(s.options[i].value,t)===e){s.selectedIndex=i;break}}}class Dy extends Bs{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=ge("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new uh(e,{textTrackComponentid:this.id_,selectConfigs:Pi,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new dh(e,{textTrackComponentid:this.id_,selectConfigs:Pi,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new ch(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),ms(Pi,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return tc(Pi,(e,t,i)=>{const r=Cy(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){ms(Pi,(t,i)=>{Ay(this.$(t.selector),e[i],t.parser)})}setDefaults(){ms(Pi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(D.localStorage.getItem(Ka))}catch(t){Te.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?D.localStorage.setItem(Ka,JSON.stringify(e)):D.localStorage.removeItem(Ka)}catch(t){Te.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}X.registerComponent("TextTrackSettings",Dy);class wy extends X{constructor(e,t){let i=t.ResizeObserver||D.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=Le({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||D.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Ec(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){lt(this,"resize",n),lt(this,"unload",a),a=null};It(this.el_.contentWindow,"unload",a),It(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}X.registerComponent("ResizeManager",wy);const ky={trackingThreshold:20,liveTolerance:15};class Iy extends X{constructor(e,t){const i=Le(ky,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(D.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Nt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}X.registerComponent("LiveTracker",Iy);class Py extends X{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ge("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Mt()}`}),description:ge("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Mt()}`})},ge("div",{className:"vjs-title-bar"},{},ic(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],l=i[r];Jn(a),n&&Ri(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}X.registerComponent("TitleBar",Py);const Ly={initialDisplay:4e3,position:[],takeFocus:!1};class Oy extends ut{constructor(e,t){t=Le(Ly,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ge("button",{},{type:"button",class:this.buildCSSClass()},ge("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}X.registerComponent("TransientButton",Oy);const yo=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&i.indexOf(a)===-1&&i.push(a)}return i.length?(i.length===1&&(r=i[0]),s.triggerSourceset(r),!0):!1},Ry=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=ie.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=ie.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,t),this.innerHTML}}),fh=(s,e)=>{let t={};for(let i=0;i<s.length&&(t=Object.getOwnPropertyDescriptor(s[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},My=s=>fh([s.el(),D.HTMLMediaElement.prototype,D.Element.prototype,Ry],"innerHTML"),ud=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=My(s),r=n=>(...a)=>{const l=n.apply(e,a);return yo(s),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Le(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},Ny=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Mc(D.Element.prototype.getAttribute.call(this,"src")):""},set(s){return D.Element.prototype.setAttribute.call(this,"src",s),s}}),By=s=>fh([s.el(),D.HTMLMediaElement.prototype,Ny],"src"),Fy=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=By(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Le(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const l=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),l},e.load=()=>{const n=r.call(e);return yo(s)||(s.triggerSourceset(""),ud(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):yo(s)||ud(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class le extends ye{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const l=[];for(;a--;){const d=n[a];d.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(d),this.remoteTextTracks().addTrack(d.track),this.textTracks().addTrack(d.track),!r&&!this.el_.hasAttribute("crossorigin")&&ia(d.src)&&(r=!0)):l.push(d))}for(let d=0;d<l.length;d++)this.el_.removeChild(l[d])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&Te.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. 161This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(xr||Gn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),le.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){Fy(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Rt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:l=>{const d={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(d),e==="text"&&this[Os.remoteText.getterName]().trigger(d)},addtrack(l){r.addTrack(l.track)},removetrack(l){r.removeTrack(l.track)}},a=function(){const l=[];for(let d=0;d<r.length;d++){let f=!1;for(let m=0;m<i.length;m++)if(i[m]===r[d]){f=!0;break}f||l.push(r[d])}for(;l.length;)r.removeTrack(l.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(l=>{const d=n[l];i.addEventListener(l,d),this.on("dispose",f=>i.removeEventListener(l,d))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){Rt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),le.disposeMediaElement(e),e=i}else{e=ie.createElement("video");const i=this.options_.tag&&Ii(this.options_.tag),r=Le({},i);(!xr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,cc(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Is(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const r=t[i],n=this.options_[r];typeof n<"u"&&(n?Is(e,r,r):Yn(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const r=function(){i=!0};this.on("loadstart",r);const n=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),i||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Xn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Te(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&zt&&ai&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)ti(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return Te.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const r=ge("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return Te.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return Te.warn(`No matching source element found with src: ${e}`),!1}reset(){le.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=ie.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&(e.creationTime=D.performance.now()),e}}Hn(le,"TEST_VID",function(){if(!Rs())return;const s=ie.createElement("video"),e=ie.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});le.isSupported=function(){try{le.TEST_VID.volume=.5}catch{return!1}return!!(le.TEST_VID&&le.TEST_VID.canPlayType)};le.canPlayType=function(s){return le.TEST_VID.canPlayType(s)};le.canPlaySource=function(s,e){return le.canPlayType(s.type)};le.canControlVolume=function(){try{const s=le.TEST_VID.volume;le.TEST_VID.volume=s/2+.1;const e=s!==le.TEST_VID.volume;return e&&ot?(D.setTimeout(()=>{le&&le.prototype&&(le.prototype.featuresVolumeControl=s!==le.TEST_VID.volume)}),!1):e}catch{return!1}};le.canMuteVolume=function(){try{const s=le.TEST_VID.muted;return le.TEST_VID.muted=!s,le.TEST_VID.muted?Is(le.TEST_VID,"muted","muted"):Yn(le.TEST_VID,"muted","muted"),s!==le.TEST_VID.muted}catch{return!1}};le.canControlPlaybackRate=function(){if(zt&&ai&&zn<58)return!1;try{const s=le.TEST_VID.playbackRate;return le.TEST_VID.playbackRate=s/2+.1,s!==le.TEST_VID.playbackRate}catch{return!1}};le.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(ie.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(ie.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(ie.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(ie.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};le.supportsNativeTextTracks=function(){return Xn||ot&&ai};le.supportsNativeVideoTracks=function(){return!!(le.TEST_VID&&le.TEST_VID.videoTracks)};le.supportsNativeAudioTracks=function(){return!!(le.TEST_VID&&le.TEST_VID.audioTracks)};le.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEac
161h(function([s,e]){Hn(le.prototype,s,()=>le[e](),!0)});le.prototype.featuresVolumeControl=le.canControlVolume();le.prototype.movingMediaElementInDOM=!ot;le.prototype.featuresFullscreenResize=!0;le.prototype.featuresProgressEvents=!0;le.prototype.featuresTimeupdateEvents=!0;le.prototype.featuresVideoFrameCallback=!!(le.TEST_VID&&le.TEST_VID.requestVideoFrameCallback);le.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()}};le.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&(function(){try{s.load()}catch{}})()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){le.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){le.prototype["set"+He(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){le.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){le.prototype["set"+He(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){le.prototype[s]=function(){return this.el_[s]()}});ye.withSourceHandlers(le);le.nativeSourceHandler={};le.nativeSourceHandler.canPlayType=function(s){try{return le.TEST_VID.canPlayType(s)}catch{return""}};le.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return le.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Xo(s.src);return le.nativeSourceHandler.canPlayType(`video/${t}`)}return""};le.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};le.nativeSourceHandler.dispose=function(){};le.registerSourceHandler(le.nativeSourceHandler);ye.registerTech("Html5",le);const ph=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ja={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},_o=["tiny","xsmall","small","medium","large","xlarge","huge"],mn={};_o.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;mn[s]=`vjs-layout-${e}`});const Uy={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class we extends X{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Mt()}`,t=Object.assign(we.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Zd(this.id_),this.fsApi_=Tn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHe
vendor: 11,367 bytes, lines 161-170
161ight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Ii(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),this.languages_=a}else this.languages_=we.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Vo(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(It(ie,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Le(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const l=new D.DOMParser().parseFromString(ly,"image/svg+xml");if(l.querySelector("parsererror"))Te.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=l.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new uy(this),this.addClass("vjs-spatial-navigation-enabled")),xr&&this.addClass("vjs-touch-enabled"),ot||this.addClass("vjs-workinghover"),we.players[this.id_]=this;const n=ao.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),lt(ie,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),lt(ie,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),we.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),ry(this),ft.names.forEach(e=>{const t=ft[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Ii(e);if(r){for(t=this.el_=e,e=this.tag=ie.createElement("video");t.children.length;)e.appendChild(t.firstChild);yr(t,"video-js")||Gi(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(d=>{try{e[d]=t[d]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",ai&&Wn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(d){r&&d==="class"||t.setAttribute(d,n[d]),r&&e.setAttribute(d,n[d])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(d=>oc[d]).map(d=>"vjs-device-"+d.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Sc("vjs-styles-dimensions");const d=Oi(".vjs-styles-defaults"),f=Oi("head");f.insertBefore(this.styleEl_,d?d.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const l=e.getElementsByTagName("a");for(let d=0;d<l.length;d++){const f=l.item(d);Gi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),lo(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Te.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Te.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,yi(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),N0(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(D.VIDEOJS_NO_DYNAMIC_STYLE===!0){const l=typeof this.width_=="number"?this.width_:this.options_.width,d=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(l>=0&&(f.width=l),d>=0&&(f.height=d));return}let e,t,i,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const n=i.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),xc(this.styleEl_,` 162 .${r} { 163 width: ${e}px; 164 height: ${t}px; 165 } 166 167 .${r}.vjs-fluid:not(.vjs-audio-only-mode) { 168 padding-top: ${a*100}%; 169 } 170 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=He(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(ye.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ft.names.forEach(d=>{const f=ft[d];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const l=ye.getTech(e);if(!l)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(Me(this,this.handleTechReady_),!0),go.jsonToTextTracks(this.textTracksJson_||[],this.tech_),ph.forEach(d=>{this.on(this.tech_,d,f=>this[`handleTech${He(d)}_`](f))}),Object.keys(Ja).forEach(d=>{this.on(this.tech_,d,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ja[d]}_`].bind(this),event:f});return}this[`handleTech${Ja[d]}_`](f)})}),this.on(this.tech_,"loadstart",d=>this.handleTechLoadStart_(d)),this.on(this.tech_,"sourceset",d=>this.handleTechSourceset_(d)),this.on(this.tech_,"waiting",d=>this.handleTechWaiting_(d)),this.on(this.tech_,"ended",d=>this.handleTechEnded_(d)),this.on(this.tech_,"seeking",d=>this.handleTechSeeking_(d)),this.on(this.tech_,"play",d=>this.handleTechPlay_(d)),this.on(this.tech_,"pause",d=>this.handleTechPause_(d)),this.on(this.tech_,"durationchange",d=>this.handleTechDurationChange_(d)),this.on(this.tech_,"fullscreenchange",(d,f)=>this.handleTechFullscreenChange_(d,f)),this.on(this.tech_,"fullscreenerror",(d,f)=>this.handleTechFullscreenError_(d,f)),this.on(this.tech_,"enterpictureinpicture",d=>this.handleTechEnterPictureInPicture_(d)),this.on(this.tech_,"leavepictureinpicture",d=>this.handleTechLeavePictureInPicture_(d)),this.on(this.tech_,"error",d=>this.handleTechError_(d)),this.on(this.tech_,"posterchange",d=>this.handleTechPosterChange_(d)),this.on(this.tech_,"textdata",d=>this.handleTechTextData_(d)),this.on(this.tech_,"ratechange",d=>this.handleTechRateChange_(d)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&lo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ft.names.forEach(e=>{const t=ft[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=go.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Te.warn(`Using the tech directly can be dangerous. I hope you know
170what you're doing. 171See https://github.com/videojs/video.js/issues/2617 for more info. 172`),this.tech_}version(){return{"video.js":ao}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(vr(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),vr(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!vr(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=oy(this,t)),this.cache_.source=Le({},e,{src:t,type:i});const r=this.cache_.sources.filter(d=>d.src&&d.src===t),n=[],a=this.$$("source"),l=[];for(let d=0;d<a.length;d++){const f=Ii(a[d]);n.push(f),f.src&&f.src===t&&l.push(f.src)}l.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}
vendor: 29,405 bytes, line 172
172handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(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()?ti(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),i=>i.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.isInPictureInPicture()&&!ie.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=ie[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in iy)return ey(this.middleware_,this.tech_,e,t);if(e in Xu)return Gu(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Te(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in ty)return Z0(this.middleware_,this.tech_,e);if(e in Xu)return Gu(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Te(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Te(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Te(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=ti){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Xn||ot);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Ht(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Ht(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Ht(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Lc(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),i()}function l(f,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);const d=t.requestFullscreenHelper_(e);d&&(d.then(n,n),d.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(d,f){r(),i(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const l=e.exitFullscreenHelper_();l&&(l.then(r,r),l.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=ie[this.fsApi_.exitFullscreen]();return e&&ti(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ie.documentElement.style.overflow,It(ie,"keydown",this.boundFullWindowOnEscKey_),ie.documentElement.style.overflow="hidden",Gi(ie.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,lt(ie,"keydown",this.boundFullWindowOnEscKey_),ie.documentElement.style.overflow=this.docOrigOverflow,Kn(ie.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&D.documentPictureInPicture){const e=ie.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ge("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),D.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(vc(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in ie&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(D.documentPictureInPicture&&D.documentPictureInPicture.window)return D.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in ie)return ie.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=X.getComponent("FullscreenToggle");ie[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),X.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),X.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){const n=r[i];let a=ye.getTech(n);if(a||(a=X.getComponent(n)),!a){Te.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(l=>[l,ye.getTech(l)]).filter(([l,d])=>d?d.isSupported():(Te.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(l,d,f){let m;return l.some(y=>d.some(k=>{if(m=f(y,k),m)return!0})),m};let r;const n=l=>(d,f)=>l(f,d),a=([l,d],f)=>{if(d.canPlaySource(f,this.options_[l.toLowerCase()]))return{source:f,tech:l}};return this.options_.sourceOrder?r=i(e,t,n(a)):r=i(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Fc(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),Q0(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}J0(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?wc(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();ti(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),yi(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(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"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(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_()))}usingNativeControls(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")))}error(e){if(e===void 0)return this.error_||null;if(Li("beforeerror").forEach(t=>{const i=t(this,e);if(!(ni(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Ve(e),this.addClass("vjs-error"),Te.error(`(CODE:${this.error_.code} ${Ve.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Li("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=Me(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==i)&&(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},l=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);const d=this.getChild("controlBar");d&&!ot&&!zt&&(d.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),d.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const y=this.options_.inactivityTimeout;y<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),yi(this)&&this.trigger("languagechange"))}languages(){return Le(we.prototype.options_.languages,this.languages_)}toJSON(){const e=Le(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=Le(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new Bs(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<_o.length;i++){const r=_o[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(mn[e]),this.addClass(mn[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},Uy,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return mn[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=Le(e);const{artist:r,artwork:n,description:a,poster:l,src:d,textTracks:f,title:m}=this.cache_.media;!n&&l&&(this.cache_.media.artwork=[{src:l,type:In(l)}]),i&&this.crossOrigin(i),d&&this.src(d),l&&this.poster(l),Array.isArray(f)&&f.forEach(y=>this.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:i};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:In(r.poster)}]),r}return Le(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Ii(e),r=i["data-setup"];if(yr(e,"vjs-fill")&&(i.fill=!0),yr(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Te.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,l=n.length;a<l;a++){const d=n[a],f=d.nodeName.toLowerCase();f==="source"?t.sources.push(Ii(d)):f==="track"&&t.tracks.push(Ii(d))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}we.prototype.videoTracks=()=>{};we.prototype.audioTracks=()=>{};we.prototype.textTracks=()=>{};we.prototype.remoteTextTracks=()=>{};we.prototype.remoteTextTrackEls=()=>{};ft.names.forEach(function(s){const e=ft[s];we.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});we.prototype.crossorigin=we.prototype.crossOrigin;we.players={};const cr=D.navigator;we.prototype.options_={techOrder:ye.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:cr&&(cr.languages&&cr.languages[0]||cr.userLanguage||cr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};ph.forEach(function(s){we.prototype[`handleTech${He(s)}_`]=function(){return this.trigger(s)}});X.registerComponent("Player",we);const Pn="plugin",vs="activePlugins_",fs={},Ln=s=>fs.hasOwnProperty(s),yn=s=>Ln(s)?fs[s]:void 0,gh=(s,e)=>{s[vs]=s[vs]||{},s[vs][e]=!0},On=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},jy=function(s,e){const t=function(){On(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return gh(this,s),On(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},dd=(s,e)=>(e.prototype.name=s,function(...t){On(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,On(this,i.getEventHash()),i});class bt{constructor(e){if(this.constructor===bt)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Vo(this),delete this.trigger,Dc(this,this.constructor.defaultState),gh(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ns(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[vs][e]=!1,this.player=this.state=null,t[e]=dd(e,fs[e])}static isBasic(e){const t=typeof e=="string"?yn(e):e;return typeof t=="function"&&!bt.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Ln(e))Te.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(we.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return fs[e]=t,e!==Pn&&(bt.isBasic(t)?we.prototype[e]=jy(e,t):we.prototype[e]=dd(e,t)),t}static deregisterPlugin(e){if(e===Pn)throw new Error("Cannot de-register base plugin.");Ln(e)&&(delete fs[e],delete we.prototype[e])}static getPlugins(e=Object.keys(fs)){let t;return e.forEach(i=>
172{const r=yn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=yn(e);return t&&t.VERSION||""}}bt.getPlugin=yn;bt.BASE_PLUGIN_NAME=Pn;bt.registerPlugin(Pn,bt);we.prototype.usingPlugin=function(s){return!!this[vs]&&this[vs][s]===!0};we.prototype.hasPlugin=function(s){return!!Ln(s)};function qy(s,e){let t=!1;return function(...i){return t||Te.warn(s),t=!0,e.apply(this,i)}}function Wt(s,e,t,i){return qy(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var $y={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const mh=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.getPlayer(s);if(i)return e&&Te.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?Oi("#"+mh(s)):s;if(!Ms(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof D.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Te.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Li("beforesetup").forEach(d=>{const f=d(r,Le(e));if(!ni(f)||Array.isArray(f)){Te.error("please return an object in beforesetup hooks");return}e=Le(e,f)});const l=X.getComponent("Player");return i=new l(r,e,t),Li("setup").forEach(d=>d(i)),i}F.hooks_=gi;F.hooks=Li;F.hook=S0;F.hookOnce=x0;F.removeHook=Jd;if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Rs()){let s=Oi(".vjs-styles-defaults");if(!s){s=Sc("vjs-styles-defaults");const e=Oi("head");e&&e.insertBefore(s,e.firstChild),xc(s,` 173 .video-js { 174 width: 300px; 175 height: 150px; 176 } 177 178 .vjs-fluid:not(.vjs-audio-only-mode) { 179 padding-top: 56.25% 180 } 181 `)}}co(1,F);F.VERSION=ao;F.options=we.prototype.options_;F.getPlayers=()=>we.players;F.getPlayer=s=>{const e=we.players;let t;if(typeof s=="string"){const i=mh(s),r=e[i];if(r)return r;t=Oi("#"+i)}else t=s;if(Ms(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};F.getAllPlayers=()=>Object.keys(we.players).map(s=>we.players[s]).filter(Boolean);F.players=we.players;F.getComponent=X.getComponent;F.registerComponent=(s,e)=>(ye.isTech(e)&&Te.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),X.registerComponent.call(X,s,e));F.getTech=ye.getTech;F.registerTech=ye.registerTech;F.use=Y0;Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(F.middleware,"TERMINATOR",{value:kn,writeable:!1,enumerable:!0});F.browser=oc;F.obj=A0;F.mergeOptions=Wt(9,"videojs.mergeOptions","videojs.obj.merge",Le);F.defineLazyProperty=Wt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Hn);F.bind=Wt(9,"videojs.bind","native Function.prototype.bind",Me);F.registerPlugin=bt.registerPlugin;F.deregisterPlugin=bt.deregisterPlugin;F.plugin=(s,e)=>(Te.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),bt.registerPlugin(s,e));F.getPlugins=bt.getPlugins;F.getPlugin=bt.getPlugin;F.getPluginVersion=bt.getPluginVersion;F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Le(F.options.languages,{[s]:e}),F.options.languages[s]};F.log=Te;F.createLogger=Zd;F.time=q0;F.createTimeRange=Wt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ht);F.createTimeRanges=Wt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ht);F.formatTime=Wt(9,"videojs.formatTime","videojs.time.formatTime",Qi);F.setFormatTime=Wt(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ic);F.resetFormatTime=Wt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Pc);F.parseUrl=Wt(9,"videojs.parseUrl","videojs.url.parseUrl",Go);F.isCrossOrigin=Wt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ia);F.EventTarget=Pt;F.any=$o;F.on=It;F.one=ea;F.off=lt;F.trigger=Ns;F.xhr=Bd;F.TrackList=Ji;F.TextTrack=kr;F.TextTrackList=zo;F.AudioTrack=Nc;F.AudioTrackList=Oc;F.VideoTrack=Bc;F.VideoTrackList=Rc;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return Te.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),Tc[s].apply(null,arguments)}});F.computedStyle=Wt(9,"videojs.computedStyle","videojs.dom.computedStyle",Ls);F.dom=Tc;F.fn=M0;F.num=yy;F.str=U0;F.url=X0;F.Error=$y;class Vy{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}}class Rn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new Vy(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Rn.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in Rn.prototype.allowedEvents_)Rn.prototype["on"+s]=null;var yh="4.1.0";const Hy=function(s,e){const t=s.qualityLevels,i=new Rn,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>
vendor: 91,052 bytes, lines 181-189
181i,s.qualityLevels.VERSION=yh,i},_h=function(s){return Hy(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",_h);_h.VERSION=yh;const vt=jn,Mn=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,Bt=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function ke(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function st(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function zy(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 182`;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i}) 183`}return e}const ii=1/30,si=ii*3,vh=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i<s.length;i++)e(s.start(i),s.end(i))&&t.push([s.start(i),s.end(i)]);return st(t)},ps=function(s,e){return vh(s,function(t,i){return t-si<=e&&i+si>=e})},hn=function(s,e){return vh(s,function(t){return t-ii>=e})},Wy=function(s){if(s.length<2)return st();const e=[];for(let t=1;t<s.length;t++){const i=s.end(t-1),r=s.start(t);e.push([i,r])}return st(e)},Gy=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return st();let l=s.length;for(;l--;)n.push({time:s.start(l),type:"start"}),n.push({time:s.end(l),type:"end"});for(l=e.length;l--;)n.push({time:e.start(l),type:"start"}),n.push({time:e.end(l),type:"end"});for(n.sort(function(d,f){return d.time-f.time}),l=0;l<n.length;l++)n[l].type==="start"?(r++,r===2&&(t=n[l].time)):n[l].type==="end"&&(r--,r===1&&(i=n[l].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return st(a)},Th=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},Xy=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},zi=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},Ky=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},Za=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},dl=function(s,e){let t=0;if(!s||!s.length)return t;for(let i=0;i<s.length;i++){const r=s.start(i),n=s.end(i);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},cl=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},vo=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),bh=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},Sh=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},xh=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=bh(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},Yy=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=cl(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},Qy=function(s,e){let t=0,i,r=e-s.mediaSequence;for(;r<s.segments.length;r++){if(i=s.segments[r],typeof i.start<"u")return{result:i.start-t,precise:!0};if(t+=cl(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},Eh=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=Yy(s,e);if(i.precise)return i.result;const r=Qy(s,e);return r.precise?r.result:i.result+t},Ch=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return D.Infinity}return Eh(s,e,t)},Tr=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:i}){let r=0;if(t>i&&([t,i]=[i,t]),t<0){for(let n=t;n<Math.min(0,i);n++)r+=s;t=0}for(let n=t;n<i;n++)r+=e[n].duration;return r},Ah=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return Ch(s);if(e===null)return null;e=e||0;let r=Eh(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:xh(null,s),r-=i),Math.max(0,r)},Jy=function(s,e,t){const r=e||0;let n=Ah(s,e,!0,t);return n===null?st():(n<r&&(n=r),st(r,n))},Zy=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const l=vo(s);let d=0;for(let f=0;f<l.length;f++){const m=l[f];if(t===m.segmentIndex&&!(typeof i=="number"&&typeof m.partIndex=="number"&&i!==m.partIndex)){d=f;break}}if(a<0){if(d>0)for(let f=d-1;f>=0;f--){const m=l[f];if(a+=m.duration,n){if(a<0)continue}else if(a+ii<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Tr({defaultDuration:s.targetDuration,durationList:l,startIndex:d,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(d<0){for(let f=d;f<0;f++)if(a-=s.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};d=0}for(let f=d;f<l.length;f++){const m=l[f];a-=m.duration;const y=m.duration>ii,k=a===0,E=y&&a+ii>=0;if(!((k||E)&&f!==l.length-1)){if(n){if(a>0)continue}else if(a-ii>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Tr({defaultDuration:s.targetDuration,durationList:l,startIndex:d,endIndex:f})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},Dh=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},hl=function(s){return s.excludeUntil&&s.excludeUntil===1/0},aa=function(s){const e=Dh(s);return!s.disabled&&!e},e_=function(s){return s.disabled},t_=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},wh=function(s,e){return e.attributes&&e.attributes[s]},i_=function(s,e,t,i=0){return wh("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},To=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>aa(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},fl=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),cd=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},Or=s=>{if(!s||!s.playlists||!s.playlists.length)return cd(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(n=>jd(n))||cd(s,n=>fl(t,n))))return!1}return!0};var Tt={liveEdgeDelay:xh,duration:Ch,seekable:Jy,getMediaInfoForTime:Zy,isEnabled:aa,isDisabled:e_,isExcluded:Dh,isIncompatible:hl,playlistEnd:Ah,isAes:t_,hasAttribute:wh,estimateSegmentRequestTime:i_,isLowestEnabledRendition:To,isAudioOnly:Or,playlistMatch:fl,segmentDurationWithParts:cl};const{log:kh}=F,Ts=(s,e)=>`${s}-${e}`,Ih=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,s_=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new Hg;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){l.hasOwnProperty(f)&&delete l[f]}),l.segments&&l.segments.forEach(function(f){["parts","preloadHints"].forEach(function(m){f.hasOwnProperty(m)&&delete f[m]})})),!l.targetDuration){let f=10;l.segments&&l.segments.length&&(f=l.segments.reduce((m,y)=>Math.max(m,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${f}`}),l.targetDuration=f}const d=bh(l);if(d.length&&!l.partTargetDuration){const f=d.reduce((m,y)=>Math.max(m,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${f}`}),kh.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),l.partTargetDuration=f}return l},js=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},Ph=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},r_=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];Ph({playlist:t,id:Ts(e,t.uri)}),t.resolvedUri=vt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||kh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},n_=s=>{js(s,e=>{e.uri&&(e.resolvedUri=vt(s.uri,e.uri))})},a_=(s,e)=>{const t=Ts(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},Lh=(s,e,t=Ih)=>{s.uri=e;for(let r=0;r<s.playlists.length;r++)if(!s.playlists[r].uri){const n=`placeholder-uri-${r}`;s.playlists[r].uri=n}const i=Or(s);js(s,(r,n,a,l)=>{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let d=0;d<s.playlists.length;d++){const f=s.playlists[d];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[Ke({},r)]}r.playlists.forEach(function(d,f){const m=t(n,a,l,d),y=Ts(f,m);d.uri?d.resolvedUri=d.resolvedUri||vt(s.uri,d.uri):(d.uri=f===0?m:y,d.resolvedUri=d.uri),d.id=d.id||y,d.attributes=d.attributes||{},s.playlists[d.id]=d,s.playlists[d.uri]=d})}),r_(s),n_(s)};class hd{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,r)=>{i.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const Oh=22,Yi=({requestType:s,request:e,error:t,parseFailure:i})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},l=r&&!n||i;if(t&&n)a.error=Ke({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.errorType=F.Error.NetworkRequestTimeout;else if(l){const d=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=d,a.status=e.status,a.headers=e.headers}return a},o_=Bt("CodecUtils"),Rh=function(s){const e=s.attributes||{};if(e.CODECS)return Zt(e.CODECS)},Mh=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},l_=(s,e)=>{if(!Mh(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},Ar=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Ud(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){o_(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},fd=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},br=function(s,e){const t=e.attributes||{},i=Ar(Rh(e)||[]);if(Mh(s,e)&&!i.audio&&!l_(s,e)){const r=Ar(Wg(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},{EventTarget:u_}=F,d_=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=Sh(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new D.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},c_=(s,e)=>{if(!s)return e;const t=ke(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i<e.parts.length;i++)s.parts&&s.parts[i]&&(t.parts[i]=ke(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},h_=(s,e,t)=>{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let l=0;l<r.length;l++){const d=i[l+t],f=r[l];d?(a=d.map||a,n.push(c_(d,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},Nh=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=vt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=vt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=vt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=vt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=vt(e,t.uri))})},Bh=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},Fh=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,bo=(s,e,t=Fh)=>{const i=ke(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=Bh(e);const n=ke(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=h_(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{Nh(a,n.resolvedUri)});for(let a=0;a<i.playlists.length;a++)i.playlists[a].id===e.id&&(i.playlists[a]=n);return i.playlists[e.id]=n,i.playlists[e.uri]=n,js(s,(a,l,d,f)=>{if(a.playlists)for(let m=0;m<a.playlists.length;m++)e.id===a.playlists[m].id&&(a.playlists[m]=n)}),i},So=(s,e)=>{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},pd=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:i}};class gs extends u_{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Bt("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new hd,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=vt(this.main.uri,e.uri);this.llhls&&(t=d_(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Yi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=s_({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const r=i.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const l=Rh(i)||[];return!!Ar(l).video};e.some(t)&&e.forEach(i=>{t(i)||(i.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),Ph({playlist:a,uri:i,id:r});const l=bo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(So(this.media(),!!l)),n.parsedPlaylist=pd(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new hd,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(D.clearTimeout(this.finalRenditionTimeout),t){const l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,e,!1),l);return}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(So(e,!0)),!r)return;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;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(l,d)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Mn(e.resolvedUri,d),l)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:d.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(D.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_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Yi({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Mn(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=pd(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Lh(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=Bh(i),i.segments.forEach(r=>{Nh(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||D.location.href;this.main=a_(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const l=a.resolvedUri,d=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),m=Ts(r,f),y=this.createCloneAttributes_(r,a.attributes),k=this.createClonePlaylist_(a,m,e,y);i.playlists[n]=k,i.playlists[m]=k,i.playlists[f]=k}else i.playlists.splice(n,1);delete i.playlists[d],delete i.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||!i.mediaGroups[n][r])){for(const a in i.mediaGroups[n])if(a===r){for(const l in i.mediaGroups[n][a])i.mediaGroups[n][a][l].playlists.forEach((f,m)=>{const y=i.playlists[f.id],k=y.id,E=y.resolvedUri;delete i.playlists[k],delete i.playlists[E]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Ts(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),d=this.createClonePlaylist_(t,a,e,l);i.playlists[r]=d,i.playlists[a]=d,i.playlists[n]=d,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===i)r.mediaGroups[n][t]={};else continue;for(const l in r.mediaGroups[n][a]){const d=r.mediaGroups[n][a][l];r.mediaGroups[n][t][l]=Ke({},d);const f=r.mediaGroups[n][t][l],m=this.createCloneURI_(d.resolvedUri,e);f.resolvedUri=m,f.uri=m,f.playlists=[],d.playlists.forEach((y,k)=>{const E=r.playlists[y.id],O=Ih(n,t,l),v=Ts(t,O);if(E&&!r.playlists[v]){const P=this.createClonePlaylist_(E,v,e),B=P.resolvedUri;r.playlists[v]=P,r.playlists[B]=P}f.playlists[k]=this.createClonePlaylist_(y,v,e)})}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),ke(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const r=e.contentProtection[i].attributes.keyId;t.add(r.toLowerCase())}return t}}const xo=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},f_=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},p_=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},Uh=function(){const s=function e(t,i){t=ke({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const l=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,d=f_(n,t);n.delete(r);const f=l(d||t,function(y,k){return p_(a,f,y,k),xo(f,y,k,i)}),m=f.abort;return f.abort=function(){return f.aborted=!0,m.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return s.original=!0,s},g_=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=D.BigInt(s.offset)+D.BigInt(s.length)-D.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},Eo=function(s){const e={};return s.byterange&&(e.Range=g_(s.byterange)),e},m_=function(s,e){return s.start(e)+"-"+s.end(e)},y_=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},__=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},jh=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];$d(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},Nn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},qh=function(s){return s.resolvedUri},$h=s=>{const e=Array.prototype.slice.call(s),t=16;let i="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(y_).join(""),n=e.slice(a*t,a*t+t).map(__).join(""),i+=r+" "+n+` 184`;return i},v_=({bytes:s})=>$h(s),T_=s=>{let e="",t;for(t=0;t<s.length;t++)e+=m_(s,t)+" ";return e};var b_=Object.freeze({__proto__:null,createTransferableMessage:jh,initSegmentId:Nn,segmentKeyId:qh,hexDump:$h,tagDump:v_,textRanges:T_});const Vh=.25,S_=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},x_=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,E_=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let d=0;d<e.segments.length-1;d++){i=e.segments[d];const f=new Date(e.segments[d+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?x_(r.videoTimingInfo):r.duration+r.duration*Vh,l=new Date(n.getTime()+a*1e3);return t>l?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Tt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},C_=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let n=0;n<e.segments.length&&(i=e.segments[n],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(s<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+r.duration*Vh)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},A_=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},D_=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},w_=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=C_(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=S_(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},Hh=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!D_(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const l=E_(s,e);if(!l)return a({message:`${s} was not found in the stream`});const d=l.segment,f=A_(d.dateTimeObject,s);if(l.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});i(l.estimatedStart+f),n.one("seeked",()=>{Hh({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const m=d.start+f,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(m)},eo=(s,e)=>{if(s.readyState===4)return e()},k_=(s,e,t,i)=>{let r=[],n,a=!1;const l=function(y,k,E,O){return k.abort(),a=!0,t(y,k,E,O)},d=function(y,k){if(a)return;if(y)return y.metadata=Yi({requestType:i,request:k,error:y}),l(y,k,"",r);const E=k.responseText.substring(r&&r.byteLength||0,k.responseText.length);if(r=im(r,Vd(E,!0)),n=n||fr(r),r.length<10||n&&r.length<n+2)return eo(k,()=>l(y,k,"",r));const O=Bo(r);return O==="ts"&&r.length<188?eo(k,()=>l(y,k,"",r)):!O&&r.length<376?eo(k,()=>l(y,k,"",r)):l(null,k,O,r)},m=e({uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:k,loaded:E}){return xo(y,null,{statusCode:y.status},d)})}},function(y,k){return xo(m,y,k,d)});return m},{EventTarget:I_}=F,gd=function(s,e){if(!Fh(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const i=s.segments[t],r=e.segments[t];if(i.uri!==r.uri)return!1;if(!i.byterange&&!r.byterange)continue;const n=i.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},P_=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},L_=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=e0(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return Lh(n,e,P_),n},O_=(s,e)=>{js(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},R_=(s,e,t)=>{let i=!0,r=ke(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const d=$n(a.sidx);t&&t[d]&&t[d].sidx&&Ro(a,t[d].sidx,a.sidx.resolvedUri)}const l=bo(r,a,gd);l&&(r=l,i=!1)}return js(e,(n,a,l,d)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,m=bo(r,n.playlists[0],gd);m&&(r=m,d in r.mediaGroups[a][l]||(r.mediaGroups[a][l][d]=n),r.mediaGroups[a][l][d].playlists[0]=r.playlists[f],i=!1)}}),O_(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},M_=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,md=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=$n(n);if(!e[a])break;const l=e[a].sidxInfo;M_(l,n)&&(t[a]=e[a])}}return t},N_=(s,e)=>{let i=md(s.playlists,e);return js(s,(r,n,a,l)=>{if(r.playlists&&r.playlists.length){const d=r.playlists;i=ke(i,md(d,e))}}),i};class Co extends I_{constructor(e,t,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Bt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const r=e.sidx&&$n(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){D.clearTimeout(this.mediaRequest_),this.mediaRequest_=D.setTimeout(()=>i(!1),0);return}const n=Mn(e.sidx.resolvedUri),a=(d,f)=>{if(this.requestErrored_(d,f,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=f;let k;try{k=n0(fe(f.response).subarray(8))}catch(E){E.metadata=Yi({requestType:y,request:f,parseFailure:!0}),this.requestErrored_(E,f,t);return}return m[r]={sidxInfo:e.sidx,sidx:k},Ro(e,k,e.sidx.resolvedUri),i(!0)},l="dash-sidx";this.request=k_(n,this.vhs_.xhr,(d,f,m,y)=>{if(d)return a(d,f);if(!m||m!=="mp4"){const O=m||"unknown";return a({status:f.status,message:`Unsupported ${O} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:k,length:E}=e.sidx.byterange;if(y.length>=E+k)return a(d,{response:y.subarray(k,k+E),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Eo({byterange:e.sidx.byterange})},a)},l)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,D.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(D.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){D.clearTimeout(this.mediaRequest_),this.mediaRequest_=D.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Yi({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Mn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=t0(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:vt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Yi({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){D.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=L_({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=R_(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,l=[];i.playlists.forEach(f=>{l.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const d={duration:n,isLive:!a,renditions:l};t.parsedManifest=d,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(D.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=D.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=N_(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=D.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},So(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var tt={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const B_=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},zh=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},F_=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},Wh=function(s){return function(){const e=F_(s),t=zh(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},Gh=function(s){return`var browserWorkerPolyFill = ${zh.toString()}; 185browserWorkerPolyFill(self); 186`+s},Xh=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},U_=Gh(Xh(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(u,h){o[u]||(o[u]=[]),o[u]=o[u].concat(h)},this.off=function(u,h){var c;return o[u]?(c=o[u].indexOf(h),o[u]=o[u].slice(),o[u].splice(c,1),c>-1):!1},this.trigger=function(u){var h,c,p,g;if(h=o[u],!!h)if(arguments.length===2)for(p=h.length,c=0;c<p;++c)h[c].call(this,arguments[1]);else{for(g=[],c=arguments.length,c=1;c<arguments.length;++c)g.push(arguments[c]);for(p=h.length,c=0;c<p;++c)h[c].apply(this,g)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(u){o.push(u)}),this.on("done",function(u){o.flush(u)}),this.on("partialdone",function(u){o.partialFlush(u)}),this.on("endedtimeline",function(u){o.endTimeline(u)}),this.on("reset",function(u){o.reset(u)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,i=Math.pow(2,32),r=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),h;return u.getBigUint64?(h=u.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?Number(h):h):u.getUint32(0)*i+u.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,l,d,f,m,y,k,E,O,v,P,B,N,L,V,j,q,R,H,T,C,U,K,$,W,ee,se,Y,Z,J,te,oe,me,de,xe,pe,Ae;(function(){var o;if($={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(o in $)$.hasOwnProperty(o)&&($[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);W=new Uint8Array([105,115,111,109]),se=new Uint8Array([97,118,99,49]),ee=new Uint8Array([0,0,0,1]),Y=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Z=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),J={video:Y,audio:Z},me=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),oe=new Uint8Array([0,0,0,0,0,0,0,0]),de=new Uint8Array([0,0,0,0,0,0,0,0]),xe=de,pe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ae=de,te=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(o){var u=[],h=0,c,p,g;for(c=1;c<arguments.length;c++)u.push(arguments[c]);for(c=u.length;c--;)h+=u[c].byteLength;for(p=new Uint8Array(h+8),g=new DataView(p.buffer,p.byteOffset,p.byteLength),g.setUint32(0,p.byteLength),p.set(o,4),c=0,h=8;c<u.length;c++)p.set(u[c],h),h+=u[c].byteLength;return p},d=function(){return l($.dinf,l($.dref,me))},f=function(o){return l($.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},m=function(){return l($.ftyp,W,ee,W,se)},q=function(o){return l($.hdlr,J[o])},y=function(o){return l($.mdat,o)},j=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=o.samplerate&255),l($.mdhd,u)},V=function(o){return l($.mdia,j(o),q(o.type),E(o))},k=function(o){return l($.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},E=function(o){return l($.minf,o.type==="video"?l($.vmhd,te):l($.smhd,oe),d(),H(o))},O=function(o,u){for(var h=[],c=u.length;c--;)h[c]=C(u[c]);return l.apply(null,[$.moof,k(o)].concat(h))},v=function(o){for(var u=o.length,h=[];u--;)h[u]=N(o[u]);return l.apply(null,[$.moov,B(4294967295)].concat(h).concat(P(o)))},P=function(o){for(var u=o.length,h=[];u--;)h[u]=U(o[u]);return l.apply(null,[$.mvex].concat(h))},B=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,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 l($.mvhd,u)},R=function(o){var u=o.samples||[],h=new Uint8Array(4+u.length),c,p;for(p=0;p<u.length;p++)c=u[p].flags,h[p+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return l($.sdtp,h)},H=function(o){return l($.stbl,T(o),l($.stts,Ae),l($.stsc,xe),l($.stsz,pe),l($.stco,de))},(function(){var o,u;T=function(h){return l($.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?o(h):u(h))},o=function(h){var c=h.sps||[],p=h.pps||[],g=[],S=[],x,A;for(x=0;x<c.length;x++)g.push((c[x].byteLength&65280)>>>8),g.push(c[x].byteLength&255),g=g.concat(Array.prototype.slice.call(c[x]));for(x=0;x<p.length;x++)S.push((p[x].byteLength&65280)>>>8),S.push(p[x].byteLength&255),S=S.concat(Array.prototype.slice.call(p[x]));if(A=[$.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,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]),l($.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([c.length],g,[p.length],S))),l($.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var w=h.sarRatio[0],M=h.sarRatio[1];A.push(l($.pasp,new Uint8Array([(w&4278190080)>>24,(w&16711680)>>16,(w&65280)>>8,w&255,(M&4278190080)>>24,(M&16711680)>>16,(M&65280)>>8,M&255])))}return l.apply(null,A)},u=function(h){return l($.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}})(),L=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.duration&255,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,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return l($.tkhd,u)},C=function(o){var u,h,c,p,g,S,x;return u=l($.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),S=Math.floor(o.baseMediaDecodeTime/a),x=Math.floor(o.baseMediaDecodeTime%a),h=l($.tfdt,new Uint8Array([1,0,0,0,S>>>24&255,S>>>16&255,S>>>8&255,S&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255])),g=92,o.type==="audio"?(c=K(o,g),l($.traf,u,h,c)):(p=R(o),c=K(o,p.length+g),l($.traf,u,h,c,p))},N=function(o){return o.duration=o.duration||4294967295,l($.trak,L(o),V(o))},U=function(o){var u=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),l($.trex,u)},(function(){var o,u,h;h=function(c,p){var g=0,S=0,x=0,A=0;return c.length&&(c[0].duration!==void 0&&(g=1),c[0].size!==void 0&&(S=2),c[0].flags!==void 0&&(x=4),c[0].compositionTimeOffset!==void 0&&(A=8)),[0,0,g|S|x|A,1,(c.length&4278190080)>>>24,(c.length&16711680)>>>16,(c.length&65280)>>>8,c.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},u=function(c,p){var g,S,x,A,w,M;for(A=c.samples||[],p+=20+16*A.length,x=h(A,p),S=new Uint8Array(x.length+A.length*16),S.set(x),g=x.length,M=0;M<A.length;M++)w=A[M],S[g++]=(w.duration&4278190080)>>>24,S[g++]=(w.duration&16711680)>>>16,S[g++]=(w.duration&65280)>>>8,S[g++]=w.duration&255,S[g++]=(w.size&4278190080)>>>24,S[g++]=(w.size&16711680)>>>16,S[g++]=(w.size&65280)>>>8,S[g++]=w.size&255,S[g++]=w.flags.isLeading<<2|w.flags.dependsOn,S[g++]=w.flags.isDependedOn<<6|w.flags.hasRedundancy<<4|w.flags.paddingValue<<1|w.flags.isNonSyncSample,S[g++]=w.flags.degradationPriority&61440,S[g++]=w.flags.degradationPriority&15,S[g++]=(w.compositionTimeOffset&4278190080)>>>24,S[g++]=(w.compositionTimeOffset&16711680)>>>16,S[g++]=(w.compositionTimeOffset&65280)>>>8,S[g++]=w.compositionTimeOffset&255;return l($.trun,S)},o=function(c,p){var g,S,x,A,w,M;for(A=c.samples||[],p+=20+8*A.length,x=h(A,p),g=new Uint8Array(x.length+A.length*8),g.set(x),S=x.length,M=0;M<A.length;M++)w=A[M],g[S++]=(w.duration&4278190080)>>>24,g[S++]=(w.duration&16711680)>>>16,g[S++]=(w.duration&65280)>>>8,g[S++]=w.duration&255,g[S++]=(w.size&4278190080)>>>24,g[S++]=(w.size&16711680)>>>16,g[S++]=(w.size&65280)>>>8,g[S++]=w.size&255;return l($.trun,g)},K=function(c,p){return c.type==="audio"?o(c,p):u(c,p)}})();var Je={ftyp:m,mdat:y,moof:O,moov:v,initSegment:function(o){var u=m(),h=v(o),c;return c=new Uint8Array(u.byteLength+h.byteLength),c.set(u),c.set(h,u.byteLength),c}},Qe=function(o){var u,h,c=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,c.byteLength=0,u=0;u<o.length;u++)h=o[u],h.nalUnitType==="access_unit_delimiter_rbsp"?(c.length&&(c.duration=h.dts-c.dts,p.byteLength+=c.byteLength,p.nalCount+=c.length,p.duration+=c.duration,p.push(c)),c=[h],c.byteLength=h.data.byteLength,c.pts=h.pts,c.dts=h.dts):(h.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(c.keyFrame=!0),c.duration=h.dts-c.dts,c.byteLength+=h.data.byteLength,c.push(h));return p.length&&(!c.duration||c.duration<=0)&&(c.duration=p[p.length-1].duration),p.byteLength+=c.byteLength,p.nalCount+=c.length,p.duration+=c.duration,p.push(c),p},rt=function(o){var u,h,c=[],p=[];for(c.byteLength=0,c.nalCount=0,c.duration=0,c.pts=o[0].pts,c.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,u=0;u<o.length;u++)h=o[u],h.keyFrame?(c.length&&(p.push(c),p.byteLength+=c.byteLength,p.nalCount+=c.nalCount,p.duration+=c.duration),c=[h],c.nalCount=h.length,c.byteLength=h.byteLength,c.pts=h.pts,c.dts=h.dts,c.duration=h.duration):(c.duration+=h.duration,c.nalCount+=h.length,c.byteLength+=h.byteLength,c.push(h));return p.length&&c.duration<=0&&(c.duration=p[p.length-1].duration),p.byteLength+=c.byteLength,p.nalCount+=c.nalCount,p.duration+=c.duration,p.push(c),p},mt=function(o){var u;return!o[0][0].keyFrame&&o.length>1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},Gt=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Zi=function(o,u){var h=Gt();return h.dataOffset=u,h.compositionTimeOffset=o.pts-o.dts,h.duration=o.duration,h.size=4*o.length,h.size+=o.byteLength,o.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},es=function(o,u){var h,c,p,g,S,x=u||0,A=[];for(h=0;h<o.length;h++)for(g=o[h],c=0;c<g.length;c++)S=g[c],p=Zi(S,x),x+=p.size,A.push(p);return A},Be=function(o){var u,h,c,p,g,S,x=0,A=o.byteLength,w=o.nalCount,M=A+4*w,z=new Uint8Array(M),ae=new DataView(z.buffer);for(u=0;u<o.length;u++)for(p=o[u],h=0;h<p.length;h++)for(g=p[h],c=0;c<g.length;c++)S=g[c],ae.setUint32(x,S.data.byteLength),x+=4,z.set(S.data,x),x+=S.data.byteLength;return z},at=function(o,u){var h,c=u||0,p=[];return h=Zi(o,c),p.push(h),p},ze=function(o){var u,h,c=0,p=o.byteLength,g=o.length,S=p+4*g,x=new Uint8Array(S),A=new DataView(x.buffer);for(u=0;u<o.length;u++)h=o[u],A.setUint32(c,h.data.byteLength),c+=4,x.set(h.data,c),c+=h.data.byteLength;return x},Mi={groupNalsIntoFrames:Qe,groupFramesIntoGops:rt,extendFirstKeyFrame:mt,generateSampleTable:es,concatenateNalData:Be,generateSampleTableForFrame:at,concatenateNalDataForFrame:ze},xt=[33,16,5,32,164,27],li=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ce=function(o){for(var u=[];o--;)u.push(0);return u},Re=function(o){return Object.keys(o).reduce(function(u,h){return u[h]=new Uint8Array(o[h].reduce(function(c,p){return c.concat(p)},[])),u},{})},We,ui=function(){if(!We){var o={96e3:[xt,[227,64],Ce(154),[56]],88200:[xt,[231],Ce(170),[56]],64e3:[xt,[248,192],Ce(240),[56]],48e3:[xt,[255,192],Ce(268),[55,148,128],Ce(54),[112]],44100:[xt,[255,192],Ce(268),[55,163,128],Ce(84),[112]],32e3:[xt,[255,192],Ce(268),[55,234],Ce(226),[112]],24e3:[xt,[255,192],Ce(268),[55,255,128],Ce(268),[111,112],Ce(126),[224]],16e3:[xt,[255,192],Ce(268),[55,255,128],Ce(268),[111,255],Ce(269),[223,108],Ce(195),[1,192]],12e3:[li,Ce(268),[3,127,248],Ce(268),[6,255,240],Ce(268),[13,255,224],Ce(268),[27,253,128],Ce(259),[56]],11025:[li,Ce(268),[3,127,248],Ce(268),[6,255,240],Ce(268),[13,255,224],Ce(268),[27,255,192],Ce(268),[55,175,128],Ce(108),[112]],8e3:[li,Ce(268),[3,121,16],Ce(47),[7]]};We=Re(o)}return We},qs=9e4,Ft,vi,Xt,Ni,ts,is,Bi;Ft=function(o){return o*qs},vi=function(o,u){return o*u},Xt=function(o){return o/qs},Ni=function(o,u){return o/u},ts=function(o,u){return Ft(Ni(o,u))},is=function(o,u){return vi(Xt(o),u)},Bi=function(o,u,h){return Xt(h?o:o-u)};var Pe={ONE_SECOND_IN_TS:qs,secondsToVideoTs:Ft,secondsToAudioTs:vi,videoTsToSeconds:Xt,audioTsToSeconds:Ni,audioTsToVideoTs:ts,videoTsToAudioTs:is,metadataTsToSeconds:Bi},Rr=ui,Ti=Pe,ss=function(o){var u,h,c=0;for(u=0;u<o.length;u++)h=o[u],c+=h.data.byteLength;return c},$s=function(o,u,h,c){var p,g=0,S=0,x=0,A=0,w,M,z;if(u.length&&(p=Ti.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),g=Math.ceil(Ti.ONE_SECOND_IN_TS/(o.samplerate/1024)),h&&c&&(S=p-Math.max(h,c),x=Math.floor(S/g),A=x*g),!(x<1||A>Ti.ONE_SECOND_IN_TS/2))){for(w=Rr()[o.samplerate],w||(w=u[0].data),M=0;M<x;M++)z=u[0],u.splice(0,0,{data:w,dts:z.dts-g,pts:z.pts-g});return o.baseMediaDecodeTime-=Math.floor(Ti.videoTsToAudioTs(A,o.samplerate)),A}},Mr=function(o,u,h){return u.minSegmentDts>=h?o:(u.minSegmentDts=1/0,o.filter(function(c){return c.dts>=h?(u.minSegmentDts=Math.min(u.minSegmentDts,c.dts),u.minSegmentPts=u.minSegmentDts,!0):!1}))},Nr=function(o){var u,h,c=[];for(u=0;u<o.length;u++)h=o[u],c.push({size:h.data.byteLength,duration:1024});return c},Br=function(o){var u,h,c=0,p=new Uint8Array(ss(o));for(u=0;u<o.length;u++)h=o[u],p.set(h.data,c),c+=h.data.byteLength;return p},rs={prefixWithSilence:$s,trimAdtsFramesByEarliestDts:Mr,generateSampleTable:Nr,concatenateFrameData:Br},Vs=Pe.ONE_SECOND_IN_TS,oa=function(o,u){typeof u.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=u.pts),o.minSegmentPts===void 0?o.minSegmentPts=u.pts:o.minSegmentPts=Math.min(o.minSegmentPts,u.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=u.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,u.pts)),typeof u.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=u.dts),o.minSegmentDts===void 0?o.minSegmentDts=u.dts:o.minSegmentDts=Math.min(o.minSegmentDts,u.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=u.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,u.dts))},Fr=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},Ur=function(o,u){var h,c,p=o.minSegmentDts;return u||(p-=o.timelineStartInfo.dts),h=o.timelineStartInfo.baseMediaDecodeTime,h+=p,h=Math.max(0,h),o.type==="audio"&&(c=o.samplerate/Vs,h*=c,h=Math.floor(h)),h},_={clearDtsInfo:Fr,calculateTrackBaseMediaDecodeTime:Ur,collectDtsInfo:oa},b=4,I=128,G=function(o){for(var u=0,h={payloadType:-1,payloadSize:0},c=0,p=0;u<o.byteLength&&o[u]!==I;){for(;o[u]===255;)c+=255,u++;for(c+=o[u++];o[u]===255;)p+=255,u++;if(p+=o[u++],!h.payload&&c===b){var g=String.fromCharCode(o[u+3],o[u+4],o[u+5],o[u+6]);if(g==="GA94"){h.payloadType=c,h.payloadSize=p,h.payload=o.subarray(u,u+p);break}else h.payload=void 0}u+=p,c=0,p=0}return h},ne=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},ce=function(o,u){var h=[],c,p,g,S;if(!(u[0]&64))return h;for(p=u[0]&31,c=0;c<p;c++)g=c*3,S={type:u[g+2]&3,pts:o},u[g+2]&4&&(S.ccData=u[g+3]<<8|u[g+4],h.push(S));return h},re=function(o){for(var u=o.byteLength,h=[],c=1,p,g;c<u-2;)o[c]===0&&o[c+1]===0&&o[c+2]===3?(h.push(c+2),c+=2):c++;if(h.length===0)return o;p=u-h.length,g=new Uint8Array(p);var S=0;for(c=0;c<p;S++,c++)S===h[0]&&(S++,h.shift()),g[c]=o[S];return g},Oe={parseSei:G,parseUserData:ne,parseCaptionPackets:ce,discardEmulationPreventionBytes:re,USER_DATA_REGISTERED_ITU_T_T35:b},Ge=t,Ze=Oe,Ue=function(o){o=o||{},Ue.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new De(0,0),new De(0,1),new De(1,0),new De(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ee({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(u){u.on("data",this.trigger.bind(this,"data")),u.on("partialdone",this.trigger.bind(this,"partialdone")),u.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};Ue.prototype=new Ge,Ue.prototype.push=function(o){var u,h,c;if(o.nalUnitType==="sei_rbsp"&&(u=Ze.parseSei(o.escapedRBSP),!!u.payload&&u.payloadType===Ze.USER_DATA_REGISTERED_ITU_T_T35&&(h=Ze.parseUserData(u),!!h))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}c=Ze.parseCaptionPackets(o.pts,h),this.captionPackets_=this.captionPackets_.concat(c),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Ue.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(u){return o==="flush"?u.flush():u.partialFlush()},this)},Ue.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(u,h){u.presortIndex=h}),this.captionPackets_.sort(function(u,h){return u.pts===h.pts?u.presortIndex-h.presortIndex:u.pts-h.pts}),this.captionPackets_.forEach(function(u){u.type<2?this.dispatchCea608Packet(u):this.dispatchCea708Packet(u)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Ue.prototype.flush=function(){return this.flushStream("flush")},Ue.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ue.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Ue.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},Ue.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Ue.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Ue.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Ue.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var ns={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Kt=function(o){var u=ns[o]||o;return o&4096&&o===u?"":String.fromCharCode(u)},Et=function(o){return 32<=o&&o<=127||160<=o&&o<=255},yt=function(o){this.windowNum=o,this.reset()};yt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},yt.prototype.getText=function(){return this.rows.join(` 187`)},yt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},yt.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},yt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},yt.prototype.addText=function(o){this.rows[this.rowIdx]+=o},yt.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var di=function(o,u,h){this.serviceNum=o,this.text="",this.currentWindow=new yt(-1),this.windows=[],this.stream=h,typeof u=="string"&&this.createTextDecoder(u)};di.prototype.init=function(o,u){this.startPts=o;for(var h=0;h<8;h++)this.windows[h]=new yt(h),typeof u=="function"&&(this.windows[h].beforeRowOverflow=u)},di.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]},di.prototype.createTextDecoder=function(o){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(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var Ee=function(o){o=o||{},Ee.prototype.init.call(this);var u=this,h=o.captionServices||{},c={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(c[g]=p.encoding)}),this.serviceEncodings=c,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(u.new708Packet(),u.add708Bytes(g)):(u.current708Packet===null&&u.new708Packet(),u.add708Bytes(g))}};Ee.prototype=new Ge,Ee.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ee.prototype.add708Bytes=function(o){var u=o.ccData,h=u>>>8,c=u&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(c)},Ee.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,h=null,c=null,p=0,g=u[p++];for(o.seq=g>>6,o.sizeCode=g&63;p<u.length;p++)g=u[p++],h=g>>5,c=g&31,h===7&&c>0&&(g=u[p++],h=g),this.pushServiceBlock(h,p,c),c>0&&(p+=c-1)},Ee.prototype.pushServiceBlock=function(o,u,h){var c,p=u,g=this.current708Packet.data,S=this.services[o];for(S||(S=this.initService(o,p));p<u+h&&p<g.length;p++)c=g[p],Et(c)?p=this.handleText(p,S):c===24?p=this.multiByteCharacter(p,S):c===16?p=this.extendedCommands(p,S):128<=c&&c<=135?p=this.setCurrentWindow(p,S):152<=c&&c<=159?p=this.defineWindow(p,S):c===136?p=this.clearWindows(p,S):c===140?p=this.deleteWindows(p,S):c===137?p=this.displayWindows(p,S):c===138?p=this.hideWindows(p,S):c===139?p=this.toggleWindows(p,S):c===151?p=this.setWindowAttributes(p,S):c===144?p=this.setPenAttributes(p,S):c===145?p=this.setPenColor(p,S):c===146?p=this.setPenLocation(p,S):c===143?S=this.reset(p,S):c===8?S.currentWindow.backspace():c===12?S.currentWindow.clearText():c===13?S.currentWindow.pendingNewLine=!0:c===14?S.currentWindow.clearText():c===141&&p++},Ee.prototype.extendedCommands=function(o,u){var h=this.current708Packet.data,c=h[++o];return Et(c)&&(o=this.handleText(o,u,{isExtended:!0})),o},Ee.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},Ee.prototype.initService=function(o,u){var c="SERVICE"+o,h=this,c,p;return c in this.serviceEncodings&&(p=this.serviceEncodings[c]),this.services[o]=new di(o,p,h),this.services[o].init(this.getPts(u),function(g){h.flushDisplayed(g,h.services[o])}),this.services[o]},Ee.prototype.handleText=function(o,u,h){var c=h&&h.isExtended,p=h&&h.isMultiByte,g=this.current708Packet.data,S=c?4096:0,x=g[o],A=g[o+1],w=u.currentWindow,M,z;function ae(Q){return Q.map(he=>("0"+(he&255).toString(16)).slice(-2)).join("")}if(p?(z=[x,A],o++):z=[x],u.textDecoder_&&!c)M=u.textDecoder_.decode(new Uint8Array(z));else if(p){const Q=ae(z);M=String.fromCharCode(parseInt(Q,16))}else M=Kt(S|x);return w.pendingNewLine&&!w.isEmpty()&&w.newLine(this.getPts(o)),w.pendingNewLine=!1,w.addText(M),o},Ee.prototype.multiByteCharacter=function(o,u){var h=this.current708Packet.data,c=h[o+1],p=h[o+2];return Et(c)&&Et(p)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},Ee.prototype.setCurrentWindow=function(o,u){var h=this.current708Packet.data,c=h[o],p=c&7;return u.setCurrentWindow(p),o},Ee.prototype.defineWindow=function(o,u){var h=this.current708Packet.data,c=h[o],p=c&7;u.setCurrentWindow(p);var g=u.currentWindow;return c=h[++o],g.visible=(c&32)>>5,g.rowLock=(c&16)>>4,g.columnLock=(c&8)>>3,g.priority=c&7,c=h[++o],g.relativePositioning=(c&128)>>7,g.anchorVertical=c&127,c=h[++o],g.anchorHorizontal=c,c=h[++o],g.anchorPoint=(c&240)>>4,g.rowCount=c&15,c=h[++o],g.columnCount=c&63,c=h[++o],g.windowStyle=(c&56)>>3,g.penStyle=c&7,g.virtualRowCount=g.rowCount+1,o},Ee.prototype.setWindowAttributes=function(o,u){var h=this.current708Packet.data,c=h[o],p=u.currentWindow.winAttr;return c=h[++o],p.fillOpacity=(c&192)>>6,p.fillRed=(c&48)>>4,p.fillGreen=(c&12)>>2,p.fillBlue=c&3,c=h[++o],p.borderType=(c&192)>>6,p.borderRed=(c&48)>>4,p.borderGreen=(c&12)>>2,p.borderBlue=c&3,c=h[++o],p.borderType+=(c&128)>>5,p.wordWrap=(c&64)>>6,p.printDirection=(c&48)>>4,p.scrollDirection=(c&12)>>2,p.justify=c&3,c=h[++o],p.effectSpeed=(c&240)>>4,p.effectDirection=(c&12)>>2,p.displayEffect=c&3,o},Ee.prototype.flushDisplayed=function(o,u){for(var h=[],c=0;c<8;c++)u.windows[c].visible&&!u.windows[c].isEmpty()&&h.push(u.windows[c].getText());u.endPts=o,u.text=h.join(` 188 189`),this.pushCaption(u),u.startPts=o},Ee.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},Ee.prototype.displayWindows=function(o,u){var h=this.current708Packet.data,c=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var g=0;g<8;g++)c&1<<g&&(u.windows[g].visible=1);return o},Ee.prototype.hideWindows=function(o,u){var h=this.current708Packet.data,c=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var g=0;g<8;g++)c&1<<g&&(u.windows[g].visible=0);return o},Ee.prototype.toggleWindows=function(o,u){var h=this.current708Packet.data,c=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var g=0;g<8;g++)c&1<<g&&(u.windows[g].visible^=1);return o},Ee.prototype.clearWindows=function(o,u){var h=this.current708Packet.data,c=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var g=0;g<8;g++)c&1<<g&&u.windows[g].clearText();return o},Ee.prototype.deleteWindows=function(o,u){var h=this.current708Packet.data,c=h[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var g=0;g<8;g++)c&1<<g&&u.windows[g].reset();return o},Ee.prototype.setPenAttributes=function(o,u){var h=this.current708Packet.data,c=h[o],p=u.currentWindow.penAttr;return c=h[++o],p.textTag=(c&240)>>4,p.offset=(c&12)>>2,p.penSize=c&3,c=h[++o],p.italics=(c&128)>>7,p.underline=(c&64)>>6,p.edgeType=(c&56)>>3,p.fontStyle=c&7,o},Ee.prototype.setPenColor=function(o,u){var h=this.current708Packet.data,c=h[o],p=u.currentWindow.penColor;return c=h[++o],p.fgOpacity=(c&192)>>6,p.fgRed=(c&48)>>4,p.fgGreen=(c&12)>>2,p.fgBlue=c&3,c=h[++o],p.bgOpacity=(c&192)>>6,p.bgRed=(c&48)>>4,p.bgGreen=(c&12)>>2,p.bgBlue=c&3,c=h[++o],p.edgeRed=(c&48)>>4,p.edgeGreen=(c&12)>>2,p.edgeBlue=c&3,o},Ee.prototype.setPenLocation=function(o,u){var h=this.current708Packet.data,c=h[o],p=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,c=h[++o],p.row=c&15,c=h[++o],p.column=c&63,o},Ee.prototype.reset=function(o,u){var h=this.getPts(o);return this.flushDisplayed(h,u),this.initService(u.serviceNum,o)};var ci={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},Ct=function(o){return o===null?"":(o=ci[o]||o,String.fromCharCode(o))},Lt=14,At=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ut=function(){for(var o=[],u=Lt+1;u--;)o.push({text:"",indent:0,offset:0});return o},De=function(o,u){De.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var c,p,g,S,x;if(c=h.ccData&32639,c===this.lastControlCode_){this.lastControlCode_=null;return}if((c&61440)===4096?this.lastControlCode_=c:c!==this.PADDING_&&(this.lastControlCode_=null),g=c>>>8,S=c&255,c!==this.PADDING_)if(c===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(c===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(c===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(c===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(c===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(c===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(c===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(c===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=Ut();else if(c===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ut();else if(c===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=Ut()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,S))g=(g&3)<<8,x=Ct(g|S),this[this.mode_](h.pts,x),this.column_++;else if(this.isExtCharacter(g,S))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,x=Ct(g|S),this[this.mode_](h.pts,x),this.column_++;else if(this.isMidRowCode(g,S))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(S&14)===14&&this.addFormatting(h.pts,["i"]),(S&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,S)){const w=S&3;this.nonDisplayed_[this.row_].offset=w,this.column_+=w}else if(this.isPAC(g,S)){var A=At.indexOf(c&7968);if(this.mode_==="rollUp"&&(A-this.rollUpRows_+1<0&&(A=this.rollUpRows_-1),this.setRollUp(h.pts,A)),A!==this.row_&&A>=0&&A<=14&&(this.clearFormatting(h.pts),this.row_=A),S&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(c&16)===16){const w=(c&14)>>1;this.column_=w*4,this.nonDisplayed_[this.row_].indent+=w}this.isColorPAC(S)&&(S&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(S===0&&(S=null),x=Ct(g),x+=Ct(S),this[this.mode_](h.pts,x),this.column_+=x.length)}};De.prototype=new Ge,De.prototype.flushDisplayed=function(o){const u=c=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+c+"."})},h=[];this.displayed_.forEach((c,p)=>{if(c&&c.text&&c.text.length){try{c.text=c.text.trim()}catch{u(p)}c.text.length&&h.push({text:c.text,line:p+1,position:10+Math.min(70,c.indent*10)+c.offset*2.5})}else c==null&&u(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:h,stream:this.name_})},De.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ut(),this.nonDisplayed_=Ut(),this.lastControlCode_=null,this.column_=0,this.row_=Lt,this.rollUpRows_=2,this.formatting_=[]},De.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_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},De.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},De.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},De.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},De.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},De.prototype.isPAC=function(o,u){return o>=this.BASE_&&o<this.BASE_+8&&u>=64&&u<=127},De.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},De.prototype.isNormalChar=function(o){return o>=32&&o<=127},De.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=Lt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Ut(),this.displayed_=Ut()),u!==void 0&&u!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[u-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};u===void 0&&(u=this.row_),this.topRow_=u-this.rollUpRows_+1},De.prototype.addFormatting=function(o,u){this.formatting_=this.formatting_.concat(u);var h=u.reduce(function(c,p){return c+"<"+p+">"},"");this[this.mode_](o,h)},De.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(h,c){return h+"</"+c+">"},"");this.formatting_=[],this[this.mode_](o,u)}},De.prototype.popOn=function(o,u){var h=this.nonDisplayed_[this.row_].text;h+=u,this.nonDisplayed_[this.row_].text=h},De.prototype.rollUp=function(o,u){var h=this.displayed_[this.row_].text;h+=u,this.displayed_[this.row_].text=h},De.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<Lt+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},De.prototype.paintOn=function(o,u){var h=this.displayed_[this.row_].text;h+=u,this.displayed_[this.row_].text=h};var bi={CaptionStream:Ue,Cea608Stream:De,Cea708Stream:Ee},Si={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},hi=t,jr=8589934592,xi=4294967296,Hs="shared",la=function(o,u){var h=1;for(o>u&&(h=-1);Math.abs(u-o)>xi;)o+=h*jr;return o},ua=function(o){var u,h;ua.prototype.init.call(this),this.type_=o||Hs,this.push=function(c){if(c.type==="metadata"){this.trigger("data",c);return}this.type_!==Hs&&c.type!==this.type_||(h===void 0&&(h=c.dts),c.dts=la(c.dts,h),c.pts=la(c.pts,h),u=c.dts,this.trigger("data",c))},this.flush=function(){h=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ua.prototype=new hi;var ml={TimestampRolloverStream:ua,handleRollover:la},Df=(o,u,h)=>{if(!o)return-1;for(var c=h;c<o.length;c++)if(o[c]===u)return c;return-1},wf={typedArrayIndexOf:Df},qr=wf.typedArrayIndexOf,$r={Utf8:3},yl=function(o,u,h){var c,p="";for(c=u;c<h;c++)p+="%"+("00"+o[c].toString(16)).slice(-2);return p},zs=function(o,u,h){return decodeURIComponent(yl(o,u,h))},Ws=function(o,u,h){return unescape(yl(o,u,h))},Gs=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Xs={APIC:function(o){var u=1,h,c,p="-->";o.data[0]===$r.Utf8&&(h=qr(o.data,0,u),!(h<0)&&(o.mimeType=Ws(o.data,u,h),u=h+1,o.pictureType=o.data[u],u++,c=qr(o.data,0,u),!(c<0)&&(o.description=zs(o.data,u,c),u=c+1,o.mimeType===p?o.url=Ws(o.data,u,o.data.length):o.pictureData=o.data.subarray(u,o.data.length))))},"T*":function(o){o.data[0]===$r.Utf8&&(o.value=zs(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===$r.Utf8&&(u=qr(o.data,0,1),u!==-1&&(o.description=zs(o.data,1,u),o.value=zs(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=Ws(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===$r.Utf8&&(u=qr(o.data,0,1),u!==-1&&(o.description=zs(o.data,1,u),o.url=Ws(o.data,u+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var u;for(u=0;u<o.data.length;u++)if(o.data[u]===0){o.owner=Ws(o.data,0,u);break}o.privateData=o.data.subarray(u+1),o.data=o.privateData}},kf=function(o){var u,h,c=10,p=0,g=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=Gs(o.subarray(6,10)),p+=10;var S=o[5]&64;S&&(c+=4,c+=Gs(o.subarray(10,14)),p-=Gs(o.subarray(16,20)));do{if(u=Gs(o.subarray(c+4,c+8)),u<1)break;h=String.fromCharCode(o[c],o[c+1],o[c+2],o[c+3]);var x={id:h,data:o.subarray(c+10,c+u+10)};x.key=x.id,Xs[x.id]?Xs[x.id](x):x.id[0]==="T"?Xs["T*"](x):x.id[0]==="W"&&Xs["W*"](x),g.push(x),c+=10,c+=u}while(c<p);return g}},_l={parseId3Frames:kf,parseSyncSafeInteger:Gs,frameParsers:Xs},If=t,Pf=Si,Ei=_l,Vr;Vr=function(o){var u={descriptor:o&&o.descriptor},h=0,c=[],p=0,g;if(Vr.prototype.init.call(this),this.dispatchType=Pf.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(g=0;g<u.descriptor.length;g++)this.dispatchType+=("00"+u.descriptor[g].toString(16)).slice(-2);this.push=function(S){var x,A,w,M,z,ae;if(S.type==="timed-metadata"){if(S.dataAlignmentIndicator&&(p=0,c.length=0),c.length===0&&(S.data.length<10||S.data[0]!==73||S.data[1]!==68||S.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(c.push(S),p+=S.data.byteLength,c.length===1&&(h=Ei.parseSyncSafeInteger(S.data.subarray(6,10)),h+=10),!(p<h)){for(x={data:new Uint8Array(h),frames:[],pts:c[0].pts,dts:c[0].dts},z=0;z<h;)x.data.set(c[0].data.subarray(0,h-z),z),z+=c[0].data.byteLength,p-=c[0].data.byteLength,c.shift();A=10,x.data[5]&64&&(A+=4,A+=Ei.parseSyncSafeInteger(x.data.subarray(10,14)),h-=Ei.parseSyncSafeInteger(x.data.subarray(16,20)));do{if(w=Ei.parseSyncSafeInteger(x.data.subarray(A+4,A+8)),w<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ae=String.fromCharCode(x.data[A],x.data[A+1],x.data[A+2],x.data[A+3]),M={id:ae,data:x.data.subarray(A+10,A+w+10)},M.key=M.id,Ei.frameParsers[M.id]?Ei.frameParsers[M.id](M):M.id[0]==="T"?Ei.frameParsers["T*"](M):M.id[0]==="W"&&Ei.frameParsers["W*"](M),M.owner==="com.apple.streaming.transportStreamTimestamp"){var Q=M.data,he=(Q[3]&1)<<30|Q[4]<<22|Q[5]<<14|Q[6]<<6|Q[7]>>>2;he*=4,he+=Q[7]&3,M.timeStamp=he,x.pts===void 0&&x.dts===void 0&&(x.pts=M.timeStamp,x.dts=M.timeStamp),this.trigger("timestamp",M)}x.frames.push(M),A+=10,A+=w}while(A<h);this.trigger("data",x)}}}},Vr.prototype=new If;var Lf=Vr,da=t,ca=bi,jt=Si,Of=ml.TimestampRolloverStream,Hr,Ks,zr,as=188,ha=71;Hr=function(){var o=new Uint8Array(as),u=0;Hr.prototype.init.call(this),this.push=function(h){var c=0,p=as,g;for(u?(g=new Uint8Array(h.byteLength+u),g.set(o.subarray(0,u)),g.set(h,u),u=0):g=h;p<g.byteLength;){if(g[c]===ha&&g[p]===ha){this.trigger("data",g.subarray(c,p)),c+=as,p+=as;continue}c++,p++}c<g.byteLength&&(o.set(g.subarray(c),0),u=g.byteLength-c)},this.flush=function(){u===as&&o[0]===ha&&(this.trigger("data",o),u=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){u=0,this.trigger("reset")}},Hr.prototype=new da,Ks=function(){var o,u,h,c;Ks.prototype.init.call(this),c=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,g){var S=0;g.payloadUnitStartIndicator&&(S+=p[S]+1),g.type==="pat"?u(p.subarray(S),g):h(p.subarray(S),g)},u=function(p,g){g.section_number=p[7],g.last_section_number=p[8],c.pmtPid=(p[10]&31)<<8|p[11],g.pmtPid=c.pmtPid},h=function(p,g){var S,x,A,w;if(p[5]&1){for(c.programMapTable={video:null,audio:null,"timed-metadata":{}},S=(p[1]&15)<<8|p[2],x=3+S-4,A=(p[10]&15)<<8|p[11],w=12+A;w<x;){var M=p[w],z=(p[w+1]&31)<<8|p[w+2];M===jt.H264_STREAM_TYPE&&c.programMapTable.video===null?c.programMapTable.video=z:M===jt.ADTS_STREAM_TYPE&&c.programMapTable.audio===null?c.programMapTable.audio=z:M===jt.METADATA_STREAM_TYPE&&(c.programMapTable["timed-metadata"][z]=M),w+=((p[w+3]&15)<<8|p[w+4])+5}g.programMapTable=c.programMapTable}},this.push=function(p){var g={},S=4;if(g.payloadUnitStartIndicator=!!(p[1]&64),g.pid=p[1]&31,g.pid<<=8,g.pid|=p[2],(p[3]&48)>>>4>1&&(S+=p[S]+1),g.pid===0)g.type="pat",o(p.subarray(S),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",o(p.subarray(S),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,S,g]):this.processPes_(p,S,g)},this.processPes_=function(p,g,S){S.pid===this.programMapTable.video?S.streamType=jt.H264_STREAM_TYPE:S.pid===this.programMapTable.audio?S.streamType=jt.ADTS_STREAM_TYPE:S.streamType=this.programMapTable["timed-metadata"][S.pid],S.type="pes",S.data=p.subarray(g),this.trigger("data",S)}},Ks.prototype=new da,Ks.STREAM_TYPES={h264:27,adts:15},zr=function(){var o=this,u=!1,h={data:[],size:0},c={data:[],size:0},p={data:[],size:0},g,S=function(A,w){var M;const z=A[0]<<16|A[1]<<8|A[2];w.data=new Uint8Array,z===1&&(w.packetLength=6+(A[4]<<8|A[5]),w.dataAlignmentIndicator=(A[6]&4)!==0,M=A[7],M&192&&(w.pts=(A[9]&14)<<27|(A[10]&255)<<20|(A[11]&254)<<12|(A[12]&255)<<5|(A[13]&254)>>>3,w.pts*=4,w.pts+=(A[13]&6)>>>1,w.dts=w.pts,M&64&&(w.dts=(A[14]&14)<<27|(A[15]&255)<<20|(A[16]&254)<<12|(A[17]&255)<<5|(A[18]&254)>>>3,w.dts*=4,w.dts+=(A[18]&6)>>>1)),w.data=A.subarray(9+A[8]))},x=function(A,w,M){var z=new Uint8Array(A.size),ae={type:w},Q=0,he=0,ve=!1,et;if(!(!A.data.length||A.size<9)){for(ae.trackId=A.data[0].pid,Q=0;Q<A.data.length;Q++)et=A.data[Q],z.set(et.data,he),he+=et.data.byteLength;S(z,ae),ve=w==="video"||ae.packetLength<=A.size,(M||ve)&&(A.size=0,A.data.length=0),ve&&o.trigger("data",ae)}};zr.prototype.init.call(this),this.push=function(A){({pat:function(){},pes:function(){var w,M;switch(A.streamType){case jt.H264_STREAM_TYPE:w=h,M="video";break;case jt.ADTS_STREAM_TYPE:w=c,M="audio";break;case jt.METADATA_STREAM_TYPE:w=p,M="timed-metadata";break;default:return}A.payloadUnitStartIndicator&&x(w,M,!0),w.data.push(A),w.size+=A.data.byteLength},pmt:function(){var w={type:"metadata",tracks:[]};g=A.programMapTable,g.video!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),u=!0,o.trigger("data",w)}})[A.type]()},this.reset=function(){h.size=0,h.data.length=0,c.size=0,c.data.length=0,this.trigger("reset")},this.flushStreams_=function(){x(h,"video"),x(c,"audio"),x(p,"timed-metadata")},this.flush=function(){if(!u&&g){var A={type:"metadata",tracks:[]};g.video!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.video,codec:"avc",type:"video"}),g.audio!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+g.audio,codec:"adts",type:"audio"}),o.trigger("data",A)}u=!1,this.flushStreams_(),this.trigger("done")}},zr.prototype=new da;var vl={PAT_PID:0,MP2T_PACKET_LENGTH:as,TransportPacketStream:Hr,TransportParseStream:Ks,ElementaryStream:zr,TimestampRolloverStream:Of,CaptionStream:ca.CaptionStream,Cea608Stream:ca.Cea608Stream,Cea708Stream:ca.Cea708Stream,MetadataStream:Lf};for(var fa in jt)jt.hasOwnProperty(fa)&&(vl[fa]=jt[fa]);var Rf=vl,Mf=t,Nf=Pe.ONE_SECOND_IN_TS,Wr,Tl=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Wr=function(o){var u,h=0;Wr.prototype.init.call(this),this.skipWarn_=function(c,p){this.trigger("log",{level:"warn",message:`adts ski
189ping bytes ${c} to ${p} in frame ${h} outside syncword`})},this.push=function(c){var p=0,g,S,x,A,w;if(o||(h=0),c.type==="audio"){u&&u.length?(x=u,u=new Uint8Array(x.byteLength+c.data.byteLength),u.set(x),u.set(c.data,x.byteLength)):u=c.data;for(var M;p+7<u.length;){if(u[p]!==255||(u[p+1]&246)!==240){typeof M!="number"&&(M=p),p++;continue}if(typeof M=="number"&&(this.skipWarn_(M,p),M=null),S=(~u[p+1]&1)*2,g=(u[p+3]&3)<<11|u[p+4]<<3|(u[p+5]&224)>>5,A=((u[p+6]&3)+1)*1024,w=A*Nf/Tl[(u[p+2]&60)>>>2],u.byteLength-p<g)break;this.trigger("data",{pts:c.pts+h*w,dts:c.dts+h*w,sampleCount:A,audioobjecttype:(u[p+2]>>>6&3)+1,channelcount:(u[p+2]&1)<<2|(u[p+3]&192)>>>6,samplerate:Tl[(u[p+2]&60)>>>2],samplingfrequencyindex:(u[p+2]&60)>>>2,samplesize:16,data:u.subarray(p+7+S,p+g)}),h++,p+=g}typeof M=="number"&&(this.skipWarn_(M,p),M=null),u=u.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}},Wr.prototype=new Mf;var Bf=Wr,bl;bl=function(o){var u=o.byteLength,h=0,c=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+c},this.loadWord=function(){var p=o.byteLength-u,g=new Uint8Array(4),S=Math.min(4,u);if(S===0)throw new Error("no bytes available");g.set(o.subarray(p,p+S)),h=new DataView(g.buffer).getUint32(0),c=S*8,u-=S},this.skipBits=function(p){var g;c>p?(h<<=p,c-=p):(p-=c,g=Math.floor(p/8),p-=g*8,u-=g,this.loadWord(),h<<=p,c-=p)},this.readBits=function(p){var g=Math.min(c,p),S=h>>>32-g;return c-=g,c>0?h<<=g:u>0&&this.loadWord(),g=p-g,g>0?S<<g|this.readBits(g):S},this.skipLeadingZeros=function(){var p;for(p=0;p<c;++p)if((h&2147483648>>>p)!==0)return h<<=p,c-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ff=bl,Sl=t,Uf=Ff,Gr,Xr,xl;Xr=function(){var o=0,u,h;Xr.prototype.init.call(this),this.push=function(c){var p;h?(p=new Uint8Array(h.byteLength+c.data.byteLength),p.set(h),p.set(c.data,h.byteLength),h=p):h=c.data;for(var g=h.byteLength;o<g-3;o++)if(h[o+2]===1){u=o+5;break}for(;u<g;)switch(h[u]){case 0:if(h[u-1]!==0){u+=2;break}else if(h[u-2]!==0){u++;break}o+3!==u-2&&this.trigger("data",h.subarray(o+3,u-2));do u++;while(h[u]!==1&&u<g);o=u-2,u+=3;break;case 1:if(h[u-1]!==0||h[u-2]!==0){u+=3;break}this.trigger("data",h.subarray(o+3,u-2)),o=u-2,u+=3;break;default:u+=3;break}h=h.subarray(o),u-=o,o=0},this.reset=function(){h=null,o=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(o+3)),h=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Xr.prototype=new Sl,xl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Gr=function(){var o=new Xr,u,h,c,p,g,S,x;Gr.prototype.init.call(this),u=this,this.push=function(A){A.type==="video"&&(h=A.trackId,c=A.pts,p=A.dts,o.push(A))},o.on("data",function(A){var w={trackId:h,pts:c,dts:p,data:A,nalUnitTypeCode:A[0]&3
vendor: 196,272 bytes, lines 189-204
1891};switch(w.nalUnitTypeCode){case 5:w.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:w.nalUnitType="sei_rbsp",w.escapedRBSP=g(A.subarray(1));break;case 7:w.nalUnitType="seq_parameter_set_rbsp",w.escapedRBSP=g(A.subarray(1)),w.config=S(w.escapedRBSP);break;case 8:w.nalUnitType="pic_parameter_set_rbsp";break;case 9:w.nalUnitType="access_unit_delimiter_rbsp";break}u.trigger("data",w)}),o.on("done",function(){u.trigger("done")}),o.on("partialdone",function(){u.trigger("partialdone")}),o.on("reset",function(){u.trigger("reset")}),o.on("endedtimeline",function(){u.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},x=function(A,w){var M=8,z=8,ae,Q;for(ae=0;ae<A;ae++)z!==0&&(Q=w.readExpGolomb(),z=(M+Q+256)%256),M=z===0?M:z},g=function(A){for(var w=A.byteLength,M=[],z=1,ae,Q;z<w-2;)A[z]===0&&A[z+1]===0&&A[z+2]===3?(M.push(z+2),z+=2):z++;if(M.length===0)return A;ae=w-M.length,Q=new Uint8Array(ae);var he=0;for(z=0;z<ae;he++,z++)he===M[0]&&(he++,M.shift()),Q[z]=A[he];return Q},S=function(A){var w=0,M=0,z=0,ae=0,Q,he,ve,et,Dt,Ai,ir,sr,rr,nr,on,Fe=[1,1],ar,$t;if(Q=new Uf(A),he=Q.readUnsignedByte(),et=Q.readUnsignedByte(),ve=Q.readUnsignedByte(),Q.skipUnsignedExpGolomb(),xl[he]&&(Dt=Q.readUnsignedExpGolomb(),Dt===3&&Q.skipBits(1),Q.skipUnsignedExpGolomb(),Q.skipUnsignedExpGolomb(),Q.skipBits(1),Q.readBoolean()))for(on=Dt!==3?8:12,$t=0;$t<on;$t++)Q.readBoolean()&&($t<6?x(16,Q):x(64,Q));if(Q.skipUnsignedExpGolomb(),Ai=Q.readUnsignedExpGolomb(),Ai===0)Q.readUnsignedExpGolomb();else if(Ai===1)for(Q.skipBits(1),Q.skipExpGolomb(),Q.skipExpGolomb(),ir=Q.readUnsignedExpGolomb(),$t=0;$t<ir;$t++)Q.skipExpGolomb();if(Q.skipUnsignedExpGolomb(),Q.skipBits(1),sr=Q.readUnsignedExpGolomb(),rr=Q.readUnsignedExpGolomb(),nr=Q.readBits(1),nr===0&&Q.skipBits(1),Q.skipBits(1),Q.readBoolean()&&(w=Q.readUnsignedExpGolomb(),M=Q.readUnsignedExpGolomb(),z=Q.readUnsignedExpGolomb(),ae=Q.readUnsignedExpGolomb()),Q.readBoolean()&&Q.readBoolean()){switch(ar=Q.readUnsignedByte(),ar){case 1:Fe=[1,1];break;case 2:Fe=[12,11];break;case 3:Fe=[10,11];break;case 4:Fe=[16,11];break;case 5:Fe=[40,33];break;case 6:Fe=[24,11];break;case 7:Fe=[20,11];break;case 8:Fe=[32,11];break;case 9:Fe=[80,33];break;case 10:Fe=[18,11];break;case 11:Fe=[15,11];break;case 12:Fe=[64,33];break;case 13:Fe=[160,99];break;case 14:Fe=[4,3];break;case 15:Fe=[3,2];break;case 16:Fe=[2,1];break;case 255:{Fe=[Q.readUnsignedByte()<<8|Q.readUnsignedByte(),Q.readUnsignedByte()<<8|Q.readUnsignedByte()];break}}Fe&&Fe[0]/Fe[1]}return{profileIdc:he,levelIdc:ve,profileCompatibility:et,width:(sr+1)*16-w*2-M*2,height:(2-nr)*(rr+1)*16-z*2-ae*2,sarRatio:Fe}}},Gr.prototype=new Sl;var jf={H264Stream:Gr},qf=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],El=function(o,u){var h=o[u+6]<<21|o[u+7]<<14|o[u+8]<<7|o[u+9],c=o[u+5],p=(c&16)>>4;return h=h>=0?h:0,p?h+20:h+10},Cl=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=El(o,u),Cl(o,u))},$f=function(o){var u=Cl(o,0);return o.length>=u+2&&(o[u]&255)===255&&(o[u+1]&240)===240&&(o[u+1]&22)===16},Al=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Vf=function(o,u,h){var c,p="";for(c=u;c<h;c++)p+="%"+("00"+o[c].toString(16)).slice(-2);return p},Hf=function(o,u,h){return unescape(Vf(o,u,h))},zf=function(o,u){var h=(o[u+5]&224)>>5,c=o[u+4]<<3,p=o[u+3]&6144;return p|c|h},Wf=function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":o[u]&!0&&(o[u+1]&240)===240?"audio":null},Gf=function(o){for(var u=0;u+5<o.length;){if(o[u]!==255||(o[u+1]&246)!==240){u++;continue}return qf[(o[u+2]&60)>>>2]}return null},Xf=function(o){var u,h,c,p;u=10,o[5]&64&&(u+=4,u+=Al(o.subarray(10,14)));do{if(h=Al(o.subarray(u+4,u+8)),h<1)return null;if(p=String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3]),p==="PRIV"){c=o.subarray(u+10,u+h+10);for(var g=0;g<c.byteLength;g++)if(c[g]===0){var S=Hf(c,0,g);if(S==="com.apple.streaming.transportStreamTimestamp"){var x=c.subarray(g+1),A=(x[3]&1)<<30|x[4]<<22|x[5]<<14|x[6]<<6|x[7]>>>2;return A*=4,A+=x[7]&3,A}break}}u+=10,u+=h}while(u<o.byteLength);return null},pa={isLikelyAacData:$f,parseId3TagSize:El,parseAdtsSize:zf,parseType:Wf,parseSampleRate:Gf,parseAacTimestamp:Xf},Kf=t,Dl=pa,Kr;Kr=function(){var o=new Uint8Array,u=0;Kr.prototype.init.call(this),this.setTimestamp=function(h){u=h},this.push=function(h){var c=0,p=0,g,S,x,A;for(o.length?(A=o.length,o=new Uint8Array(h.byteLength+A),o.set(o.subarray(0,A)),o.set(h,A)):o=h;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(c=Dl.parseId3TagSize(o,p),p+c>o.length))break;S={type:"timed-metadata",data:o.subarray(p,p+c)},this.trigger("data",S),p+=c;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(c=Dl.parseAdtsSize(o,p),p+c>o.length))break;x={type:"audio",data:o.subarray(p,p+c),pts:u,dts:u},this.trigger("data",x),p+=c;continue}p++}g=o.length-p,g>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},Kr.prototype=new Kf;var Yf=Kr,Qf=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Jf=Qf,Zf=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ep=Zf,Yr=t,Ys=Je,Qs=Mi,Qr=rs,qt=_,fi=Rf,Jr=Pe,wl=Bf,tp=jf.H264Stream,ip=Yf,sp=pa.isLikelyAacData,rp=Pe.ONE_SECOND_IN_TS,kl=Jf,Il=ep,Zr,Js,en,Fi,np=function(o,u){u.stream=o,this.trigger("log",u)},Pl=function(o,u){for(var h=Object.keys(u),c=0;c<h.length;c++){var p=h[c];p==="headOfPipeline"||!u[p].on||u[p].on("log",np.bind(o,p))}},Ll=function(o,u){var h;if(o.length!==u.length)return!1;for(h=0;h<o.length;h++)if(o[h]!==u[h])return!1;return!0},Ol=function(o,u,h,c,p,g){var S=h-u,x=c-u,A=p-h;return{start:{dts:o,pts:o+S},end:{dts:o+x,pts:o+A},prependedContentDuration:g,baseMediaDecodeTime:o}};Js=function(o,u){var h=[],c,p=0,g=0,S=1/0;u=u||{},c=u.firstSequenceNumber||0,Js.prototype.init.call(this),this.push=function(x){qt.collectDtsInfo(o,x),o&&kl.forEach(function(A){o[A]=x[A]}),h.push(x)},this.setEarliestDts=function(x){p=x},this.setVideoBaseMediaDecodeTime=function(x){S=x},this.setAudioAppendStart=function(x){g=x},this.flush=function(){var x,A,w,M,z,ae,Q;if(h.length===0){this.trigger("done","AudioSegmentStream");return}x=Qr.trimAdtsFramesByEarliestDts(h,o,p),o.baseMediaDecodeTime=qt.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),Q=Qr.prefixWithSilence(o,x,g,S),o.samples=Qr.generateSampleTable(x),w=Ys.mdat(Qr.concatenateFrameData(x)),h=[],A=Ys.moof(c,[o]),M=new Uint8Array(A.byteLength+w.byteLength),c++,M.set(A),M.set(w,A.byteLength),qt.clearDtsInfo(o),z=Math.ceil(rp*1024/o.samplerate),x.length&&(ae=x.length*z,this.trigger("segmentTimingInfo",Ol(Jr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),x[0].dts,x[0].pts,x[0].dts+ae,x[0].pts+ae,Q||0)),this.trigger("timingInfo",{start:x[0].pts,end:x[0].pts+ae})),this.trigger("data",{track:o,boxes:M}),this.trigger("done","AudioSegmentStream")},this.reset=function(){qt.clearDtsInfo(o),h=[],this.trigger("reset")}},Js.prototype=new Yr,Zr=function(o,u){var h,c=[],p=[],g,S;u=u||{},h=u.firstSequenceNumber||0,Zr.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(x){qt.collectDtsInfo(o,x),x.nalUnitType==="seq_parameter_set_rbsp"&&!g&&(g=x.config,o.sps=[x.data],Il.forEach(function(A){o[A]=g[A]},this)),x.nalUnitType==="pic_parameter_set_rbsp"&&!S&&(S=x.data,o.pps=[x.data]),c.push(x)},this.flush=function(){for(var x,A,w,M,z,ae,Q=0,he,ve;c.length&&c[0].nalUnitType!=="access_unit_delimiter_rbsp";)c.shift();if(c.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(x=Qs.groupNalsIntoFrames(c),w=Qs.groupFramesIntoGops(x),w[0][0].keyFrame||(A=this.getGopForFusion_(c[0],o),A?(Q=A.duration,w.unshift(A),w.byteLength+=A.byteLength,w.nalCount+=A.nalCount,w.pts=A.pts,w.dts=A.dts,w.duration+=A.duration):w=Qs.extendFirstKeyFrame(w)),p.length){var et;if(u.alignGopsAtEnd?et=this.alignGopsAtEnd_(w):et=this.alignGopsAtStart_(w),!et){this.gopCache_.unshift({gop:w.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),c=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}qt.clearDtsInfo(o),w=et}qt.collectDtsInfo(o,w),o.samples=Qs.generateSampleTable(w),z=Ys.mdat(Qs.concatenateNalData(w)),o.baseMediaDecodeTime=qt.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),this.trigger("processedGopsInfo",w.map(function(Dt){return{pts:Dt.pts,dts:Dt.dts,byteLength:Dt.byteLength}})),he=w[0],ve=w[w.length-1],this.trigger("segmentTimingInfo",Ol(o.baseMediaDecodeTime,he.dts,he.pts,ve.dts+ve.duration,ve.pts+ve.duration,Q)),this.trigger("timingInfo",{start:w[0].pts,end:w[w.length-1].pts+w[w.length-1].duration}),this.gopCache_.unshift({gop:w.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),c=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),M=Ys.moof(h,[o]),ae=new Uint8Array(M.byteLength+z.byteLength),h++,ae.set(M),ae.set(z,M.byteLength),this.trigger("data",{track:o,boxes:ae}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),c=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){qt.clearDtsInfo(o),g=void 0,S=void 0},this.getGopForFusion_=function(x){var A=45e3,w=1/0,M,z,ae,Q,he;for(he=0;he<this.gopCache_.length;he++)Q=this.gopCache_[he],ae=Q.gop,!(!(o.pps&&Ll(o.pps[0],Q.pps[0]))||!(o.sps&&Ll(o.sps[0],Q.sps[0])))&&(ae.dts<o.timelineStartInfo.dts||(M=x.dts-ae.dts-ae.duration,M>=-1e4&&M<=A&&(!z||w>M)&&(z=Q,w=M)));return z?z.gop:null},this.alignGopsAtStart_=function(x){var A,w,M,z,ae,Q,he,ve;for(ae=x.byteLength,Q=x.nalCount,he=x.duration,A=w=0;A<p.length&&w<x.length&&(M=p[A],z=x[w],M.pts!==z.pts);){if(z.pts>M.pts){A++;continue}w++,ae-=z.byteLength,Q-=z.nalCount,he-=z.duration}return w===0?x:w===x.length?null:(ve=x.slice(w),ve.byteLength=ae,ve.duration=he,ve.nalCount=Q,ve.pts=ve[0].pts,ve.dts=ve[0].dts,ve)},this.alignGopsAtEnd_=function(x){var A,w,M,z,ae,Q;for(A=p.length-1,w=x.length-1,ae=null,Q=!1;A>=0&&w>=0;){if(M=p[A],z=x[w],M.pts===z.pts){Q=!0;break}if(M.pts>z.pts){A--;continue}A===p.length-1&&(ae=w),w--}if(!Q&&ae===null)return null;var he;if(Q?he=w:he=ae,he===0)return x;var ve=x.slice(he),et=ve.reduce(function(Dt,Ai){return Dt.byteLength+=Ai.byteLength,Dt.duration+=Ai.duration,Dt.nalCount+=Ai.nalCount,Dt},{byteLength:0,duration:0,nalCount:0});return ve.byteLength=et.byteLength,ve.duration=et.duration,ve.nalCount=et.nalCount,ve.pts=ve[0].pts,ve.dts=ve[0].dts,ve},this.alignGopsWith=function(x){p=x}},Zr.prototype=new Yr,Fi=function(o,u){this.numberOfTracks=0,this.metadataStream=u,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Fi.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},Fi.prototype=new Yr,Fi.prototype.flush=function(o){var u=0,h={captions:[],captionStreams:{},metadata:[],info:{}},c,p,g,S=0,x;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(S=this.videoTrack.timelineStartInfo.pts,Il.forEach(function(A){h.info[A]=this.videoTrack[A]},this)):this.audioTrack&&(S=this.audioTrack.timelineStartInfo.pts,kl.forEach(function(A){h.info[A]=this.audioTrack[A]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Ys.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),x=0;x<this.pendingBoxes.length;x++)h.data.set(this.pendingBoxes[x],u),u+=this.pendingBoxes[x].byteLength;for(x=0;x<this.pendingCaptions.length;x++)c=this.pendingCaptions[x],c.startTime=Jr.metadataTsToSeconds(c.startPts,S,this.keepOriginalTimestamps),c.endTime=Jr.metadataTsToSeconds(c.endPts,S,this.keepOriginalTimestamps),h.captionStreams[c.stream]=!0,h.captions.push(c);for(x=0;x<this.pendingMetadata.length;x++)p=this.pendingMetadata[x],p.cueTime=Jr.metadataTsToSeconds(p.pts,S,this.keepOriginalTimestamps),h.metadata.push(p);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),x=0;x<h.captions.length;x++)c=h.captions[x],this.trigger("caption",c);for(x=0;x<h.metadata.length;x++)p=h.metadata[x],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Fi.prototype.setRemux=function(o){this.remuxTracks=o},en=function(o){var u=this,h=!0,c,p;en.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new fi.MetadataStream,g.aacStream=new ip,g.audioTimestampRolloverStream=new fi.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new fi.TimestampRolloverStream("timed-metadata"),g.adtsStream=new wl,g.coalesceStream=new Fi(o,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(S){g.aacStream.setTimestamp(S.timeStamp)}),g.aacStream.on("data",function(S){S.type!=="timed-metadata"&&S.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:u.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Js(p,o),g.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!c}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Pl(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new fi.MetadataStream,g.packetStream=new fi.TransportPacketStream,g.parseStream=new fi.TransportParseStream,g.elementaryStream=new fi.ElementaryStream,g.timestampRolloverStream=new fi.TimestampRolloverStream,g.adtsStream=new wl,g.h264Stream=new tp,g.captionStream=new fi.CaptionStream(o),g.coalesceStream=new Fi(o,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(S){var x;if(S.type==="metadata"){for(x=S.tracks.length;x--;)!c&&S.tracks[x].type==="video"?(c=S.tracks[x],c.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime):!p&&S.tracks[x].type==="audio"&&(p=S.tracks[x],p.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime);c&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Zr(c,o),g.videoSegmentStream.on("log",u.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(A){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=A,g.audioSegmentStream.setEarliestDts(A.dts-u.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",u.trigger.bind(u,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(A){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(A)}),g.videoSegmentStream.on("timingInfo",u.trigger.bind(u,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Js(p,o),g.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!c})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(S){S.dispatchType=g.metadataStream.dispatchType,u.trigger("id3Frame",S)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),Pl(this,g)},this.setBaseMediaDecodeTime=function(g){var S=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,qt.clearDtsInfo(p),S.audioTimestampRolloverStream&&S.audioTimestampRolloverStream.discontinuity()),c&&(S.videoSegmentStream&&(S.videoSegmentStream.gopCache_=[]),c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,qt.clearDtsInfo(c),S.captionStream.reset()),S.timestampRolloverStream&&S.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var S=this.transmuxPipeline_;o.remux=g,S&&S.coalesceStream&&S.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){c&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var S=this;return function(x){x.stream=g,S.trigger("log",x)}},this.push=function(g){if(h){var S=sp(g);S&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!S&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!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()}},en.prototype=new Yr;var ap={Transmuxer:en},op=function(o){return o>>>0},lp=function(o){return("00"+o.toString(16)).slice(-2)},tn={toUnsigned:op,toHexString:lp},up=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3]),u},Rl=up,dp=tn.toUnsigned,cp=Rl,Ml=function(o,u){var h=[],c,p,g,S,x;if(!u.length)return null;for(c=0;c<o.byteLength;)p=dp(o[c]<<24|o[c+1]<<16|o[c+2]<<8|o[c+3]),g=cp(o.subarray(c+4,c+8)),S=p>1?c+p:o.byteLength,g===u[0]&&(u.length===1?h.push(o.subarray(c+8,S)):(x=Ml(o.subarray(c+8,S),u.slice(1)),x.length&&(h=h.concat(x)))),c=S;return h},ga=Ml,hp=tn.toUnsigned,fp=n.getUint64,pp=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=fp(o.subarray(4)):u.baseMediaDecodeTime=hp(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},ma=pp,gp=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),h={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:u.getUint32(4)},c=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,S=h.flags[2]&16,x=h.flags[2]&32,A=h.flags[0]&65536,w=h.flags[0]&131072,M;return M=8,c&&(M+=4,h.baseDataOffset=u.getUint32(12),M+=4),p&&(h.sampleDescriptionIndex=u.getUint32(M),M+=4),g&&(h.defaultSampleDuration=u.getUint32(M),M+=4),S&&(h.defaultSampleSize=u.getUint32(M),M+=4),x&&(h.defaultSampleFlags=u.getUint32(M)),A&&(h.durationIsEmpty=!0),!c&&w&&(h.baseDataOffsetIsMoof=!0),h},Nl=gp,mp=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},yp=mp,Bl=yp,_p=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},h=new DataView(o.buffer,o.byteOffset,o.byteLength),c=u.flags[2]&1,p=u.flags[2]&4,g=u.flags[1]&1,S=u.flags[1]&2,x=u.flags[1]&4,A=u.flags[1]&8,w=h.getUint32(4),M=8,z;for(c&&(u.dataOffset=h.getInt32(M),M+=4),p&&w&&(z={flags:Bl(o.subarray(M,M+4))},M+=4,g&&(z.duration=h.getUint32(M),M+=4),S&&(z.size=h.getUint32(M),M+=4),A&&(u.version===1?z.compositionTimeOffset=h.getInt32(M):z.compositionTimeOffset=h.getUint32(M),M+=4),u.samples.push(z),w--);w--;)z={},g&&(z.duration=h.getUint32(M),M+=4),S&&(z.size=h.getUint32(M),M+=4),x&&(z.flags=Bl(o.subarray(M,M+4)),M+=4),A&&(u.version===1?z.compositionTimeOffset=h.getInt32(M):z.compositionTimeOffset=h.getUint32(M),M+=4),u.samples.push(z);return u},Fl=_p,Ul={tfdt:ma,trun:Fl},jl={parseTfdt:Ul.tfdt,parseTrun:Ul.trun},vp=function(o){for(var u=0,h=String.fromCharCode(o[u]),c="";h!=="\0";)c+=h,u++,h=String.fromCharCode(o[u]);return c+=h,c},Tp={uint8ToCString:vp},sn=Tp.uint8ToCString,bp=n.getUint64,Sp=function(o){var u=4,h=o[0],c,p,g,S,x,A,w,M;if(h===0){c=sn(o.subarray(u)),u+=c.length,p=sn(o.subarray(u)),u+=p.length;var z=new DataView(o.buffer);g=z.getUint32(u),u+=4,x=z.getUint32(u),u+=4,A=z.getUint32(u),u+=4,w=z.getUint32(u),u+=4}else if(h===1){var z=new DataView(o.buffer);g=z.getUint32(u),u+=4,S=bp(o.subarray(u)),u+=8,A=z.getUint32(u),u+=4,w=z.getUint32(u),u+=4,c=sn(o.subarray(u)),u+=c.length,p=sn(o.subarray(u)),u+=p.length}M=new Uint8Array(o.subarray(u,o.byteLength));var ae={scheme_id_uri:c,value:p,timescale:g||1,presentation_time:S,presentation_time_delta:x,event_duration:A,id:w,message_data:M};return Ep(h,ae)?ae:void 0},xp=function(o,u,h,c){return o||o===0?o/u:c+h/u},Ep=function(o,u){var h=u.scheme_id_uri!=="\0",c=o===0&&ql(u.presentation_time_delta)&&h,p=o===1&&ql(u.presentation_time)&&h;return!(o>1)&&c||p},ql=function(o){return o!==void 0||o!==null},Cp={parseEmsgBox:Sp,scaleTime:xp},Zs;typeof window<"u"?Zs=window:typeof s<"u"?Zs=s:typeof self<"u"?Zs=self:Zs={};var $l=Zs,rn=tn.toUnsigned,er=tn.toHexString,Xe=ga,os=Rl,ya=Cp,Ap=Nl,Dp=Fl,wp=ma,kp=n.getUint64,Vl,Hl,zl,Wl,Gl,_a,Xl,va=$l,Ip=_l.parseId3Frames;Vl=function(o){var u={},h=Xe(o,["moov","trak"]);return h.reduce(function(c,p){var g,S,x,A,w;return g=Xe(p,["tkhd"])[0],!g||(S=g[0],x=S===0?12:20,A=rn(g[x]<<24|g[x+1]<<16|g[x+2]<<8|g[x+3]),w=Xe(p,["mdia","mdhd"])[0],!w)?null:(S=w[0],x=S===0?12:20,c[A]=rn(w[x]<<24|w[x+1]<<16|w[x+2]<<8|w[x+3]),c)},u)},Hl=function(o,u){var h;h=Xe(u,["moof","traf"]);var c=h.reduce(function(p,g){var S=Xe(g,["tfhd"])[0],x=rn(S[4]<<24|S[5]<<16|S[6]<<8|S[7]),A=o[x]||9e4,w=Xe(g,["tfdt"])[0],M=new DataView(w.buffer,w.byteOffset,w.byteLength),z;w[0]===1?z=kp(w.subarray(4,12)):z=M.getUint32(4);let ae;return typeof z=="bigint"?ae=z/va.BigInt(A):typeof z=="number"&&!isNaN(z)&&(ae=z/A),ae<Number.MAX_SAFE_INTEGER&&(ae=Number(ae)),ae<p&&(p=ae),p},1/0);return typeof c=="bigint"||isFinite(c)?c:0},zl=function(o,u){var h=Xe(u,["moof","traf"]),c=0,p=0,g;if(h&&h.length){var S=Xe(h[0],["tfhd"])[0],x=Xe(h[0],["trun"])[0],A=Xe(h[0],["tfdt"])[0];if(S){var w=Ap(S);g=w.trackId}if(A){var M=wp(A);c=M.baseMediaDecodeTime}if(x){var z=Dp(x);z.samples&&z.samples.length&&(p=z.samples[0].compositionTimeOffset||0)}}var ae=o[g]||9e4;typeof c=="bigint"&&(p=va.BigInt(p),ae=va.BigInt(ae));var Q=(c+p)/ae;return typeof Q=="bigint"&&Q<Number.MAX_SAFE_INTEGER&&(Q=Number(Q)),Q},Wl=function(o){var u=Xe(o,["moov","trak"]),h=[];return u.forEach(function(c){var p=Xe(c,["mdia","hdlr"]),g=Xe(c,["tkhd"]);p.forEach(function(S,x){var A=os(S.subarray(8,12)),w=g[x],M,z,ae;A==="vide"&&(M=new DataView(w.buffer,w.byteOffset,w.byteLength),z=M.getUint8(0),ae=z===0?M.getUint32(12):M.getUint32(20),h.push(ae))})}),h},_a=function(o){var u=o[0],h=u===0?12:20;return rn(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3])},Gl=function(o){var u=Xe(o,["moov","trak"]),h=[];return u.forEach(function(c){var p={},g=Xe(c,["tkhd"])[0],S,x;g&&(S=new DataView(g.buffer,g.byteOffset,g.byteLength),x=S.getUint8(0),p.id=x===0?S.getUint32(12):S.getUint32(20));var A=Xe(c,["mdia","hdlr"])[0];if(A){var w=os(A.subarray(8,12));w==="vide"?p.type="video":w==="soun"?p.type="audio":p.type=w}var M=Xe(c,["mdia","minf","stbl","stsd"])[0];if(M){var z=M.subarray(8);p.codec=os(z.subarray(4,8));var ae=Xe(z,[p.codec])[0],Q,he;ae&&(/^[asm]vc[1-9]$/i.test(p.codec)?(Q=ae.subarray(78),he=os(Q.subarray(4,8)),he==="avcC"&&Q.length>11?(p.codec+=".",p.codec+=er(Q[9]),p.codec+=er(Q[10]),p.codec+=er(Q[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(Q=ae.subarray(28),he=os(Q.subarray(4,8)),he==="esds"&&Q.length>20&&Q[19]!==0?(p.codec+="."+er(Q[19]),p.codec+="."+er(Q[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var ve=Xe(c,["mdia","mdhd"])[0];ve&&(p.timescale=_a(ve)),h.push(p)}),h},Xl=function(o,u=0){var h=Xe(o,["emsg"]);return h.map(c=>{var p=ya.parseEmsgBox(new Uint8Array(c)),g=Ip(p.message_data);return{cueTime:ya.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,u),duration:ya.scaleTime(p.event_duration,p.timescale),frames:g}})};var tr={findBox:Xe,parseType:os,timescale:Vl,startTime:Hl,compositionStartTime:zl,videoTrackIds:Wl,tracks:Gl,getTimescaleFromMediaHeader:_a,getEmsgID3:Xl};const{parseTrun:Pp}=jl,{findBox:Kl}=tr;var Yl=$l,Lp=function(o){var u=Kl(o,["moof","traf"]),h=Kl(o,["mdat"]),c=[];return h.forEach(function(p,g){var S=u[g];c.push({mdat:p,traf:S})}),c},Op=function(o,u,h){var c=u,p=h.defaultSampleDuration||0,g=h.defaultSampleSize||0,S=h.trackId,x=[];return o.forEach(function(A){var w=Pp(A),M=w.samples;M.forEach(function(z){z.duration===void 0&&(z.duration=p),z.size===void 0&&(z.size=g),z.trackId=S,z.dts=c,z.compositionTimeOffset===void 0&&(z.compositionTimeOffset=0),typeof c=="bigint"?(z.pts=c+Yl.BigInt(z.compositionTimeOffset),c+=Yl.BigInt(z.duration)):(z.pts=c+z.compositionTimeOffset,c+=z.duration)}),x=x.concat(M)}),x},Ql={getMdatTrafPairs:Lp,parseSamples:Op},Rp=Oe.discardEmulationPreventionBytes,Mp=bi.CaptionStream,Ta=ga,Np=ma,Bp=Nl,{getMdatTrafPairs:Fp,parseSamples:Up}=Ql,jp=function(o,u){for(var h=o,c=0;c<u.length;c++){var p=u[c];if(h<p.size)return p;h-=p.size}return null},qp=function(o,u,h){var c=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},g,S,x,A;for(S=0;S+4<o.length;S+=x)if(x=c.getUint32(S),S+=4,!(x<=0))switch(o[S]&31){case 6:var w=o.subarray(S+1,S+1+x),M=jp(S,u);if(g={nalUnitType:"sei_rbsp",size:x,data:w,escapedRBSP:Rp(w),trackId:h},M)g.pts=M.pts,g.dts=M.dts,A=M;else if(A)g.pts=A.pts,g.dts=A.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+S+" for trackId "+h+". See mux.js#223."});break}p.seiNals.push(g);break}return p},$p=function(o,u){var h={},c=Fp(o);return c.forEach(function(p){var g=p.mdat,S=p.traf,x=Ta(S,["tfhd"]),A=Bp(x[0]),w=A.trackId,M=Ta(S,["tfdt"]),z=M.length>0?Np(M[0]).baseMediaDecodeTime:0,ae=Ta(S,["trun"]),Q,he;u===w&&ae.length>0&&(Q=Up(ae,z,A),he=qp(g,Q,w),h[w]||(h[w]={seiNals:[],logs:[]}),h[w].seiNals=h[w].seiNals.concat(he.seiNals),h[w].logs=h[w].logs.concat(he.logs))}),h},Vp=function(o,u,h){var c;if(u===null)return null;c=$p(o,u);var p=c[u]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Hp=function(){var o=!1,u,h,c,p,g,S;this.isInitialized=function(){return o},this.init=function(x){u=new Mp,o=!0,S=x?x.isPartial:!1,u.on("data",function(A){A.startTime=A.startPts/p,A.endTime=A.endPts/p,g.captions.push(A),g.captionStreams[A.stream]=!0}),u.on("log",function(A){g.logs.push(A)})},this.isNewInit=function(x,A){return x&&x.length===0||A&&typeof A=="object"&&Object.keys(A).length===0?!1:c!==x[0]||p!==A[c]},this.parse=function(x,A,w){var M;if(this.isInitialized()){if(!A||!w)return null;if(this.isNewInit(A,w))c=A[0],p=w[c];else if(c===null||!p)return h.push(x),null}else return null;for(;h.length>0;){var z=h.shift();this.parse(z,A,w)}return M=Vp(x,c,p),M&&M.logs&&(g.logs=g.logs.concat(M.logs)),M===null||!M.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(M.seiNals),this.flushStream(),g)},this.pushNals=function(x){if(!this.isInitialized()||!x||x.length===0)return null;x.forEach(function(A){u.push(A)})},this.flushStream=function(){if(!this.isInitialized())return null;S?u.partialFlush():u.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;u.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],c=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},zp=Hp;const{parseTfdt:Wp}=jl,Ci=ga,{getTimescaleFromMediaHeader:Gp}=tr,{parseSamples:Xp,getMdatTrafPairs:Kp}=Ql;var Jl=function(){let o=9e4;this.init=function(u){const h=Ci(u,["moov","trak","mdia","mdhd"])[0];h&&(o=Gp(h))},this.parseSegment=function(u){const h=[],c=Kp(u);let p=0;return c.forEach(function(g){const S=g.mdat,x=g.traf,A=Ci(x,["tfdt"])[0],w=Ci(x,["tfhd"])[0],M=Ci(x,["trun"]);if(A&&(p=Wp(A).baseMediaDecodeTime),M.length&&w){const z=Xp(M,p,w);let ae=0;z.forEach(function(Q){const he="utf-8",ve=new TextDecoder(he),et=S.slice(ae,ae+Q.size);if(Ci(et,["vtte"])[0]){ae+=Q.size;return}Ci(et,["vttc"]).forEach(function(ir){const sr=Ci(ir,["payl"])[0],rr=Ci(ir,["sttg"])[0],nr=Q.pts/o,on=(Q.pts+Q.duration)/o;let Fe,ar;if(sr)try{Fe=ve.decode(sr)}catch($t){console.error($t)}if(rr)try{ar=ve.decode(rr)}catch($t){console.error($t)}Q.duration&&Fe&&h.push({cueText:Fe,start:nr,end:on,settings:ar})}),ae+=Q.size})}}),h}},ba=Si,Zl=function(o){var u=o[1]&31;return u<<=8,u|=o[2],u},nn=function(o){return!!(o[1]&64)},an=function(o){var u=0;return(o[3]&48)>>>4>1&&(u+=o[4]+1),u},Yp=function(o,u){var h=Zl(o);return h===0?"pat":h===u?"pmt":u?"pes":null},Qp=function(o){var u=nn(o),h=4+an(o);return u&&(h+=o[h]+1),(o[h+10]&31)<<8|o[h+11]},Jp=function(o){var u={},h=nn(o),c=4+an(o);if(h&&(c+=o[c]+1),!!(o[c+5]&1)){var p,g,S;p=(o[c+1]&15)<<8|o[c+2],g=3+p-4,S=(o[c+10]&15)<<8|o[c+11];for(var x=12+S;x<g;){var A=c+x;u[(o[A+1]&31)<<8|o[A+2]]=o[A],x+=((o[A+3]&15)<<8|o[A+4])+5}return u}},Zp=function(o,u){var h=Zl(o),c=u[h];switch(c){case ba.H264_STREAM_TYPE:return"video";case ba.ADTS_STREAM_TYPE:return"audio";case ba.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},eg=function(o){var u=nn(o);if(!u)return null;var h=4+an(o);if(h>=o.byteLength)return null;var c=null,p;return p=o[h+7],p&192&&(c={},c.pts=(o[h+9]&14)<<27|(o[h+10]&255)<<20|(o[h+11]&254)<<12|(o[h+12]&255)<<5|(o[h+13]&254)>>>3,c.pts*=4,c.pts+=(o[h+13]&6)>>>1,c.dts=c.pts,p&64&&(c.dts=(o[h+14]&14)<<27|(o[h+15]&255)<<20|(o[h+16]&254)<<12|(o[h+17]&255)<<5|(o[h+18]&254)>>>3,c.dts*=4,c.dts+=(o[h+18]&6)>>>1)),c},Sa=function(o){switch(o){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}},tg=function(o){for(var u=4+an(o),h=o.subarray(u),c=0,p=0,g=!1,S;p<h.byteLength-3;p++)if(h[p+2]===1){c=p+5;break}for(;c<h.byteLength;)switch(h[c]){case 0:if(h[c-1]!==0){c+=2;break}else if(h[c-2]!==0){c++;break}p+3!==c-2&&(S=Sa(h[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0));do c++;while(h[c]!==1&&c<h.length);p=c-2,c+=3;break;case 1:if(h[c-1]!==0||h[c-2]!==0){c+=3;break}S=Sa(h[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0),p=c-2,c+=3;break;default:c+=3;break}return h=h.subarray(p),c-=p,p=0,h&&h.byteLength>3&&(S=Sa(h[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},ig={parseType:Yp,parsePat:Qp,parsePmt:Jp,parsePayloadUnitStartIndicator:nn,parsePesType:Zp,parsePesTime:eg,videoPacketContainsKeyFrame:tg},eu=Si,ls=ml.handleRollover,Ie={};Ie.ts=ig,Ie.aac=pa;var Ui=Pe.ONE_SECOND_IN_TS,dt=188,Yt=71,sg=function(o,u){for(var h=0,c=dt,p,g;c<o.byteLength;){if(o[h]===Yt&&o[c]===Yt){switch(p=o.subarray(h,c),g=Ie.ts.parseType(p,u.pid),g){case"pat":u.pid=Ie.ts.parsePat(p);break;case"pmt":var S=Ie.ts.parsePmt(p);u.table=u.table||{},Object.keys(S).forEach(function(x){u.table[x]=S[x]});break}h+=dt,c+=dt;continue}h++,c++}},tu=function(o,u,h){for(var c=0,p=dt,g,S,x,A,w,M=!1;p<=o.byteLength;){if(o[c]===Yt&&(o[p]===Yt||p===o.byteLength)){if(g=o.subarray(c,p),S=Ie.ts.parseType(g,u.pid),S==="pes"&&(x=Ie.ts.parsePesType(g,u.table),A=Ie.ts.parsePayloadUnitStartIndicator(g),x==="audio"&&A&&(w=Ie.ts.parsePesTime(g),w&&(w.type="audio",h.audio.push(w),M=!0))),M)break;c+=dt,p+=dt;continue}c++,p++}for(p=o.byteLength,c=p-dt,M=!1;c>=0;){if(o[c]===Yt&&(o[p]===Yt||p===o.byteLength)){if(g=o.subarray(c,p),S=Ie.ts.parseType(g,u.pid),S==="pes"&&(x=Ie.ts.parsePesType(g,u.table),A=Ie.ts.parsePayloadUnitStartIndicator(g),x==="audio"&&A&&(w=Ie.ts.parsePesTime(g),w&&(w.type="audio",h.audio.push(w),M=!0))),M)break;c-=dt,p-=dt;continue}c--,p--}},rg=function(o,u,h){for(var c=0,p=dt,g,S,x,A,w,M,z,ae,Q=!1,he={data:[],size:0};p<o.byteLength;){if(o[c]===Yt&&o[p]===Yt){switch(g=o.subarray(c,p),S=Ie.ts.parseType(g,u.pid),S){case"pes":if(x=Ie.ts.parsePesType(g,u.table),A=Ie.ts.parsePayloadUnitStartIndicator(g),x==="video"&&(A&&!Q&&(w=Ie.ts.parsePesTime(g),w&&(w.type="video",h.video.push(w),Q=!0)),!h.firstKeyFrame)){if(A&&he.size!==0){for(M=new Uint8Array(he.size),z=0;he.data.length;)ae=he.data.shift(),M.set(ae,z),z+=ae.byteLength;if(Ie.ts.videoPacketContainsKeyFrame(M)){var ve=Ie.ts.parsePesTime(M);ve?(h.firstKeyFrame=ve,h.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}he.size=0}he.data.push(g),he.size+=g.byteLength}break}if(Q&&h.firstKeyFrame)break;c+=dt,p+=dt;continue}c++,p++}for(p=o.byteLength,c=p-dt,Q=!1;c>=0;){if(o[c]===Yt&&o[p]===Yt){if(g=o.subarray(c,p),S=Ie.ts.parseType(g,u.pid),S==="pes"&&(x=Ie.ts.parsePesType(g,u.table),A=Ie.ts.parsePayloadUnitStartIndicator(g),x==="video"&&A&&(w=Ie.ts.parsePesTime(g),w&&(w.type="video",h.video.push(w),Q=!0))),Q)break;c-=dt,p-=dt;continue}c--,p--}},ng=function(o,u){if(o.audio&&o.audio.length){var h=u;(typeof h>"u"||isNaN(h))&&(h=o.audio[0].dts),o.audio.forEach(function(g){g.dts=ls(g.dts,h),g.pts=ls(g.pts,h),g.dtsTime=g.dts/Ui,g.ptsTime=g.pts/Ui})}if(o.video&&o.video.length){var c=u;if((typeof c>"u"||isNaN(c))&&(c=o.video[0].dts),o.video.forEach(function(g){g.dts=ls(g.dts,c),g.pts=ls(g.pts,c),g.dtsTime=g.dts/Ui,g.ptsTime=g.pts/Ui}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=ls(p.dts,c),p.pts=ls(p.pts,c),p.dtsTime=p.dts/Ui,p.ptsTime=p.pts/Ui}}},ag=function(o){for(var u=!1,h=0,c=null,p=null,g=0,S=0,x;o.length-S>=3;){var A=Ie.aac.parseType(o,S);switch(A){case"timed-metadata":if(o.length-S<10){u=!0;break}if(g=Ie.aac.parseId3TagSize(o,S),g>o.length){u=!0;break}p===null&&(x=o.subarray(S,S+g),p=Ie.aac.parseAacTimestamp(x)),S+=g;break;case"audio":if(o.length-S<7){u=!0;break}if(g=Ie.aac.parseAdtsSize(o,S),g>o.length){u=!0;break}c===null&&(x=o.subarray(S,S+g),c=Ie.aac.parseSampleRate(x)),h++,S+=g;break;default:S++;break}if(u)return null}if(c===null||p===null)return null;var w=Ui/c,M={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*w,pts:p+h*1024*w}]};return M},og=function(o){var u={pid:null,table:null},h={};sg(o,u);for(var c in u.table)if(u.table.hasOwnProperty(c)){var p=u.table[c];switch(p){case eu.H264_STREAM_TYPE:h.video=[],rg(o,u,h),h.video.length===0&&delete h.video;break;case eu.ADTS_STREAM_TYPE:h.audio=[],tu(o,u,h),h.audio.length===0&&delete h.audio;break}}return h},lg=function(o,u){var h=Ie.aac.isLikelyAacData(o),c;return h?c=ag(o):c=og(o),!c||!c.audio&&!c.video?null:(ng(c,u),c)},ug={inspect:lg,parseAudioPes_:tu};const dg=function(o,u){u.on("data",function(h){const c=h.initSegment;h.initSegment={data:c.buffer,byteOffset:c.byteOffset,byteLength:c.byteLength};const p=h.data;h.data=p.buffer,o.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),u.on("done",function(h){o.postMessage({action:"done"})}),u.on("gopInfo",function(h){o.postMessage({action:"gopInfo",gopInfo:h})}),u.on("videoSegmentTimingInfo",function(h){const c={start:{decode:Pe.videoTsToSeconds(h.start.dts),presentation:Pe.videoTsToSeconds(h.start.pts)},end:{decode:Pe.videoTsToSeconds(h.end.dts),presentation:Pe.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Pe.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(c.prependedContentDuration=Pe.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:c})}),u.on("audioSegmentTimingInfo",function(h){const c={start:{decode:Pe.videoTsToSeconds(h.start.dts),presentation:Pe.videoTsToSeconds(h.start.pts)},end:{decode:Pe.videoTsToSeconds(h.end.dts),presentation:Pe.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:Pe.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(c.prependedContentDuration=Pe.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:c})}),u.on("id3Frame",function(h){o.postMessage({action:"id3Frame",id3Frame:h})}),u.on("caption",function(h){o.postMessage({action:"caption",caption:h})}),u.on("trackinfo",function(h){o.postMessage({action:"trackinfo",trackInfo:h})}),u.on("audioTimingInfo",function(h){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Pe.videoTsToSeconds(h.start),end:Pe.videoTsToSeconds(h.end)}})}),u.on("videoTimingInfo",function(h){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Pe.videoTsToSeconds(h.start),end:Pe.videoTsToSeconds(h.end)}})}),u.on("log",function(h){o.postMessage({action:"log",log:h})})};class iu{constructor(u,h){this.options=h||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ap.Transmuxer(this.options),dg(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new zp,this.captionParser.init());const h=new Uint8Array(u.data,u.byteOffset,u.byteLength),c=this.captionParser.parse(h,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:c&&c.captions||[],logs:c&&c.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(u){this.webVttParser||(this.webVttParser=new Jl);const h=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.webVttParser.init(h)}getMp4WebVttText(u){this.webVttParser||(this.webVttParser=new Jl);const h=new Uint8Array(u.data,u.byteOffset,u.byteLength),c=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:c||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:u,data:h}){const c=tr.startTime(u,h);this.self.postMessage({action:"probeMp4StartTime",startTime:c,data:h},[h.buffer])}probeMp4Tracks({data:u}){const h=tr.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:u},[u.buffer])}probeEmsgID3({data:u,offset:h}){const c=tr.getEmsgID3(u,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:c,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:h}){const c=typeof h=="number"&&!isNaN(h)?h*Pe.ONE_SECOND_IN_TS:void 0,p=ug.inspect(u,c);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){const h=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(u){const h=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Pe.secondsToVideoTs(h)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(Pe.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new iu(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new iu(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var j_=Wh(U_);const q_=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:d,videoFramePtsTime:f}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});const m=s.data.segment.boxes||{data:s.data.segment.data},y={type:i,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof d<"u"&&(y.videoFrameDtsTime=d),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},$_=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},V_=(s,e)=>{e.gopInfo=s.data.gopInfo},Kh=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:d,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:k,onCaptions:E,onDone:O,onEndedTimeline:v,onTransmuxerLog:P,isEndOfTimeline:B,segment:N,triggerSegmentEventFn:L}=s,V={buffer:[]};let j=B;const q=H=>{e.currentTransmux===s&&(H.data.action==="data"&&q_(H,V,a),H.data.action==="trackinfo"&&l(H.data.trackInfo),H.data.action==="gopInfo"&&V_(H,V),H.data.action==="audioTimingInfo"&&d(H.data.audioTimingInfo),H.data.action==="videoTimingInfo"&&f(H.data.videoTimingInfo),H.data.action==="videoSegmentTimingInfo"&&m(H.data.videoSegmentTimingInfo),H.data.action==="audioSegmentTimingInfo"&&y(H.data.audioSegmentTimingInfo),H.data.action==="id3Frame"&&k([H.data.id3Frame],H.data.id3Frame.dispatchType),H.data.action==="caption"&&E(H.data.caption),H.data.action==="endedtimeline"&&(j=!1,v()),H.data.action==="log"&&P(H.data.log),H.data.type==="transmuxed"&&(j||(e.onmessage=null,$_({transmuxedData:V,callback:O}),Yh(e))))},R=()=>{const H={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:Vi({segment:N})}};O(null,H)};if(e.onmessage=q,e.onerror=R,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const H=t instanceof ArrayBuffer?t:t.buffer,T=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:H,byteOffset:T,byteLength:t.byteLength},[H])}B&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Yh=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():Kh(s.currentTransmux))},yd=(s,e)=>{s.postMessage({action:e}),Yh(s)},Qh=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,yd(e,s);return}e.transmuxQueue.push(yd.bind(null,e,s))},H_=s=>{Qh("reset",s)},z_=s=>{Qh("endTimeline",s)},Jh=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,Kh(s);return}s.transmuxer.transmuxQueue.push(s)},W_=s=>{const e=new j_;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e};var to={reset:H_,endTimeline:z_,transmux:Jh,createTransmuxer:W_};const bs=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=Ke({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const l=[a?s.data:s.data.buffer];e.postMessage(r,l)}else e.postMessage(r)},ri={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Zh="wvtt",Ao=s=>{s.forEach(e=>{e.abort()})},G_=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),X_=s=>{const e=s.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=s.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},pl=(s,e)=>{const{requestType:t}=e,i=Yi({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:ri.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:ri.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:ri.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:ri.FAILURE,xhr:e,metadata:i}:null},_d=(s,e,t,i)=>(r,n)=>{const a=n.response,l=pl(r,n);if(l)return t(l,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:ri.FAILURE,xhr:n},s);const d=new DataView(a),f=new Uint32Array([d.getUint32(0),d.getUint32(4),d.getUint32(8),d.getUint32(12)]);for(let y=0;y<e.length;y++)e[y].bytes=f;const m={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:m}),t(null,s)},K_=(s,e)=>{e===Zh&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},Y_=(s,e,t)=>{e===Zh&&bs({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},ef=(s,e)=>{const t=Bo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:ri.FAILURE,metadata:{mediaType:r}})}bs({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&K_(s,n.codec))}),e(null))})},Q_=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=pl(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,ef(s,function(l){if(l)return l.xhr=r,l.status=r.status,e(l,s);e(null,s)})},J_=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=pl(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const l=t==="arraybuffer"||!n.responseText?n.response:B_(n.responseText.substring(s.lastReachedChar||0));return s.stats=G_(n),s.key?s.encryptedBytes=new Uint8Array(l):s.bytes=new Uint8Array(l),e(null,s)},Z_=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{const O=s.map&&s.map.tracks||{},v=!!(O.audio&&O.video);let P=i.bind(null,s,"audio","start");const B=i.bind(null,s,"audio","end");let N=i.bind(null,s,"video","start");const L=i.bind(null,s,"video","end"),V=()=>Jh({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:v,onData:j=>{j.type=j.type==="combined"?"video":j.type,m(s,j)},onTrackInfo:j=>{t&&(v&&(j.isMuxed=!0),t(s,j))},onAudioTimingInfo:j=>{P&&typeof j.start<"u"&&(P(j.start),P=null),B&&typeof j.end<"u"&&B(j.end)},onVideoTimingInfo:j=>{N&&typeof j.start<"u"&&(N(j.start),N=null),L&&typeof j.end<"u"&&L(j.end)},onVideoSegmentTimingInfo:j=>{const q={pts:{start:j.start.presentation,end:j.end.presentation},dts:{start:j.start.decode,end:j.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:q}),r(j)},onAudioSegmentTimingInfo:j=>{const q={pts:{start:j.start.pts,end:j.end.pts},dts:{start:j.start.dts,end:j.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:q}),n(j)},onId3:(j,q)=>{a(s,j,q)},onCaptions:j=>{l(s,[j])},isEndOfTimeline:d,onEndedTimeline:()=>{f()},onTransmuxerLog:k,onDone:(j,q)=>{y&&(j.type=j.type==="combined"?"video":j.type,E({type:"segmenttransmuxingcomplete",segment:s}),y(q,s,j))},segment:s,triggerSegmentEventFn:E});bs({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:j=>{s.bytes=e=j.data;const q=j.result;q&&(t(s,{hasAudio:q.hasAudio,hasVideo:q.hasVideo,isMuxed:v}),t=null),V()}})},tf=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{let O=new Uint8Array(e);if(T0(O)){s.isFmp4=!0;const{tracks:v}=s.map;if(v.text&&(!v.audio||!v.video)){m(s,{data:O,type:"text"}),Y_(s,v.text.codec,y);return}const B={isFmp4:!0,hasVideo:!!v.video,hasAudio:!!v.audio};v.audio&&v.audio.codec&&v.audio.codec!=="enca"&&(B.audioCodec=v.audio.codec),v.video&&v.video.codec&&v.video.codec!=="encv"&&(B.videoCodec=v.video.codec),v.video&&v.audio&&(B.isMuxed=!0),t(s,B);const N=(L,V)=>{m(s,{data:O,type:B.hasAudio&&!B.isMuxed?"audio":"video"}),V&&V.length&&a(s,V),L&&L.length&&l(s,L),y(null,s,{})};bs({action:"probeMp4StartTime",timescales:s.map.timescales,data:O,transmuxer:s.transmuxer,callback:({data:L,startTime:V})=>{e=L.buffer,s.bytes=O=L,B.hasAudio&&!B.isMuxed&&i(s,"audio","start",V),B.hasVideo&&i(s,"video","start",V),bs({action:"probeEmsgID3",data:O,transmuxer:s.transmuxer,offset:V,callback:({emsgData:j,id3Frames:q})=>{if(e=j.buffer,s.bytes=O=j,!v.video||!j.byteLength||!s.transmuxer){N(void 0,q);return}bs({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:O,timescales:s.map.timescales,trackIds:[v.video.id],callback:R=>{e=R.data.buffer,s.bytes=O=R.data,R.logs.forEach(function(H){k(ke(H,{stream:"mp4CaptionParser"}))}),N(R.captions,q)}})}})}});return}if(!s.transmuxer){y(null,s,{});return}if(typeof s.container>"u"&&(s.container=Bo(O)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),y(null,s,{});return}Z_({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})},sf=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const l=f=>{if(f.data.source===s){i.removeEventListener("message",l);const m=f.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};i.onerror=()=>{const f="An error occurred in the decryption worker",m=Vi({segment:r}),y={message:f,metadata:{error:new Error(f),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},i.addEventListener("message",l);let d;e.bytes.slice?d=e.bytes.slice():d=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(jh({source:s,encrypted:t,key:d,iv:e.iv}),[t.buffer,d.buffer])},ev=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),sf({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},O=>{e.bytes=O,E({type:"segmentdecryptioncomplete",segment:e}),tf({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})})},tv=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})=>{let O=0,v=!1;return(P,B)=>{if(!v){if(P)return v=!0,Ao(s),y(P,B);if(O+=1,O===s.length){const N=function(){if(B.encryptedBytes)return ev({decryptionWorker:e,segment:B,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E});tf({segment:B,bytes:B.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:k,triggerSegmentEventFn:E})};if(B.endOfAllRequests=Date.now(),B.map&&B.map.encryptedBytes&&!B.map.bytes)return E({type:"segmentdecryptionstart",segment:B}),sf({decryptionWorker:e,id:B.requestId+"-init",encryptedBytes:B.map.encryptedBytes,key:B.map.key,segment:B,doneFn:y},L=>{B.map.bytes=L,E({type:"segmentdecryptioncomplete",segment:B}),ef(B,V=>{if(V)return Ao(s),y(V,B);N()})});N()}}}},iv=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},sv=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:d,endedTimelineFn:f,dataFn:m})=>y=>{if(!y.target.aborted)return s.stats=ke(s.stats,X_(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},rv=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:O,doneFn:v,onTransmuxerLog:P,triggerSegmentEventFn:B})=>{const N=[],L=tv({activeXhrs:N,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:O,doneFn:v,onTransmuxerLog:P,triggerSegmentEventFn:B});if(i.key&&!i.key.bytes){const H=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&H.push(i.map.key);const T=ke(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=_d(i,H,L,B),U={uri:i.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:U});const K=s(T,C);N.push(K)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const K=ke(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),$=_d(i,[i.map.key],L,B),W={uri:i.map.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:W});const ee=s(K,$);N.push(ee)}const T=ke(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Eo(i.map),requestType:"segment-media-initialization"}),C=Q_({segment:i,finishProcessingFn:L,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const U=s(T,C);N.push(U)}const V=ke(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Eo(i),requestType:"segment"}),j=J_({segment:i,finishProcessingFn:L,responseType:V.responseType,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const q=s(V,j);q.addEventListener("progress",sv({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:d,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:k,endedTimelineFn:E,dataFn:O})),N.push(q);const R={};return N.forEach(H=>{H.addEventListener("loadend",iv({loadendState:R,abortFn:r}))}),()=>Ao(N)},fn=Bt("PlaylistSelector"),vd=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},Ss=function(s,e){if(!s)return"";const t=D.getComputedStyle(s);return t?t[e]:""},xs=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},gl=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||D.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||D.Number.MAX_VALUE,t-i},nv=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||D.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||D.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let rf=function(s){const{main:e,bandwidth:t,playerWidth:i,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:l}=s;if(!e)return;const d={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;Tt.isAudioOnly(e)&&(f=l.getAudioTrackPlaylists_(),d.audioOnly=!0);let m=f.map(R=>{let H;const T=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,C=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return H=R.attributes&&R.attributes.BANDWIDTH,H=H||D.Number.MAX_VALUE,{bandwidth:H,width:T,height:C,playlist:R}});xs(m,(R,H)=>R.bandwidth-H.bandwidth),m=m.filter(R=>!Tt.isIncompatible(R.playlist));let y=m.filter(R=>Tt.isEnabled(R.playlist));y.length||(y=m.filter(R=>!Tt.isDisabled(R.playlist)));const k=y.filter(R=>R.bandwidth*tt.BANDWIDTH_VARIANCE<t);let E=k[k.length-1];const O=k.filter(R=>R.bandwidth===E.bandwidth)[0];if(a===!1){const R=O||y[0]||m[0];if(R&&R.playlist){let H="sortedPlaylistReps";return O&&(H="bandwidthBestRep"),y[0]&&(H="enabledPlaylistReps"),fn(`choosing ${vd(R)} using ${H} with options`,d),R.playlist}return fn("could not choose a playlist with options",d),null}const v=k.filter(R=>R.width&&R.height);xs(v,(R,H)=>R.width-H.width);const P=v.filter(R=>R.width===i&&R.height===r);E=P[P.length-1];const B=P.filter(R=>R.bandwidth===E.bandwidth)[0];let N,L,V;B||(N=v.filter(R=>n==="cover"?R.width>i&&R.height>r:R.width>i||R.height>r),L=N.filter(R=>R.width===N[0].width&&R.height===N[0].height),E=L[L.length-1],V=L.filter(R=>R.bandwidth===E.bandwidth)[0]);let j;if(l.leastPixelDiffSelector){const R=v.map(H=>(H.pixelDiff=Math.abs(H.width-i)+Math.abs(H.height-r),H));xs(R,(H,T)=>H.pixelDiff===T.pixelDiff?T.bandwidth-H.bandwidth:H.pixelDiff-T.pixelDiff),j=R[0]}const q=j||V||B||O||y[0]||m[0];if(q&&q.playlist){let R="sortedPlaylistReps";return j?R="leastPixelDiffRep":V?R="resolutionPlusOneRep":B?R="resolutionBestRep":O?R="bandwidthBestRep":y[0]&&(R="enabledPlaylistReps"),fn(`choosing ${vd(q)} using ${R} with options`,d),q.playlist}return fn("could not choose a playlist with options",d),null};const Td=function(){let s=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),rf({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Ss(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(Ss(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?Ss(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},av=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&D.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),rf({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(Ss(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(Ss(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?Ss(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},ov=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:d}=s,f=e.playlists.filter(O=>!Tt.isIncompatible(O));let m=f.filter(Tt.isEnabled);m.length||(m=f.filter(O=>!Tt.isDisabled(O)));const k=m.filter(Tt.hasAttribute.bind(null,"BANDWIDTH")).map(O=>{const P=d.getSyncPoint(O,r,l,t)?1:2,N=Tt.estimateSegmentRequestTime(n,i,O)*P-a;return{playlist:O,rebufferingImpact:N}}),E=k.filter(O=>O.rebufferingImpact<=0);return xs(E,(O,v)=>gl(v.playlist,O.playlist)),E.length?E[0]:(xs(k,(O,v)=>O.rebufferingImpact-v.rebufferingImpact),k[0]||null)},lv=function(){const s=this.playlists.main.playlists.filter(Tt.isEnabled);return xs(s,(t,i)=>gl(t,i)),s.filter(t=>!!br(this.playlists.main,t).video)[0]||null},uv=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function nf(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const dv=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,l=t,d=!1;const f=n[i];f&&(a=f.label,l=f.language,d=f.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:d,label:a,language:l},!1).track}}},cv=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=D.WebKitDataCue||D.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const l=new i(r.startTime+t,r.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",s[n].addCue(l)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},hv=function(s){Object.defineProperties(s.frame,{id:{get(){return F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},fv=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=D.WebKitDataCue||D.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||D.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(k=>{const E=new r(y,y,k.value||k.url||k.data||"");E.frame=k,E.value=k,hv(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,l=[];for(let m=0;m<a.length;m++)a[m]&&l.push(a[m]);const d=l.reduce((m,y)=>{const k=m[y.startTime]||[];return k.push(y),m[y.startTime]=k,m},{}),f=Object.keys(d).sort((m,y)=>Number(m)-Number(y));f.forEach((m,y)=>{const k=d[m],E=isFinite(i)?i:m,O=Number(f[y+1])||E;k.forEach(v=>{v.endTime=O})})},pv={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},gv=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),mv=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=D.WebKitDataCue||D.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(gv.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:pv[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},bd=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},gr=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},yv=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},_v=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Hi.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},vv=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(r;r<s.length&&!(s[r].pts>=i);r++);return s.slice(0,r).concat(e)},Tv=(s,e,t,i)=>{const r=Math.ceil((e-i)*Hi.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Hi.ONE_SECOND_IN_TS),a=s.slice();let l=s.length;for(;l--&&!(s[l].pts<=n););if(l===-1)return a;let d=l+1;for(;d--&&!(s[d].pts<=r););return d=Math.max(d,0),a.splice(d,l-d+1),a},bv=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==i[r]||s[n]!==e[n])return!1}return!0},Sv=function(s,e,t){e=e||[];const i=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(i.push(n),r+=a.duration,r>t))return n}return i.length===0?0:i[i.length-1]},hr=1,xv=500,Sd=s=>typeof s=="number"&&isFinite(s),pn=1/60,Ev=(s,e,t)=>s!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.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.":!e.hasVideo&&t.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,Cv=(s,e,t)=>{let i=e-tt.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},cs=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:d,partIndex:f,timeline:m}=s,y=l.length-1;let k="mediaIndex/partIndex increment";s.getMediaInfoForTime?k=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(k="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(k+=` with independent ${s.independent}`);const E=typeof f=="number",O=s.segment.uri?"segment":"pre-segment",v=E?Sh({preloadSegment:i})-1:0;return`${O} [${n+d}/${n+y}]`+(E?` part [${f}/${v}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${k}] playlist [${a}]`},xd=s=>`${s}TimingInfo`,Av=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>!r&&s===e?null:s<e?t:i.length?i.end(i.length-1):t,Do=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:r})=>{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},Dv=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&r)},wv=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},ki=s=>{const e=s.pendingSegment_;if(!e)return;if(Do({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&Dv(s.timelineChangeController_)){if(wv(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},kv=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=D.BigInt(n)-D.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},Ed=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+ii:!1,Iv=(s,e)=>{if(e!=="hls")return null;const t=kv({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=Ed({segmentDuration:t,maxDuration:i*2}),n=Ed({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},Vi=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};class wo extends F.EventTarget{constructor(e,t={}){if(super(),!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");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Bt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ki(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(Ke({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ki(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(Ke({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():ki(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ki(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return st();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Nn(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=qh(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){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")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: 190currentTime: ${this.currentTime_()} 191bufferedEnd: ${Za(this.buffered_())} 192`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){const d=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=d}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&i()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=Tv(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const l in this.inbandTextTracks_)gr(e,t,this.inbandTextTracks_[l]);gr(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),xv)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Vi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Za(e)||0,i=dl(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=Sv(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){const k=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=k.end?k.end:t,k.parts&&k.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let k,E,O;const v=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 193For TargetTime: ${v}. 194CurrentTime: ${this.currentTime_()} 195BufferedEnd: ${t} 196Fetch At Buffer: ${this.fetchAtBuffer_} 197`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const P=this.getSyncInfoFromMediaSequenceSync_(v);if(!P){const B="No sync info found while using media sequence sync";return this.error({message:B,metadata:{errorType:F.Error.StreamingFailedToSelectNextSegment,error:new Error(B)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${P.start} --> ${P.end})`),k=P.segmentIndex,E=P.partIndex,O=P.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const P=Tt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:v,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});k=P.segmentIndex,E=P.partIndex,O=P.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${v}`:`currentTime ${v}`,l.mediaIndex=k,l.startOfSegment=O,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}const d=a[l.mediaIndex];let f=d&&typeof l.partIndex=="number"&&d.parts&&d.parts[l.partIndex];if(!d||typeof l.partIndex=="number"&&!f)return null;typeof l.partIndex!="number"&&d.parts&&(l.partIndex=0,f=d.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&f&&!m&&!f.independent)if(l.partIndex===0){const k=a[l.mediaIndex-1],E=k.parts&&k.parts.length&&k.parts[k.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=k.parts.length-1,l.independent="previous segment")}else d.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:d,getMediaInfoForTime:f}=e,m=i.segments[r],y=typeof l=="number"&&m.parts[l],k={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?l:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},E=typeof d<"u"?d:this.isPendingTimestampOffset_;k.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const O=Za(this.sourceUpdater_.audioBuffered());return typeof O=="number"&&(k.audioAppendStart=O-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(k.gopsToAlignWith=_v(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),k}timestampOffsetForSegment_(e){return Av(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=Tt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=Xy(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const l=ov({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;const f=n-a-l.rebufferingImpact;let m=.5;a<=ii&&(m=1),!(!l.playlist||l.playlist.uri===this.playlist_.uri||f<m)&&(this.bandwidth=l.playlist.attributes.BANDWIDTH*tt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${cs(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:r}=t,n={segmentInfo:Vi({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},bv(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():ki(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=xd(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ki(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const l=n[a.stream];l.startTime=Math.min(l.startTime,a.startTime+r),l.endTime=Math.max(l.endTime,a.endTime+r),l.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:l,endTime:d,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${l} -> ${d} for ${a}`),dv(m,this.vhs_.tech_,a),gr(l,d,m[a]),cv({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Do({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){ki(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[xd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=Nn(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+zi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+zi(a).join(", "));const l=n.length?n.start(0):0,d=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(d-l<=hr&&m-f<=hr){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${zi(n).join(", ")}, video buffer: ${zi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const k=this.currentTime_()-hr;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${k}`),this.remove(0,k,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${hr}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=D.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},hr*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===Oh){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const l=[r];let d=r.byteLength;i&&(l.unshift(i),d+=i.byteLength),n=uv({bytes:d,segments:l})}const a={segmentInfo:Vi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){ki(this),this.loadQueue_.push(()=>{const t=Ke({},e,{forceTimestampOffset:!0});Ke(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting 198${nf(e.uri)} 199${cs(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=rv({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:d,stream:f})=>{this.logger_(`${cs(e)} logged from transmuxer stream ${f} as a ${d}: ${l}`)},triggerSegmentEventFn:({type:l,segment:d,keyInfo:f,trackInfo:m,timingInfo:y})=>{const E={segmentInfo:Vi({segment:d})};f&&(E.keyInfo=f),m&&(E.trackInfo=m),y&&(E.timingInfo=y),this.trigger({type:l,metadata:E})}})}trimBackBuffer_(e){const t=Cv(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){const d=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=d}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<pn){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${pn}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===ri.ABORTED)return;if(this.pause(),e.code===ri.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=vv(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:l,audioTimingInfo:d}){if(typeof e<"u")return e;if(!a)return d.start;const f=t.segments[i-1];return i===0||!f||typeof f.start>"u"||f.end!==r+n?r:l.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,l=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,l&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),l&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=Ev(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const d={segmentInfo:Vi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:d})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=Iv(e,this.sourceType_);if(t&&(t.severity==="warn"?F.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${cs(e)}`);return}this.logger_(`Appended ${cs(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,r=e.part,n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${cs(e)}`),this.resetEverything();return}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_()}recordThroughput_(e){if(e.duration<pn){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${pn}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,r=t.end;if(!Sd(i)||!Sd(r))return;gr(i,r,this.segmentMetadataTrack_);const n=D.WebKitDataCue||D.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},l=JSON.stringify(a),d=new n(i,r,l);d.value=a,this.segmentMetadataTrack_.addCue(d)}}function mi(){}const af=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Pv=["video","audio"],ko=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},Lv=(s,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===s)return t}return null},Es=(s,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),Es("audio",e),Es("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||ko(s,e))){if(i.type!==s){if(t=Lv(s,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),!i.doneFn){e.queuePending[s]=null,Es(s,e);return}}},of=(s,e)=>{const t=e[`${s}Buffer`],i=af(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},ei=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,wt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(ei(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===Oh?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(ei(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];ei(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(ei(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=af(s),r=Cs(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(of(s,e),!!ei(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Cs(s);if(!ei(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const d={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:d}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(f){d.errorType=F.Error.StreamingCodecsChangeError,d.error=f,f.metadata=d,t.error_=f,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},kt=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Es(s,e)},Cd=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=zy(i);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,r),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}Es(s,e)};class lf extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Es("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Bt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Cd("video",this),this.onAudioUpdateEnd_=Cd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){kt({type:"mediaSource",sourceUpdater:this,action:wt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){kt({type:e,sourceUpdater:this,action:wt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){F.log.error("removeSourceBuffer is not supported!");return}kt({type:"mediaSource",sourceUpdater:this,action:wt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){F.log.error("changeType is not supported!");return}kt({type:e,sourceUpdater:this,action:wt.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(kt({type:r,sourceUpdater:this,action:wt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(d=>{this.appendBuffer.apply(this,d)})}}audioBuffered(){return ei(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:st()}videoBuffered(){return ei(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:st()}buffered(){const e=ei(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=ei(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Gy(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=mi){kt({type:"mediaSource",sourceUpdater:this,action:wt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=mi){typeof e!="string"&&(e=void 0),kt({type:"mediaSource",sourceUpdater:this,action:wt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=mi){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}kt({type:"audio",sourceUpdater:this,action:wt.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=mi){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}kt({type:"video",sourceUpdater:this,action:wt.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(ko("audio",this)||ko("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(kt({type:"audio",sourceUpdater:this,action:wt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(kt({type:"video",sourceUpdater:this,action:wt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&kt({type:"audio",sourceUpdater:this,action:wt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&kt({type:"video",sourceUpdater:this,action:wt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),Pv.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>of(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Ad=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),Ov=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Dd=new Uint8Array(` 200 201`.split("").map(s=>s.charCodeAt(0)));class Rv extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Mv extends wo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return st();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return st([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Nn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=Dd.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Dd,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){gr(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===ri.TIMEOUT&&this.handleTimeout_(),e.code===ri.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(l){this.stopForError({message:l.message,metadata:{errorType:F.Error.StreamingVttParserError,error:l}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new D.VTTCue(l.startTime,l.endTime,l.text):l)}),yv(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",r=t&&t.type==="text";i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const r=i.start+t,n=i.end+t,a=new D.VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(l=>{const d=l.split(":"),f=d[0],m=d[1];a[f]=isNaN(m)?m:Number(m)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof D.WebVTT!="function")throw new Rv;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof D.TextDecoder=="function"?t=new D.TextDecoder("utf8"):(t=D.WebVTT.StringDecoder(),i=!0);const r=new D.WebVTT.Parser(D,D.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=Ad(a)),r.parse(a)}let n=e.bytes;i&&(n=Ad(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,d=n/Hi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,y=this.handleRollover_(f.startTime+d,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+m,0)}),!i.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*Hi.ONE_SECOND_IN_TS;const r=t*Hi.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Hi.ONE_SECOND_IN_TS}}const Nv=function(s,e){const t=s.cues;for(let i=0;i<t.length;i++){const r=t[i];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},Bv=function(s,e,t=0){if(!s.segments)return;let i=t,r;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(r||(r=Nv(e,i+a.duration/2)),r){if("cueIn"in a){r.endTime=i,r.adEndTime=i,i+=a.duration,r=null;continue}if(i<r.endTime){i+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new D.VTTCue(i,i+a.duration,a.cueOut),r.adStartTime=i,r.adEndTime=i+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[l,d]=a.cueOutCont.split("/").map(parseFloat);r=new D.VTTCue(i,i+a.duration,""),r.adStartTime=i-l,r.adEndTime=r.adStartTime+d,e.addCue(r)}i+=a.duration}};class wd{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Fv{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class uf{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),!!this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=` 202`,a=i,l=t;this.start_=a,e.forEach((d,f)=>{const m=this.storage_.get(l),y=a,k=y+d.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),O=new wd({start:y,end:k,appended:E,segmentIndex:f});d.syncInfo=O;let v=a;const P=(d.parts||[]).map((B,N)=>{const L=v,V=v+B.duration,j=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[N]&&m.partsSyncInfo[N].isAppended),q=new wd({start:L,end:V,appended:j,segmentIndex:f,partIndex:N});return v=V,n+=`Media Sequence: ${l}.${N} | Range: ${L} --> ${V} | Appended: ${j} 203`,B.syncInfo=q,q});r.set(l,new Fv(O,P)),n+=`${nf(d.resolvedUri)} | Media Sequence: ${l} | Range: ${y} --> ${k} | Appended: ${E} 204`,l++,a=k}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let l=0;l<n;l++){const d=t[l];a-=d.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class kd extends uf{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const Uv=86400,io=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const l=a.getSyncInfoForTime(r);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const l=vo(e);r=r||0;for(let d=0;d<l.length;d++){const f=e.endList||r===0?d:l.length-(d+1),m=l[f],y=m.segment,k=s.timelineToDatetimeMappings[y.timeline];if(!k||!y.dateTimeObject)continue;let O=y.dateTimeObject.getTime()/1e3+k;if(y.parts&&typeof m.partIndex=="number")for(let P=0;P<m.partIndex;P++)O+=y.parts[P].duration;const v=Math.abs(r-O);if(a!==null&&(v===0||a<v))break;a=v,n={time:O,segmentIndex:m.segmentIndex,partIndex:m.partIndex}}return n}},{name:"Segment",run:(s,e,t,i,r)=>{let n=null,a=null;r=r||0;const l=vo(e);for(let d=0;d<l.length;d++){const f=e.endList||r===0?d:l.length-(d+1),m=l[f],y=m.segment,k=m.part&&m.part.start||y&&y.start;if(y.timeline===i&&typeof k<"u"){const E=Math.abs(r-k);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:k,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l<e.discontinuityStarts.length;l++){const d=e.discontinuityStarts[l],f=e.discontinuitySequence+l+1,m=s.discontinuities[f];if(m){const y=Math.abs(r-m.time);if(a!==null&&a<y)break;(!n||a===null||a>=y)&&(a=y,n={time:m.time,segmentIndex:d,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class jv extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new uf,i=new kd(t),r=new kd(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=Bt("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return io.find(({name:d})=>d==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const l of a){const{syncPoint:d,strategy:f}=l,{segmentIndex:m,time:y}=d;if(m<0)continue;const k=e.segments[m],E=y,O=E+k.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${O}]}`),r>=E&&r<O)return this.logger_("Found sync point with exact match: ",d),d}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Tr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let l=0;l<io.length;l++){const d=io[l],f=d.run(this,e,t,i,r,n);f&&(f.strategy=d.name,a.push({strategy:d.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const l=Math.abs(e[a].syncPoint[t.key]-t.value);l<r&&(r=l,i=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>Uv){F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],l,d;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),l=e.startOfSegment,d=t.end+a.mapping;else if(a)l=t.start+a.mapping,d=t.end+a.mapping;else return!1;return n&&(n.start=l,n.end=d),(!r.start||l<r.start)&&(r.start=l),r.end=d,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,l=n-e.mediaIndex,d=Math.abs(l);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>d){let f;l<0?f=i.start-Tr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=i.end+Tr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:d}}}}dispose(){this.trigger("dispose"),this.off()}}class qv extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const $v=Gh(Xh(function(){var s=(function(){function v(){this.listeners={}}var P=v.prototype;return P.on=function(N,L){this.listeners[N]||(this.listeners[N]=[]),this.listeners[N].push(L)},P.off=function(N,L){if(!this.listeners[N])return!1;var V=this.listeners[N].indexOf(L);return this.listeners[N]=this.listeners[N].slice(0),this.listeners[N].splice(V,1),V>-1},P.trigger=function(N){var L=this.listeners[N];if(L)if(arguments.length===2)for(var V=L.length,j=0;j<V;++j)L[j].call(this,arguments[1]);else for(var q=Array.prototype.slice.call(arguments,1),R=L.length,H=0;H<R;++H)L[H].apply(this,q)},P.dispose=function(){this.listeners={}},P.pipe=function(N){this.on("data",function(L){N.push(L)})},v})();function e(v){return v.subarray(0,v.byteLength-v[v.byteLength-1])}const t=function(){const v=[[[],[],[],[],[]],[[],[],[],[],[]]],P=v[0],B=v[1],N=P[4],L=B[4];let V,j,q;const R=[],H=[];let T,C,U,K,$,W;for(V=0;V<256;V++)H[(R[V]=V<<1^(V>>7)*283)^V]=V;for(j=q=0;!N[j];j^=T||1,q=H[q]||1)for(K=q^q<<1^q<<2^q<<3^q<<4,K=K>>8^K&255^99,N[j]=K,L[K]=j,U=R[C=R[T=R[j]]],W=U*16843009^C*65537^T*257^j*16843008,$=R[K]*257^K*16843008,V=0;V<4;V++)P[V][j]=$=$<<24^$>>>8,B[V][K]=W=W<<24^W>>>8;for(V=0;V<5;V++)P[V]=P[V].slice(0),B[V]=B[V].slice(0);return v};let i=null;class r{constructor(P){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let B,N,L;const V=this._tables[0][4],j=this._tables[1],q=P.length;let R=1;if(q!==4&&q!==6&&q!==8)throw new Error("Invalid aes key size");const H=P.slice(0),T=[];for(this._key=[H,T],B=q;B<4*q+28;B++)L=H[B-1],(B%q===0||q===8&&B%q===4)&&(L=V[L>>>24]<<24^V[L>>16&255]<<16^V[L>>8&255]<<8^V[L&255],B%q===0&&(L=L<<8^L>>>24^R<<24,R=R<<1^(R>>7)*283)),H[B]=H[B-q]^L;for(N=0;B;N++,B--)L=H[N&3?B:B-4],B<=4||N<4?T[N]=L:T[N]=j[0][V[L>>>24]]^j[1][V[L>>16&255]]^j[2][V[L>>8&255]]^j[3][V[L&255]]}decrypt(P,B,N,L,V,j){const q=this._key[1];let R=P^q[0],H=L^q[1],T=N^q[2],C=B^q[3],U,K,$;const W=q.length/4-2;let ee,se=4;const Y=this._tables[1],Z=Y[0],J=Y[1],te=Y[2],oe=Y[3],me=Y[4];for(ee=0;ee<W;ee++)U=Z[R>>>24]^J[H>>16&255]^te[T>>8&255]^oe[C&255]^q[se],K=Z[H>>>24]^J[T>>16&255]^te[C>>8&255]^oe[R&255]^q[se+1],$=Z[T>>>24]^J[C>>16&255]^te[R>>8&255]^oe[H&255]^q[se+2],C=Z[C>>>24]^J[R>>16&255]^te[H>>8&255]^oe[T&255]^q[se+3],se+=4,R=U,H=K,T=$;for(ee=0;ee<4;ee++)V[(3&-ee)+j]=me[R>>>24]<<24^me[H>>16&255]<<16^me[T>>8&255]<<8^me[C&255]^q[se++],U=R,R=H,H=T,T=C,C=U}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(P){this.jobs.push(P),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(v){return v<<24|(v&65280)<<8|(v&16711680)>>8|v>>>24},l=function(v,P,B){const N=new Int32Array(v.buffer,v.byteOffset,v.byteLength>>2),L=new r(Array.prototype.slice.call(P)),V=new Uint8Array(v.byteLength),j=new Int32Array(V.buffer);let q,R,H,T,C,U,K,$,W;for(q=B[0],R=B[1],H=B[2],T=B[3],W=0;W<N.length;W+=4)C=a(N[W]),U=a(N[W+1]),K=a(N[W+2]),$=a(N[W+3]),L.decrypt(C,U,K,$,j,W),j[W]=a(j[W]^q),j[W+1]=a(j[W+1]^R),j[W+2]=a(j[W+2]^H),j[W+3]=a(j[W+3]^T),q=C,R=U,H=K,T=$;return V};class d{constructor(P,B,N,L){const V=d.STEP,j=new Int32Array(P.buffer),q=new Uint8Array(P.byteLength);let R=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(j.subarray(R,R+V),B,N,q)),R=V;R<j.length;R+=V)N=new Uint32Array([a(j[R-4]),a(j[R-3]),a(j[R-2]),a(j[R-1])]),this.asyncStream_.push(this.decryptChunk_(j.subarray(R,R+V),B,N,q));this.asyncStream_.push(function(){L(null,e(q))})}static get STEP(){return 32e3}decryptChunk_(P,B,N,L){return function(){const V=l(P,B,N);L.set(V,P.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m;typeof window<"u"?m=window:typeof f<"u"?m=f:typeof self<"u"?m=self:m={};var y=m,k=function(P){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(P):P&&P.buffer instanceof ArrayBuffer},E=y.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),(function(){var v=new Uint16Array([65484]),P=new Uint8Array(v.buffer,v.byteOffset,v.byteLength);return P[0]===255?"big":P[0]===204?"little":"unknown"})();const O=function(v){const P={};return Object.keys(v).forEach(B=>{const N=v[B];k(N)?P[B]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:P[B]=N}),P};self.onmessage=function(v){const P=v.data,B=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),N=new Uint32Array(P.key.bytes,P.key.byteOffset,P.key.byteLength/4),L=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new d(B,N,L,function(V,j){self.postMessage(O({source:P.source,decrypted:j}),[j.buffer])})}}));var Vv=Wh($v);const Hv=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},df=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Io=(s,e)=>{e.activePlaylistLoader=s,s.load()},zv=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),l=r.activePlaylistLoader,d=r.lastGroup_;if(!(a&&d&&a.id===d.id)&&(r.lastGroup_=a,r.lastTrack_=n,df(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){l&&i.resetEverything();return}t.resyncLoader(),Io(a.playlistLoader,r)}},Wv=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},Gv=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),d=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=l,n.lastTrack_=a,df(i,n),!!l)){if(l.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(s==="AUDIO"){if(!l.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(d===l.playlistLoader){Io(l.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),Io(l.playlistLoader,n)}},Bn={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(d=>d.default)[0]||n[0]).id,l=t.tracks[a];if(r===l){i({error:{message:"Problem encountered loading the default audio track."}});return}F.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const d in t.tracks)t.tracks[d].enabled=t.tracks[d]===l;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},Id={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Bn[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const l=e.media();n.playlist(l,r),n.track(a.activeTrack()),(!i.paused()||l.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",Bn[s](s,t))}},Xv={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:l,tracks:d,logger_:f}},mainPlaylistLoader:m}=e,y=Or(m.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=m.main.playlists));for(const k in a[s]){l[k]||(l[k]=[]);for(const E in a[s][k]){let O=a[s][k][E],v;if(y?(f(`AUDIO group '${k}' label '${E}' is a main playlist`),O.isMainPlaylist=!0,v=null):i==="vhs-json"&&O.playlists?v=new gs(O.playlists[0],t,n):O.resolvedUri?v=new gs(O.resolvedUri,t,n):O.playlists&&i==="dash"?v=new Co(O.playlists[0],t,n,m):v=null,O=ke({id:E,playlistLoader:v},O),Id[s](s,O.playlistLoader,e),l[k].push(O),typeof d[E]>"u"){const P=new F.AudioTrack({id:E,kind:Hv(O),enabled:!1,language:O.language,default:O.default,label:E});d[E]=P}}}r.on("error",Bn[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[s]:{groups:d,tracks:f}},mainPlaylistLoader:m}=e;for(const y in l[s]){d[y]||(d[y]=[]);for(const k in l[s][y]){if(!i.options_.useForcedSubtitles&&l[s][y][k].forced)continue;let E=l[s][y][k],O;if(r==="hls")O=new gs(E.resolvedUri,i,a);else if(r==="dash"){if(!E.playlists.filter(P=>P.excludeUntil!==1/0).length)return;O=new Co(E.playlists[0],i,a,m)}else r==="vhs-json"&&(O=new gs(E.playlists?E.playlists[0]:E.resolvedUri,i,a));if(E=ke({id:k,playlistLoader:O},E),Id[s](s,E.playlistLoader,e),d[y].push(E),typeof f[k]>"u"){const v=t.addRemoteTextTrack({id:k,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:k},!1).track;f[k]=v}}}n.on("error",Bn[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const l in i[s][a]){const d=i[s][a][l];if(!/^(?:CC|SERVICE)/.test(d.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:l,language:d.language,instreamId:d.instreamId,default:d.default&&d.autoselect};if(f[m.instreamId]&&(m=ke(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(ke({id:l},d)),typeof n[l]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[l]=y}}}}},cf=(s,e)=>{for(let t=0;t<s.length;t++)if(fl(e,s[t])||s[t].playlists&&cf(s[t].playlists,e))return!0;return!1},Kv=(s,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const l=Object.keys(r);if(!a)if(s==="AUDIO"&&l.length>1&&Or(e.main))for(let d=0;d<l.length;d++){const f=r[l[d]];if(cf(f,n)){a=f;break}}else r.main?a=r.main:l.length===1&&(a=r[l[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(d=>d.id===t.id)[0]||null},Yv={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},Qv=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},Jv=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{Xv[f](f,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=Kv(f,s),e[f].activeTrack=Yv[f](f,s),e[f].onGroupChanged=zv(f,s),e[f].onGroupChanging=Wv(f,s),e[f].onTrackChanged=Gv(f,s),e[f].getActiveGroup=Qv(f,s)});const l=e.AUDIO.activeGroup();if(l){const f=(l.filter(y=>y.default)[0]||l[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const d=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",d),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",d),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const f in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[f])},Zv=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:mi,activeTrack:mi,getActiveGroup:mi,onGroupChanged:mi,onTrackChanged:mi,lastTrack_:null,logger_:Bt(`MediaGroups[${e}]`)}}),s};class Pd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vt(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class eT extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Pd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Bt("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=vt(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(a.status===429){const f=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${f} seconds.`),this.startTTLTimeout_(parseInt(f,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let l;try{l=JSON.parse(this.request_.responseText)}catch(f){const m={errorType:F.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(l);const d={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:d}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new D.URL(e),i=new D.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(D.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new D.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const i=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=D.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){D.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new Pd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const tT=(s,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(null,i)},e)}},iT=10;let pi;const sT=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],rT=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},nT=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:d}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return d(`${f} as current playlist is not set`),!0;if(i.id===s.id)return!1;const m=!!ps(e,t).length;if(!s.endList)return!m&&typeof s.partTargetDuration=="number"?(d(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(d(`${f} as current playlist is live`),!0);const y=dl(e,t),k=l?tt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:tt.MAX_BUFFER_LOW_WATER_LINE;if(a<k)return d(`${f} as duration < max low water line (${a} < ${k})`),!0;const E=i.attributes.BANDWIDTH,O=s.attributes.BANDWIDTH;if(E<O&&(!l||y<n)){let v=`${f} as next bandwidth < current bandwidth (${E} < ${O})`;return l&&(v+=` and forwardBuffer < bufferHighWaterLine (${y} < ${n})`),d(v),!0}if((!l||E>O)&&y>=r){let v=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return l&&(v+=` and next bandwidth > current bandwidth (${E} > ${O})`),d(v),!0}return d(`not ${f} as no switching criteria met`),!1};class aT extends F.EventTarget{constructor(e){super(),this.fastQualityChange_=tT(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:d,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:k,leastPixelDiffSelector:E,captionServices:O,experimentalUseMMS:v}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:P}=e;(P===null||typeof P>"u")&&(P=1/0),pi=a,this.bufferBasedABR=!!k,this.leastPixelDiffSelector=!!E,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=l,this.playlistExclusionDuration=d,this.maxPlaylistRetries=P,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:P,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=Zv(),v&&D.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new D.ManagedMediaSource,this.usingManagedMediaSource_=!0,F.log("Using ManagedMediaSource")):D.MediaSource&&(this.mediaSource=new D.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=st(),this.hasPlayed_=!1,this.syncController_=new jv(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new Vv,this.sourceUpdater_=new lf(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new qv,this.keyStatusMap_=new Map;const B={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:O,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Co(t,this.vhs_,ke(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new gs(t,this.vhs_,ke(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new wo(ke(B,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new wo(ke(B,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Mv(ke(B,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((V,j)=>{function q(){r.off("vttjserror",R),V()}function R(){r.off("vttjsloaded",q),j()}r.one("vttjsloaded",q),r.one("vttjserror",R),r.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new eT(this.vhs_.xhr,N),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),sT.forEach(V=>{this[V+"_"]=rT.bind(this,V)}),this.logger_=Bt("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{const V=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-V,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const a=(i.length?i[0].playlists:i.playlists).filter(l=>l.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=D.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const l=i.main||r.length&&i[r[0]];for(const d in l)if(l[d].default){n={label:d};break}}if(!n)return t;const a=[];for(const l in i)if(i[l][n.label]){const d=i[l][n.label];if(d.playlists&&d.playlists.length)a.push.apply(a,d.playlists);else if(d.uri)a.push(d);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const m=e.playlists[f];m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===l&&a.push(m)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;To(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),Jv({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;To(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,i=>{this.player_.trigger(Ke({},i))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const l in i.AUDIO[a])i.AUDIO[a][l].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),pi.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return nT({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const r=i.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",i=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:iT}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(i=>{this.mainSegmentLoader_.on(i,r=>{this.player_.trigger(Ke({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(Ke({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(Ke({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let r=i;if(e.start){const n=e.start.timeOffset;if(n<0){const a=this.mainPlaylistLoader_.main,l=pi.Playlist.liveEdgeDelay(a,e),d=i+l;r=Math.max(Math.min(d+n,i),t.start(0))}else r=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const r=pi.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=si;const l=a.end(a.length-1);return l-n<=si&&r-l<=si}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(aa),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const O=this.pathwayAttribute_(e),v=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(O),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(O)},v);return}let E=!1;r.forEach(O=>{if(O===e)return;const v=O.excludeUntil;typeof v<"u"&&v!==1/0&&(E=!0,delete O.excludeUntil)}),E&&(F.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+i*1e3,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const d=this.selectPlaylist();if(!d){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:F.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${d.id}.`),d.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=d.targetDuration/2*1e3||5*1e3,k=typeof d.lastRequest=="number"&&Date.now()-d.lastRequest<=y;return this.switchMedia_(d,"exclude",a||k)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&i.push(l)}),["main","audio","subtitle"].forEach(a=>{const l=this[`${a}SegmentLoader_`];l&&(e===a||e==="all")&&i.push(l)}),i.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){const t=ps(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:pi.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const l=r.start,d=r.end;if(!isFinite(l)||!isFinite(d))return null;const f=pi.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),m=Math.max(l,d-f);return st([[l,m]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=pi.Playlist.seekable(i,n,pi.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||i>a?e:st([[Math.max(i,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${Th(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let i=pi.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=br(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||Xg),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||Tu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||Tu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?mr(m,this.usingManagedMediaSource_):Na(m),l={};let d;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";l[m]=l[m]||[],l[m].push(r[f]),f==="audio"&&(d=m)}}),n&&d&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${d} does not support codec(s): "${r.audio}"`)}if(Object.keys(l).length){const f=Object.keys(l).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${l[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const y=(Zt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,k=(Zt(r[m]||"")[0]||{}).type;y&&k&&y.toLowerCase()!==k.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=br(this.main,r),a=[];n.audio&&!Na(n.audio)&&!mr(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Na(n.video)&&!mr(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=Ar(Zt(e)),n=fd(r),a=r.video&&Zt(r.video)[0]||null,l=r.audio&&Zt(r.audio)[0]||null;Object.keys(i).forEach(d=>{const f=i[d];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],y=br(this.mainPlaylistLoader_.main,f),k=fd(y);if(!(!y.audio&&!y.video)){if(k!==n&&m.push(`codec count "${k}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&Zt(y.video)[0]||null,O=y.audio&&Zt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),O&&l&&O.type.toLowerCase()!==l.type.toLowerCase()&&m.push(`audio codec "${O.type}" !== "${l.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),Bv(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=tt.GOAL_BUFFER_LENGTH,i=tt.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,tt.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=tt.BUFFER_LOW_WATER_LINE,i=tt.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,tt.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,tt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return tt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){bd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),mv({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();bd(this.inbandTextTracks_,e,this.tech_),fv({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,i=>{this.trigger(Ke({},i))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const l of t.playlists){const d=l.attributes.serviceLocation;if(d&&(a.push(d),!n.has(d)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,r=new Set;let n=!1;Object.keys(i).forEach(a=>{const l=i[a],d=this.pathwayAttribute_(l),f=d&&e!==d;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!f&&(delete l.excludeUntil,delete l.lastExcludeReason_,n=!0);const y=!l.excludeUntil&&l.excludeUntil!==1/0;!r.has(l.id)&&f&&y&&(r.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const l=this.mediaTypes_[a];if(l.activePlaylistLoader){const d=l.activePlaylistLoader.media_;d&&d.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||r&&r.size){for(const[a,l]of i.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(a));for(const[a,l]of r.entries()){const d=i.get(a);if(!d){t.filter(m=>m.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(l,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(d,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);!r||!r.size||r.forEach(n=>{const a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,d=i.lastExcludeReason_===t&&i.excludeUntil===1/0;l?l&&d&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:Ov(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const oT=(s,e,t)=>i=>{const r=s.main.playlists[e],n=hl(r),a=aa(r);if(typeof i>"u")return a;i?delete r.disabled:r.disabled=!0;const l={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i!==a&&!n&&(i?(t(r),s.trigger({type:"renditionenabled",metadata:l})):s.trigger({type:"renditiondisabled",metadata:l})),i};class lT{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=br(r.main(),t),this.playlist=t,this.id=i,this.enabled=oT(e.playlists,t.id,n)}}const uT=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=Or(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!hl(i)).map((i,r)=>new lT(s,i,i.id)):[]}},Ld=["seeking","seeked","pause","playing","error"];class dT extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Bt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],d={};l.forEach(m=>{d[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",d[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",d[m].reset),this.tech_.on(["seeked","seeking"],d[m].reset)});const f=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(Ld,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(Ld,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",d[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",d[m].reset),this.tech_.off(["seeked","seeking"],d[m].reset)}),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=Ky(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:zi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+si>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(st([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const O=t.start(0);n=O+(O===t.end(0)?0:si)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${Th(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),d=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-ii)*2,k=[d,f];for(let O=0;O<k.length;O++){if(!k[O])continue;if(dl(k[O],i)<y)return!1}const E=hn(l,i);return E.length===0?!1:(n=E.start(0)+si,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${i}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=ps(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=hn(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+si;const a=!i.endList,l=typeof i.partTargetDuration=="number";return a&&(l||r)&&(n=e.end(e.length-1)+i.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){const n=ps(e,i-3),a=ps(e,i),l=ps(t,i);l.length&&!a.length&&n.length&&(r={start:n.end(0),end:l.end(0)})}else hn(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=hn(t,i);if(this.resetTimeUpdate_(),r.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+ii);const n={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=Wy(e);for(let r=0;r<i.length;r++){const n=i.start(r),a=i.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}}const cT={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},hf=function(s,e){let t=0,i=0;const r=ke(cT,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(m){m!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(m),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},l=function(){if(Date.now()-t<r.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){F.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(s,a)},d=function(){s.off("loadedmetadata",n),s.off("error",l),s.off("dispose",d)},f=function(m){d(),hf(s,m)};s.on("error",l),s.on("dispose",d),s.reloadSourceOnError=f},hT=function(s){hf(this,s)};var ff="3.17.3",fT="7.1.0",pT="1.3.1",gT="7.2.0",mT="4.0.2";const $e={PlaylistLoader:gs,Playlist:Tt,utils:b_,STANDARD_PLAYLIST_SELECTOR:Td,INITIAL_PLAYLIST_SELECTOR:lv,lastBandwidthSelector:Td,movingAverageBandwidthSelector:av,comparePlaylistBandwidth:gl,comparePlaylistResolution:nv,xhr:Uh()};Object.keys(tt).forEach(s=>{Object.defineProperty($e,s,{get(){return F.log.warn(`using Vhs.${s}
204 is UNSAFE be sure you know what you are doing`),tt[s]},set(e){if(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}tt[s]=e}})});const pf="videojs-vhs",gf=function(s,e){const t=e.media();let i=-1;for(let r=0;r<s.length;r++)if(s[r].id===t.id){i=r;break}s.selectedIndex_=i,s.trigger({selectedIndex:i,type:"change"})},yT=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),gf(s,e.playlists)};$e.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const _T=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=Ar(Zt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Cs(i.video),n=Cs(i.audio),a={};for(const l in s)a[l]={},n&&(a[l].audioContentType=n),r&&(a[l].videoContentType=r),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pssh&&(a[l].pssh=e.contentProtection[l].pssh),typeof s[l]=="string"&&(a[l].url=s[l]);return ke(s,a)},vT=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const l=i.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),TT=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=vT(r,Object.keys(e)),a=[],l=[];return n.forEach(d=>{l.push(new Promise((f,m)=>{s.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{s.eme.initializeMediaKeys({keySystems:d},y=>{if(y){m(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},bT=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=_T(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},mf=()=>{if(!D.localStorage)return null;const s=D.localStorage.getItem(pf);if(!s)return null;try{return JSON.parse(s)}catch{return null}},ST=s=>{if(!D.localStorage)return!1;let e=mf();e=e?ke(e,s):s;try{D.localStorage.setItem(pf,JSON.stringify(e))}catch{return!1}return e},xT=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,yf=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},_f=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},vf=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},Tf=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};$e.supportsNativeHls=(function(){if(!ie||!ie.createElement)return!1;const s=ie.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1})();$e.supportsNativeDash=(function(){return!ie||!ie.createElement||!F.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ie.createElement("video").canPlayType("application/dash+xml"))})();$e.supportsTypeNatively=s=>s==="hls"?$e.supportsNativeHls:s==="dash"?$e.supportsNativeDash:!1;$e.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};$e.xhr.onRequest=function(s){yf($e.xhr,s)};$e.xhr.onResponse=function(s){_f($e.xhr,s)};$e.xhr.offRequest=function(s){vf($e.xhr,s)};$e.xhr.offResponse=function(s){Tf($e.xhr,s)};const ET=F.getComponent("Component");class bf extends ET{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Bt("VhsHandler"),t.options_&&t.options_.playerId){const r=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ie,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=ie.fullscreenElement||ie.webkitFullscreenElement||ie.mozFullScreenElement||ie.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ke(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
vendor: 7,678 bytes, line 204
204!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=mf();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=tt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===tt.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=xT(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=$e,this.options_.sourceType=qd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new aT(this.options_);const i=ke({liveRangeSafeTimeDelta:si},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new dT(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?$e.movingAverageBandwidthSelector(.55):$e.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=$e.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){const d=a.downlink*1e3*1e3;d>=l&&n>=l?n=Math.max(n,d):n=d}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>zi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>zi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&ST({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{uT(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.playlistController_.mediaSource),(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),TT({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media ke
204ys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=bT({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{yT(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{gf(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":ff,"mux.js":fT,"mpd-parser":pT,"m3u8-parser":gT,"aes-decrypter":mT}}version(){return this.constructor.version()}canChangeType(){return lf.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return w_({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return Hh({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{yf(this.xhr,e)},this.xhr.onResponse=e=>{_f(this.xhr,e)},this.xhr.offRequest=e=>{vf(this.xhr,e)},this.xhr.offResponse=e=>{Tf(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,r=>{this.player_.trigger(Ke({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(Ke({},r))})})}}const Fn={name:"videojs-http-streaming",VERSION:ff,canHandleSource(s,e={}){const t=ke(F.options,e);return!t.vhs.experimentalUseMMS&&!mr("avc1.4d400d,mp4a.40.2",!1)?!1:Fn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=ke(F.options,t);return e.vhs=new bf(s,e,i),e.vhs.xhr=Uh(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=qd(s);if(!t)return"";const i=Fn.getOverrideNative(e);return!$e.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}},CT=()=>mr("avc1.4d400d,mp4a.40.2",!0);CT()&&F.getTech("Html5").registerSourceHandler(Fn,0);F.VhsHandler=bf;F.VhsSourceHandler=Fn;F.Vhs=$e;F.use||F.registerComponent("Vhs",$e);F.options.vhs=F.options.vhs||{};(!F.getPlugin||!F.getPlugin("reloadSourceOnError"))&&F.registerPlugin("reloadSourceOnError",hT);function Od(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=Array(e);t<e;t++)i[t]=s[t];return i}function Sf(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function xf(s,e,t){return Object.defineProperty(s,"prototype",{writable:!1}),s}function AT(s,e){var t=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(!t){if(Array.isArray(s)||(t=IT(s))||e){t&&(s=t);var i=0,r=function(){};return{s:r,n:function(){return i>=s.length?{done:!0}:{done:!1,value:s[i++]}},e:function(d){throw d},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 205In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n,a=!0,l=!1;return{s:function(){t=t.call(s)},n:function(){var d=t.next();return a=d.done,d},e:function(d){l=!0,n=d},f:function(){try{a||t.return==null||t.return()}finally{if(l)throw n}}}}function DT(s,e,t){return(e=kT(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function wT(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function kT(s){var e=wT(s,"string");return typeof e=="symbol"?e:e+""}function Po(s){"@babel/helpers - typeof";return Po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Po(s)}function IT(s,e){if(s){if(typeof s=="string")return Od(s,e);var t={}.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Od(s,e):void 0}}var be=function(e,t,i){this.vjsPlayer=e,this.controller=i,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource="",this.contentSourceType="",this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("readyforpreroll",this.onReadyForPreroll.bind(this)),this.vjsPlayer.on("adtimeout",this.onAdTimeout.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.controller.getSettings().requestMode==="onPlay"&&this.vjsPlayer.one("play",this.controller.requestAds.bind(this.controller)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(t)};be.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle&&clearInterval(this.updateTimeIntervalHandle),this.seekCheckIntervalHandle&&clearInterval(this.seekCheckIntervalHandle),this.resizeCheckIntervalHandle&&clearInterval(this.resizeCheckIntervalHandle),this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)};be.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())};be.prototype.checkForSeeking=function(){var s=this.vjsPlayer.currentTime(),e=(s-this.contentPlayheadTracker.previousTime)*1e3;Math.abs(e)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()};be.prototype.checkForResize=function(){var s=this.getPlayerWidth(),e=this.getPlayerHeight();(s!=this.vjsPlayerDimensions.width||e!=this.vjsPlayerDimensions.height)&&(this.vjsPlayerDimensions.width=s,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(s,e))};be.prototype.localContentEndedListener=function(){this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete());for(var s in this.contentEndedListeners)typeof this.contentEndedListeners[s]=="function"&&this.contentEndedListeners[s]();
205this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))};be.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")};be.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var s=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in s)s[e]&&clearInterval(s[e])};be.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()};be.prototype.onAdTimeout=function(){this.controller.onAdTimeout()};be.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.h5Player.hasAttribute("autoplay")&&this.controller.setSetting("adWillAutoPlay",!0),this.onVolumeChange(),this.vjsPlayer.on("fullscreenchange",this.onFullscreenChange.bind(this)),this.vjsPlayer.on("volumechange",this.onVolumeChange.bind(this)),this.controller.onPlayerReady()};be.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()};be.prototype.onVolumeChange=function(){var s=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(s)};be.prototype.injectAdContainerDiv=function(s){this.vjsControls.el().parentNode.appendChild(s)};be.prototype.getContentPlayer=function(){return this.h5Player};be.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()};be.prototype.setVolume=function(s){this.vjsPlayer.volume(s),s==0?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)};be.prototype.unmute=function(){this.vjsPlayer.muted(!1)};be.prototype.mute=function(){this.vjsPlayer.muted(!0)};be.prototype.play=function(){this.vjsPlayer.play()};be.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()};be.prototype.getPlayerWidth=function(){var s=(getComputedStyle(this.vjsPlayer.el())||{}).width;return(!s||parseFloat(s)===0)&&(s=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(s)||this.vjsPlayer.width()};be.prototype.getPlayerHeight=function(){var s=(getComputedStyle(this.vjsPlayer.el())||{}).height;return(!s||parseFloat(s)===0)&&(s=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(s)||this.vjsPlayer.height()};be.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_};be.prototype.getPlayerId=function(){return this.vjsPlayer.id()};be.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()};be.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker};be.prototype.onAdError=function(s){this.vjsControls.show();var e=s.getError!==void 0?s.getError():s.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:s}})};be.prototype.onAdLog=function(s){var e=s.getAdData(),t=e.adError!==void 0?e.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:t,AdEvent:s}})};be.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()};be.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()};be.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")};be.prototype.onAllAdsCompleted=function(){this.contentComplete==!0&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())};be.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")};be.prototype.changeSource=function(s){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),s&&this.vjsPlayer.src(s),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))};be.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)};be.prototype.triggerPlayerEvent=function(s,e){this.vjsPlayer.trigger(s,e)};be.prototype.addContentEndedListener=function(s){this.contentEndedListeners.push(s)};be.prototype.reset=function(){this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var Se=function(e){this.controller=e,this.adContainerDiv=document.createElement("div"),this.controlsDiv=document.createElement("div"),this.countdownDiv=document.createElement("div"),this.seekBarDiv=document.createElement("div"),this.progressDiv=document.createElement("div"),this.playPauseDiv=document.createElement("div"),this.muteDiv=document.createElement("div"),this.sliderDiv
205=document.createElement("div"),this.sliderLevelDiv=document.createElement("div"),this.fullscreenDiv=document.createElement("div"),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+"_",this.showCountdown=!0,this.controller.getSettings().showCountdown===!1&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};Se.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.classList.add("hide-ad-container"),this.adContainerDiv.addEventListener("mouseenter",this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener("mouseleave",this.hideAdControls.bind(this),!1),this.adContainerDiv.addEventListener("click",this.onAdContainerClick.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)};Se.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,"ima-controls-div"),this.controlsDiv.style.width="100%",this.controller.getIsMobile()?this.countdownDiv.style.display="none":(this.assignControlAttributes(this.countdownDiv,"ima-countdown-div"),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?"block":"none"),this.assignControlAttributes(this.seekBarDiv,"ima-seek-bar-div"),this.seekBarDiv.style.width="100%",this.assignControlAttributes(this.progressDiv,"ima-progress-div"),this.assignControlAttributes(this.playPauseDiv,"ima-play-pause-div"),this.addClass(this.playPauseDiv,"ima-playing"),this.playPauseDiv.addEventListener("click",this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,"ima-mute-div"),this.addClass(this.muteDiv,"ima-non-muted"),this.muteDiv.addEventListener("click",this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,"ima-slider-div"),this.sliderDiv.addEventListener("mousedown",this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display="none"),this.assignControlAttributes(this.sliderLevelDiv,"ima-slider-level-div"),this.assignControlAttributes(this.fullscreenDiv,"ima-fullscreen-div"),this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.fullscreenDiv.addEventListener("click",this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)};Se.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()};Se.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()};Se.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()};Se.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()};Se.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()};Se.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")};Se.prototype.updateAdUi=function(s,e,t,i,r){var n=Math.floor(e/60),a=Math.floor(e%60);a.toString().length<2&&(a="0"+a);var l=": ";r>1&&(l=" ("+i+" "+this.controller.getSettings().adLabelNofN+" "+r+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+l+n+":"+a;var d=s/t,f=d*100;this.progressDiv.style.width=f+"%"};Se.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=this.controller.getPlayerVolume()*100+"%"};Se.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"};Se.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)};Se.prototype.onMouseMove=function(s){this.changeVolume(s)};Se.prototype.onMouseUp=function(s){this.changeVolume(s),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)};Se.prototype.changeVolume=function(s){var e=(s.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",this.percent==0?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted")):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted")),this.controller.setVolume(e/100)};Se.prototype.showAdContainer=function(){this.adContainerDiv.classList.remove("hide-ad-container")};Se.prototype.hideAdContainer=function(){this.adContainerDiv.classList.add("hide-ad-container")};Se.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()};Se.prototype.reset=function(){this.hideAdContainer()};Se.prototype.onAdError=function(){this.hideAdContainer()};Se.prototype.onAdBreakStart=function(s){this.showAdContainer();var e=s.getAd().getContentType();e==="application/javascript"&&!this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="none":this.controlsDiv.style.display="block",this.onAdsPlaying(),this.hideAdControls()};Se.prototype.onAdBreakEnd=function(){var s=this.controller.getCurrentAd();(s==null||s.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""};Se.prototype.onAllAdsCompleted=function(){this.hideAdContainer()};Se.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1};Se.prototype.onNonLinearAdLoad=function(){this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0};Se.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")};Se.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")};Se.prototype.onPlayerVolumeChanged=function(s){s==0?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=s*100+"%")};Se.prototype.showAdControls=function(){var s=this.controller.getSettings(),e=s.disableAdControls;e||this.addClass(this.controlsDiv,"ima-controls-div-showing")};Se.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")};Se.prototype.assignControlAttributes=function(s,e){s.id=this.controlPrefix+e,s.className=this.controlPrefix+e+" "+e};Se.prototype.getClassRegexp=function(s){return new RegExp("(^|[^A-Za-z-])"+s+"((?![A-Za-z-])|$)","gi")};Se.prototype.elementHasClass=function(s,e){var t=this.getClassRegexp(e);return t.test(s.className)};Se.prototype.addClass=function(s,e){s.className=s.className.trim()+" "+e};Se.prototype.removeClass=function(s,e){var t=this.getClassRegexp(e);
205s.className=s.className.trim().replace(t,"")};Se.prototype.getAdContainerDiv=function(){return this.adContainerDiv};Se.prototype.setShowCountdown=function(s){this.showCountdown=s,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var PT="2.6.0",LT={version:PT},_e=function(e){this.controller=e,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.isAdTimedOut=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,this.controller.getSettings().autoPlayAdBreaks===!1&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus),this.controller.getSettings().ppid&&google.ima.settings.setPpid(this.controller.getSettings().ppid),this.controller.getSettings().featureFlags&&google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags)};_e.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),this.controller.getSettings().vpaidAllowed==!1&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),this.controller.getSettings().vpaidMode!==void 0&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.controller.getSettings().sessionId&&this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId),this.adsLoader.getSettings().setPlayerType("videojs-ima"),this.adsLoader.getSettings().setPlayerVersion(LT.version),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-loader",adsLoader:this.adsLoader})};_e.prototype.requestAds=function(){var s=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?s.adTagUrl=this.controller.getSettings().adTagUrl:s.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(s.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(s.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),this.controller.getSettings().omidMode&&window.console.warn("The additional setting `omidMode` has been removed. Use `omidVendorAccess` instead."),this.controller.getSettings().omidVendorAccess){s.omidAccessModeRules={};var e=this.controller.getSettings().omidVendorAccess;Object.keys(e).forEach(function(i){s.omidAccessModeRules[i]=e[i]})}s.linearAdSlotWidth=this.controller.getPlayerWidth(),s.linearAdSlotHeight=this.controller.getPlayerHeight(),s.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),s.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),s.setAdWillAutoPlay(this.controller.adsWillAutoplay()),s.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var t=this.controller.getSettings().adsRequest;t&&Po(t)==="object"&&Object.keys(t).forEach(function(i){s[i]=t[i]}),this.adsLoader.requestAds(s),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:s})};_e.prototype.onAdsManagerLoaded=function(s){this.createAdsRenderingSettings(),this.adsManager=s.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this.onAdLog.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this)),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-manager",adsManager:this.adsManager}),this.autoPlayAdBreaks||this.initAdsManager();var e=this.controller.getSettings(),t=e.preventLateAdStart;t?t&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()};_e.prototype.onAdsLoaderError=function(s){window.console.warn("AdsLoader error: "+s.getError()),this.controller.onErrorLoadingAds(s),this.adsManager&&this.adsManager.destroy()};_e.prototype.initAdsManager=function(){try{var s=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=s,this.adsManagerDimensions.height=e,this.adsManager.init(s,e),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(t){this.onAdError(t)}};_e.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var s in this.controller.getSettings().adsRenderingSettings)s!==""&&(this.adsRenderingSettings[s]=this.controller.getSettings().adsRenderingSettings[s])};_e.prototype.onAdError=function(s){var e=s.getError!==void 0?s.getError():s.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(s),this.adsActive=!1,this.adPlaying=!1};_e.prototype.onAdBreakReady=function(s){this.adBreakReadyListener(s)};_e.prototype.onContentPauseRequested=function(s){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(s)};_e.prototype.onContentResumeRequested=function(s){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()};_e.prototype.onAllAdsCompleted=function(s){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()};_e.prototype.onAdLoaded=function(s){s.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())};_e.prototype.onAdStarted=function(s){this.currentAd=s.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()};_e.prototype.onAdPaused=function(){this.controller.onAdsPaused()};_e.prototype.onAdResumed=function(s){this.controller.onAdsResumed()};_e.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)};_e.prototype.onAdLog=function(s){this.controller.onAdLog(s)};_e.prototype.onAdPlayheadTrackerInterval=function(){if(this.adsManager!==null){var s=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),t=e-s;t=t>0?t:0;var i=0,r;this.currentAd.getAdPodInfo()&&(r=this.currentAd.getAdPodInfo().getAdPosition(),i=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(t,s,e,r,i)}};_e.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),(this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)||!this.adsManager)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()};_e.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)};_e.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(s){this.onAdError(s)}}};_e.prototype.onAdTimeout=function(){this.isAdTimedOut=!0};_e.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&this.controller.getSettings().requestMode==="onLoad"&&this.requestAds()};_e.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height)};_e.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight())};_e.prototype.onPlayerVolumeChanged=function(s){this.adsManager&&this.adsManager.setVolume(s),s==0?this.adMuted=!0:this.adMuted=!1};_e.prototype.onPlayerResize=function(s,e){this.adsManager&&(this.adsManagerDimensions.width=s,this.adsManagerDimensions.height=e,this.adsManager.resize(s,e))};_e.prototype.getCurrentAd=function(){return this.currentAd};_e.prototype.setAdBreakReadyListener=function(s){this.adBreakReadyListener=s};_e.prototype.isAdPlaying=function(){return this.adPlaying};_e.prototype.isAdMuted=function(){return this.adMuted};_e.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1};_e.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0};_e.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1};_e.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0};_e.prototype.setVolume=function(s){this.adsManager.setVolume(s),s==0?this.adMuted=!0:this.adMuted=!1};_e.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0))};_e.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())};_e.prototype.addEventListener=function(s,e){this.adsManager&&this.adsManager.addEventListener(s,e)};_e.prototype.getAdsManager=function(){return this.adsManager};_e.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var ue=function(e,t){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var i={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},r=Object.assign({},i,t.contribAdsSettings||{});this.playerWrapper=new be(e,r,this),this.adUi=new Se(this),this.sdkImpl=new _e(this)};ue.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3};ue.prototype.initWithSettings=function(s){this.settings=Object.assign({},ue.IMA_DEFAULTS,s||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)};ue.prototype.warnAboutDeprecatedSettings=function(){var s=this,e=["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"];e.forEach(function(t){s.settings[t]!==void 0&&console.warn("WARNING: videojs.ima setting "+t+" is deprecated")})};ue.prototype.getSettings=function(){return this.settings};ue.prototype.getIsMobile=function(){return this.isMobile};ue.prototype.getIsIos=function(){return this.isIos};ue.prototype.injectAdContainerDiv=function(s){this.playerWrapper.injectAdContainerDiv(s)};ue.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()};ue.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()};ue.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()};ue.prototype.requestAds=function(){this.sdkImpl.requestAds()};ue.prototype.setSetting=function(s,e){this.settings[s]=e};ue.prototype.onErrorLoadingAds=function(s){this.adUi.onAdError(),this.playerWrapper.onAdError(s)};ue.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())};ue.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())};ue.prototype.setVolume=function(s){this.playerWrapper.setVolume(s),this.sdkImpl.setVolume(s)};ue.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()};ue.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()};ue.prototype.onAdError=function(s){this.adUi.onAdError(),this.playerWrapper.onAdError(s)};ue.prototype.onAdBreakStart=function(s){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(s)};ue.prototype.showAdContainer=function(){this.adUi.showAdContainer()};ue.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()};ue.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()};ue.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()};ue.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()};ue.prototype.onAdPlayheadUpdated=function(s,e,t,i,r){this.adUi.updateAdUi(s,e,t,i,r)};ue.prototype.onAdLog=function(s){this.playerWrapper.onAdLog(s)};ue.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()};ue.prototype.playContent=function(){this.playerWrapper.play()};ue.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()};ue.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()};ue.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()};ue.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()};ue.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()};ue.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()};ue.prototype.onPlayerResize=function(s,e){this.sdkImpl.onPlayerResize(s,e)};ue.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()};ue.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()};ue.prototype.onContentAndAdsCompleted=function(){for(var s in this.contentAndAdsEndedListeners)typeof this.contentAndAdsEndedListeners[s]=="function"&&this.contentAndAdsEndedListeners[s]()};ue.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()};ue.prototype.onPlayerReadyForPreroll=function(){this.sdkIm
205pl.onPlayerReadyForPreroll()};ue.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()};ue.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()};ue.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()};ue.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()};ue.prototype.onPlayerVolumeChanged=function(s){this.adUi.onPlayerVolumeChanged(s),this.sdkImpl.onPlayerVolumeChanged(s)};ue.prototype.setContentWithAdTag=function(s,e){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(s)};ue.prototype.setContentWithAdsResponse=function(s,e){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(s)};ue.prototype.setContentWithAdsRequest=function(s,e){this.reset(),this.settings.adsRequest=e||this.settings.adsRequest,this.playerWrapper.changeSource(s)};ue.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()};ue.prototype.addContentEndedListener=function(s){this.playerWrapper.addContentEndedListener(s)};ue.prototype.addContentAndAdsEndedListener=function(s){this.contentAndAdsEndedListeners.push(s)};ue.prototype.setAdBreakReadyListener=function(s){this.sdkImpl.setAdBreakReadyListener(s)};ue.prototype.setShowCountdown=function(s){this.adUi.setShowCountdown(s),this.showCountdown=s,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"};ue.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()};ue.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()};ue.prototype.addEventListener=function(s,e){this.sdkImpl.addEventListener(s,e)};ue.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()};ue.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()};ue.prototype.changeAdTag=function(s){this.reset(),this.settings.adTagUrl=s};ue.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()};ue.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()};ue.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()};ue.prototype.adsWillAutoplay=function(){return this.settings.adsWillAutoplay!==void 0?this.settings.adsWillAutoplay:this.settings.adWillAutoplay!==void 0?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay};ue.prototype.adsWillPlayMuted=function(){return this.settings.adsWillPlayMuted!==void 0?this.settings.adsWillPlayMuted:this.settings.adWillPlayMuted!==void 0?this.settings.adWillPlayMuted:this.playerWrapper.getPlayerOptions().muted!==void 0?this.playerWrapper.getPlayerOptions().muted:this.playerWrapper.getVolume()==0};ue.prototype.triggerPlayerEvent=function(s,e){this.playerWrapper.triggerPlayerEvent(s,e)};var St=function(e,t,i){this.vjsPlayer=e,this.daiController=i,this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("pause",this.onPause.bind(this)),this.vjsPlayer.on("play",this.onPlay.bind(this)),this.vjsPlayer.on("seeked",this.onSeekEnd.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(t)};St.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()};St.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()};St.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()};St.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())};St.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()};St.prototype.getStreamPlayer=function(){return this.h5Player};St.prototype.getVjsPlayer=function(){return this.vjsPlayer};St.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_};St.prototype.getPlayerId=function(){return this.vjsPlayer.id()};St.prototype.onAdError=function(s){this.vjsControls.show();var e=s.getError!==void 0?s.getError():s.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:s}})};St.prototype.onAdBreakStart=function(){this.vjsControls.hide()};St.prototype.onAdBreakEnd=function(){this.vjsControls.show()};St.prototype.reset=function(){this.vjsControls.show()};var Rd="TXXX",gt=function(e){this.daiController=e,this.streamPlayer=null,this.vjsPlayer=null,this.streamManager=null,this.uiSettings=new google.ima.dai.api.UiSettings,this.isAdBreak=!1,this.isSnapback=!1,this.snapForwardTime=0,this.timedMetadata,this.metadataLoaded={},this.SOURCE_TYPES={hls:"application/x-mpegURL",dash:"application/d
205ash+xml"}};gt.prototype.initImaDai=function(){var s=this;this.streamPlayer=this.daiController.getStreamPlayer(),this.vjsPlayer=this.daiController.getVjsPlayer(),this.createAdUiDiv(),this.daiController.getSettings().locale&&this.uiSettings.setLocale(this.daiController.getSettings().locale),this.streamManager=new google.ima.dai.api.StreamManager(this.streamPlayer,this.adUiDiv,this.uiSettings),this.streamPlayer.addEventListener("pause",this.onStreamPause),this.streamPlayer.addEventListener("play",this.onStreamPlay);var e=[google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED];e.forEach(function(t){s.streamManager.addEventListener(t,s.onStreamEvent.bind(s))}),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()};gt.prototype.onAddTrack=function(s){var e=this,t=s.track;t.kind==="metadata"&&(t.mode="hidden",t.addEventListener("cuechange",function(i){var r=t.activeCues_||t.activeCues;if(r){var n=AT(r),a;try{for(n.s();!(a=n.n()).done;){var l=a.value;l.value&&l.value.key===Rd&&e.streamManager.onTimedMetadata(DT({},Rd,l.value.data))}}catch(d){n.e(d)}finally{n.f()}}}))};gt.prototype.createAdUiDiv=function(){var s=document.createElement("div");s.id="ad-ui",s.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(s),this.adUiDiv=s};gt.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")};gt.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")};gt.prototype.onSeekEnd=function(s){var e=this.daiController.getSettings().streamType;if(e!=="live"){if(this.isSnapback){this.isSnapback=!1;return}var t=this.streamManager.previousCuePointForStreamTime(s);t&&!t.played&&(this.isSnapback=!0,this.snapForwardTime=s,this.vjsPlayer.currentTime(t.start))}};gt.prototype.onStreamEvent=function(s){switch(s.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(s.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+s.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(s),this.daiController.getSettings().fallbackStreamUrl&&this.loadUrl(this.daiController.getSettings().fallbackStreamUrl);break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:this.isAdBreak=!0,this.adUiDiv.style.display="block",this.daiController.onAdBreakStart();break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:this.isAdBreak=!1,this.adUiDiv.style.display="none",this.daiController.onAdBreakEnd(),this.snapForwardTime&&this.snapForwardTime>this.vjsPlayer.currentTime()&&(this.vjsPlayer.currentTime(this.snapForwardTime),this.snapForwardTime=0);break}};gt.prototype.loadUrl=function(s){this.vjsPlayer.ready((function(){var e=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:s,type:this.SOURCE_TYPES[e]});var t=this.daiController.getSettings().bookmarkTime;if(t){var i=this.streamManager.streamTimeForContentTime(t);this.isSnapback=!0,this.vjsPlayer.currentTime(i)}}).bind(this))};gt.prototype.requestStream=function(){var s,e=this.daiController.getSettings().streamType;if(e==="vod"?(s=new google.ima.dai.api.VODStreamRequest,s.contentSourceId=this.daiController.getSettings().cmsId,s.videoId=this.daiController.getSettings().videoId):e==="live"?(s=new google.ima.dai.api.LiveStreamRequest,s.assetKey=this.daiController.getSettings().assetKey):window.console.warn("No valid stream type selected"),s.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(s.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(s.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(s.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(s.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){s.omidAccessModeRules={};var t=this.daiController.getSettings().omidMode;t.FULL&&(s.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=t.FULL),t.DOMAIN&&(s.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=t.DOMAIN),t.LIMITED&&(s.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=t.LIMITED)}this.streamManager.requestStream(s),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:s})};gt.prototype.onPlayerReady=function(){this.initImaDai()};gt.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()};gt.prototype.addEventListener=function(s,e){this.streamManager&&this.streamManager.addEventListener(s,e)};gt.prototype.getStreamManager=function(){return this.streamManager};gt.prototype.reset=function(){this.streamManager&&this.streamManager.reset()};var Ne=function(e,t){this.inAdBreak=!1,this.settings={},this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(t);var i={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},r=Object.assign({},i,t.contribAdsSettings||{});this.playerWrapper=new St(e,r,this),this.sdkImpl=new gt(this)};Ne.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0};Ne.prototype.initWithSettings=function(s){this.settings=Object.assign({},Ne.IMA_DEFAULTS,s||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)};Ne.prototype.warnAboutDeprecatedSettings=function(){var s=this,e=[];e.forEach(function(t){s.settings[t]!==void 0&&console.warn("WARNING: videojs.imaDai setting "+t+" is deprecated")})};Ne.prototype.getSettings=function(){return this.settings};Ne.prototype.getIsMobile=function(){return this.isMobile};Ne.prototype.getIsIos=function(){return this.isIos};Ne.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()};Ne.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()};Ne.prototype.requestStream=function(){this.sdkImpl.requestStream()};Ne.prototype.setSetting=function(s,e){this.settings[s]=e};Ne.prototype.onErrorLoadingAds=function(s){this.playerWrapper.onAdError(s)};Ne.prototype.onAdError=function(s){this.playerWrapper.onAdError(s)};Ne.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()};Ne.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()};Ne.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()};Ne.prototype.isInAdBreak=function(){return this.inAdBreak};Ne.prototype.onSeekEnd=function(s){this.sdkImpl.onSeekEnd(s)};Ne.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()};Ne.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()};Ne.prototype.addEventListener=function(s,e){this.sdkImpl.addEventListener(s,e)};Ne.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()};Ne.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()};Ne.prototype.streamWillAutoplay=function(){return this.settings.streamWillAutoplay!==void 0?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay};Ne.prototype.triggerPlayerEvent=function(s,e){this.playerWrapper.triggerPlayerEvent(s,e)};var OT=function(e,t){this.controller=new ue(e,t),this.addContentAndAdsEndedListener=(function(i){this.controller.addContentAndAdsEndedListener(i)}).bind(this),this.addContentEndedListener=(function(i){this.controller.addContentEndedListener(i)}).bind(this),this.addEventListener=(function(i,r){this.controller.addEventListener(i,r)}).bind(this),this.changeAdTag=(function(i){this.controller.changeAdTag(i)}).bind(this),this.getAdsManager=(function(){return this.controller.getAdsManager()}).bind(this),this.initializeAdDisplayContainer=(function(){this.controller.initializeAdDisplayContainer()}).bind(this),this.pauseAd=(function(){this.controller.pauseAd()}).bind(this),this.playAdBreak=(function(){this.controller.playAdBreak()}).bind(this),this.requestAds=(function(){this.controller.requestAds()}).bind(this),this.resumeAd=(function(){this.controller.resumeAd()}).bind(this),this.setAdBreakReadyListener=(function(i){this.controller.setAdBreakReadyListener(i)}).bind(this),this.setContentWithAdTag=(function(i,r){this.controller.setContentWithAdTag(i,r)}).bind(this),this.setContentWithAdsResponse=(function(i,r){this.controller.setContentWithAdsResponse(i,r)}).bind(this),this.setContentWithAdsRequest=(function(i,r){this.controller.setContentWithAdsRequest(i,r)}).bind(this),this.setShowCountdown=(function(i){this.controller.setShowCountdown(i)}).bind(this)},RT=function(e,t){this.controller=new Ne(e,t),this.streamEndedListener=(function(i){this.controller.addStreamEndedListener(i)}).bind(this),this.addEventListener=(function(i,r){this.controller.addEventListener(i,r)}
205).bind(this),this.getStreamManager=(function(){return this.controller.getStreamManager()}).bind(this)},MT=function(e){this.ima=new OT(this,e)},NT=xf(function s(e,t){if(Sf(this,s),e=e.toLowerCase(),e!=="hls"&&e!=="dash"){window.console.error("VodStream error: incorrect streamFormat.");return}else if(e==="dash"){window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin.");return}else if(typeof t!="string"){window.console.error("assetKey error: value must be string.");return}this.streamFormat=e,this.assetKey=t}),BT=xf(function s(e,t,i){if(Sf(this,s),e=e.toLowerCase(),e!=="hls"&&e!=="dash"){window.console.error("VodStream error: incorrect streamFormat.");return}else if(e==="dash"){window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin.");return}else if(typeof t!="string"){window.console.error("cmsId error: value must be string.");return}else if(typeof i!="string"){window.console.error("videoId error: value must be string.");return}this.streamFormat=e,this.cmsId=t,this.videoId=i}),FT=function(e,t){if(e instanceof NT)t.streamType="live",t.assetKey=e.assetKey;else if(e instanceof BT)t.streamType="vod",t.cmsId=e.cmsId,t.videoId=e.videoId;else{window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");return}t.streamFormat=e.streamFormat,this.imaDai=new RT(this,t)},Ef=F.registerPlugin||F.plugin;Ef("ima",MT);Ef("imaDai",FT);var UT=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),jT=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,128,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,
205102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function Cf(s){return Object.assign({muted:!1,timeout:250,inline:!1},s)}function Af(s,e){var t=s.muted,i=s.timeout,r=s.inline,n=e(),a=n.element,l=n.source,d=void 0,f=void 0,m=void 0;return a.muted=t,t===!0&&a.setAttribute("muted","muted"),r===!0&&a.setAttribute("playsinline","playsinline"),a.src=l,new Promise(function(y){d=a.play(),f=setTimeout(function(){m(!1,new Error("Timeout "+i+" ms has been reached"))},i),m=function(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;a.remove(),a.srcObject=null,clearTimeout(f),y({result:E,error:O})},d!==void 0?d.then(function(){return m(!0)}).catch(function(k){return m(!1,k)}):m(!0)})}function qT(s){return s=Cf(s),Af(s,function(){return{element:document.createElement("video"),source:URL.createObjectURL(jT)}})}function $T(s){return s=Cf(s),Af(s,function(){return{element:document.createElement("audio"),source:URL.createObjectURL(UT)}})}var VT={audio:$T,video:qT},hs=(s=>(s.COMPLETE="complete",s.ALL_ADS_COMPLETED="allAdsCompleted",s.STARTED="start",s))(hs||{});class Vt{static _gadsScriptsStatus="idle";static get gadsScriptsStatus(){return Vt._gadsScriptsStatus}static loadScript(e){return new Promise((t,i)=>{const r=document.createElement("script");r.async=!0,r.defer=!0,r.type="text/javascript",r.src=e;const n=document.getElementsByTagName("script")[0];n?.parentNode?.insertBefore(r,n),r.onload=()=>{t(null)},r.onerror=()=>{i(null)}})}static async loadGoogleAdsScripts(){if(Vt.gadsScriptsStatus=="idle")try{const e=["//www.googletagservices.com/tag/js/gpt.js","//imasdk.googleapis.com/js/sdkloader/ima3.js"].map(t=>Vt.loadScript(t));await Promise.all([...e,hg(()=>import("./Dz_eXEoY.js"),__vite__mapDeps([0]),import.meta.url)]),Vt._gadsScriptsStatus="loaded"}catch{Vt._gadsScriptsStatus="error"}}static async init(){await Vt.loadGoogleAdsScripts()}static adsManagerLoadedCallback(e,t){const i=[hs.COMPLETE,hs.STARTED,hs.ALL_ADS_COMPLETED];for(let r=0;r<i.length;r++)e?.ima.addEventListener(i[r],t)}static isAdsNotPlaying(e,t){return t===hs.STARTED?!1:!(e==="ended"&&(!t||t!==hs.ALL_ADS_COMPLETED))}}const Md=["playing","waiting","ended","play","pause"],HT={ref:"videoPlayer",class:"video-js vjs-default-skin",preload:"auto",autoplay:"",controls:"",playsinline:""},zT=["src"],WT=fg({__name:"VideoJsPlayer",props:{videoSrc:{default:""}},emits:["stateChange"],setup(s,{emit:e}){const t=e,{jwConfig:i}=pg().public,r=or(null),n=or(null),a=or(!0);gg(async()=>{if(r.value==null)return;await Vt.init();const y=!await VT.video({timeout:100,muted:!1});n.value=F(r.value,{muted:y}),n.value.on(Md,f),Vt.gadsScriptsStatus==="loaded"&&n.value.ima({id:r.value,adTagUrl:i.AD_TAG,adsManagerLoadedCallback:()=>Vt.adsManagerLoadedCallback(n.value,m)}),n.value?.on("ready",()=>setTimeout(()=>a.value=!1,4e3))}),mg(()=>{n.value!=null&&(Md.forEach(y=>n.value?.off(y)),n.value.dispose())});const l=or(),d=or();function f(y){d.value=y.type,Vt.isAdsNotPlaying(y.type,l.value)&&t("stateChange",y.type)}function m(y){l.value=y.type}return(y,k)=>(yg(),_g("div",{class:vg(["video-js-container",{"hide-big-play-button":a.value}])},[su("video",HT,[su("source",{src:s.videoSrc,type:"video/mp4"},null,8,zT)],512)],2))}}),GT=Tg(WT,[["__scopeId","data-v-3d6df1c1"]]),YT=Object.freeze(Object.defineProperty({__proto__:null,default:GT},Symbol.toStringTag,{value:"Module"}));
205export{YT as V,ie as d,F as v,D as w}; 206//# sourceMappingURL=C6vLx7B0.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.