1import{aH as _r,aZ as Vp}from"./theme.js";var da,zu;function xn(){if(zu)return da;zu=1;var s;return typeof window<"u"?s=window:typeof globalThis<"u"?s=globalThis:typeof self<"u"?s=self:s={},da=s,da}var zp=xn();const w=_r(zp),Gp={},Wp=Object.freeze(Object.defineProperty({__proto__:null,default:Gp},Symbol.toStringTag,{value:"Module"})),Xp=Vp(Wp);var fa,Gu;function vc(){if(Gu)return fa;Gu=1;var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},e=Xp,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),fa=t,fa}var Kp=vc();const ie=_r(Kp);var Qr={exports:{}},pa={exports:{}},Wu;function Yp(){return Wu||(Wu=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}(pa)),pa.exports}var ma,Xu;function Qp(){if(Xu)return ma;Xu=1,ma=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 ma}var ga,Ku;function Jp(){if(Ku)return ga;Ku=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 u=0;return function(){return u>=r.length?{done:!0}:{done:!1,value:r[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 2In 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,u=new Array(n);a<n;a++)u[a]=r[a];return u}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(u,c){this.typeToInterceptorsMap_.has(u)||this.typeToInterceptorsMap_.set(u,new Set);
2var f=this.typeToInterceptorsMap_.get(u);return f.has(c)?!1:(f.add(c),!0)},n.removeInterceptor=function(u,c){var f=this.typeToInterceptorsMap_.get(u);return f&&f.has(c)?(f.delete(c),!0):!1},n.clearInterceptorsByType=function(u){var c=this.typeToInterceptorsMap_.get(u);return c?(this.typeToInterceptorsMap_.delete(u),this.typeToInterceptorsMap_.set(u,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(u){return this.typeToInterceptorsMap_.get(u)||new Set},n.execute=function(u,c){for(var f=this.getForType(u),g=s(f),_;!(_=g()).done;){var k=_.value;try{c=k(c)}catch{}}return c},r}();return ga=i,ga}var _a,Yu;function Zp(){if(Yu)return _a;Yu=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,u=a.maxAttempts,c=a.delayFactor,f=a.fuzzFactor,g=a.initialDelay;return new e({maxAttempts:u||this.maxAttempts_,delayFactor:c||this.delayFactor_,fuzzFactor:f||this.fuzzFactor_,initialDelay:g||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 _a=s,_a}var ya,Qu;function em(){if(Qu)return ya;Qu=1;var s=xn(),e=function(r,n){return n===void 0&&(n=!1),function(a,u,c){if(a){r(a);return}if(u.statusCode>=400&&u.statusCode<=599){var f=c;if(n)if(s.TextDecoder){var g=t(u.headers&&u.headers["content-type"]);try{f=new TextDecoder(g).decode(c)}catch{}}else f=String.fromCharCode.apply(null,new Uint8Array(c));r({cause:f});return}r(null,c)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),u=a[0],c=a[1];return u.trim()==="charset"?c.trim():r},"utf-8")}return ya=e,ya}var Ju;function tm(){if(Ju)return Qr.exports;Ju=1;var s=xn(),e=Yp(),t=Qp(),i=Jp(),r=Zp();f.httpHandler=em(),f.requestInterceptorsStorage=new i,f.responseInterceptorsStorage=new i,f.retryManager=new r;var n=function(L){var T={};return L&&L.trim().split(` 3`).forEach(function(P){var B=P.indexOf(":"),N=P.slice(0,B).trim().toLowerCase(),O=P.slice(B+1).trim();typeof T[N]>"u"?T[N]=O:Array.isArray(T[N])?T[N].push(O):T[N]=[T[N],O]}),T};Qr.exports=f,Qr.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(D){f[D==="delete"?"del":D]=function(L,T,P){return T=c(L,T,P),T.method=D.toUpperCase(),g(T)}});function a(D,L){for(var T=0;T<D.length;T++)L(D[T])}function u(D){for(var L in D)if(D.hasOwnProperty(L))return!1;return!0}function c(D,L,T){var P=D;
3return t(L)?(T=L,typeof D=="string"&&(P={uri:D})):P=e({},L,{uri:D}),P.callback=T,P}function f(D,L,T){return L=c(D,L,T),g(L)}function g(D){if(typeof D.callback>"u")throw new Error("callback argument missing");if(D.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var L={uri:D.uri||D.url,headers:D.headers||{},body:D.body,metadata:D.metadata||{},retry:D.retry,timeout:D.timeout},T=f.requestInterceptorsStorage.execute(D.requestType,L);D.uri=T.uri,D.headers=T.headers,D.body=T.body,D.metadata=T.metadata,D.retry=T.retry,D.timeout=T.timeout}var P=!1,B=function(Z,J,te){P||(P=!0,D.callback(Z,J,te))};function N(){$.readyState===4&&!f.responseInterceptorsStorage.getIsEnabled()&&setTimeout(q,0)}function O(){var Y=void 0;if($.response?Y=$.response:Y=$.responseText||_($),G)try{Y=JSON.parse(Y)}catch{}return Y}function H(Y){if(clearTimeout(ee),clearTimeout(D.retryTimeout),Y instanceof Error||(Y=new Error(""+(Y||"Unknown XMLHttpRequest Error"))),Y.statusCode=0,!V&&f.retryManager.getIsEnabled()&&D.retry&&D.retry.shouldRetry()){D.retryTimeout=setTimeout(function(){D.retry.moveToNextAttempt(),D.xhr=$,g(D)},D.retry.getCurrentFuzzedDelay());return}if(D.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var Z={headers:se.headers||{},body:se.body,responseUrl:$.responseURL,responseType:$.responseType},J=f.responseInterceptorsStorage.execute(D.requestType,Z);se.body=J.body,se.headers=J.headers}return B(Y,se)}function q(){if(!V){var Y;clearTimeout(ee),clearTimeout(D.retryTimeout),D.useXDR&&$.status===void 0?Y=200:Y=$.status===1223?204:$.status;var Z=se,J=null;if(Y!==0?(Z={body:O(),statusCode:Y,method:C,headers:{},url:v,rawRequest:$},$.getAllResponseHeaders&&(Z.headers=n($.getAllResponseHeaders()))):J=new Error("Internal XMLHttpRequest Error"),D.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var te={headers:Z.headers||{},body:Z.body,responseUrl:$.responseURL,responseType:$.responseType},oe=f.responseInterceptorsStorage.execute(D.requestType,te);Z.body=oe.body,Z.headers=oe.headers}return B(J,Z,Z.body)}}var $=D.xhr||null;$||(D.cors||D.useXDR?$=new f.XDomainRequest:$=new f.XMLHttpRequest);var R,V,v=$.url=D.uri||D.url,C=$.method=D.method||"GET",F=D.body||D.data,K=$.headers=D.headers||{},j=!!D.sync,G=!1,ee,se={body:void 0,headers:{},statusCode:0,method:C,url:v,rawRequest:$};if("json"in D&&D.json!==!1&&(G=!0,K.accept||K.Accept||(K.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(K["content-type"]||K["Content-Type"]||(K["Content-Type"]="application/json"),F=JSON.stringify(D.json===!0?F:D.json))),$.onreadystatechange=N,$.onload=q,$.onerror=H,$.onprogress=function(){},$.onabort=function(){V=!0,clearTimeout(D.retryTimeout)},$.ontimeout=H,$.open(C,v,!j,D.username,D.password),j||($.withCredentials=!!D.withCredentials),!j&&D.timeout>0&&(ee=setTimeout(function(){if(!V){V=!0,$.abort("timeout");var Y=new Error("XMLHttpRequest timeout");Y.code="ETIMEDOUT",H(Y)}},D.timeout)),$.setRequestHeader)for(R in K)K.hasOwnProperty(R)&&$.setRequestHeader(R,K[R]);else if(D.headers&&!u(D.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in D&&($.responseType=D.responseType),"beforeSend"in D&&typeof D.beforeSend=="function"&&D.beforeSend($),$.send(F||null),$}function _(D){try{if(D.responseType==="document")return D.responseXML;var L=D.responseXML&&D.responseXML.documentElement.nodeName==="parsererror";if(D.responseType===""&&!L)return D.responseXML}catch{}return null}function k(){}return Qr.exports}var im=tm();const bc=_r(im);var Ta={exports:{}},va,Zu;
3function sm(){if(Zu)return va;Zu=1;var s=vc(),e=Object.create||function(){function v(){}return function(C){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return v.prototype=C,new v}}();function t(v,C){this.name="ParsingError",this.code=v.code,this.message=C||v.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(v){function C(K,j,G,ee){return(K|0)*3600+(j|0)*60+(G|0)+(ee|0)/1e3}var F=v.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return F?F[3]?C(F[1],F[2],F[3].replace(":",""),F[4]):F[1]>59?C(F[1],F[2],0,F[4]):C(0,F[1],F[2],F[4]):null}function r(){this.values=e(null)}r.prototype={set:function(v,C){!this.get(v)&&C!==""&&(this.values[v]=C)},get:function(v,C,F){return F?this.has(v)?this.values[v]:C[F]:this.has(v)?this.values[v]:C},has:function(v){return v in this.values},alt:function(v,C,F){for(var K=0;K<F.length;++K)if(C===F[K]){this.set(v,C);break}},integer:function(v,C){/^-?\d+$/.test(C)&&this.set(v,parseInt(C,10))},percent:function(v,C){return C.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(C=parseFloat(C),C>=0&&C<=100)?(this.set(v,C),!0):!1}};function n(v,C,F,K){var j=K?v.split(K):[v];for(var G in j)if(typeof j[G]=="string"){var ee=j[G].split(F);if(ee.length===2){var se=ee[0].trim(),Y=ee[1].trim();C(se,Y)}}}function a(v,C,F){var K=v;function j(){var se=i(v);if(se===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+K);return v=v.replace(/^[^\sa-zA-Z-]+/,""),se}function G(se,Y){var Z=new r;n(se,function(J,te){switch(J){case"region":for(var oe=F.length-1;oe>=0;oe--)if(F[oe].id===te){Z.set(J,F[oe].region);break}break;case"vertical":Z.alt(J,te,["rl","lr"]);break;case"line":var me=te.split(","),le=me[0];Z.integer(J,le),Z.percent(J,le)&&Z.set("snapToLines",!1),Z.alt(J,le,["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(){v=v.replace(/^\s+/,"")}if(ee(),C.startTime=j(),ee(),v.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+K);v=v.substr(3),ee(),C.endTime=j(),ee(),G(v,C)}var u=s.createElement&&s.createElement("textarea"),c={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)"},g={v:"title",lang:"lang"},_={rt:"ruby"};function k(v,C){function F(){if(!C)return null;function le(fe){return C=C.substr(fe.length),fe}var Te=C.match(/^([^<]*)(<[^>]*>?)?/);return le(Te[1]?Te[1]:Te[2])}function K(le){return u.innerHTML=le,le=u.textContent,u.textContent="",le}function j(le,Te){return!_[Te.localName]||_[Te.localName]===le.localName}function G(le,Te){var fe=c[le];if(!fe)return null;var Se=v.document.createElement(fe),We=g[le];return We&&Te&&(Se[We]=Te.trim()),Se}for(var ee=v.document.createElement("div"),se=ee,Y,Z=[];(Y=F())!==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=v.document.createProcessingInstruction("timestamp",J),se.appendChild(te);continue}var oe=Y.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!oe||(te=G(oe[1],oe[3]),!te)||!j(se,te))continue;if(oe[2]){var me=oe[2].split(".");me.forEach(function(le){var Te=/^bg_/.test(le),fe=Te?le.slice(3):le;if(f.hasOwnProperty(fe)){var Se=Te?"background-color":"color",We=f[fe];te.style[Se]=We}}),te.className=me.join(" ")}Z.push(oe[1]),se.appendChild(te),se=te;continue}se.appendChild(v.document.createTextNode(K(Y)))}return ee}var D=[[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
3],[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 L(v){for(var C=0;C<D.length;C++){var F=D[C];if(v>=F[0]&&v<=F[1])return!0}return!1}function T(v){var C=[],F="",K;if(!v||!v.childNodes)return"ltr";function j(se,Y){for(var Z=Y.childNodes.length-1;Z>=0;Z--)se.push(Y.childNodes[Z])}function G(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 G(se);if(Y.childNodes)return j(se,Y),G(se)}for(j(C,v);F=G(C);)for(var ee=0;ee<F.length;ee++)if(K=F.charCodeAt(ee),L(K))return"rtl";return"ltr"}function P(v){if(typeof v.line=="number"&&(v.snapToLines||v.line>=0&&v.line<=100))return v.line;if(!v.track||!v.track.textTrackList||!v.track.textTrackList.mediaElement)return-1;for(var C=v.track,F=C.textTrackList,K=0,j=0;j<F.length&&F[j]!==C;j++)F[j].mode==="showing"&&K++;return++K*-1}function B(){}B.prototype.applyStyles=function(v,C){C=C||this.div;for(var F in v)v.hasOwnProperty(F)&&(C.style[F]=v[F])},B.prototype.formatStyle=function(v,C){return v===0?0:v+C};function N(v,C,F){B.call(this),this.cue=C,this.cueDiv=k(v,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=v.document.createElement("div"),K={direction:T(this.cueDiv),writingMode:C.vertical===""?"horizontal-tb":C.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:C.align==="middle"?"center":C.align,font:F.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(K),this.div.appendChild(this.cueDiv);var j=0;switch(C.positionAlign){case"start":case"line-left":j=C.position;break;case"center":j=C.position-C.size/2;break;case"end":case"line-right":j=C.position-C.size;break}C.vertical===""?this.applyStyles({left:this.formatStyle(j,"%"),width:this.formatStyle(C.size,"%")}):this.applyStyles({top:this.formatStyle(j,"%"),height:this.formatStyle(C.size,"%")}),this.move=function(G){this.applyStyles({top:this.formatStyle(G.top,"px"),bottom:this.formatStyle(G.bottom,"px"),left:this.formatStyle(G.left,"px"),right:this.formatStyle(G.right,"px"),height:this.formatStyle(G.height,"px"),width:this.formatStyle(G.width,"px")})}}N.prototype=e(B.prototype),N.prototype.constructor=N;function O(v){var C,F,K,j;if(v.div){F=v.div.offsetHeight,K=v.div.offsetWidth,j=v.div.offsetTop;var G=(G=v.div.childNodes)&&(G=G[0])&&G.getClientRects&&G.getClientRects();v=v.div.getBoundingClientRect(),C=G?Math.max(G[0]&&G[0].height||0,v.height/G.length):0}this.left=v.left,this.right=v.right,this.top=v.top||j,this.height=v.height||F,this.bottom=v.bottom||j+(v.height||F),this.width=v.width||K,this.lineHeight=C!==void 0?C:v.lineHeight}O.prototype.move=function(v,C){switch(C=C!==void 0?C:this.lineHeight,v){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}},O.prototype.overlaps=function(v){return this.left<v.right&&this.right>v.left&&this.top<v.bottom&&this.bottom>v.top},O.prototype.overlapsAny=function(v){for(var C=0;C<v.length;C++)if(this.overlaps(v[C]))return!0;return!1},O.prototype.within=function(v){return this.top>=v.top&&this.bottom<=v.bottom&&this.left>=v.left&&this.right<=v.right},O.prototype.overlapsOppositeAxis=function(v,C){switch(C){case"+x":return this.left<v.left;case"-x":return this.right>v.right;case"+y":return this.top<v.top;case"-y":return this.bottom>v.bottom}},O.prototype.intersectPercentage=function(v){var C=Math.max(0,Math.min(this.right,v.right)-Math.max(this.left,v.left)),F=Math.max(0,Math.min(this.bottom,v.bottom)-Math.max(this.top,v.top)),K=C*F;return K/(this.height*this.width)},O.prototype.toCSSCompatValues=function(v){return{top:this.top-v.top,bottom:v.bottom-this.bottom,left:this.left-v.left,right:v.right-this.right,height:this.height,width:this.width}}
3,O.getSimpleBoxPosition=function(v){var C=v.div?v.div.offsetHeight:v.tagName?v.offsetHeight:0,F=v.div?v.div.offsetWidth:v.tagName?v.offsetWidth:0,K=v.div?v.div.offsetTop:v.tagName?v.offsetTop:0;v=v.div?v.div.getBoundingClientRect():v.tagName?v.getBoundingClientRect():v;var j={left:v.left,right:v.right,top:v.top||K,height:v.height||C,bottom:v.bottom||K+(v.height||C),width:v.width||F};return j};function H(v,C,F,K){function j(fe,Se){for(var We,Ge=new O(fe),Ze=1,ct=0;ct<Se.length;ct++){for(;fe.overlapsOppositeAxis(F,Se[ct])||fe.within(F)&&fe.overlapsAny(K);)fe.move(Se[ct]);if(fe.within(F))return fe;var Ft=fe.intersectPercentage(F);Ze>Ft&&(We=new O(fe),Ze=Ft),fe=new O(Ge)}return We||Ge}var G=new O(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=G.lineHeight,te=J*Math.round(se),oe=F[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===""?F.height:F.width,Y=Y.reverse()),G.move(me,te)}else{var le=G.lineHeight/F.height*100;switch(ee.lineAlign){case"center":se-=le/2;break;case"end":se-=le;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"],G=new O(C)}var Te=j(G,Y);C.move(Te.toCSSCompatValues(F))}function q(){}q.StringDecoder=function(){return{decode:function(v){if(!v)return"";if(typeof v!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(v))}}},q.convertCueToDOMTree=function(v,C){return!v||!C?null:k(v,C)};var $=.05,R="sans-serif",V="1.5%";return q.processCues=function(v,C,F){if(!v||!C||!F)return null;for(;F.firstChild;)F.removeChild(F.firstChild);var K=v.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=V,F.appendChild(K);function j(J){for(var te=0;te<J.length;te++)if(J[te].hasBeenReset||!J[te].displayState)return!0;return!1}if(!j(C)){for(var G=0;G<C.length;G++)K.appendChild(C[G].displayState);return}var ee=[],se=O.getSimpleBoxPosition(K),Y=Math.round(se.height*$*100)/100,Z={font:Y+"px "+R};(function(){for(var J,te,oe=0;oe<C.length;oe++)te=C[oe],J=new N(v,te,Z),K.appendChild(J.div),H(v,J,se,ee),te.displayState=J.div,ee.push(O.getSimpleBoxPosition(J))})()},q.Parser=function(v,C,F){F||(F=C,C={}),C||(C={}),this.window=v,this.vttjs=C,this.state="INITIAL",this.buffer="",this.decoder=F||new TextDecoder("utf8"),this.regionList=[]},q.Parser.prototype={reportOrThrowError:function(v){if(v instanceof t)this.onparsingerror&&this.onparsingerror(v);else throw v},parse:function(v){var C=this;v&&(C.buffer+=C.decoder.decode(v,{stream:!0}));function F(){for(var J=C.buffer,te=0;te<J.length&&J[te]!=="\r"&&J[te]!==` 4`;)++te;var oe=J.substr(0,te);return J[te]==="\r"&&++te,J[te]===` 5`&&++te,C.buffer=J.substr(te),oe}function K(J){var te=new r;if(n(J,function(me,le){switch(me){case"id":te.set(me,le);break;case"width":te.percent(me,le);break;case"lines":te.integer(me,le);break;case"regionanchor":case"viewportanchor":var Te=le.split(",");if(Te.length!==2)break;var fe=new r;if(fe.percent("x",Te[0]),fe.percent("y",Te[1]),!fe.has("x")||!fe.has("y"))break;te.set(me+"X",fe.get("x")),te.set(me+"Y",fe.get("y"));break;case"scroll":te.alt(me,le,["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(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 G(J){J.match(/X-TIMESTAMP-MAP/)?n(J,function(te,oe){switch(te){case"X-TIMESTAMP-MAP":j(oe);break}},/=/):n(J,function(te,oe){switch(te){case"Region":K(oe);break}},/:/)}try{var ee;if(C.state==="INITIAL"){if(!/\r\n|\n/.test(C.buffer))return this;ee=F();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=F(),C.state){case"HEADER":/:/.test(ee)?G(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;
5continue}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+=` 6`),C.cue.text+=ee.replace(/\u2028/g,` 7`).replace(/u2029/g,` 8`);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 v=this;try{if(v.buffer+=v.decoder.decode(),(v.cue||v.state==="HEADER")&&(v.buffer+=` 9 10`,v.parse()),v.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(C){v.reportOrThrowError(C)}return v.onflush&&v.onflush(),this}},va=q,va}var ba,el;function rm(){if(el)return ba;el=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 u=e[a.toLowerCase()];return u?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var u=t[a.toLowerCase()];return u?a.toLowerCase():!1}function n(a,u,c){this.hasBeenReset=!1;var f="",g=!1,_=a,k=u,D=c,L=null,T="",P=!0,B="auto",N="start",O="auto",H="auto",q=100,$="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return f},set:function(R){f=""+R}},pauseOnExit:{enumerable:!0,get:function(){return g},set:function(R){g=!!R}},startTime:{enumerable:!0,get:function(){return _},set:function(R){if(typeof R!="number")throw new TypeError("Start time must be set to a number.");_=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 D},set:function(R){D=""+R,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return L},set:function(R){L=R,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return T},set:function(R){var V=i(R);if(V===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");T=V,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 V=r(R);V?(N=V,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return O},set:function(R){if(R<0||R>100)throw new Error("Position must be between 0 and 100.");O=R,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return H},set:function(R){var V=r(R);V?(H=V,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return q},set:function(R){if(R<0||R>100)throw new Error("Size must be between 0 and 100.");q=R,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return $},set:function(R){var V=r(R);if(!V)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");$=V,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},ba=n,ba}var Sa,tl;function nm(){if(tl)return Sa;tl=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,u=100,c=0,f=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(_){if(!t(_))throw new Error("Width must be between 0 and 100.");r=_}},lines:{enumerable:!0,get:function(){return n},set:function(_){if(typeof _!="number")throw new TypeError("Lines must be set to a number.");n=_}},regionAnchorY:{enumerable:!0,get:function(){return u},set:function(_){if(!t(_))throw new Error("RegionAnchorX must be between 0 and 100.");u=_}},regionAnchorX:{enumerable:!0,get:function(){return a}
10,set:function(_){if(!t(_))throw new Error("RegionAnchorY must be between 0 and 100.");a=_}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(_){if(!t(_))throw new Error("ViewportAnchorY must be between 0 and 100.");f=_}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(_){if(!t(_))throw new Error("ViewportAnchorX must be between 0 and 100.");c=_}},scroll:{enumerable:!0,get:function(){return g},set:function(_){var k=e(_);k===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=k}}})}return Sa=i,Sa}var il;function am(){if(il)return Ta.exports;il=1;var s=xn(),e=Ta.exports={WebVTT:sm(),VTTCue:rm(),VTTRegion:nm()};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(),Ta.exports}var om=am();const sl=_r(om);function Ve(){return Ve=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},Ve.apply(null,arguments)}var rl="https://example.com",kn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=w.location&&w.location.href||"");var i=/^\/\//.test(e),r=!w.location&&!/\/\//i.test(e);e=new w.URL(e,w.location||rl);var n=new URL(t,e);return r?n.href.slice(rl.length):i?n.href.slice(n.protocol.length):n.href},vo=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 u=Array.prototype.slice.call(arguments,1),c=r.length,f=0;f<c;++f)r[f].apply(this,u)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s}(),um=function(e){return w.atob?w.atob(e):Buffer.from(e,"base64").toString("binary")};function Sc(s){for(var e=um(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}class lm extends vo{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(` 11`);t>-1;t=this.buffer.indexOf(` 12`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const cm=" ",Ea=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},hm=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},at=function(s){const e={};if(!s)return e;const t=s.split(hm());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},nl=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 dm extends vo{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 u=a(e);return u===e?n:n.concat([u])},[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=Ve(Ea(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=at(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=Ea(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=at(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=nl(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=at(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: 4,328 bytes, line 12
12,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=at(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=at(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=at(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(cm)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=at(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=Ea(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=at(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=at(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=at(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(i.attributes.hasOwnProperty(a)){i.attributes[a]=parseInt(i.attributes[a],10);const u=a==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[u]=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=at(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=at(t[1]),["ID","CLASS"].forEach(function(u){i.attributes.hasOwnProperty(u)&&(i.attributes[u]=String(i.attributes[u]))}),["START-DATE","END-DATE"].forEach(function(u){i.attributes.hasOwnProperty(u)&&(i.attributes[u]=new Date(i.attributes[u]))}),["DURATION","PLANNED-DURATION"].forEach(function(u){i.attributes.hasOwnProperty(u)&&(i.attributes[u]=parseFloat(i.attributes[u]))}),["END-ON-NEXT"].forEach(function(u){i.attributes.hasOwnProperty(u)&&(i.attributes[u]=/YES/i.test(i.attributes[u]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(u){i.attributes.hasOwnProperty(u)&&(i.attributes[u]=i.attributes[u].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;
12for(const u in i.attributes){if(!a.test(u))continue;const c=/[0-9A-Fa-f]{6}/g.test(i.attributes[u]),f=/^\d+(\.\d+)?$/.test(i.attributes[u]);i.attributes[u]=c?i.attributes[u].toString(16):f?parseFloat(i.attributes[u]):String(i.attributes[u])}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=at(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=at(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=nl(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=at(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 fm=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),yi=function(s){const e={};return Object.keys(s).forEach(function(t){e[fm(t)]=s[t]}),e},Ca=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",u=t&&t*3,c=i&&i*2;t&&!e.hasOwnProperty(n)&&(e[n]=u,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[n]<u&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${u})`}),e[n]=u),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]<c&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${c}).`}),e[a]=c)};class pm extends vo{constructor(e={}){super(),this.lineStream=new lm,this.parseStream=new dm,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,u=!1;const c=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},g="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let _=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let k=0,D=0;const L={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof _=="number"&&(r.timeline=_),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(T){let P,B;if(t.manifest.definitions){for(const N in t.manifest.definitions)if(T.uri&&(T.uri=T.uri.replace(`{$${N}}`,t.manifest.definitions[N])),T.attributes)for(const O in T.attributes)typeof T.attributes[O]=="string"&&(T.attributes[O]=T.attributes[O].replace(`{$${N}}`,t.manifest.definitions[N]))}({tag(){({version(){T.version&&(this.manifest.version=T.version)},"allow-cache"(){this.manifest.allowCache=T.allowed,"allowed"in T||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const N={};"length"in T&&(r.byterange=N,N.length=T.length,"offset"in T||(T.offset=k)),"offset"in T&&(r.byterange=N,N.offset=T.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"})),T.title&&(r.title=T.title),T.duration>0&&(r.duration=T.duration),T.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!T.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(T.attributes.METHOD==="NONE"){a=null;return}if(!T.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(T.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:T.attributes};return}if(T.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:T.attributes.URI};return}if(T.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(T.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(T.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),T.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(T.attributes.KEYID&&T.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:T.attributes.KEYFORMAT,keyId:T.attributes.KEYID.substring(2)},pssh:Sc(T.attributes.URI.split(",")[1])};return}T.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:T.attributes.METHOD||"AES-128",uri:T.attributes.URI},typeof T.attributes.IV<"u"&&(a.iv=T.attributes.IV)},"media-sequence"(){if(!isFinite(T.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+T.number});return}this.manifest.mediaSequence=T.number},"discontinuity-sequence"(){if(!isFinite(T.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+T.number});return}this.manifest.discontinuitySequence=T.number,_=T.number},"playlist-type"(){if(!/VOD|EVENT/.test(T.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+T.playlist});return}this.manifest.playlistType=T.playlistType},map(){n={},T.uri&&(n.uri=T.uri),T.byterange&&(n.byterange=T.byterange),a&&(n.key=a)}
vendor: 5,316 bytes, line 12
12,"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!T.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Ve(r.attributes,T.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(T.attributes&&T.attributes.TYPE&&T.attributes["GROUP-ID"]&&T.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const N=this.manifest.mediaGroups[T.attributes.TYPE];N[T.attributes["GROUP-ID"]]=N[T.attributes["GROUP-ID"]]||{},P=N[T.attributes["GROUP-ID"]],B={default:/yes/i.test(T.attributes.DEFAULT)},B.default?B.autoselect=!0:B.autoselect=/yes/i.test(T.attributes.AUTOSELECT),T.attributes.LANGUAGE&&(B.language=T.attributes.LANGUAGE),T.attributes.URI&&(B.uri=T.attributes.URI),T.attributes["INSTREAM-ID"]&&(B.instreamId=T.attributes["INSTREAM-ID"]),T.attributes.CHARACTERISTICS&&(B.characteristics=T.attributes.CHARACTERISTICS),T.attributes.FORCED&&(B.forced=/yes/i.test(T.attributes.FORCED)),P[T.attributes.NAME]=B},discontinuity(){_+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=T.dateTimeString,this.manifest.dateTimeObject=T.dateTimeObject),r.dateTimeString=T.dateTimeString,r.dateTimeObject=T.dateTimeObject;const{lastProgramDateTime:N}=this;this.lastProgramDateTime=new Date(T.dateTimeString).getTime(),N===null&&this.manifest.segments.reduceRight((O,H)=>(H.programDateTime=O-H.duration*1e3,H.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(T.duration)||T.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+T.duration});return}this.manifest.targetDuration=T.duration,Ca.call(this,this.manifest)},start(){if(!T.attributes||isNaN(T.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:T.attributes["TIME-OFFSET"],precise:T.attributes.PRECISE}},"cue-out"(){r.cueOut=T.data},"cue-out-cont"(){r.cueOutCont=T.data},"cue-in"(){r.cueIn=T.data},skip(){this.manifest.skip=yi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",T.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const N=this.manifest.segments.length,O=yi(T.attributes);r.parts=r.parts||[],r.parts.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=D),D=O.byterange.offset+O.byterange.length);const H=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${H} for segment #${N}`,T.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((q,$)=>{q.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${$} lacks required attribute(s): LAST-PART`})})},"server-control"(){const N=this.manifest.serverControl=yi(T.attributes);N.hasOwnProperty("canBlockReload")||(N.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ca.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,O=yi(T.attributes),H=O.type&&O.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=H?D:0,H&&(D=O.byterange.offset+O.byterange.length)));const q=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${q} for segment #${N}`,T.attributes,["TYPE","URI"]),!!O.type)for(let $=0;$<r.preloadHints.length-1;$++){const R=r.preloadHints[$];R.type&&R.type===O.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${q} for segment #${N} has the same TYPE ${O.type} as preload hint #${$}`})}},"rendition-report"(){const N=yi(T.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(N);const O=this.manifest.renditionReports.length-1,H=["LAST-MSN","URI"];u&&H.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${O}`,T.attributes,H)},"part-inf"(){this.manifest.partInf=yi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",T.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Ca.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(yi(T.attributes));const N=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${N}`,T.attributes,["ID","START-DATE"]);const O=this.manifest.dateRanges[N];O.endDate&&O.startDate&&new Date(O.endDate)<new Date(O.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),O.duration&&O.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),O.plannedDuration&&O.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const H=!!O.endOnNext;if(H&&!O.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
12=YES attribute must have a CLASS attribute"}),H&&(O.duration||O.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),O.duration&&O.endDate){const $=O.startDate.getTime()+O.duration*1e3;this.manifest.dateRanges[N].endDate=new Date($)}if(!L[O.id])L[O.id]=O;else{for(const $ in L[O.id])if(O[$]&&JSON.stringify(L[O.id][$])!==JSON.stringify(O[$])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const q=this.manifest.dateRanges.findIndex($=>$.id===O.id);this.manifest.dateRanges[q]=Ve(this.manifest.dateRanges[q],O),L[O.id]=Ve(L[O.id],O),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=yi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",T.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const N=(O,H)=>{if(O in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${O}`});return}this.manifest.definitions[O]=H};if("QUERYPARAM"in T.attributes){if("NAME"in T.attributes||"IMPORT"in T.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const O=this.params.get(T.attributes.QUERYPARAM);if(!O){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${T.attributes.QUERYPARAM}`});return}N(T.attributes.QUERYPARAM,decodeURIComponent(O));return}if("NAME"in T.attributes){if("IMPORT"in T.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in T.attributes)||typeof T.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${T.attributes.NAME}`});return}N(T.attributes.NAME,T.attributes.VALUE);return}if("IMPORT"in T.attributes){if(!this.mainDefinitions[T.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${T.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}N(T.attributes.IMPORT,this.mainDefinitions[T.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:T.attributes,uri:T.uri,timeline:_}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",T.attributes,["BANDWIDTH","URI"])}}[T.tagType]||c).call(t)},uri(){r.uri=T.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=_,n&&(r.map=n),D=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){T.segment?(r.custom=r.custom||{},r.custom[T.customType]=T.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[T.customType]=T.data)}})[T.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(` 13`),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 Ui={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^/},mm=["video","audio","text"],al=["Video","Audio","Text"],Ec=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;mm.forEach(function(a){var u=Ui[a].exec(r.toLowerCase());if(!(!u||u.length<=1)){n=a;var c=r.substring(0,u[1].length),f=r.replace(c,"");i.push({type:c,details:f,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},gm=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},Cc=function(e){return e===void 0&&(e=""),Ui.audio.test(e.trim().toLowerCase())},_m=function(e){return e===void 0&&(e=""),Ui.text.test(e.trim().toLowerCase())},gs=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Ec(n.trim())}),i="video";t.length===1&&Cc(t[0])?i="audio":t.length===1&&_m(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Ui.mp4.test(n)})?r="mp4":t.every(function(n){return Ui.webm.test(n)})?r="webm":t.every(function(n){return Ui.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},ar=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),w.MediaSource&&w.MediaSource.isTypeSupp
13orted&&w.MediaSource.isTypeSupported(gs(e))||t&&w.ManagedMediaSource&&w.ManagedMediaSource.isTypeSupported&&w.ManagedMediaSource.isTypeSupported(gs(e))||!1},Da=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<al.length;i++){var r=al[i];if(Ui["muxer"+r].test(t))return!0}return!1})},ol="mp4a.40.2",ym="avc1.4d400d",Tm=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,vm=/^application\/dash\+xml/i,Dc=function(e){return Tm.test(e)?"hls":vm.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},bm=function(e){return e.toString(2).length},Sm=function(e){return Math.ceil(bm(e)/8)},Ac=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Em=function(e){return Ac(e)},de=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!Em(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))},et=w.BigInt||Number,Ga=[et("0x1"),et("0x100"),et("0x10000"),et("0x1000000"),et("0x100000000"),et("0x10000000000"),et("0x1000000000000"),et("0x100000000000000"),et("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 Cm=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,u=a===void 0?!1:a;e=de(e);var c=u?"reduce":"reduceRight",f=e[c]?e[c]:Array.prototype[c],g=f.call(e,function(k,D,L){var T=u?L:Math.abs(L+1-e.length);return k+et(D)*Ga[T]},et(0));if(n){var _=Ga[e.length]/et(2)-et(1);g=et(g),g>_&&(g-=_,g-=_,g-=et(2))}return Number(g)},Dm=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=et(e);for(var a=Sm(e),u=new Uint8Array(new ArrayBuffer(a)),c=0;c<a;c++){var f=n?c:Math.abs(c+1-u.length);u[f]=Number(e/Ga[c]&et(255)),e<0&&(u[f]=Math.abs(~u[f]),u[f]-=c===0?1:2)}return u},wc=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},Am=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(u){return u&&(u.byteLength||u.length)&&typeof u!="string"}),t.length<=1)return de(t[0]);var r=t.reduce(function(u,c,f){return u+(c.byteLength||c.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(u){u=de(u),n.set(u,a),a+=u.byteLength}),n},Me=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,u=r.mask,c=u===void 0?[]:u;e=de(e),t=de(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(g,_){var k=c[_]?c[_]&e[a+_]:e[a+_];return g===k})},wm=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var u=e.mediaGroups[r][n][a];i(u,r,n,a)}})},Js={},Ht={},Oi={},ul;function In(){if(ul)return Oi;ul=1;function s(n,a,u){if(u===void 0&&(u=Array.prototype),n&&typeof u.find=="function")return u.find.call(n,a);for(var c=0;c<n.length;c++)if(Object.prototype.hasOwnProperty.call(n,c)){var f=n[c];if(a.call(void 0,f,c,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 u in a)Object.prototype.hasOwnProperty.call(a,u)&&(n[u]=a[u]);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 Oi.assign=t,Oi.find=s,Oi.freeze=e,Oi.MIME_TYPE=i,Oi.NAMESPACE=r,Oi}var ll;function xc(){if(ll)return Ht;ll=1;var s=In(),e=s.find,t=s.NAMESPACE;function i(y){return y!==""}function r(y){return y?y.split(/[\t\n\f\r ]+/).filter(i):[]}function n(y,b){return y.hasOwnProperty(b)||(y[b]=!0),y}
vendor: 20,439 bytes, line 13
13function a(y){if(!y)return[];var b=r(y);return Object.keys(b.reduce(n,{}))}function u(y){return function(b){return y&&y.indexOf(b)!==-1}}function c(y,b){for(var I in y)Object.prototype.hasOwnProperty.call(y,I)&&(b[I]=y[I])}function f(y,b){var I=y.prototype;if(!(I instanceof b)){let W=function(){};W.prototype=b.prototype,W=new W,c(I,W),y.prototype=I=W}I.constructor!=y&&(typeof y!="function"&&console.error("unknown Class:"+y),I.constructor=y)}var g={},_=g.ELEMENT_NODE=1,k=g.ATTRIBUTE_NODE=2,D=g.TEXT_NODE=3,L=g.CDATA_SECTION_NODE=4,T=g.ENTITY_REFERENCE_NODE=5,P=g.ENTITY_NODE=6,B=g.PROCESSING_INSTRUCTION_NODE=7,N=g.COMMENT_NODE=8,O=g.DOCUMENT_NODE=9,H=g.DOCUMENT_TYPE_NODE=10,q=g.DOCUMENT_FRAGMENT_NODE=11,$=g.NOTATION_NODE=12,R={},V={};R.INDEX_SIZE_ERR=(V[1]="Index size error",1),R.DOMSTRING_SIZE_ERR=(V[2]="DOMString size error",2);var v=R.HIERARCHY_REQUEST_ERR=(V[3]="Hierarchy request error",3);R.WRONG_DOCUMENT_ERR=(V[4]="Wrong document",4);var C=R.INVALID_CHARACTER_ERR=(V[5]="Invalid character",5);R.NO_DATA_ALLOWED_ERR=(V[6]="No data allowed",6),R.NO_MODIFICATION_ALLOWED_ERR=(V[7]="No modification allowed",7);var F=R.NOT_FOUND_ERR=(V[8]="Not found",8);R.NOT_SUPPORTED_ERR=(V[9]="Not supported",9);var K=R.INUSE_ATTRIBUTE_ERR=(V[10]="Attribute in use",10),j=R.INVALID_STATE_ERR=(V[11]="Invalid state",11);R.SYNTAX_ERR=(V[12]="Syntax error",12),R.INVALID_MODIFICATION_ERR=(V[13]="Invalid modification",13),R.NAMESPACE_ERR=(V[14]="Invalid namespace",14),R.INVALID_ACCESS_ERR=(V[15]="Invalid access",15);function G(y,b){if(b instanceof Error)var I=b;else I=this,Error.call(this,V[y]),this.message=V[y],Error.captureStackTrace&&Error.captureStackTrace(this,G);return I.code=y,b&&(this.message=this.message+": "+b),I}G.prototype=Error.prototype,c(R,G);function ee(){}ee.prototype={length:0,item:function(y){return y>=0&&y<this.length?this[y]:null},toString:function(y,b,I){for(var W=!!I&&!!I.requireWellFormed,ne=[],ce=0;ce<this.length;ce++)Rs(this[ce],ne,y,b,null,W);return ne.join("")},filter:function(y){return Array.prototype.filter.call(this,y)},indexOf:function(y){return Array.prototype.indexOf.call(this,y)}};function se(y,b){this._node=y,this._refresh=b,Y(this)}function Y(y){var b=y._node._inc||y._node.ownerDocument._inc;if(y._inc!==b){var I=y._refresh(y._node);if(kr(y,"length",I.length),!y.$$length||I.length<y.$$length)for(var W=I.length;W in y;W++)Object.prototype.hasOwnProperty.call(y,W)&&delete y[W];c(I,y),y._inc=b}}se.prototype.item=function(y){return Y(this),this[y]||null},f(se,ee);function Z(){}function J(y,b){for(var I=y.length;I--;)if(y[I]===b)return I}function te(y,b,I,W){if(W?b[J(b,W)]=I:b[b.length++]=I,y){I.ownerElement=y;var ne=y.ownerDocument;ne&&(W&&Ze(ne,y,W),Ge(ne,y,I))}}function oe(y,b,I){var W=J(b,I);if(W>=0){for(var ne=b.length-1;W<ne;)b[W]=b[++W];if(b.length=ne,y){var ce=y.ownerDocument;ce&&(Ze(ce,y,I),I.ownerElement=null)}}else throw new G(F,new Error(y.tagName+"@"+I))}Z.prototype={length:0,item:ee.prototype.item,getNamedItem:function(y){for(var b=this.length;b--;){var I=this[b];if(I.nodeName==y)return I}},setNamedItem:function(y){var b=y.ownerElement;if(b&&b!=this._ownerElement)throw new G(K);var I=this.getNamedItem(y.nodeName);return te(this._ownerElement,this,y,I),I},setNamedItemNS:function(y){var b=y.ownerElement,I;if(b&&b!=this._ownerElement)throw new G(K);return I=this.getNamedItemNS(y.namespaceURI,y.localName),te(this._ownerElement,this,y,I),I},removeNamedItem:function(y){var b=this.getNamedItem(y);return oe(this._ownerElement,this,b),b},removeNamedItemNS:function(y,b){var I=this.getNamedItemNS(y,b);return oe(this._ownerElement,this,I),I},getNamedItemNS:function(y,b){for(var I=this.length;I--;){var W=this[I];if(W.localName==b&&W.namespaceURI==y)return W}return null}};function me(){}me.prototype={hasFeature:function(y,b){return!0},createDocument:function(y,b,I){var W=new We;if(W.implementation=this,W.childNodes=new ee,W.doctype=I||null,I&&W.appendChild(I),b){var ne=W.createElementNS(y,b);W.appendChild(ne)}return W},createDocumentType:function(y,b,I){var W=new ki;return W.name=y,W.nodeName=y,W.publicId=b||"",W.systemId=I||"",W}};function le(){}le.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(y,b){return $e(this,y,b)},replaceChild:function(y,b){$e(this,y,b,Ie),b&&this.removeChild(b)},removeChild:function(y){return Ft(this,y)},appendChild:function(y){return this.insertBefore(y,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(y){return xr(this.ownerDocument||this,this,y)},normalize:function(){Se(this,null,{enter:function(y){for(var b=y.firstChild;b;){var I=b.nextSibling;I!==null&&I.nodeType===D&&b.nodeType===D?(y.removeChild(I),b.appendData(I.data)):b=I}return!0}})},isSupported:function(y,b){return this.ownerDocument.implementation.hasFeature(y,b)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(y){for(var b=this;b;){var I=b._nsMap;if(I){for(var W in I)if(Object.prototype.hasOwnProperty.call(I,W)&&I[W]===y)return W}b=b.nodeType==k?b.ownerDocument:b.parentNode}return null},lookupNamespaceURI:function(y){for(var b=this;b;){var I=b._nsMap;if(I&&Object.prototype.hasOwnProperty.call(I,y))return I[y];b=b.nodeType==k?b.ownerDocument:b.parentNode}return null},isDefaultNamespace:function(y){var b=this.lookupPrefix(y);return b==null}};function Te(y){return y=="<"&&"<"||y==">"&&">"||y=="&"&&"&"||y=='"'&&"""||"&#"+y.charCodeAt()+";"}c(g,le),c(g,le.prototype);function fe(y,b){return Se(y,null,{enter:function(I){return b(I)?Se.STOP:!0}})===Se.STOP}function Se(y,b,I){for(var W=[{node:y,context:b,phase:Se.ENTER}];W.length>0;){var ne=W.pop();if(ne.phase===Se.ENTER){var ce=I.enter(ne.node,ne.context);if(ce===Se.STOP)return Se.STOP;if(W.push({node:ne.node,context:ce,phase:Se.EXIT}),ce==null)continue;for(var re=ne.node.lastChild;re;)W.push({node:re,context:ce,phase:Se.ENTER}),re=re.previousSibling}else I.exit&&I.exit(ne.node,ne.context)}}Se.STOP=Symbol("walkDOM.STOP"),Se.ENTER=0,Se.EXIT=1;function We(){this.ownerDocument=this}function Ge(y,b,I){y&&y._inc++;var W=I.namespaceURI;W===t.XMLNS&&(b._nsMap[I.prefix?I.localName:""]=I.value)}function Ze(y,b,I,W){y&&y._inc++;var ne=I.namespaceURI;ne===t.XMLNS&&delete b._nsMap[I.prefix?I.localName:""]}function ct(y,b,I){if(y&&y._inc){y._inc++;var W=b.childNodes;if(I)W[W.length++]=I;else{for(var ne=b.firstChild,ce=0;ne;)W[ce++]=ne,ne=ne.nextSibling;W.length=ce,delete W[W.length]}}}function Ft(y,b){var I=b.previousSibling,W=b.nextSibling;return I?I.nextSibling=W:y.firstChild=W,W?W.previousSibling=I:y.lastChild=I,b.parentNode=null,b.previousSibling=null,b.nextSibling=null,ct(y.ownerDocument,y),b}function zi(y){return y&&(y.nodeType===le.DOCUMENT_NODE||y.nodeType===le.DOCUMENT_FRAGMENT_NODE||y.nodeType===le.ELEMENT_NODE)}function Gi(y){return y&&(tt(y)||qe(y)||Oe(y)||y.nodeType===le.DOCUMENT_FRAGMENT_NODE||y.nodeType===le.COMMENT_NODE||y.nodeType===le.PROCESSING_INSTRUCTION_NODE)}function Oe(y){return y&&y.nodeType===le.DOCUMENT_TYPE_NODE}function tt(y){return y&&y.nodeType===le.ELEMENT_NODE}function qe(y){return y&&y.nodeType===le.TEXT_NODE}function wi(y,b){var I=y.childNodes||[];if(e(I,tt)||Oe(b))return!1;var W=e(I,Oe);return!(b&&W&&I.indexOf(W)>I.indexOf(b))}function gt(y,b){var I=y.childNodes||[];function W(ce){return tt(ce)&&ce!==b}if(e(I,W))return!1;var ne=e(I,Oe);return!(b&&ne&&I.indexOf(ne)>I.indexOf(b))}function ei(y,b,I){if(!zi(y))throw new G(v,"Unexpected parent node type "+y.nodeType);if(I&&I.parentNode!==y)throw new G(F,"child not in parent");if(!Gi(b)||Oe(b)&&y.nodeType!==le.DOCUMENT_NODE)throw new G(v,"Unexpected node type "+b.nodeType+" for parent node type "+y.nodeType)}function be(y,b,I){var W=y.childNodes||[],ne=b.childNodes||[];if(b.nodeType===le.DOCUMENT_FRAGMENT_NODE){var ce=ne.filter(tt);if(ce.length>1||e(ne,qe))throw new G(v,"More than one element or text in fragment");if(ce.length===1&&!wi(y,I))throw new G(v,"Element in fragment can not be inserted before doctype")}if(tt(b)&&!wi(y,I))throw new G(v,"Only one element can be added and only after doctype");if(Oe(b)){if(e(W,Oe))throw new G(v,"Only one doctype is allowed");var re=e(W,tt);if(I&&W.indexOf(re)<W.indexOf(I))throw new G(v,"Doctype can only be inserted before an element");if(!I&&re)throw new G(v,"Doctype can not be appended since element is present")}}function Ie(y,b,I){var W=y.childNodes||[],ne=b.childNodes||[];if(b.nodeType===le.DOCUMENT_FRAGMENT_NODE){var ce=ne.filter(tt);if(ce.length>1||e(ne,qe))throw new G(v,"More than one element or text in fragment");if(ce.length===1&&!gt(y,I))throw new G(v,"Element in fragment can not be inserted before doctype")}if(tt(b)&&!gt(y,I))throw new G(v,"Only one element can be added and only after doctype");if(Oe(b)){if(e(W,function(je){return Oe(je)&&je!==I}))throw new G(v,"Only one doctype is allowed");var re=e(W,tt);if(I&&W.indexOf(re)<W.indexOf(I))throw new G(v,"Doctype can only be inserted before an element")}}function $e(y,b,I,W){ei(y,b,I),y.nodeType===le.DOCUMENT_NODE&&(W||be)(y,b,I);var ne=b.parentNode;if(ne&&ne.removeChild(b),b.nodeType===q){var ce=b.firstChild;if(ce==null)return b;var re=b.lastChild}else ce=re=b;var ke=I?I.previousSibling:y.lastChild;ce.previousSibling=ke,re.nextSibling=I,ke?ke.nextSibling=ce:y.firstChild=ce,I==null?y.lastChild=re:I.previousSibling=re;do{ce.parentNode=y;var je=y.ownerDocument||y;ti(ce,je)}while(ce!==re&&(ce=ce.nextSibling));return ct(y.ownerDocument||y,y),b.nodeType==q&&(b.firstChild=b.lastChild=null),b}function ti(y,b){if(y.ownerDocument!==b){if(y.ownerDocument=b,y.nodeType===_&&y.attributes)for(var I=0;I<y.attributes.length;I++){var W=y.attributes.item(I);W&&(W.ownerDocument=b)}for(var ne=y.firstChild;ne;)ti(ne,b),ne=ne.nextSibling}}function Os(y,b){b.parentNode&&b.parentNode.removeChild(b),b.parentNode=y,b.previousSibling=y.lastChild,b.nextSibling=null,b.previousSibling?b.previousSibling.nextSibling=b:y.firstChild=b,y.lastChild=b,ct(y.ownerDocument,y,b);var I=y.ownerDocument||y;return ti(b,I),b}We.prototype={nodeName:"#document",nodeType:O,doctype:null,documentElement:null,_inc:1,insertBefore:function(y,b){if(y.nodeType==q){for(var I=y.firstChild;I;){var W=I.nextSibling;this.insertBefore(I,b),I=W}return y}return $e(this,y,b),ti(y,this),this.documentElement===null&&y.nodeType===_&&(this.documentElement=y),y},removeChild:function(y){return this.documentElement==y&&(this.documentElement=null),Ft(this,y)},replaceChild:function(y,b){$e(this,y,b,Ie),ti(y,this),b&&this.removeChild(b),tt(y)&&(this.documentElement=y)},importNode:function(y,b){return Yn(this,y,b)},getElementById:function(y){var b=null;return fe(this.documentElement,function(I){if(I.nodeType==_&&I.getAttribute("id")==y)return b=I,!0}),b},getElementsByClassName:function(y){var b=a(y);return new se(this,function(I){var W=[];return b.length>0&&fe(I.documentElement,function(ne){if(ne!==I&&ne.nodeType===_){var ce=ne.getAttribute("class");if(ce){var re=y===ce;if(!re){var ke=a(ce);re=b.every(u(ke))}re&&W.push(ne)}}}),W})},createElement:function(y){var b=new Pt;b.ownerDocument=this,b.nodeName=y,b.tagName=y,b.localName=y,b.childNodes=new ee;var I=b.attributes=new Z;return I._ownerElement=b,b},createDocumentFragment:function(){var y=new Ki;return y.ownerDocument=this,y.childNodes=new ee,y},createTextNode:function(y){var b=new xi;return b.ownerDocument=this,b.appendData(y),b},createComment:function(y){var b=new Wi;return b.ownerDocument=this,b.appendData(y),b},createCDATASection:function(y){if(y.indexOf("]]>")!==-1)throw new G(C,'data contains "]]>"');var b=new Xi;return b.ownerDocument=this,b.appendData(y),b},createProcessingInstruction:function(y,b){var I=new Ls;return I.ownerDocument=this,I.tagName=I.nodeName=I.target=y,I.nodeValue=I.data=b,I},createAttribute:function(y){var b=new ci;return b.ownerDocument=this,b.name=y,b.nodeName=y,b.localName=y,b.specified=!0,b},createEntityReference:function(y){var b=new hi;return b.ownerDocument=this,b.nodeName=y,b},createElementNS:function(y,b){var I=new Pt,W=b.split(":"),ne=I.attributes=new Z;return I.childNodes=new ee,I.ownerDocument=this,I.nodeName=b,I.tagName=b,I.namespaceURI=y,W.length==2?(I.prefix=W[0],I.localName=W[1]):I.localName=b,ne._ownerElement=I,I},createAttributeNS:function(y,b){var I=new ci,W=b.split(":");return I.ownerDocument=this,I.nodeName=b,I.name=b,I.namespaceURI=y,I.specified=!0,W.length==2?(I.prefix=W[0],I.localName=W[1]):I.localName=b,I}},f(We,le);function Pt(){this._nsMap={}}Pt.prototype={nodeType:_,hasAttribute:function(y){return this.getAttributeNode(y)!=null},getAttribute:function(y){var b=this.getAttributeNode(y);return b&&b.value||""},getAttributeNode:function(y){return this.attributes.getNamedItem(y)},setAttribute:function(y,b){var I=this.ownerDocument.createAttribute(y);I.value=I.nodeValue=""+b,this.setAttributeNode(I)},removeAttribute:function(y){var b=this.getAttributeNode(y);b&&this.removeAttributeNode(b)},appendChild:function(y){return y.nodeType===q?this.insertBefore(y,null):Os(this,y)},setAttributeNode:function(y){return this.attributes.setNamedItem(y)},setAttributeNodeNS:function(y){return this.attributes.setNamedItemNS(y)},removeAttributeNode:function(y){return this.attributes.removeNamedItem(y.nodeName)},removeAttributeNS:function(y,b){var I=this.getAttributeNodeNS(y,b);I&&this.removeAttributeNode(I)},hasAttributeNS:function(y,b){return this.getAttributeNodeNS(y,b)!=null},getAttributeNS:function(y,b){var I=this.getAttributeNodeNS(y,b);return I&&I.value||""},setAttributeNS:function(y,b,I){var W=this.ownerDocument.createAttributeNS(y,b);W.value=W.nodeValue=""+I,this.setAttributeNode(W)},getAttributeNodeNS:function(y,b){return this.attributes.getNamedItemNS(y,b)},getElementsByTagName:function(y){return new se(this,function(b){var I=[];return fe(b,function(W){W!==b&&W.nodeType==_&&(y==="*"||W.tagName==y)&&I.push(W)}),I})},getElementsByTagNameNS:function(y,b){return new se(this,function(I){var W=[];return fe(I,function(ne){ne!==I&&ne.nodeType===_&&(y==="*"||ne.namespaceURI===y)&&(b==="*"||ne.localName==b)&&W.push(ne)}),W})}},We.prototype.getElementsByTagName=Pt.prototype.getElementsByTagName,We.prototype.getElementsByTagNameNS=Pt.prototype.getElementsByTagNameNS,f(Pt,le);function ci(){}ci.prototype.nodeType=k,f(ci,le);function qt(){}qt.prototype={data:"",substringData:function(y,b){return this.data.substring(y,y+b)},appendData:function(y){y=this.data+y,this.nodeValue=this.data=y,this.length=y.length},insertData:function(y,b){this.replaceData(y,0,b)},appendChild:function(y){throw new Error(V[v])},deleteData:function(y,b){this.replaceData(y,b,"")},replaceData:function(y,b,I){var W=this.data.substring(0,y),ne=this.data.substring(y+b);I=W+I+ne,this.nodeValue=this.data=I,this.length=I.length}},f(qt,le);function xi(){}xi.prototype={nodeName:"#text",nodeType:D,splitText:function(y){var b=this.data,I=b.substring(y);b=b.substring(0,y),this.data=this.nodeValue=b,this.length=b.length;var W=this.ownerDocument.createTextNode(I);return this.parentNode&&this.parentNode.insertBefore(W,this.nextSibling),W}},f(xi,qt);function Wi(){}Wi.prototype={nodeName:"#comment",nodeType:N},f(Wi,qt);function Xi(){}Xi.prototype={nodeName:"#cdata-section",nodeType:L},f(Xi,qt);function ki(){}ki.prototype.nodeType=H,f(ki,le);function we(){}we.prototype.nodeType=$,f(we,le);function Cr(){}Cr.prototype.nodeType=P,f(Cr,le);function hi(){}hi.prototype.nodeType=T,f(hi,le);function Ki(){}Ki.prototype.nodeName="#document-fragment",Ki.prototype.nodeType=q,f(Ki,le);function Ls(){}Ls.prototype.nodeType=B,f(Ls,le);function Dr(){}Dr.prototype.serializeToString=function(y,b,I,W){return Ar.call(y,b,I,W)},le.prototype.toString=Ar;function Ar(y,b,I){var W=!!I&&!!I.requireWellFormed,ne=[],ce=this.nodeType==9&&this.documentElement||this,re=ce.prefix,ke=ce.namespaceURI;if(ke&&re==null){var re=ce.lookupPrefix(ke);if(re==null)var je=[{namespace:ke,prefix:null}]}return Rs(this,ne,y,b,je,W),ne.join("")}function wr(y,b,I){var W=y.prefix||"",ne=y.namespaceURI;if(!ne||W==="xml"&&ne===t.XML||ne===t.XMLNS)return!1;for(var ce=I.length;ce--;){var re=I[ce];if(re.prefix===W)return re.namespace!==ne}return!0}function Yi(y,b,I){y.push(" ",b,'="',I.replace(/[<>&"\t\n\r]/g,Te),'"')}function Rs(y,b,I,W,ne,ce){ne||(ne=[]),Se(y,{ns:ne,isHTML:I},{enter:function(re,ke){var je=ke.ns,Xe=ke.isHTML;if(W)if(re=W(re),re){if(typeof re=="string")return b.push(re),null}else return null;switch(re.nodeType){case _:var Re=re.attributes,Qi=Re.length,$t=re.tagName;Xe=t.isHTML(re.namespaceURI)||Xe;var _t=$t;if(!Xe&&!re.prefix&&re.namespaceURI){for(var ht,ii=0;ii<Re.length;ii++)if(Re.item(ii).name==="xmlns"){ht=Re.item(ii).value;break}if(!ht)for(var ve=je.length-1;ve>=0;ve--){var si=je[ve];if(si.prefix===""&&si.namespace===re.namespaceURI){ht=si.namespace;break}}if(ht!==re.namespaceURI)for(var ve=je.length-1;ve>=0;ve--){var si=je[ve];if(si.namespace===re.namespaceURI){si.prefix&&(_t=si.prefix+":"+$t);break}}}b.push("<",_t);for(var yt=je.slice(),Dt=0;Dt<Qi;Dt++){var Tt=Re.item(Dt);Tt.prefix=="xmlns"?yt.push({prefix:Tt.localName,namespace:Tt.value}):Tt.nodeName=="xmlns"&&yt.push({prefix:"",namespace:Tt.value})}for(var Dt=0;Dt<Qi;Dt++){var Tt=Re.item(Dt);if(wr(Tt,Xe,yt)){var Ot=Tt.prefix||"",Ee=Tt.namespaceURI;Yi(b,Ot?"xmlns:"+Ot:"xmlns",Ee),yt.push({prefix:Ot,namespace:Ee})}var di=W?W(Tt):Tt;di&&(typeof di=="string"?b.push(di):Yi(b,di.name,di.value))}if($t===_t&&wr(re,Xe,yt)){var fi=re.prefix||"",Ee=re.namespaceURI;Yi(b,fi?"xmlns:"+fi:"xmlns",Ee),yt.push({prefix:fi,namespace:Ee})}var ri=re.firstChild;if(ri||Xe&&!/^(?:meta|link|img|br|hr|input)$/i.test($t)){if(b.push(">"),Xe&&/^script$/i.test($t)){for(;ri;)ri.data?b.push(ri.data):Rs(ri,b,Xe,W,yt.slice(),ce),ri=ri.nextSibling;return b.push("</",$t,">"),null}return{ns:yt,isHTML:Xe,tag:_t}}else return b.push("/>"),null;case O:case q:return{ns:je.slice(),isHTML:Xe,tag:null};case k:return Yi(b,re.name,re.value),null;case D:return b.push(re.data.replace(/[<&>]/g,Te)),null;case L:if(ce&&re.data.indexOf("]]>")!==-1)throw new G(j,'The CDATASection data contains "]]>"');return b.push("<![CDATA[",re.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case N:if(ce&&re.data.indexOf("-->")!==-1)throw new G(j,'The comment node data contains "-->"');return b.push("<!--",re.data,"-->"),null;case H:if(ce){if(re.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(re.publicId))throw new G(j,"DocumentType publicId is not a valid PubidLiteral");if(re.systemId&&!/^("[^"]*"|'[^']*')$/.test(re.systemId))throw new G(j,"DocumentType systemId is not a valid SystemLiteral");if(re.internalSubset&&re.internalSubset.indexOf("]>")!==-1)throw new G(j,'DocumentType internalSubset contains "]>"')}var Ir=re.publicId,pi=re.systemId;if(b.push("<!DOCTYPE ",re.name),Ir)b.push(" PUBLIC ",Ir),pi&&pi!="."&&b.push(" ",pi),b.push(">");else if(pi&&pi!=".")b.push(" SYSTEM ",pi,">");else{var Ms=re.internalSubset;Ms&&b.push(" [",Ms,"]"),b.push(">")}return null;case B:if(ce&&re.data.indexOf("?>")!==-1)throw new G(j,'The ProcessingInstruction data contains "?>"');return b.push("<?",re.target," ",re.data,"?>"),null;case T:return b.push("&",re.nodeName,";"),null;default:return b.push("??",re.nodeName),null}},exit:function(re,ke){ke&&ke.tag&&b.push("</",ke.tag,">")}})}function Yn(y,b,I){var W;return Se(b,null,{enter:function(ne,ce){var re=ne.cloneNode(!1);re.ownerDocument=y,re.parentNode=null,ce===null?W=re:ce.appendChild(re);var ke=ne.nodeType===k||I;return ke?re:null}}),W}function xr(y,b,I){var W;return Se(b,null,{enter:function(ne,ce){var re=new ne.constructor;for(var ke in ne)if(Object.prototype.hasOwnProperty.call(ne,ke)){var je=ne[ke];typeof je!="object"&&je!=re[ke]&&(re[ke]=je)}ne.childNodes&&(re.childNodes=new ee),re.ownerDocument=y;var Xe=I;switch(re.nodeType){case _:var Re=ne.attributes,Qi=re.attributes=new Z,$t=Re.length;Qi._ownerElement=re;for(var _t=0;_t<$t;_t++)re.setAttributeNode(xr(y,Re.item(_t),!0));break;case k:Xe=!0}return ce!==null?ce.appendChild(re):W=re,Xe?re:null}}),W}function kr(y,b,I){y[b]=I}try{Object.defineProperty&&(Object.defineProperty(se.prototype,"length",{get:function(){return Y(this),this.$$length}}),Object.defineProperty(le.prototype,"textContent",{get:function(){if(this.nodeType===_||this.nodeType===q){var y=[];return Se(this,null,{enter:function(b){if(b.nodeType===_||b.nodeType===q)return!0;
13if(b.nodeType===B||b.nodeType===N)return null;y.push(b.nodeValue)}}),y.join("")}return this.nodeValue},set:function(y){switch(this.nodeType){case _:case q:for(;this.firstChild;)this.removeChild(this.firstChild);(y||String(y))&&this.appendChild(this.ownerDocument.createTextNode(y));break;default:this.data=y,this.value=y,this.nodeValue=y}}}),kr=function(y,b,I){y["$$"+b]=I})}catch{}return Ht.DocumentType=ki,Ht.DOMException=G,Ht.DOMImplementation=me,Ht.Element=Pt,Ht.Node=le,Ht.NodeList=ee,Ht.walkDOM=Se,Ht.XMLSerializer=Dr,Ht}var Zs={},Aa={},cl;function xm(){return cl||(cl=1,function(s){var e=In().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e
vendor: 14,815 bytes, line 13
13({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:
13` 14`
vendor: 9,925 bytes, line 14
14,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:"
14 ",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}(Aa)),Aa}var Jr={},hl;function km(){if(hl)return Jr;hl=1;var s=In().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,u=3,c=4,f=5,g=6,_=7;function k(v,C){this.message=v,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,k)}k.prototype=new Error,k.prototype.name=k.name;function D(){}D.prototype={parse:function(v,C,F){var K=this.domBuilder;K.startDocument(),H(C,C={}),L(v,C,F,K,this.errorHandler),K.endDocument()}};function L(v,C,F,K,j){function G(Ie){if(Ie>65535){Ie-=65536;var $e=55296+(Ie>>10),ti=56320+(Ie&1023);return String.fromCharCode($e,ti)}else return String.fromCharCode(Ie)}function ee(Ie){var $e=Ie.slice(1,-1);return Object.hasOwnProperty.call(F,$e)?F[$e]:$e.charAt(0)==="#"?G(parseInt($e.substr(1).replace("x","0x"))):(j.error("entity n
14ot found:"+Ie),Ie)}function se(Ie){if(Ie>Te){var $e=v.substring(Te,Ie).replace(/&#?\w+;/g,ee);oe&&Y(Te),K.characters($e,0,Ie-Te),Te=Ie}}function Y(Ie,$e){for(;Ie>=J&&($e=te.exec(v));)Z=$e.index,J=Z+$e[0].length,oe.lineNumber++;oe.columnNumber=Ie-Z+1}for(var Z=0,J=0,te=/.*(?:\r\n?|\n)|.*$/g,oe=K.locator,me=[{currentNSMap:C}],le={},Te=0;;){try{var fe=v.indexOf("<",Te);if(fe<0){if(!v.substr(Te).match(/^\s*$/)){var Se=K.doc,We=Se.createTextNode(v.substr(Te));Se.appendChild(We),K.currentElement=We}return}switch(fe>Te&&se(fe),v.charAt(fe+1)){case"/":var qe=v.indexOf(">",fe+3),Ge=v.substring(fe+2,qe).replace(/[ \t\n\r]+$/g,""),Ze=me.pop();qe<0?(Ge=v.substring(fe+2).replace(/[\s<].*/,""),j.error("end tag name: "+Ge+" is not complete:"+Ze.tagName),qe=fe+1+Ge.length):Ge.match(/\s</)&&(Ge=Ge.replace(/[\s<].*/,""),j.error("end tag name: "+Ge+" maybe not complete"),qe=fe+1+Ge.length);var ct=Ze.localNSMap,Ft=Ze.tagName==Ge,zi=Ft||Ze.tagName&&Ze.tagName.toLowerCase()==Ge.toLowerCase();if(zi){if(K.endElement(Ze.uri,Ze.localName,Ge),ct)for(var Gi in ct)Object.prototype.hasOwnProperty.call(ct,Gi)&&K.endPrefixMapping(Gi);Ft||j.fatalError("end tag name: "+Ge+" is not match the current start tagName:"+Ze.tagName)}else me.push(Ze);qe++;break;case"?":oe&&Y(fe),qe=$(v,fe,K);break;case"!":oe&&Y(fe),qe=q(v,fe,K,j);break;default:oe&&Y(fe);var Oe=new R,tt=me[me.length-1].currentNSMap,qe=P(v,fe,Oe,tt,ee,j),wi=Oe.length;if(!Oe.closed&&O(v,qe,Oe.tagName,le)&&(Oe.closed=!0,F.nbsp||j.warning("unclosed xml attribute")),oe&&wi){for(var gt=T(oe,{}),ei=0;ei<wi;ei++){var be=Oe[ei];Y(be.offset),be.locator=T(oe,{})}K.locator=gt,B(Oe,K,tt)&&me.push(Oe),K.locator=oe}else B(Oe,K,tt)&&me.push(Oe);s.isHTML(Oe.uri)&&!Oe.closed?qe=N(v,qe,Oe.tagName,ee,K):qe++}}catch(Ie){if(Ie instanceof k)throw Ie;j.error("element parse error: "+Ie),qe=-1}qe>Te?Te=qe:se(Math.max(fe,Te)+1)}}function T(v,C){return C.lineNumber=v.lineNumber,C.columnNumber=v.columnNumber,C}function P(v,C,F,K,j,G){function ee(oe,me,le){F.attributeNames.hasOwnProperty(oe)&&G.fatalError("Attribute "+oe+" redefined"),F.addValue(oe,me.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,j),le)}for(var se,Y,Z=++C,J=r;;){var te=v.charAt(Z);switch(te){case"=":if(J===n)se=v.slice(C,Z),J=u;else if(J===a)J=u;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(J===u||J===n)if(J===n&&(G.warning('attribute value must after "="'),se=v.slice(C,Z)),C=Z+1,Z=v.indexOf(te,C),Z>0)Y=v.slice(C,Z),ee(se,Y,C-1),J=f;else throw new Error("attribute value no end '"+te+"' match");else if(J==c)Y=v.slice(C,Z),ee(se,Y,C),G.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:F.setTagName(v.slice(C,Z));case f:case g:case _:J=_,F.closed=!0;case c:case n:break;case a:F.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return G.error("unexpected end of input"),J==r&&F.setTagName(v.slice(C,Z)),Z;case">":switch(J){case r:F.setTagName(v.slice(C,Z));case f:case g:case _:break;case c:case n:Y=v.slice(C,Z),Y.slice(-1)==="/"&&(F.closed=!0,Y=Y.slice(0,-1));case a:J===a&&(Y=se),J==c?(G.warning('attribute "'+Y+'" missed quot(")!'),ee(se,Y,C)):((!s.isHTML(K[""])||!Y.match(/^(?:disabled|checked|selected)$/i))&&G.warning('attribute "'+Y+'" missed value!! "'+Y+'" instead!!'),ee(Y,Y,C));break;case u:throw new Error("attribute value missed!!")}return Z;case"Â":te=" ";default:if(te<=" ")switch(J){case r:F.setTagName(v.slice(C,Z)),J=g;break;case n:se=v.slice(C,Z),J=a;break;case c:var Y=v.slice(C,Z);G.warning('attribute "'+Y+'" missed quot(")!!'),ee(se,Y,C);case f:J=g;break}else switch(J){case a:F.tagName,(!s.isHTML(K[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&G.warning('attribute "'+se+'" missed value!! "'+se+'" instead2!!'),ee(se,se,C),C=Z,J=n;break;case f:G.warning('attribute space is required"'+se+'"!!');case g:J=n,C=Z;break;case u:J=c,C=Z;break;case _:throw new Error("elements closed character '/' and '>' must be connected to")}}Z++}}function B(v,C,F){for(var K=v.tagName,j=null,te=v.length;te--;){var G=v[te],ee=G.qName,se=G.value,oe=ee.indexOf(":");if(oe>0)var Y=G.prefix=ee.slice(0,oe),Z=ee.slice(oe+1),J=Y==="xmlns"&&Z;else Z=ee,Y=null,J=ee==="xmlns"&&"";G.localName=Z,J!==!1&&(j==null&&(j={},H(F,F={})),F[J]=j[J]=se,G.uri=s.XMLNS,C.startPrefixMapping(J,se))}for(var te=v.length;te--;){G=v[te];var Y=G.prefix;Y&&(Y==="xml"&&(G.uri=s.XML),Y!=="xmlns"&&(G.uri=F[Y||""]))}var oe=K.indexOf(":");oe>0?(Y=v.prefix=K.slice(0,oe),Z=v.localName=K.slice(oe+1)):(Y=null,Z=v.localName=K);var me=v.uri=F[Y||""];if(C.startElement(me,Z,K,v),v.closed){if(C.endElement(me,Z,K),j)for(Y in j)Object.prototype.hasOwnProperty.call(j,Y)&&C.endPrefixMapping(Y)}else return v.currentNSMap=F,v.localNSMap=j,!0}function N(v,C,F,K,j){if(/^(?:script|textarea)$/i.test(F)){var G=v.indexOf("</"+F+">",C),ee=v.substring(C+1,G);if(/[&<]/.test(ee))return/^script$/i.test(F)?(j.characters(ee,0,ee.length),G):(ee=ee.replace(/&#?\w+;/g,K),j.characters(ee,0,ee.length),G)}return C+1}function O(v,C,F,K){var j=K[F];return j==null&&(j=v.lastIndexOf("</"+F+">"),j<C&&(j=v.lastIndexOf("</"+F)),K[F]=j),j<C}function H(v,C){for(var F in v)Object.prototype.hasOwnProperty.call(v,F)&&(C[F]=v[F])}function q(v,C,F,K){var j=v.charAt(C+2);switch(j){case"-":if(v.charAt(C+3)==="-"){var G=v.indexOf("-->",C+4);return G>C?(F.comment(v,C+4,G-C-4),G+3):(K.error("Unclosed comment"),-1)}else return-1;default:if(v.substr(C+3,6)=="CDATA["){var G=v.indexOf("]]>",C+9);return F.startCDATA(),F.characters(v,C+9,G-C-9),F.endCDATA(),G+3}var ee=V(v,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 F.startDTD(Y,Z,J),F.endDTD(),te.index+te[0].length}}return-1}function $(v,C,F){var K=v.indexOf("?>",C);if(K){var j=v.substring(C,K).match(/^<\?(\S*)\s*([\s\S]*?)$/);return j?(j[0].length,F.processingInstruction(j[1],j[2]),K+2):-1}return-1}function R(){this.attributeNames={}}R.prototype={setTagName:function(v){if(!i.test(v))throw new Error("invalid tagName:"+v);this.tagName=v},addValue:function(v,C,F){if(!i.test(v))throw new Error("invalid attribute:"+v);this.attributeNames[v]=this.length,this[this.length++]={qName:v,value:C,offset:F}},length:0,getLocalName:function(v){return this[v].localName},getLocator:function(v){return this[v].locator},getQName:function(v){return this[v].qName},getURI:function(v){return this[v].uri},getValue:function(v){return this[v].value}};function V(v,C){var F,K=[],j=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(j.lastIndex=C,j.exec(v);F=j.exec(v);)if(K.push(F),F[1])return K}return Jr.XMLReader=D,Jr.ParseError=k,Jr}var dl;function Im(){if(dl)return Zs;dl=1;
14var s=In(),e=xc(),t=xm(),i=km(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,u=i.XMLReader;function c(P){return P.replace(/\r[\n\u0085]/g,` 15`).replace(/[\r\u0085\u2028]/g,` 16`)}function f(P){this.options=P||{locator:{}}}f.prototype.parseFromString=function(P,B){var N=this.options,O=new u,H=N.domBuilder||new _,q=N.errorHandler,$=N.locator,R=N.xmlns||{},V=/\/x?html?$/.test(B),v=V?t.HTML_ENTITIES:t.XML_ENTITIES;$&&H.setDocumentLocator($),O.errorHandler=g(q,H,$),O.domBuilder=N.domBuilder||H,V&&(R[""]=n.HTML),R.xml=R.xml||n.XML;var C=N.normalizeLineEndings||c;return P&&typeof P=="string"?O.parse(C(P),R,v):O.errorHandler.error("invalid doc source"),H.doc};function g(P,B,N){if(!P){if(B instanceof _)return B;P=B}var O={},H=P instanceof Function;N=N||{};function q($){var R=P[$];!R&&H&&(R=P.length==2?function(V){P($,V)}:P),O[$]=R&&function(V){R("[xmldom "+$+"] "+V+D(N))}||function(){}}return q("warning"),q("error"),q("fatalError"),O}function _(){this.cdata=!1}function k(P,B){B.lineNumber=P.lineNumber,B.columnNumber=P.columnNumber}_.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(P,B,N,O){var H=this.doc,q=H.createElementNS(P,N||B),$=O.length;T(this,q),this.currentElement=q,this.locator&&k(this.locator,q);for(var R=0;R<$;R++){var P=O.getURI(R),V=O.getValue(R),N=O.getQName(R),v=H.createAttributeNS(P,N);this.locator&&k(O.getLocator(R),v),v.value=v.nodeValue=V,q.setAttributeNode(v)}},endElement:function(P,B,N){var O=this.currentElement;O.tagName,this.currentElement=O.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),T(this,N)},ignorableWhitespace:function(P,B,N){},characters:function(P,B,N){if(P=L.apply(this,arguments),P){if(this.cdata)var O=this.doc.createCDATASection(P);else var O=this.doc.createTextNode(P);this.currentElement?this.currentElement.appendChild(O):/^\s*$/.test(P)&&this.doc.appendChild(O),this.locator&&k(this.locator,O)}},skippedEntity:function(P){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(P){(this.locator=P)&&(P.lineNumber=0)},comment:function(P,B,N){P=L.apply(this,arguments);var O=this.doc.createComment(P);this.locator&&k(this.locator,O),T(this,O)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(P,B,N){var O=this.doc.implementation;if(O&&O.createDocumentType){var H=O.createDocumentType(P,B,N);this.locator&&k(this.locator,H),T(this,H),this.doc.doctype=H}},warning:function(P){console.warn("[xmldom warning] "+P,D(this.locator))},error:function(P){console.error("[xmldom error] "+P,D(this.locator))},fatalError:function(P){throw new a(P,this.locator)}};function D(P){if(P)return` 17@`+(P.systemId||"")+"#[line:"+P.lineNumber+",col:"+P.columnNumber+"]"}function L(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){_.prototype[P]=function(){return null}});function T(P,B){P.currentElement?P.currentElement.appendChild(B):P.doc.appendChild(B)}return Zs.__DOMHandler=_,Zs.normalizeLineEndings=c,Zs.DOMParser=f,Zs}var fl;function Pm(){if(fl)return Js;fl=1;var s=xc();return Js.DOMImplementation=s.DOMImplementation,Js.XMLSerializer=s.XMLSerializer,Js.DOMParser=Im().DOMParser,Js}var Om=Pm();const pl=s=>!!s&&typeof s=="object",Qe=(...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]):pl(e[i])&&pl(t[i])?e[i]=Qe(e[i],t[i]):e[i]=t[i]}),e),{}),kc=s=>Object.keys(s).map(e=>s[e]),Lm=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},_s=s=>s.reduce((e,t)=>e.concat(t),[]),Ic=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},Rm=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),Mm=(s,e)=>kc(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));
17var ys={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 dr=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:kn(s||"",e)};if(t||i){const a=(t||i).split("-");let u=w.BigInt?w.BigInt(a[0]):parseInt(a[0],10),c=w.BigInt?w.BigInt(a[1]):parseInt(a[1],10);u<Number.MAX_SAFE_INTEGER&&typeof u=="bigint"&&(u=Number(u)),c<Number.MAX_SAFE_INTEGER&&typeof c=="bigint"&&(c=Number(c));let f;typeof c=="bigint"||typeof u=="bigint"?f=w.BigInt(c)-w.BigInt(u)+w.BigInt(1):f=c-u+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),r.byterange={length:f,offset:u}}return r},Nm=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=w.BigInt(s.offset)+w.BigInt(s.length)-w.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},ml=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),Bm={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=ml(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:u=0,timeShiftBufferDepth:c=1/0}=s,f=ml(s.endNumber),g=(e+t)/1e3,_=i+a,D=g+u-_,L=Math.ceil(D*r/n),T=Math.floor((g-_-c)*r/n),P=Math.floor((g-_)*r/n);return{start:Math.max(0,T),end:typeof f=="number"?f:Math.min(L,P)}}},Um=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}},bo=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:u}=Bm[e](s),c=Lm(a,u).map(Um(s));if(e==="static"){const f=c.length-1,g=typeof r=="number"?r:n;c[f].duration=g-t/i*f}return c},Pc=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:u=0,duration:c}=s;if(!e)throw new Error(ys.NO_BASE_URL);const f=dr({baseUrl:e,source:t.sourceURL,range:t.range}),g=dr({baseUrl:e,source:e,indexRange:r});if(g.map=f,c){const _=bo(s);_.length&&(g.duration=_[0].duration,g.timeline=_[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=u,[g]},So=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,u=a.offset+a.length,c=e.timescale,f=e.references.filter(P=>P.referenceType!==1),g=[],_=s.endList?"static":"dynamic",k=s.sidx.timeline;let D=k,L=s.mediaSequence||0,T;typeof e.firstOffset=="bigint"?T=w.BigInt(u)+e.firstOffset:T=u+e.firstOffset;for(let P=0;P<f.length;P++){const B=e.references[P],N=B.referencedSize,O=B.subsegmentDuration;let H;typeof T=="bigint"?H=T+w.BigInt(N)-w.BigInt(1):H=T+N-1;const q=`${T}-${H}`,R=Pc({baseUrl:t,timescale:c,timeline:n,periodStart:k,presentationTime:D,number:L,duration:O,sourceDuration:r,indexRange:q,type:_})[0];i&&(R.map=i),g.push(R),typeof T=="bigint"?T+=w.BigInt(N):T+=N,D+=O/c,L++}return s.segments=g,s},Fm=["AUDIO","SUBTITLES"],qm=1/60,Oc=s=>Mm(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),$m=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},gl=s=>{let e=[];return wm(s,Fm,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},_l=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},jm=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:c}){return c===i.timeline});const r=$m(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(c){return Math.abs(c.presentationTime-n.presentationTime)<qm});if(a===-1){_l({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--),_l({playlist:i,mediaSequence:r.segments[a].number})})},Hm=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(gl(s)),i=e.playlists.concat(gl(e));return e.timelineStarts=Oc([s.timelineStarts,e.timelineStarts]),jm({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Pn=s=>s&&s.uri+"-"+Nm(s.byterange),wa=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=>
17{const r=kc(i.reduce((n,a)=>{const u=a.attributes.id+(a.attributes.lang||"");return n[u]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[u].segments.push(...a.segments)),a.attributes.contentProtection&&(n[u].attributes.contentProtection=a.attributes.contentProtection)):(n[u]=a,n[u].attributes.timelineStarts=[]),n[u].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=Rm(i.segments||[],"discontinuity"),i))},Eo=(s,e)=>{const t=Pn(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&So(s,i,s.sidx.resolvedUri),s},Vm=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Eo(s[t],e);return s},zm=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const u={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&&(u.contentProtection=s.contentProtection),s.serviceLocation&&(u.attributes.serviceLocation=s.serviceLocation),t&&(u.sidx=t),a&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u},Gm=({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},Wm=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const u=a.attributes.role&&a.attributes.role.value||"",c=a.attributes.lang||"";let f=a.attributes.label||"main";if(c&&!a.attributes.label){const _=u?` (${u})`:"";f=`${a.attributes.lang}${_}`}n[f]||(n[f]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});const g=Eo(zm(a,t),e);return n[f].playlists.push(g),typeof i>"u"&&u==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(r)[0];r[n].default=!0}return r},Xm=(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(Eo(Gm(i),e)),t},{}),Km=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),{}),Ym=({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},Qm=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",Jm=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",Zm=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",eg=(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})})},yl=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],tg=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:u,suggestedPresentationDelay:c,minimumUpdatePeriod:f}=s[0].attributes,g=wa(s.filter(Qm)).map(Ym),_=wa(s.filter(Jm)),k=wa(s.filter(Zm)),D=s.map(H=>
17H.attributes.captionServices).filter(Boolean),L={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Vm(g,i)};f>=0&&(L.minimumUpdatePeriod=f*1e3),e&&(L.locations=e),t&&(L.contentSteering=t),u==="dynamic"&&(L.suggestedPresentationDelay=c),n&&n.length>0&&(L.eventStream=n);const T=L.playlists.length===0,P=_.length?Wm(_,i,T):null,B=k.length?Xm(k,i):null,N=g.concat(yl(P),yl(B)),O=N.map(({timelineStarts:H})=>H);return L.timelineStarts=Oc(O),eg(N,L.timelineStarts),P&&(L.mediaGroups.AUDIO.audio=P),B&&(L.mediaGroups.SUBTITLES.subs=B),D.length&&(L.mediaGroups["CLOSED-CAPTIONS"].cc=Km(D)),r?Hm({oldManifest:r,newManifest:L}):L},ig=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:u=0,minimumUpdatePeriod:c=0}=s,f=(i+r)/1e3,g=n+u,k=f+c-g;return Math.ceil((k*a-e)/t)},Lc=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:u=1,periodStart:c}=s,f=[];let g=-1;for(let _=0;_<e.length;_++){const k=e[_],D=k.d,L=k.r||0,T=k.t||0;g<0&&(g=T),T&&T>g&&(g=T);let P;if(L<0){const O=_+1;O===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?P=ig(s,g,D):P=(n*a-g)/D:P=(e[O].t-g)/D}else P=L+1;const B=u+f.length+P;let N=u+f.length;for(;N<B;)f.push({number:N,duration:D/a,time:g,timeline:c}),g+=D,N++}return f},sg=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,rg=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}`},Tl=(s,e)=>s.replace(sg,rg(e)),ng=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?bo(s):Lc(s,e),ag=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}
vendor: 4,115 bytes, line 17
17=s,r=dr({baseUrl:s.baseUrl,source:Tl(i.sourceURL,t),range:i.range});return ng(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const u=Tl(s.media||"",t),c=s.timescale||1,f=s.presentationTimeOffset||0,g=s.periodStart+(a.time-f)/c;return{uri:u,timeline:a.timeline,duration:a.duration,resolvedUri:kn(s.baseUrl||"",u),map:r,number:a.number,presentationTime:g}})},og=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=dr({baseUrl:t,source:i.sourceURL,range:i.range}),n=dr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},ug=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(ys.SEGMENT_TIME_UNSPECIFIED);const n=i.map(c=>og(s,c));let a;return t&&(a=bo(s)),e&&(a=Lc(s,e)),a.map((c,f)=>{if(n[f]){const g=n[f],_=s.timescale||1,k=s.presentationTimeOffset||0;return g.timeline=c.timeline,g.duration=c.duration,g.number=c.number,g.presentationTime=r+(c.time-k)/_,g}}).filter(c=>c)},lg=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=ag,t=Qe(s,e.template)):e.base?(i=Pc,t=Qe(s,e.base)):e.list&&(i=ug,t=Qe(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:u=1}=t;t.duration=a/u}else n.length?t.duration=n.reduce((a,u)=>Math.max(a,Math.ceil(u.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},cg=s=>s.map(lg),Ne=(s,e)=>Ic(s.childNodes).filter(({tagName:t})=>t===e),yr=s=>s.textContent.trim(),hg=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),ts=s=>{const u=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!u)return 0;const[c,f,g,_,k,D]=u.slice(1);return parseFloat(c||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(g||0)*86400+parseFloat(_||0)*3600+parseFloat(k||0)*60+parseFloat(D||0)},dg=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),vl={mediaPresentationDuration(s){return ts(s)},availabilityStartTime(s){return dg(s)/1e3},minimumUpdatePeriod(s){return ts(s)},suggestedPresentationDelay(s){return ts(s)},type(s){return s},timeShiftBufferDepth(s){return ts(s)},start(s){return ts(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return hg(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)?ts(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}},ze=s=>s&&s.attributes?Ic(s.attributes).reduce((e,t)=>{const i=vl[t.name]||vl.DEFAULT;return e[t.name]=i(t.value),e},{}):{},fg={"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"},On=(s,e)=>e.length?_s(s.map(function(t){return e.map(function(i){const r=yr(i),n=kn(t.baseUrl,r),a=Qe(ze(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,Co=s=>{const e=Ne(s,"SegmentTemplate")[0],t=Ne(s,"SegmentList")[0],i=t&&Ne(t,"SegmentURL").map(_=>Qe({tag:"SegmentURL"},ze(_))),r=Ne(s,"SegmentBase")[0],n=t||e,a=n&&Ne(n,"SegmentTimeline")[0],u=t||r||e,c=u&&Ne(u,"Initialization")[0],f=e&&ze(e);f&&c?f.initialization=c&&ze(c):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const g={template:f,segmentTimeline:a&&Ne(a,"S").map(_=>ze(_)),list:t&&Qe(ze(t),{segmentUrls:i,initialization:ze(c)}),base:r&&Qe(ze(r),{initialization:ze(c)})};return Object.keys(g).forEach(_=>{g[_]||delete g[_]}),g},pg=(s,e,t)=>i=>{const r=Ne(i,"BaseURL"),n=On(e,r),a=Qe(s,ze(i)),u=Co(i);return n.map(c=>({segmentInfo:Qe(t,u),attributes:Qe(a,c)}))},mg=s=>s.reduce((e,t)=>{const i=ze(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=fg[i.schemeIdUri];if(r){e[r]={attributes:i};
17const n=Ne(t,"cenc:pssh")[0];if(n){const a=yr(n);e[r].pssh=a&&Sc(a)}}return e},{}),gg=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[u,c]=a.split(":");u==="lang"?i.language=c:u==="er"?i.easyReader=Number(c):u==="war"?i.aspectRatio=Number(c):u==="3D"&&(i["3D"]=Number(c))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},_g=s=>_s(Ne(s.node,"EventStream").map(e=>{const t=ze(e),i=t.schemeIdUri;return Ne(e,"Event").map(r=>{const n=ze(r),a=n.presentationTime||0,u=t.timescale||1,c=n.duration||0,f=a/u+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:f,end:f+c/u,messageData:yr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),yg=(s,e,t)=>i=>{const r=ze(i),n=On(e,Ne(i,"BaseURL")),a=Ne(i,"Role")[0],u={role:ze(a)};let c=Qe(s,r,u);const f=Ne(i,"Accessibility")[0],g=gg(ze(f));g&&(c=Qe(c,{captionServices:g}));const _=Ne(i,"Label")[0];if(_&&_.childNodes.length){const P=_.childNodes[0].nodeValue.trim();c=Qe(c,{label:P})}const k=mg(Ne(i,"ContentProtection"));Object.keys(k).length&&(c=Qe(c,{contentProtection:k}));const D=Co(i),L=Ne(i,"Representation"),T=Qe(t,D);return _s(L.map(pg(c,n,T)))},Tg=(s,e)=>(t,i)=>{const r=On(e,Ne(t.node,"BaseURL")),n=Qe(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Ne(t.node,"AdaptationSet"),u=Co(t.node);return _s(a.map(yg(n,r,u)))},vg=(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=Qe({serverURL:yr(s[0])},ze(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},bg=({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,Sg=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Ne(s,"Period");if(!a.length)throw new Error(ys.INVALID_NUMBER_OF_PERIOD);const u=Ne(s,"Location"),c=ze(s),f=On([{baseUrl:t}],Ne(s,"BaseURL")),g=Ne(s,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=i,c.clientOffset=r,u.length&&(c.locations=u.map(yr));const _=[];return a.forEach((k,D)=>{const L=ze(k),T=_[D-1];L.start=bg({attributes:L,priorPeriodAttributes:T?T.attributes:null,mpdType:c.type}),_.push({node:k,attributes:L})}),{locations:c.locations,contentSteeringInfo:vg(g,n),representationInfo:_s(_.map(Tg(c,f))),eventStream:_s(_.map(_g))}},Rc=s=>{if(s==="")throw new Error(ys.DASH_EMPTY_MANIFEST);const e=new Om.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(ys.DASH_INVALID_XML);return i},Eg=s=>{const e=Ne(s,"UTCTiming")[0];if(!e)return null;const t=ze(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;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ys.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Cg=(s,e={})=>{const t=Sg(Rc(s),e),i=cg(t.representationInfo);return tg({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Dg=s=>Eg(Rc(s));var xa,bl;function Ag(){if(bl)return xa;bl=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?
17Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return xa={getUint64:e,MAX_UINT32:s},xa}var ka,Sl;function wg(){if(Sl)return ka;Sl=1;var s=Ag().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 ka=e,ka}var xg=wg();const kg=_r(xg);var Ig=de([73,68,51]),Pg=function(e,t){t===void 0&&(t=0),e=de(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},sr=function s(e,t){return t===void 0&&(t=0),e=de(e),e.length-t<10||!Me(e,Ig,{offset:t})?t:(t+=Pg(e,t),s(e,t))},El=function(e){return typeof e=="string"?wc(e):e},Og=function(e){return Array.isArray(e)?e.map(function(t){return El(t)}):[El(e)]},Lg=function s(e,t,i){i===void 0&&(i=!1),t=Og(t),e=de(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,u=e.subarray(n+4,n+8);if(a===0)break;var c=n+a;if(c>e.length){if(i)break;c=e.length}var f=e.subarray(n+8,c);Me(u,t[0])&&(t.length===1?r.push(f):r.push.apply(r,s(f,t.slice(1),i))),n=c}return r},Zr={EBML:de([26,69,223,163]),DocType:de([66,130]),Segment:de([24,83,128,103]),SegmentInfo:de([21,73,169,102]),Tracks:de([22,84,174,107]),Track:de([174]),TrackNumber:de([215]),DefaultDuration:de([35,227,131]),TrackEntry:de([174]),TrackType:de([131]),FlagDefault:de([136]),CodecID:de([134]),CodecPrivate:de([99,162]),VideoTrack:de([224]),AudioTrack:de([225]),Cluster:de([31,67,182,117]),Timestamp:de([231]),TimestampScale:de([42,215,177]),BlockGroup:de([160]),BlockDuration:de([155]),Block:de([161]),SimpleBlock:de([163])},Wa=[128,64,32,16,8,4,2,1],Rg=function(e){for(var t=1,i=0;i<Wa.length&&!(e&Wa[i]);i++)t++;return t},un=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=Rg(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Wa[n-1]),{length:n,value:Cm(a,{signed:r}),bytes:a}},Cl=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?Dm(e):e},Mg=function(e){return Array.isArray(e)?e.map(function(t){return Cl(t)}):[Cl(e)]},Ng=function s(e,t,i){if(i>=t.length)return t.length;var r=un(t,i,!1);if(Me(e.bytes,r.bytes))return i;var n=un(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Dl=function s(e,t){t=Mg(t),e=de(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=un(e,r,!1),a=un(e,r+n.length),u=r+n.length+a.length;a.value===127&&(a.value=Ng(n,e,u),a.value!==e.length&&(a.value-=u));var c=u+a.value>e.length?e.length:u+a.value,f=e.subarray(u,c);Me(t[0],n.bytes)&&(t.length===1?i.push(f):i=i.concat(s(f,t.slice(1))));var g=n.length+a.length+f.length;r+=g}return i},Bg=de([0,0,0,1]),Ug=de([0,0,1]),Fg=de([0,0,3]),qg=function(e){for(var t=[],i=1;i<e.length-2;)Me(e.subarray(i,i+3),Fg)&&(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},Mc=function(e,t,i,r){e=de(e),i=[].concat(i);for(var n=0,a,u=0;n<e.length&&(u<r||a);){var c=void 0;if(Me(e.subarray(n),Bg)?c=4:Me(e.subarray(n),Ug)&&(c=3),!c){n++;continue}if(u++,a)return qg(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+c]&31:t==="h265"&&(f=e[n+c]>>1&63),i.indexOf(f)!==-1&&(a=n+c),n+=c+(t==="h264"?1:2)}return e.subarray(0,0)},$g=function(e,t,i){return Mc(e,"h264",t,i)},jg=function(e,t,i){return Mc(e,"h265",t,i)},ot={webm:de([119,101,98,109]),matroska:de([109,97,116,114,111,115,107,97]),flac:de([102,76,97,67]),ogg:de([79,103,103,83]),ac3:de([11,119]),riff:de([82,73,70,70]),avi:de([65,86,73]),wav:de([87,65,86,69]),"3gp":de([102,116,121,112,51,103]),mp4:de([102,116,121,112]),fmp4:de([115,116,121,112]),mov:de([102,116,121,112,113,116]),moov:de([109,111,111,118]),moof:de([109,111,111,102])},Ts={aac:function(e){var t=sr(e);
17return Me(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=sr(e);return Me(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Dl(e,[Zr.EBML,Zr.DocType])[0];return Me(t,ot.webm)},mkv:function(e){var t=Dl(e,[Zr.EBML,Zr.DocType])[0];return Me(t,ot.matroska)},mp4:function(e){if(Ts["3gp"](e)||Ts.mov(e))return!1;if(Me(e,ot.mp4,{offset:4})||Me(e,ot.fmp4,{offset:4})||Me(e,ot.moof,{offset:4})||Me(e,ot.moov,{offset:4}))return!0},mov:function(e){return Me(e,ot.mov,{offset:4})},"3gp":function(e){return Me(e,ot["3gp"],{offset:4})},ac3:function(e){var t=sr(e);return Me(e,ot.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=sr(e);return Me(e,ot.flac,{offset:t})},ogg:function(e){return Me(e,ot.ogg)},avi:function(e){return Me(e,ot.riff)&&Me(e,ot.avi,{offset:8})},wav:function(e){return Me(e,ot.riff)&&Me(e,ot.wav,{offset:8})},h264:function(e){return $g(e,7,3).length},h265:function(e){return jg(e,[32,33],3).length}},Xa=Object.keys(Ts).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);Xa.forEach(function(s){var e=Ts[s];Ts[s]=function(t){return e(de(t))}});var Hg=Ts,Do=function(e){e=de(e);for(var t=0;t<Xa.length;t++){var i=Xa[t];if(Hg[i](e))return i}return""},Vg=function(e){return Lg(e,["moof"]).length>0},Ia,Al;function zg(){if(Al)return Ia;Al=1;var s=9e4,e,t,i,r,n,a,u;return e=function(c){return c*s},t=function(c,f){return c*f},i=function(c){return c/s},r=function(c,f){return c/f},n=function(c,f){return e(r(c,f))},a=function(c,f){return t(i(c),f)},u=function(c,f,g){return i(g?c:c-f)},Ia={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:u},Ia}var Ni=zg();var Ka="8.23.3";const ai={},Ci=function(s,e){return ai[s]=ai[s]||[],e&&(ai[s]=ai[s].concat(e)),ai[s]},Gg=function(s,e){Ci(s,e)},Nc=function(s,e){const t=Ci(s).indexOf(e);return t<=-1?!1:(ai[s]=ai[s].slice(),ai[s].splice(t,1),!0)},Wg=function(s,e){Ci(s,[].concat(e).map(t=>{const i=(...r)=>(Nc(s,i),t(...r));return i}))},ln={prefixed:!0},nn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],wl=nn[0];let rr;for(let s=0;s<nn.length;s++)if(nn[s][1]in ie){rr=nn[s];break}if(rr){for(let s=0;s<rr.length;s++)ln[wl[s]]=rr[s];ln.prefixed=rr[0]!==wl[0]}let dt=[];const Xg=(s,e,t)=>(i,r,n)=>{const a=e.levels[r],u=new RegExp(`^(${a})$`);let c=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(c=`%c${s}`,n.unshift(t)),n.unshift(c+":"),dt){dt.push([].concat(n));const g=dt.length-1e3;dt.splice(0,g>0?g:0)}if(!w.console)return;let f=w.console[i];!f&&i==="debug"&&(f=w.console.info||w.console.log),!(!f||!a||!u.test(i))&&f[Array.isArray(n)?"apply":"call"](w.console,n)};function Ya(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=Xg(s,n,t),n.createLogger=(a,u,c)=>{const f=u!==void 0?u:e,g=c!==void 0?c:t,_=`${s} ${f} ${a}`;return Ya(_,f,g)},n.createNewLogger=(a,u,c)=>Ya(a,u,c),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=>{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=()=>dt?[].concat(dt):[],n.history.filter=a=>(dt||[]).filter(u=>new RegExp(`.*${a}.*`).test(u[0])),n.history.clear=()=>{dt&&(dt.length=0)},n.history.disable=()=>{dt!==null&&(dt.length=0,dt=null)},n.history.enable=()=>{dt===null&&(dt=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const ye=Ya("VIDEOJS"),Bc=ye.createLogger,Kg=Object.prototype.toString,Uc=function(s){return Qt(s)?Object.keys(s):[]};
17function os(s,e){Uc(s).forEach(t=>e(s[t],t))}function Fc(s,e,t=0){return Uc(s).reduce((i,r)=>e(i,s[r],r),t)}function Qt(s){return!!s&&typeof s=="object"}function vs(s){return Qt(s)&&Kg.call(s)==="[object Object]"&&s.constructor===Object}function xe(...s){const e={};return s.forEach(t=>{t&&os(t,(i,r)=>{if(!vs(i)){e[r]=i;return}vs(e[r])||(e[r]={}),e[r]=xe(e[r],i)})}),e}function qc(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function Ln(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 Yg=Object.freeze({__proto__:null,each:os,reduce:Fc,isObject:Qt,isPlain:vs,merge:xe,values:qc,defineLazyProperty:Ln});let Ao=!1,$c=null,Bt=!1,jc,Hc=!1,us=!1,ls=!1,Jt=!1,wo=null,Rn=null;const Qg=!!(w.cast&&w.cast.framework&&w.cast.framework.CastReceiverContext);let Vc=null,cn=!1,Mn=!1,hn=!1,Nn=!1,dn=!1,fn=!1,pn=!1;const fr=!!(Ds()&&("ontouchstart"in w||w.navigator.maxTouchPoints||w.DocumentTouch&&w.document instanceof w.DocumentTouch)),Ti=w.navigator&&w.navigator.userAgentData;Ti&&Ti.platform&&Ti.brands&&(Bt=Ti.platform==="Android",us=!!Ti.brands.find(s=>s.brand==="Microsoft Edge"),ls=!!Ti.brands.find(s=>s.brand==="Chromium"),Jt=!us&&ls,wo=Rn=(Ti.brands.find(s=>s.brand==="Chromium")||{}).version||null,Mn=Ti.platform==="Windows");if(!ls){const s=w.navigator&&w.navigator.userAgent||"";Ao=/iPod/i.test(s),$c=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Bt=/Android/i.test(s),jc=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}(),Hc=/Firefox/i.test(s),us=/Edg/i.test(s),ls=/Chrome/i.test(s)||/CriOS/i.test(s),Jt=!us&&ls,wo=Rn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Vc=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}(),dn=/Tizen/i.test(s),fn=/Web0S/i.test(s),pn=dn||fn,cn=/Safari/i.test(s)&&!Jt&&!Bt&&!us&&!pn,Mn=/Windows/i.test(s),hn=/iPad/i.test(s)||cn&&fr&&!/iPhone/i.test(s),Nn=/iPhone/i.test(s)&&!hn}const it=Nn||hn||Ao,Bn=(cn||it)&&!Jt;var zc=Object.freeze({__proto__:null,get IS_IPOD(){return Ao},get IOS_VERSION(){return $c},get IS_ANDROID(){return Bt},get ANDROID_VERSION(){return jc},get IS_FIREFOX(){return Hc},get IS_EDGE(){return us},get IS_CHROMIUM(){return ls},get IS_CHROME(){return Jt},get CHROMIUM_VERSION(){return wo},get CHROME_VERSION(){return Rn},IS_CHROMECAST_RECEIVER:Qg,get IE_VERSION(){return Vc},get IS_SAFARI(){return cn},get IS_WINDOWS(){return Mn},get IS_IPAD(){return hn},get IS_IPHONE(){return Nn},get IS_TIZEN(){return dn},get IS_WEBOS(){return fn},get IS_SMART_TV(){return pn},TOUCH_ENABLED:fr,IS_IOS:it,IS_ANY_SAFARI:Bn});function xl(s){return typeof s=="string"&&!!s.trim()}function Jg(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ds(){return ie===w.document}function As(s){return Qt(s)&&s.nodeType===1}function Gc(){try{return w.parent!==w.self}catch{return!0}}function Wc(s){return function(e,t){if(!xl(e))return ie[s](null);xl(t)&&(t=ie.querySelector(t));const i=As(t)?t:ie;return i[s]&&i[s](e)}}function pe(s="div",e={},t={},i){const r=ie.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Ai(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&xo(r,i),r}function Ai(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Qa(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function or(s,e){return Jg(e),s.classList.contains(e)}function Fi(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Un(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(ye.warn("removeClass was called with an element that doesn't exist"),null)}function Xc(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEac
17h(i=>s.classList.toggle(i,t)),s}function Kc(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 Si(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 Yc(s,e){return s.getAttribute(e)}function bs(s,e,t){s.setAttribute(e,t)}function Fn(s,e){s.removeAttribute(e)}function Qc(){ie.body.focus(),ie.onselectstart=function(){return!1}}function Jc(){ie.onselectstart=function(){return!0}}function Ss(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(Es(s,"height"))),t.width||(t.width=parseFloat(Es(s,"width"))),t}}function pr(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[ln.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(it){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const _=Es(g,"transform");
17if(/^matrix/.test(_)){const k=_.slice(7,-1).split(/,\s/).map(Number);t.x+=k[4],t.y+=k[5]}else if(/^matrix3d/.test(_)){const k=_.slice(9,-1).split(/,\s/).map(Number);t.x+=k[12],t.y+=k[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&w.WebKitCSSMatrix){const k=w.getComputedStyle(g.assignedSlot.parentElement).transform,D=new w.WebKitCSSMatrix(k);t.x+=D.m41,t.y+=D.m42}g=g.parentNode||g.host}}const i={},r=pr(e.target),n=pr(s),a=n.width,u=n.height;let c=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,c=e.changedTouches[0].pageY+n.top,it&&(f-=t.x,c-=t.y)),i.y=1-Math.max(0,Math.min(1,c/u)),i.x=Math.max(0,Math.min(1,f/a)),i}function Zc(s){return Qt(s)&&s.nodeType===3}function $n(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function eh(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),As(e)||Zc(e))return e;if(typeof e=="string"&&/\S/.test(e))return ie.createTextNode(e)}).filter(e=>e)}function xo(s,e){return eh(e).forEach(t=>s.appendChild(t)),s}function th(s,e){return xo($n(s),e)}function mr(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 Di=Wc("querySelector"),ih=Wc("querySelectorAll");function Es(s,e){if(!s||!e)return"";if(typeof w.getComputedStyle=="function"){let t;try{t=w.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function sh(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 rh=Object.freeze({__proto__:null,isReal:Ds,isEl:As,isInFrame:Gc,createEl:pe,textContent:Ai,prependTo:Qa,hasClass:or,addClass:Fi,removeClass:Un,toggleClass:Xc,setAttributes:Kc,getAttributes:Si,getAttribute:Yc,setAttribute:bs,removeAttribute:Fn,blockTextSelection:Qc,unblockTextSelection:Jc,getBoundingClientRect:Ss,findPosition:pr,getPointerPosition:qn,isTextNode:Zc,emptyEl:$n,normalizeContent:eh,appendContent:xo,insertContent:th,isSingleLeftClick:mr,$:Di,$$:ih,computedStyle:Es,copyStyleSheetsToWindow:sh});let nh=!1,Ja;const Zg=function(){if(Ja.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&&Ja(a);else{Za(1);break}}else nh||Za(1)};function Za(s,e){Ds()&&(e&&(Ja=e),w.setTimeout(Zg,s))}function eo(){nh=!0,w.removeEventListener("load",eo)}Ds()&&(ie.readyState==="complete"?eo():w.addEventListener("load",eo));const ah=function(s){const e=ie.createElement("style");return e.className=s,e},oh=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var lt=new WeakMap;const e_=3;let t_=e_;function xt(){return t_++}function kl(s,e){if(!lt.has(s))return;const t=lt.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&<.delete(s)}function ko(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function jn(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||w.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 en;const i_=function(){if(typeof en!="boolean"){en=!1;try{const s=Object.defineProperty({},"passive",{get(){en=!0}});w.addEventListener("test",null,s),w.removeEventListener("test",null,s)}catch{}}return en},s_=["touchstart","touchmove"];function Et(s,e,t){if(Array.isArray(e))return ko(Et,s,e,t);lt.has(s)||lt.set(s,{});const i=lt.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=xt()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=jn(r);const a=i.handlers[r.type];if(a){const u=a.slice(0);for(let c=0,f=u.length;c<f&&!r.isImmediatePropagationStopped();c++)try{u[c].call(s,r,n)}catch(g){ye.error(g)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;i_()&&s_.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function st(s,e,t){if(!lt.has(s))return;const i=lt.get(s);if(!i.handlers)return;
vendor: 4,267 bytes, line 17
17if(Array.isArray(e))return ko(st,s,e,t);const r=function(a,u){i.handlers[u]=[],kl(a,u)};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);kl(s,e)}}function ws(s,e,t){const i=lt.has(s)?lt.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=jn(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)ws.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){lt.has(e.target)||lt.set(e.target,{});const n=lt.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 Hn(s,e,t){if(Array.isArray(e))return ko(Hn,s,e,t);const i=function(){st(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||xt(),Et(s,e,i)}function Io(s,e,t){const i=function(){st(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||xt(),Et(s,e,i)}var r_=Object.freeze({__proto__:null,fixEvent:jn,on:Et,off:st,trigger:ws,one:Hn,any:Io});const kt=30,Pe=function(s,e,t){e.guid||(e.guid=xt());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Zt=function(s,e){let t=w.performance.now();return function(...r){const n=w.performance.now();n-t>=e&&(s(...r),t=n)}},uh=function(s,e,t,i=w){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const u=this,c=arguments;let f=function(){r=null,f=null,t||s.apply(u,c)};!r&&t&&s.apply(u,c),i.clearTimeout(r),r=i.setTimeout(f,e)};return a.cancel=n,a};var n_=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:kt,bind_:Pe,throttle:Zt,debounce:uh});let er;class Ct{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Et(this,e,t),this.addEventListener=i}off(e,t){st(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Hn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Io(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=jn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ws(this,e)}queueTrigger(e){er||(er=new Map);const t=e.type||e;let i=er.get(this);i||(i=new Map,er.set(this,i));const r=i.get(t);i.delete(t),w.clearTimeout(r);const n=w.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,er.delete(this)),this.trigger(e)},0);i.set(t,n)}}Ct.prototype.allowedEvents_={};Ct.prototype.addEventListener=Ct.prototype.on;Ct.prototype.removeEventListener=Ct.prototype.off;Ct.prototype.dispatchEvent=Ct.prototype.trigger;const Vn=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,ui=s=>s instanceof Ct||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),a_=(s,e)=>{ui(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},to=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,mn=(s,e,t)=>{if(!s||!s.nodeName&&!ui(s))throw new Error(`Invalid target for ${Vn(e)}#${t}; must be a DOM node or evented object.`)},lh=(s,e,t)=>{if(!to(s))throw new Error(`Invalid event type for ${Vn(e)}#${t}; must be a non-empty string or array.`)},ch=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Vn(e)}#${t}; must be a function.`)},Pa=(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]),mn(r,s,t),lh(n,s,t),ch(a,s,t),a=Pe(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Li=(s,e,t,i)=>{mn(s,s,e),s.nodeName?r_[e](s,t,i):s[e](t,i)},o_={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"on");if(Li(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,Li(this,"on","dispose",n),Li(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"one");if(e)Li(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Li(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Pa(this,s,"any");
vendor: 4,113 bytes, line 17
17if(e)Li(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Li(t,"any",i,n)}},off(s,e,t){if(!s||to(s))st(this.eventBusEl_,s,e);else{const i=s,r=e;mn(i,this,"off"),lh(r,this,"off"),ch(t,this,"off"),t=Pe(this,t),this.off("dispose",t),i.nodeName?(st(i,r,t),st(i,"dispose",t)):ui(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){mn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!to(t))throw new Error(`Invalid event type for ${Vn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ws(this.eventBusEl_,s,e)}};function Po(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_=pe("span",{className:"vjs-event-bus"});return Object.assign(s,o_),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&<.has(i)&<.delete(i)}),w.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const u_={state:{},setState(s){typeof s=="function"&&(s=s());let e;return os(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&ui(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function hh(s,e){return Object.assign(s,u_),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&ui(s)&&s.on("statechanged",s.handleStateChanged),s}const ur=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},Fe=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},dh=function(s,e){return Fe(s)===Fe(e)};var l_=Object.freeze({__proto__:null,toLowerCase:ur,toTitleCase:Fe,titleCaseEquals:dh});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_=xe({},this.options_),t=this.options_=xe(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_${xt()}`}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&&(Po(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),hh(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_=xe(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return pe(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],u=r&&r.split("-")[0],c=n&&n[u];let f=i;return a&&a[e]?f=a[e]:c&&c[e]&&(f=c[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(g,_){const k=t[_-1];let D=k;return typeof k>"u"&&(D=g),D})),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]}
17getDescendant(...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=pe("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=Fe(e);const a=t.componentClass||n;t.name=n;const u=X.getComponent(a);if(!u)throw new Error(`Component ${a} does not exist`);if(typeof u!="function")return null;r=new u(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&&Fe(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[ur(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_:As(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_[Fe(e.name())]=null,this.childNameIndex_[ur(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 u=a.name;let c=a.opts;if(t[u]!==void 0&&(c=t[u]),c===!1)return;c===!0&&(c={}),c.playerOptions=this.options_.playerOptions;const f=this.addChild(u,c);f&&(this[u]=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(u){return typeof u=="string"?a===u:a===u.name})})).map(a=>{let u,c;return typeof a=="string"?(u=a,c=e[u]||this.options_[u]||{}):(u=a.name,c=a),{name:u,opts:c}}).filter(a=>{const u=X.getComponent(a.opts.componentClass||Fe(a.name));return u&&!n.isTech(u)}).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 Di(e,t||this.contentEl())}$$(e,t){return ih(e,t||this.contentEl())}hasClass(e){return or(this.el_,e)}addClass(...e){Fi(this.el_,...e)}removeClass(...e){Un(this.el_,...e)}toggleClass(e,t){Xc(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 Yc(this.el_,e)}setAttribute(e,t){bs(this.el_,e,t)}removeAttribute(e){Fn(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"+Fe(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Es(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Fe(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(u){u.touches.length===1&&(t={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=w.performance.now(),n=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)n=!1;else if(t){const c=u.touches[0].pageX-t.pageX,f=u.touches[0].pageY-t.pageY;Math.sqrt(c*c+f*f)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(u){t
17=null,n===!0&&w.performance.now()-e<r&&(u.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Pe(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=Pe(this,e),this.clearTimersOnDispose_(),i=w.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),w.clearTimeout(e)),e}setInterval(e,t){e=Pe(this,e),this.clearTimersOnDispose_();const i=w.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),w.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Pe(this,e),t=w.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=Pe(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),w.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=w.getComputedStyle(n,null),u=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||w.getComputedStyle(n).height==="0px"||w.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||w.innerWidth)||a.y<0||a.y>(ie.documentElement.clientHeight||w.innerHeight))return!1;let u=ie.elementFromPoint(a.x,a.y);for(;u;){if(u===n)return!0;if(u.parentNode)u=u.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 u;throw r?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=Fe(e),X.components_||(X.components_={});const a=X.getComponent("Player");if(e==="Player"&&a&&a.players){const u=a.players,c=Object.keys(u);if(u&&c.length>0){for(let f=0;f<c.length;f++)if(u[c[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return X.components_[e]=t,X.components_[ur(e)]=t,t}static getComponent(e){if(!(!e||!X.components_))return X.components_[e]}}X.registerComponent("Component",X);function c_(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 Il(s,e,t,i){return c_(s,i,t.length-1),t[i][e]}function Oa(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:Il.bind(null,"start",0,s),end:Il.bind(null,"end",1,s)},w.Symbol&&w.Symbol.iterator&&(e[w.Symbol.iterator]=()=>(s||[]).values()),e}function Nt(s,e){return Array.isArray(s)?Oa(s):s===void 0||e===void 0?Oa():Oa([[s,e]])}const fh=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 Oo=fh;function ph(s){Oo=s}function mh(){Oo=fh}function Hi(s,e=s){return Oo(s,e)}var h_=Object.freeze({__proto__:null,createTimeRanges:Nt,createTimeRange:Nt,setFormatTime:ph,resetFormatTime:mh,formatTime:Hi});function gh(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Nt(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 Ue(s){if(s instanceof Ue)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Qt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Ue.defaultMessages[this.code]||"")}Ue.prototype.code=0;Ue.prototype.message="";Ue.prototype.status=null;Ue.prototype.metadata=null;Ue.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ue.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."};Ue.MEDIA_ERR_CUSTOM=0;Ue.prototype.MEDIA_ERR_CUSTOM=0;Ue.MEDIA_ERR_ABORTED=1;Ue.prototype.MEDIA_ERR_ABORTED=1;Ue.MEDIA_ERR_NETWORK=2;Ue.prototype.MEDIA_ERR_NETWORK=2;Ue.MEDIA_ERR_DECODE=3;Ue.prototype.MEDIA_ERR_DECODE=3;Ue.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Ue.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Ue.MEDIA_ERR_ENCRYPTED=5;Ue.prototype.MEDIA_ERR_ENCRYPTED=5;function lr(s){return s!=null&&typeof s.then=="function"}function Wt(s){lr(s)&&s.then(null,e=>{})}const io=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}})})},d_=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=io(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(io))}
vendor: 10,748 bytes, line 17
17,f_=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 so={textTracksToJson:d_,jsonToTextTracks:f_,trackToJson:io};const La="vjs-modal-dialog";class xs 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_=pe("div",{className:`${La}-content`},{role:"document"}),this.descEl_=pe("p",{className:`${La}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Ai(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`${La} 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(),th(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"),$n(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 w.HTMLAnchorElement||t instanceof w.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof w.HTMLInputElement||t instanceof w.HTMLSelectElement||t instanceof w.HTMLTextAreaElement||t instanceof w.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof w.HTMLIFrameElement||t instanceof w.HTMLObjectElement||t instanceof w.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}xs.prototype.options_={pauseOnOpen:!0,temporary:!0};X.registerComponent("ModalDialog",xs);class Vi extends Ct{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),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})},ui(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}}Vi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in Vi.prototype.allowedEvents_)Vi.prototype["on"+s]=null;const Ra=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 _h extends Vi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(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 Ma=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 yh extends Vi{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Ma(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&&Ma(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Ma(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 Lo extends Vi{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 p_{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 gn{constructor(e){gn.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 m_={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},g_={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},__={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Pl={disabled:"disabled",hidden:"hidden",showing:"showing"};class Ro extends Ct{constructor(e={}){super();const t={id:e.id||"vjs_track_"+xt(),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 Mo=function(s){return new URL(s,ie.baseURI)},Th=function(s){return new URL(s,ie.baseURI).href},No=function(s){if(typeof s=="string"){const t=s.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},zn=function(s,e=w.location){return Mo(s).origin!==e.origin};var y_=Object.freeze({__proto__:null,parseUrl:Mo,getAbsoluteURL:Th,getFileExtension:No,isCrossOrigin:zn});const Ol=function(s,e){const t=new w.WebVTT.Parser(w,w.vttjs,w.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&&(w.console&&w.console.groupCollapsed&&w.console.groupCollapsed(`Text Track parsing errors for ${e.src}
17`),i.forEach(r=>ye.error(r)),w.console&&w.console.groupEnd&&w.console.groupEnd()),t.flush()},Ll=function(s,e){const t={uri:s},i=zn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),bc(t,Pe(this,function(n,a,u){if(n)return ye.error(n,a);e.loaded_=!0,typeof w.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],c=>{if(c.type==="vttjserror"){ye.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Ol(u,e)}):Ol(u,e)}))};class Tr extends Ro{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=xe(e,{kind:__[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Pl[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 gn(this.cues_),a=new gn(this.activeCues_);let u=!1;this.timeupdateHandler=Pe(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,u&&(this.trigger("cuechange"),u=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const c=()=>{this.stopTracking()};this.tech_.one("dispose",c),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(f){Pl[f]&&i!==f&&(i=f,!this.preload_&&i!=="disabled"&&this.cues.length===0&&Ll(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(),g=[];for(let _=0,k=this.cues.length;_<k;_++){const D=this.cues[_];D.startTime<=f&&D.endTime>=f&&g.push(D)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let _=0;_<g.length;_++)this.activeCues_.indexOf(g[_])===-1&&(u=!0);return this.activeCues_=g,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")&&Ll(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 w.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 so.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}}}}Tr.prototype.allowedEvents_={cuechange:"cuechange"};class vh extends Ro{constructor(e={}){const t=xe(e,{kind:g_[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 bh extends Ro{constructor(e={}){const t=xe(e,{kind:m_[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 li extends Ct{constructor(e={}){super();let t;const i=new Tr(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=li.NONE,i.addEventListener("loadeddata",()=>{t=li.LOADED,this.trigger({type:"load",target:this})})}}li.prototype.allowedEvents_={load:"load"};li.NONE=0;li.LOADING=1;li.LOADED=2;li.ERROR=3;
17const wt={audio:{ListClass:_h,TrackClass:vh,capitalName:"Audio"},video:{ListClass:yh,TrackClass:bh,capitalName:"Video"},text:{ListClass:Lo,TrackClass:Tr,capitalName:"Text"}};Object.keys(wt).forEach(function(s){wt[s].getterName=`${s}Tracks`,wt[s].privateName=`${s}Tracks_`});const Cs={remoteText:{ListClass:Lo,TrackClass:Tr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:p_,TrackClass:li,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ut=Object.assign({},wt,Cs);Cs.names=Object.keys(Cs);wt.names=Object.keys(wt);ut.names=[].concat(Cs.names).concat(wt.names);function T_(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 ut.text.TrackClass(r);return n.addTrack(a),a}class ge 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}),ut.names.forEach(i=>{const r=ut[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 ut.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(Pe(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 Nt(0,0)}bufferedPercent(){return gh(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(wt.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 Ue(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Nt(0,0):Nt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}
vendor: 10,790 bytes, lines 17-52
17initTrackListeners(){wt.names.forEach(e=>{const t=wt[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(!w.WebVTT)if(ie.body.contains(this.el())){if(!this.options_["vtt.js"]&&vs(sl)&&Object.keys(sl).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}),w.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=u=>e.addTrack(u.track),r=u=>e.removeTrack(u.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let u=0;u<e.length;u++){const c=e[u];c.removeEventListener("cuechange",n),c.mode==="showing"&&c.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 u=0;u<e.length;u++)e[u].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return T_(this,e,t,i)}createRemoteTextTrack(e){const t=xe(e,{tech:this});return new Cs.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=xt();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 ge.canPlayType(e.type)}static isTech(e){return e.prototype instanceof ge||e instanceof ge||e===ge}static registerTech(e,t){if(ge.techs_||(ge.techs_={}),!ge.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!ge.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!ge.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Fe(e),ge.techs_[e]=t,ge.techs_[ur(e)]=t,e!=="Tech"&&ge.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(ge.techs_&&ge.techs_[e])return ge.techs_[e];if(e=Fe(e),w&&w.videojs&&w.videojs[e])return ye.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),w.videojs[e]}}}ut.names.forEach(function(s){const e=ut[s];ge.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});ge.prototype.featuresVolumeControl=!0;ge.prototype.featuresMuteControl=!0;ge.prototype.featuresFullscreenResize=!1;ge.prototype.featuresPlaybackRate=!1;ge.prototype.featuresProgressEvents=!1;ge.prototype.featuresSourceset=!1;ge.prototype.featuresTimeupdateEvents=!1;ge.prototype.featuresNativeTextTracks=!1;ge.prototype.featuresVideoFrameCallback=!1;ge.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:ye.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",ge);ge.registerTech("Tech",ge);ge.defaultTechOrder_=[];const qi={},_n={},yn={};function v_(s,e){qi[s]=qi[s]||[],qi[s].push(e)}function b_(s,e,t){s.setTimeout(()=>Ri(e,qi[e.type],t,s),1)}function S_(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function E_(s,e,t){return s.reduceRight(Bo(t),e[t]())}function C_(s,e,t,i){return e[t](s.reduce(Bo(t),i))}function Rl(s,e,t,i=null){const r="call"+Fe(t),n=s.reduce(Bo(r),i),a=n===yn,u=a?null:e[t](n);return w_(s,t,u,a),u}const D_={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},A_={setCurrentTime:1,setMuted:1,setVolume:1},Ml={play:1,pause:1};function Bo(s){return(e,t)=>e===yn?yn:t[s]?t[s](e):e}function w_(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function x_(s){_n.hasOwnProperty(s.id())&&delete _n[s.id()]}function k_(s,e){const t=_n[s.id()];let i=null;if(t==null)return i=e(s),_n[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 Ri(s={},e=[],t,i,r=[],n=!1){const[a,...u]=e;if(typeof a=="string")Ri(s,qi[a],t,i,r,n);else if(a){const c=k_(i,a);if(!c.setSource)return r.push(c),Ri(s,u,t,i,r,n);c.setSource(Object.assign({},s),function(f,g){if(f)return Ri(s,u,t,i,r,n);r.push(c),Ri(g,s.type===g.type?u:qi[g.type],t,i,r,n)})}else u.length?Ri(s,u,t,i,r,n):n?t(s,r):Ri(s,qi["*"],t,i,r,!0)}const I_={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"},Tn=function(s=""){const e=No(s);return I_[e.toLowerCase()]||""},P_=(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 Tn(e)},Sh=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=Sh(t),Array.isArray(t)?e=e.concat(t):Qt(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[Nl({src:s})]:Qt(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[Nl(s)]:s=[];return s};function Nl(s){if(!s.type){const e=Tn(s.src);e&&(s.type=e)}return s}var O_=`<svg xmlns="http://www.w3.org/2000/svg"> 18 <defs> 19 <symbol viewBox="0 0 48 48" id="vjs-icon-play"> 20 <path d="M16 10v28l22-14z"></path> 21 </symbol> 22 <symbol viewBox="0 0 48 48" id="vjs-icon-pause"> 23 <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path> 24 </symbol> 25 <symbol viewBox="0 0 48 48" id="vjs-icon-audio"> 26 <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> 27 </symbol> 28 <symbol viewBox="0 0 48 48" id="vjs-icon-captions"> 29 <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> 30 </symbol> 31 <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles"> 32 <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> 33 </symbol> 34 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter"> 35 <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path> 36 </symbol> 37 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit"> 38 <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path> 39 </symbol> 40 <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle"> 41 <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> 42 </symbol> 43 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute"> 44 <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> 45 </symbol> 46 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low"> 47 <path d="M14 18v12h8l10 10V8L22 18h-8z"></path> 48 </symbol> 49 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium"> 50 <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> 51 </symbol> 52 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
53 <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> 54 </symbol> 55 <symbol viewBox="0 0 48 48" id="vjs-icon-spinner"> 56 <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> 57 </symbol> 58 <symbol viewBox="0 0 24 24" id="vjs-icon-hd"> 59 <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> 60 </symbol> 61 <symbol viewBox="0 0 48 48" id="vjs-icon-chapters"> 62 <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path> 63 </symbol> 64 <symbol viewBox="0 0 40 40" id="vjs-icon-downloading"> 65 <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> 66 </symbol> 67 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download"> 68 <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> 69 </symbol> 70 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done"> 71 <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> 72 </symbol> 73 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off"> 74 <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> 75 </symbol> 76 <symbol viewBox="0 0 48 48" id="vjs-icon-share"> 77 <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> 78 </symbol> 79 <symbol viewBox="0 0 48 48" id="vjs-icon-cog"> 80 <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> 81 </symbol> 82 <symbol viewBox="0 0 48 48" id="vjs-icon-square"> 83 <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> 84 </symbol> 85 <symbol viewBox="0 0 48 48" id="vjs-icon-circle"> 86 <circle cx="24" cy="24" r="20"></circle> 87 </symbol> 88 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline"> 89 <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> 90 </symbol> 91 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle"> 92 <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> 93 </symbol> 94 <symbol viewBox="0 0 48 48" id="vjs-icon-cancel"> 95 <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> 96 </symbol> 97 <symbol viewBox="0 0 48 48" id="vjs-icon-replay"> 98 <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-
987.16 16-16-7.16-16-16-16z"></path> 99 </symbol> 100 <symbol viewBox="0 0 48 48" id="vjs-icon-repeat"> 101 <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path> 102 </symbol> 103 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5"> 104 <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> 105 </symbol> 106 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10"> 107 <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> 108 </symbol> 109 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30"> 110 <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> 111 </symbol> 112 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5"> 113 <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> 114 </symbol> 115 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10"> 116 <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> 117 </symbol> 118 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30"> 119 <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> 120 </symbol> 121 <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description"> 122 <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> 123 </symbol> 124 <symbol viewBox="0 0 48 48" id="vjs-icon-next-item"> 125 <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path> 126 </symbol> 127 <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item"> 128 <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path> 129 </symbol>
130 <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle"> 131 <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> 132 </symbol> 133 <symbol viewBox="0 0 48 48" id="vjs-icon-cast"> 134 <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> 135 </symbol> 136 <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter"> 137 <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> 138 </symbol> 139 <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit"> 140 <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> 141 <path fill="none" d="M-1-3h24v24H-1z"></path> 142 </symbol> 143 <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook"> 144 <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path> 145 </symbol> 146 <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin"> 147 <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> 148 </symbol> 149 <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter"> 150 <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"/> 151 </symbol> 152 <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr"> 153 <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> 154 </symbol> 155 <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest"> 156 <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> 157 </symbol> 158 </defs> 159</svg>`;const Bl=dn?10009:fn?461:8,is={codes:{play:415,pause:19,ff:417,rw:412,back:Bl},names:{415:"play",19:"pause",417:"ff",412:"rw",[Bl]:"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}},Ul=5;class L_ extends Ct{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(is.isEventKey(t,"play")||is.isEventKey(t,"pause")||is.isEventKey(t,"ff")||is.isEventKey(t,"rw")){t.preventDefault();const i=is.getEventName(t);this.performMediaAction_(i)}else is.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()+Ul);break;case"rw":this.userSeek_(this.player_.currentTime()-Ul);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().getIsF
159ocusable()&&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((u,c)=>{t.push({name:()=>"ModalButton"+(c+1),el:()=>u,getPositions:()=>{const f=u.getBoundingClientRect(),g={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},_={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:g,center:_}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>u.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,focu
159sedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const u=a.getPositions().center,c=this.calculateDistance_(e,u,i);c<r&&(r=c,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 R_ extends X{constructor(e,t,i){const r=xe({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 u=Fe(a[n]);let c=ge.getTech(u);if(u||(c=X.getComponent(u)),c&&c.isSupported()){e.loadTech_(u);break}}else e.src(t.playerOptions.sources)}}X.registerComponent("MediaLoader",R_);class Gn 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"&&ye.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=pe(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(pe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=pe("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,Ai(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",Gn);class ro extends Gn{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 pe("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(pe("picture",{className:"vjs-poster",tabIndex:-1},{},pe("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()?Wt(this.player_.play()):this.player_.pause())}}ro.prototype.crossorigin=ro.prototype.crossOrigin;X.registerComponent("PosterImage",ro);const At="#222",Fl="#ccc",M_={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',
159script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Na(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 Vt(s,e,t){try{s.style[e]=t}catch{return}}function ql(s){return s?`${s}px`:""}class N_ 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(Pe(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=w.screen.orientation||w,u=w.screen.orientation?"change":"orientationchange";a.addEventListener(u,n),e.on("dispose",()=>a.removeEventListener(u,n));const c=this.options_.playerOptions.tracks||[];for(let f=0;f<c.length;f++)this.player_.addRemoteTextTrack(c[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 u=0;u<t.length;u++){const c=t[u];i&&i.enabled&&i.language&&i.language===c.language&&c.kind in e?c.kind===i.kind?a=c:a||(a=c):i&&!i.enabled?(a=null,r=null,n=null):c.default&&(c.kind==="descriptions"&&!r?r=c:c.kind in e&&!n&&(n=c))}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 w.WebVTT=="function"&&w.WebVTT.processCues(w,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let u=0;u<e.length;++u){const c=e[u];c.mode==="showing"&&a.push(c)}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)),!w.CSS.supports("inset","10px")){const a=this.el_,u=a.querySelectorAll(".vjs-text-track-cue"),c=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",Vt(a,"position","relative"),Vt(a,"height",f-c+"px"),Vt(a,"top","unset"),pn?Vt(a,"bottom",f+"px"):Vt(a,"bottom","0px"),u.length>0&&u.forEach(g=>{if(g.style.inset){const _=g.style.inset.split(" ");_.length===3&&Object.assign(g.style,{top:_[0],right:_[1],bottom:_[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!w.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)),Vt(this.el_,"insetInline",ql(n)),Vt(this.el_,"insetBlock",ql(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&&Vt(a.firstChild,"color",Na(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Vt(a.firstChild,"backgroundColor",Na(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Vt(a,"backgroundColor",Na(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${At}, 2px 2px 4px ${At}, 2px 2px 5px ${At}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${At}, 2px 2px ${At}, 3px 3px ${At}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Fl}, 0 1px ${Fl}, -1px -1px ${At}, 0 -1px ${At}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}, 0 0 4px ${At}`)),t.fontPercent&&t.fontPercent!==1){const u=w.parseFloat(a.style.fontSize);a.style.fontSize=u*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=M_[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof w.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])}w.WebVTT.processCues(w,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;Fi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&bs(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}X.registerComponent("TextTrackDisplay",N_);class B_ extends X{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
159Video Player"),i=pe("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",B_);class rt extends Gn{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=pe(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(pe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const i=this.constructor.name;return ye.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",rt);class Eh extends rt{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){Wt(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();lr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Eh.prototype.controlText_="Play Video";X.registerComponent("BigPlayButton",Eh);class U_ extends rt{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",U_);class Ch extends rt{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()?Wt(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))}}Ch.prototype.controlText_="Play";X.registerComponent("PlayToggle",Ch);class ks 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=pe("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}Â `},{role:"presentation"});return t.appendChild(i),this.contentEl_=pe("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=Hi(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,ye.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){}}ks.prototype.labelText_="Time";ks.prototype.controlText_="Time";X.registerComponent("TimeDisplay",ks);class Uo extends ks{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Uo.prototype.labelText_="Current Time";Uo.prototype.controlText_="Current Time";X.registerComponent("CurrentTimeDisplay",Uo);class Fo extends ks{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);
vendor: 8,619 bytes, line 159
159this.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)}}Fo.prototype.labelText_="Duration";Fo.prototype.controlText_="Duration";X.registerComponent("DurationDisplay",Fo);class F_ 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",F_);class qo extends ks{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(pe("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)}}qo.prototype.labelText_="Remaining Time";qo.prototype.controlText_="Remaining Time";X.registerComponent("RemainingTimeDisplay",qo);class q_ 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_=pe("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(pe("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",q_);class Dh extends rt{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_=pe("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()}}Dh.prototype.controlText_="Seek to live, currently playing live";X.registerComponent("SeekToLive",Dh);function vr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var $_=Object.freeze({__proto__:null,clamp:vr});class $o 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"&&!Jt&&e.preventDefault(),Qc(),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;Jc(),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(vr(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",$o);const Ba=(s,e)=>vr(s/e*100,0,100).toFixed(2)+"%";class j_ 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=pe("span",{className:"vjs-control-text"}),i=pe("span",{textContent:this.localize("Loaded")}),r=ie.createTextNode(": ");return this.percentageEl_=pe("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_,u=Ba(n,r);this.percent_!==u&&(this.el_.style.width=u,Ai(this.percentageEl_,u),this.percent_=u);for(let c=0;c<i.length;c++){const f=i.start(c),g=i.end(c);let _=a[c];_||(_=this.el_.appendChild(pe()),a[c]=_),!(_.dataset.start===f&&_.dataset.end===g)&&(_.dataset.start=f,_.dataset.end=g,_.style.left=Ba(f,n),_.style.width=Ba(g-f,n))}for(let c=a.length;c>i.length;c--)this.el_.removeChild(a[c-1]);a.length=i.length})}}X.registerComponent("LoadProgressBar",j_);class H_ extends X{constructor(e,t){super(e,t),this.update=Zt(Pe(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=pr(this.el_),n=Ss(this.player_.el()),a=e.width*t;if(!n||!r)return;let u=e.left-n.left+a,c=e.width-a+(n.right-e.right);c||(c=e.width-a,u=a);let f=r.width/2;u<f?f+=f-u:c<f&&(f=c),f<0?f=0:f>
159r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(i)}write(e){Ai(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 u=this.player_.liveTracker.liveWindow(),c=u-t*u;n=(c<1?"":"-")+Hi(c,u)}else n=Hi(i,a);this.update(e,t,n),r&&r()})}}X.registerComponent("TimeTooltip",H_);class jo extends X{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Zt(Pe(this,this.update),kt)}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)}}jo.prototype.options_={children:[]};!it&&!Bt&&jo.prototype.options_.children.push("timeTooltip");X.registerComponent("PlayProgressBar",jo);class Ah extends X{constructor(e,t){super(e,t),this.update=Zt(Pe(this,this.update),kt)}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`})}}Ah.prototype.options_={children:["timeTooltip"]};X.registerComponent("MouseTimeDisplay",Ah);class Wn extends $o{constructor(e,t){t=xe(Wn.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(it||Bt)||e.options_.disableSeekWhileScrubbingOnSTV;(!it&&!Bt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Pe(this,this.update),this.update=Zt(this.update_,kt),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,kt))}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}",[Hi(i,n),Hi(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(Ss(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;
159return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){mr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!mr(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(),u=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=u&&(i=u),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?Wt(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()}}Wn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};X.registerComponent("SeekBar",Wn);class wh extends X{constructor(e,t){super(e,t),this.handleMouseMove=Zt(Pe(this,this.handleMouseMove),kt),this.throttledHandleMouseSeek=Zt(Pe(this,this.handleMouseSeek),kt),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=pr(n);let u=qn(n,e).x;
159u=vr(u,0,1),r&&r.update(a,u),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&&Wt(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()}}wh.prototype.options_={children:["seekBar"]};X.registerComponent("ProgressControl",wh);class xh extends rt{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 w?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()}}xh.prototype.controlText_="Picture-in-Picture";X.registerComponent("PictureInPictureToggle",xh);class kh extends rt{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()}}kh.prototype.controlText_="Fullscreen";X.registerComponent("FullscreenToggle",kh);const V_=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 z_ extends X{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});
vendor: 8,635 bytes, line 159
159return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}X.registerComponent("VolumeLevel",z_);class G_ extends X{constructor(e,t){super(e,t),this.update=Zt(Pe(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=Ss(this.el_),a=Ss(this.player_.el()),u=e.width*t;if(!a||!n)return;const c=e.left-a.left+u,f=e.width-u+(a.right-e.right);let g=n.width/2;c<g?g+=g-c:f<g&&(g=f),g<0?g=0:g>n.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){Ai(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",G_);class Ih extends X{constructor(e,t){super(e,t),this.update=Zt(Pe(this,this.update),kt)}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`})}}Ih.prototype.options_={children:["volumeLevelTooltip"]};X.registerComponent("MouseVolumeLevelDisplay",Ih);class Xn extends $o{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){mr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=Ss(i),n=this.vertical();let a=qn(i,e);a=n?a.y:a.x,a=vr(a,0,1),t.update(r,a,n)}mr(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)})}}Xn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!it&&!Bt&&Xn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Xn.prototype.playerEvent="volumechange";X.registerComponent("VolumeBar",Xn);class Ph extends X{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||vs(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),V_(this,e),this.throttledHandleMouseMove=Zt(Pe(this,this.handleMouseMove),kt),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)}}Ph.prototype.options_={children:["volumeBar"]};X.registerComponent("VolumeControl",Ph);const W_=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 Oh extends rt{constructor(e,t){super(e,t),W_(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"),it&&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),Un(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Fi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Oh.prototype.controlText_="Mute";X.registerComponent("MuteToggle",Oh);class Lh extends X{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||vs(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"),Et(ie,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),st(ie,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Lh.prototype.options_={children:["muteToggle","volumeControl"]};X.registerComponent("VolumePanel",Lh);class Rh extends rt{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]))}}Rh.prototype.controlText_="Skip Forward";X.registerComponent("SkipForward",Rh);class Mh extends rt{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}
159 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]))}}Mh.prototype.controlText_="Skip Backward";X.registerComponent("SkipBackward",Mh);class Nh 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_=pe(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_),Et(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",Nh);class Ho extends X{constructor(e,t={}){super(e,t),this.menuButton_=new rt(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=rt.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(),Et(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 Nh(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=pe("li",{className:"vjs-menu-title",textContent:Fe(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){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=rt.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"),st(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"),it&&Gc())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
159se"))}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",Ho);class Vo extends Ho{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=Pe(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",Vo);class br extends Gn{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=pe("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",br);class Sr extends br{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=(...u)=>{this.handleTracksChange.apply(this,u)},a=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};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 u;this.on(["tap","click"],function(){if(typeof w.Event!="object")try{u=new w.Event("change")}catch{}u||(u=ie.createEvent("Event"),u.initEvent("change",!0,!0)),r.dispatchEvent(u)})}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",Sr);class Bh extends Sr{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",Bh);class Is extends Vo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=Sr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bh(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 u=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${a.kind}-menu-item`),e.push(u)}}return e}}X.registerComponent("TextTrackButton",Is);class Uh extends br{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",Uh);class zo extends Is{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>
vendor: 29,342 bytes, lines 159-160
159{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(Fe(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 Uh(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}zo.prototype.kind_="chapters";zo.prototype.controlText_="Chapters";X.registerComponent("ChaptersButton",zo);class Go extends Is{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=Pe(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()}`}}Go.prototype.kind_="descriptions";Go.prototype.controlText_="Descriptions";X.registerComponent("DescriptionsButton",Go);class Wo extends Is{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()}`}}Wo.prototype.kind_="subtitles";Wo.prototype.controlText_="Subtitles";X.registerComponent("SubtitlesButton",Wo);class Xo extends Sr{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",Xo);class Ko extends Is{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 Xo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Ko.prototype.kind_="captions";Ko.prototype.controlText_="Captions";X.registerComponent("CaptionsButton",Ko);class Fh extends Sr{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(pe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(pe("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}X.registerComponent("SubsCapsMenuItem",Fh);class Yo extends Is{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(Fe(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 Xo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Fh),e}}Yo.prototype.kinds_=["captions","subtitles"];Yo.prototype.controlText_="Subtitles";X.registerComponent("SubsCapsButton",Yo);class qh extends br{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(pe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(pe("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",qh);class $h extends Vo{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 qh(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}$h.prototype.controlText_="Audio Track";X.registerComponent("AudioTrackButton",$h);class Qo extends br{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)}}Qo.prototype.contentElType="button";X.registerComponent("PlaybackRateMenuItem",Qo);class jh extends Ho{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_=pe("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 Qo(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")}}jh.prototype.controlText_="Playback Rate";X.registerComponent("PlaybackRateMenuButton",jh);class Hh 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",Hh);class X_ extends Hh{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}}X.registerComponent("CustomControlSpacer",X_);class Vh extends X{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Vh.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",Vh);class zh extends xs{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):""}}zh.prototype.options_=Object.assign({},xs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});X.registerComponent("ErrorDisplay",zh);class Gh 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(),pe("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${xt()}`)+"-"+t[1].replace(/\W+/g,""),r=pe("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",Gh);class $i extends X{constructor(e,t={}){super(e,t);const i=pe("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],u=a.className,c=a.id.replace("%s",this.options_.id_);let f=null;const g=`vjs_select_${xt()}`;if(this.options_.type==="colors"){f=pe("span",{className:u});const k=pe("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});k.setAttribute("for",g),f.appendChild(k)}const _=new Gh(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:c});this.addChild(_),this.options_.type==="colors"&&(f.appendChild(_.el()),this.el().appendChild(f))}}createEl(){return pe("fieldset",{className:this.options_.className})}}X.registerComponent("TextTrackFieldset",$i);class Wh extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new $i(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 $i(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 $i(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 pe("div",{className:"vjs-track-settings-colors"})}}X.registerComponent("TextTrackSettingsColors",Wh);class Xh extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new $i(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 $i(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 $i(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 pe("div",{className:"vjs-track-settings-font"})}}X.registerComponent("TextTrackSettingsFont",Xh);class Kh extends X{constructor(e,t={}){super(e,t);const i=new rt(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 rt(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return pe("div",{className:"vjs-track-settings-controls"})}}X.registerComponent("TrackSettingsControls",Kh);const Ua="vjs-text-track-settings",$l=["#000","Black"],jl=["#00F","Blue"],Hl=["#0FF","Cyan"],Vl=["#0F0","Green"],zl=["#F0F","Magenta"],Gl=["#F00","Red"],Wl=["#FFF","White"],Xl=["#FF0","Yellow"],Fa=["1","Opaque"],qa=["0.5","Semi-Transparent"],Kl=["0","Transparent"],Ei={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[$l,Wl,Gl,Vl,jl,Xl,zl,Hl],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Fa,qa,Kl],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Wl,$l,Gl,Vl,jl,Xl,zl,Hl],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:[Fa,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:[Kl,qa,Fa],className:"vjs-window-opacity vjs-opacity"}};Ei.windowColor.options=Ei.backgroundColor.options;function Yh(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function K_(s,e){const t=s.options[s.options.selectedIndex].value;return Yh(t,e)}function Y_(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(Yh(s.options[i].value,t)===e){s.selectedIndex=i;break}}}class Q_ extends xs{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=pe("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 Wh(e,{textTrackComponentid:this.id_,selectConfigs:Ei,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Xh(e,{textTrackComponentid:this.id_,selectConfigs:Ei,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new Kh(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()}),os(Ei,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 Fc(Ei,(e,t,i)=>{const r=K_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){os(Ei,(t,i)=>{Y_(this.$(t.selector),e[i],t.parser)})}setDefaults(){os(Ei,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(w.localStorage.getItem(Ua))}catch(t){ye.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?w.localStorage.setItem(Ua,JSON.stringify(e)):w.localStorage.removeItem(Ua)}catch(t){ye.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}X.registerComponent("TextTrackSettings",Q_);class J_ extends X{constructor(e,t){let i=t.ResizeObserver||w.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=xe({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||w.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=uh(()=>{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(){st(this,"resize",n),st(this,"unload",a),a=null};Et(this.el_.contentWindow,"unload",a),Et(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",J_);const Z_={trackingThreshold:20,liveTolerance:15};class ey extends X{constructor(e,t){const i=xe(Z_,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(w.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_,kt),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",ey);class ty extends X{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:pe("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${xt()}`}),description:pe("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${xt()}`})},pe("div",{className:"vjs-title-bar"},{},qc(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],u=i[r];$n(a),n&&Ai(a,n),t&&(t.removeAttribute(u),n&&t.setAttribute(u,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",ty);const iy={initialDisplay:4e3,position:[],takeFocus:!1};class sy extends rt{constructor(e,t){t=xe(iy,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=pe("button",{},{type:"button",class:this.buildCSSClass()},pe("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",sy);const no=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="",w.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Qh=(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},ny=s=>Qh([s.el(),w.HTMLMediaElement.prototype,w.Element.prototype,ry],"innerHTML"),Yl=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=ny(s),r=n=>(...a)=>{const u=n.apply(e,a);return no(s),u};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",xe(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_)},ay=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Th(w.Element.prototype.getAttribute.call(this,"src")):""},set(s){return w.Element.prototype.setAttribute.call(this,"src",s),s}}),oy=s=>Qh([s.el(),w.HTMLMediaElement.prototype,ay],"src"),uy=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=oy(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",xe(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const u=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),u},e.load=()=>{const n=r.call(e);return no(s)||(s.triggerSourceset(""),Yl(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):no(s)||Yl(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class ue extends ge{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 u=[];for(;a--;){const c=n[a];c.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack(c.track),this.textTracks().addTrack(c.track),!r&&!this.el_.hasAttribute("crossorigin")&&zn(c.src)&&(r=!0)):u.push(c))}for(let c=0;c<u.length;c++)this.el_.removeChild(u[c])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&ye.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. 160This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(fr||Nn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),ue.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){uy(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})}};
160i(),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=wt[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:u=>{const c={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(c),e==="text"&&this[Cs.remoteText.getterName]().trigger(c)},addtrack(u){r.addTrack(u.track)},removetrack(u){r.removeTrack(u.track)}},a=function(){const u=[];for(let c=0;c<r.length;c++){let f=!1;for(let g=0;g<i.length;g++)if(i[g]===r[c]){f=!0;break}f||u.push(r[c])}for(;u.length;)r.removeTrack(u.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(u=>{const c=n[u];i.addEventListener(u,c),this.on("dispose",f=>i.removeEventListener(u,c))}),this.on("loadstart",a),this.on("dispose",u=>this.off("loadstart",a))}proxyNativeTracks_(){wt.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),ue.disposeMediaElement(e),e=i}else{e=ie.createElement("video");const i=this.options_.tag&&Si(this.options_.tag),r=xe({},i);(!fr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Kc(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&bs(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?bs(e,r,r):Fn(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&&Bn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){ye(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Bt&&Jt&&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)Wt(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 ye.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const r=pe("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return ye.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 ye.warn(`No matching source element found with src: ${e}`),!1}reset(){ue.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),w.performance&&(e.creationTime=w.performance.now()),e}}Ln(ue,"TEST_VID",function(){if(!Ds())return;const s=ie.createElement("video"),e=ie.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});ue.isSupported=function(){try{ue.TEST_VID.volume=.5}catch{return!1}return!!(ue.TEST_VID&&ue.TEST_VID.canPlayType)};ue.canPlayType=function(s){return ue.TEST_VID.canPlayType(s)};ue.canPlaySource=function(s,e){return ue.canPlayType(s.type)};ue.canControlVolume=function(){try{const s=ue.TEST_VID.volume;ue.TEST_VID.volume=s/2+.1;const e=s!==ue.TEST_VID.volume;return e&&it?(w.setTimeout(()=>{ue&&ue.prototype&&(ue.prototype.featuresVolumeControl=s!==ue.TEST_VID.volume)}),!1):e}catch{return!1}};ue.canMuteVolume=function(){try{const s=ue.TEST_VID.muted;return ue.TEST_VID.muted=!s,ue.TEST_VID.muted?bs(ue.TEST_VID,"muted","muted"):Fn(ue.TEST_VID,"muted","muted"),s!==ue.TEST_VID.muted}catch{return!1}};ue.canControlPlaybackRate=function(){if(Bt&&Jt&&Rn<58)return!1;try{const s=ue.TEST_VID.playbackRate;return ue.TEST_VID.playbackRate=s/2+.1,s!==ue.TEST_VID.playbackRate}catch{return!1}};ue.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};ue.supportsNativeTextTracks=function(){return Bn||it&&Jt};ue.supportsNativeVideoTracks=function(){return!!(ue.TEST_VID&&ue.TEST_VID.videoTracks)};ue.supportsNativeAudioTracks=function(){return!!(ue.TEST_VID&&ue.TEST_VID.audioTracks)};ue.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
160h(function([s,e]){Ln(ue.prototype,s,()=>ue[e](),!0)});ue.prototype.featuresVolumeControl=ue.canControlVolume();ue.prototype.movingMediaElementInDOM=!it;ue.prototype.featuresFullscreenResize=!0;ue.prototype.featuresProgressEvents=!0;ue.prototype.featuresTimeupdateEvents=!0;ue.prototype.featuresVideoFrameCallback=!!(ue.TEST_VID&&ue.TEST_VID.requestVideoFrameCallback);ue.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{}}()}};ue.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){ue.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){ue.prototype["set"+Fe(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){ue.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){ue.prototype["set"+Fe(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){ue.prototype[s]=function(){return this.el_[s]()}});ge.withSourceHandlers(ue);ue.nativeSourceHandler={};ue.nativeSourceHandler.canPlayType=function(s){try{return ue.TEST_VID.canPlayType(s)}catch{return""}};ue.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return ue.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=No(s.src);return ue.nativeSourceHandler.canPlayType(`video/${t}`)}return""};ue.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};ue.nativeSourceHandler.dispose=function(){};ue.registerSourceHandler(ue.nativeSourceHandler);ge.registerTech("Html5",ue);const Jh=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],$a={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ao=["tiny","xsmall","small","medium","large","xlarge","huge"],an={};ao.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;an[s]=`vjs-layout-${e}`});const ly={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Ce extends X{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${xt()}`,t=Object.assign(Ce.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=Bc(this.id_),this.fsApi_=ln,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: 4,349 bytes, line 160
160ight: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&&Si(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(u){a[u.toLowerCase()]=t.languages[u]}),this.languages_=a}else this.languages_=Ce.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(),Po(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Et(ie,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=xe(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 u=new w.DOMParser().parseFromString(O_,"image/svg+xml");if(u.querySelector("parsererror"))ye.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=u.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 L_(this),this.addClass("vjs-spatial-navigation-enabled")),fr&&this.addClass("vjs-touch-enabled"),it||this.addClass("vjs-workinghover"),Ce.players[this.id_]=this;const n=Ka.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"),st(ie,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),st(ie,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ce.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),x_(this),ut.names.forEach(e=>{const t=ut[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=Si(e);if(r){for(t=this.el_=e,e=this.tag=ie.createElement("video");t.children.length;)e.appendChild(t.firstChild);or(t,"video-js")||Fi(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(c=>{try{e[c]=t[c]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Jt&&Mn&&(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).forEac
160h(function(c){r&&c==="class"||t.setAttribute(c,n[c]),r&&e.setAttribute(c,n[c])}),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(c=>zc[c]).map(c=>"vjs-device-"+c.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),w.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ah("vjs-styles-dimensions");const c=Di(".vjs-styles-defaults"),f=Di("head");f.insertBefore(this.styleEl_,c?c.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 u=e.getElementsByTagName("a");for(let c=0;c<u.length;c++){const f=u.item(c);Fi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Qa(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"){ye.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)){ye.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,ui(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),a_(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(w.VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(u>=0&&(f.width=u),c>=0&&(f.height=c));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),oh(this.styleEl_,` 161 .${r} { 162 width: ${e}px; 163 height: ${t}px; 164 } 165 166 .${r}.vjs-fluid:not(.vjs-audio-only-mode) { 167 padding-top: ${a*100}%; 168 } 169 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Fe(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(ge.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};
169ut.names.forEach(c=>{const f=ut[c];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 u=ge.getTech(e);if(!u)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new u(a),this.tech_.ready(Pe(this,this.handleTechReady_),!0),so.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Jh.forEach(c=>{this.on(this.tech_,c,f=>this[`handleTech${Fe(c)}_`](f))}),Object.keys($a).forEach(c=>{this.on(this.tech_,c,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${$a[c]}_`].bind(this),event:f});return}this[`handleTech${$a[c]}_`](f)})}),this.on(this.tech_,"loadstart",c=>this.handleTechLoadStart_(c)),this.on(this.tech_,"sourceset",c=>this.handleTechSourceset_(c)),this.on(this.tech_,"waiting",c=>this.handleTechWaiting_(c)),this.on(this.tech_,"ended",c=>this.handleTechEnded_(c)),this.on(this.tech_,"seeking",c=>this.handleTechSeeking_(c)),this.on(this.tech_,"play",c=>this.handleTechPlay_(c)),this.on(this.tech_,"pause",c=>this.handleTechPause_(c)),this.on(this.tech_,"durationchange",c=>this.handleTechDurationChange_(c)),this.on(this.tech_,"fullscreenchange",(c,f)=>this.handleTechFullscreenChange_(c,f)),this.on(this.tech_,"fullscreenerror",(c,f)=>this.handleTechFullscreenError_(c,f)),this.on(this.tech_,"enterpictureinpicture",c=>this.handleTechEnterPictureInPicture_(c)),this.on(this.tech_,"leavepictureinpicture",c=>this.handleTechLeavePictureInPicture_(c)),this.on(this.tech_,"error",c=>this.handleTechError_(c)),this.on(this.tech_,"posterchange",c=>this.handleTechPosterChange_(c)),this.on(this.tech_,"textdata",c=>this.handleTechTextData_(c)),this.on(this.tech_,"ratechange",c=>this.handleTechRateChange_(c)),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)&&Qa(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ut.names.forEach(e=>{const t=ut[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=so.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&&ye.warn(`Using the tech directly can be dangerous. I hope you know
169what you're doing. 170See https://github.com/videojs/video.js/issues/2617 for more info. 171`),this.tech_}version(){return{"video.js":Ka}}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(lr(a))return a.catch(u=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),lr(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!lr(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=P_(this,t)),this.cache_.source=xe({},e,{src:t,type:i});const r=this.cache_.sources.filter(c=>c.src&&c.src===t),n=[],a=this.$$("source"),u=[];for(let c=0;c<a.length;c++){const f=Si(a[c]);n.push(f),f.src&&f.src===t&&u.push(f.src)}u.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")}
171handleTechSeeked_(){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()?Wt(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 A_)return C_(this.middleware_,this.tech_,e,t);if(e in Ml)return Rl(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw ye(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in D_)return E_(this.middleware_,this.tech_,e);if(e in Ml)return Rl(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(ye(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(ye(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(ye(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Wt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Bn||it);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")||Nt(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=Nt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Nt(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 gh(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",u),t.off("fullscreenchange",a)}function a(){n(),i()}function u(f,g){n(),r(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",u);const c=t.requestFullscreenHelper_(e);c&&(c.then(n,n),c.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(c,f){r(),i(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const u=e.exitFullscreenHelper_();u&&(u.then(r,r),u.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=ie[this.fsApi_.exitFullscreen]();return e&&Wt(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,Et(ie,"keydown",this.boundFullWindowOnEscKey_),ie.documentElement.style.overflow="hidden",Fi(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,st(ie,"keydown",this.boundFullWindowOnEscKey_),ie.documentElement.style.overflow=this.docOrigOverflow,Un(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&&w.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(pe("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),w.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(sh(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(w.documentPictureInPicture&&w.documentPictureInPicture.window)return w.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=ge.getTech(n);if(a||(a=X.getComponent(n)),!a){ye.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(u=>[u,ge.getTech(u)]).filter(([u,c])=>c?c.isSupported():(ye.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(u,c,f){let g;return u.some(_=>c.some(k=>{if(g=f(_,k),g)return!0})),g};let r;const n=u=>(c,f)=>u(f,c),a=([u,c],f)=>{if(c.canPlaySource(f,this.options_[u.toLowerCase()]))return{source:f,tech:u}};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=Sh(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]),b_(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}S_(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?dh(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();Wt(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}),ui(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(
171))}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(Ci("beforeerror").forEach(t=>{const i=t(this,e);if(!(Qt(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 Ue(e),this.addClass("vjs-error"),ye.error(`(CODE:${this.error_.code} ${Ue.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Ci("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=Pe(this,this.reportUserActivity),n=function(_){(_.screenX!==t||_.screenY!==i)&&(t=_.screenX,i=_.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},u=function(_){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",u),this.on("mouseleave",u);const c=this.getChild("controlBar");c&&!it&&!Bt&&(c.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const _=this.options_.inactivityTimeout;_<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))};this.setInterval(g,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}
171defaultPlaybackRate(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(),ui(this)&&this.trigger("languagechange"))}languages(){return xe(Ce.prototype.options_.languages,this.languages_)}toJSON(){const e=xe(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=xe(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new xs(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<ao.length;i++){const r=ao[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(an[e]),this.addClass(an[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({},ly,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 an[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=xe(e);const{artist:r,artwork:n,description:a,poster:u,src:c,textTracks:f,title:g}=this.cache_.media;!n&&u&&(this.cache_.media.artwork=[{src:u,type:Tn(u)}]),i&&this.crossOrigin(i),c&&this.src(c),u&&this.poster(u),Array.isArray(f)&&f.forEach(_=>this.addRemoteTextTrack(_,!1)),this.titleBar&&this.titleBar.update({title:g,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:Tn(r.poster)}]),r}return xe(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Si(e),r=i["data-setup"];if(or(e,"vjs-fill")&&(i.fill=!0),or(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){ye.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,u=n.length;a<u;a++){const c=n[a],f=c.nodeName.toLowerCase();f==="source"?t.sources.push(Si(c)):f==="track"&&t.tracks.push(Si(c))}}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"))}}Ce.prototype.videoTracks=()=>{};Ce.prototype.audioTracks=()=>{};Ce.prototype.textTracks=()=>{};Ce.prototype.remoteTextTracks=()=>{};Ce.prototype.remoteTextTrackEls=()=>{};
vendor: 5,020 bytes, line 171
171ut.names.forEach(function(s){const e=ut[s];Ce.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ce.prototype.crossorigin=Ce.prototype.crossOrigin;Ce.players={};const tr=w.navigator;Ce.prototype.options_={techOrder:ge.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:tr&&(tr.languages&&tr.languages[0]||tr.userLanguage||tr.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};Jh.forEach(function(s){Ce.prototype[`handleTech${Fe(s)}_`]=function(){return this.trigger(s)}});X.registerComponent("Player",Ce);const vn="plugin",cs="activePlugins_",rs={},bn=s=>rs.hasOwnProperty(s),on=s=>bn(s)?rs[s]:void 0,Zh=(s,e)=>{s[cs]=s[cs]||{},s[cs][e]=!0},Sn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},cy=function(s,e){const t=function(){Sn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Zh(this,s),Sn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},Ql=(s,e)=>(e.prototype.name=s,function(...t){Sn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Sn(this,i.getEventHash()),i});class mt{constructor(e){if(this.constructor===mt)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Po(this),delete this.trigger,hh(this,this.constructor.defaultState),Zh(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 ws(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[cs][e]=!1,this.player=this.state=null,t[e]=Ql(e,rs[e])}static isBasic(e){const t=typeof e=="string"?on(e):e;return typeof t=="function"&&!mt.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(bn(e))ye.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ce.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 rs[e]=t,e!==vn&&(mt.isBasic(t)?Ce.prototype[e]=cy(e,t):Ce.prototype[e]=Ql(e,t)),t}static deregisterPlugin(e){if(e===vn)throw new Error("Cannot de-register base plugin.");bn(e)&&(delete rs[e],delete Ce.prototype[e])}static getPlugins(e=Object.keys(rs)){let t;return e.forEach(i=>{const r=on(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=on(e);return t&&t.VERSION||""}}mt.getPlugin=on;mt.BASE_PLUGIN_NAME=vn;mt.registerPlugin(vn,mt);Ce.prototype.usingPlugin=function(s){return!!this[cs]&&this[cs][s]===!0};Ce.prototype.hasPlugin=function(s){return!!bn(s)};function hy(s,e){let t=!1;return function(...i){return t||ye.warn(s),t=!0,e.apply(this,i)}}function Ut(s,e,t,i){return hy(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var dy={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 ed=s=>s.indexOf("#")===0?s.slice(1):s;function U(s,e,t){let i=U.getPlayer(s);if(i)return e&&ye.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?Di("#"+ed(s)):s;if(!As(r))throw new TypeError("The element or ID supplied is not val
171id. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof w.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&ye.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)),Ci("beforesetup").forEach(c=>{const f=c(r,xe(e));if(!Qt(f)||Array.isArray(f)){ye.error("please return an object in beforesetup hooks");return}e=xe(e,f)});const u=X.getComponent("Player");return i=new u(r,e,t),Ci("setup").forEach(c=>c(i)),i}U.hooks_=ai;U.hooks=Ci;U.hook=Gg;U.hookOnce=Wg;U.removeHook=Nc;if(w.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ds()){let s=Di(".vjs-styles-defaults");if(!s){s=ah("vjs-styles-defaults");const e=Di("head");e&&e.insertBefore(s,e.firstChild),oh(s,` 172 .video-js { 173 width: 300px; 174 height: 150px; 175 } 176 177 .vjs-fluid:not(.vjs-audio-only-mode) { 178 padding-top: 56.25% 179 } 180 `)}}Za(1,U);U.VERSION=Ka;U.options=Ce.prototype.options_;U.getPlayers=()=>Ce.players;U.getPlayer=s=>{const e=Ce.players;let t;if(typeof s=="string"){const i=ed(s),r=e[i];if(r)return r;t=Di("#"+i)}else t=s;if(As(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};U.getAllPlayers=()=>Object.keys(Ce.players).map(s=>Ce.players[s]).filter(Boolean);U.players=Ce.players;U.getComponent=X.getComponent;U.registerComponent=(s,e)=>(ge.isTech(e)&&ye.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));U.getTech=ge.getTech;U.registerTech=ge.registerTech;U.use=v_;Object.defineProperty(U,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(U.middleware,"TERMINATOR",{value:yn,writeable:!1,enumerable:!0});U.browser=zc;U.obj=Yg;U.mergeOptions=Ut(9,"videojs.mergeOptions","videojs.obj.merge",xe);U.defineLazyProperty=Ut(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ln);U.bind=Ut(9,"videojs.bind","native Function.prototype.bind",Pe);U.registerPlugin=mt.registerPlugin;U.deregisterPlugin=mt.deregisterPlugin;U.plugin=(s,e)=>(ye.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),mt.registerPlugin(s,e));U.getPlugins=mt.getPlugins;U.getPlugin=mt.getPlugin;U.getPluginVersion=mt.getPluginVersion;U.addLanguage=function(s,e){return s=(""+s).toLowerCase(),U.options.languages=xe(U.options.languages,{[s]:e}),U.options.languages[s]};U.log=ye;U.createLogger=Bc;U.time=h_;U.createTimeRange=Ut(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Nt);U.createTimeRanges=Ut(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Nt);U.formatTime=Ut(9,"videojs.formatTime","videojs.time.formatTime",Hi);U.setFormatTime=Ut(9,"videojs.setFormatTime","videojs.time.setFormatTime",ph);U.resetFormatTime=Ut(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",mh);U.parseUrl=Ut(9,"videojs.parseUrl","videojs.url.parseUrl",Mo);U.isCrossOrigin=Ut(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",zn);U.EventTarget=Ct;U.any=Io;U.on=Et;U.one=Hn;U.off=st;U.trigger=ws;U.xhr=bc;U.TrackList=Vi;U.TextTrack=Tr;U.TextTrackList=Lo;U.AudioTrack=vh;U.AudioTrackList=_h;U.VideoTrack=bh;U.VideoTrackList=yh;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{U[s]=function(){return ye.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),rh[s].apply(null,arguments)}});U.computedStyle=Ut(9,"videojs.computedStyle","videojs.dom.computedStyle",Es);U.dom=rh;U.fn=n_;U.num=$_;U.str=l_;U.url=y_;U.Error=dy;class fy{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 En extends U.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 fy(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}}En.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in En.prototype.allowedEvents_)En.prototype["on"+s]=null;var td="4.1.0";const py=function(s,e){const t=s.qualityLevels,i=new En,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=td,i},id=function(s){return py(this,U.obj.merge({},s))};U.registerPlugin("qualityLevels",id);id.VERSION=td;
180const ft=kn,Cn=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>U.log.debug?U.log.debug.bind(U,"VHS:",`${s} >`):function(){};function De(...s){const e=U.obj||U;return(e.merge||e.mergeOptions).apply(e,s)}function Je(...s){const e=U.time||U;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function my(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 181`;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i}) 182`}return e}const Xt=1/30,Kt=Xt*3,sd=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 Je(t)},ns=function(s,e){return sd(s,function(t,i){return t-Kt<=e&&i+Kt>=e})},tn=function(s,e){return sd(s,function(t){return t-Xt>=e})},gy=function(s){if(s.length<2)return Je();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 Je(e)},_y=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return Je();let u=s.length;for(;u--;)n.push({time:s.start(u),type:"start"}),n.push({time:s.end(u),type:"end"});for(u=e.length;u--;)n.push({time:e.start(u),type:"start"}),n.push({time:e.end(u),type:"end"});for(n.sort(function(c,f){return c.time-f.time}),u=0;u<n.length;u++)n[u].type==="start"?(r++,r===2&&(t=n[u].time)):n[u].type==="end"&&(r--,r===1&&(i=n[u].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return Je(a)},rd=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(", ")},yy=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Bi=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},Ty=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},ja=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},Jo=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},Zo=(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},oo=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),[]),nd=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},ad=({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},od=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=nd(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},vy=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+=Zo(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},by=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+=Zo(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},ud=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=vy(s,e);if(i.precise)return i.result;const r=by(s,e);return r.precise?r.result:i.result+t},ld=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 w.Infinity}return ud(s,e,t)},cr=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},cd=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return ld(s);if(e===null)return null;e=e||0;let r=ud(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:od(null,s),r-=i),Math.max(0,r)},Sy=function(s,e,t){const r=e||0;let n=cd(s,e,!0,t);return n===null?Je():(n<r&&(n=r),Je(r,n))},Ey=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const u=oo(s);let c=0;for(let f=0;f<u.length;f++){const g=u[f];if(t===g.segmentIndex&&!(typeof i=="number"&&typeof g.partIndex=="number"&&i!==g.partIndex)){c=f;break}}if(a<0){if(c>0)for(let f=c-1;f>=0;f--){const g=u[f];
182if(a+=g.duration,n){if(a<0)continue}else if(a+Xt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-cr({defaultDuration:s.targetDuration,durationList:u,startIndex:c,endIndex:f})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(c<0){for(let f=c;f<0;f++)if(a-=s.targetDuration,a<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};c=0}for(let f=c;f<u.length;f++){const g=u[f];a-=g.duration;const _=g.duration>Xt,k=a===0,D=_&&a+Xt>=0;if(!((k||D)&&f!==u.length-1)){if(n){if(a>0)continue}else if(a-Xt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+cr({defaultDuration:s.targetDuration,durationList:u,startIndex:c,endIndex:f})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},hd=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},eu=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Kn=function(s){const e=hd(s);return!s.disabled&&!e},Cy=function(s){return s.disabled},Dy=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},dd=function(s,e){return e.attributes&&e.attributes[s]},Ay=function(s,e,t,i=0){return dd("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},uo=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>Kn(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},tu=(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),Jl=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},Er=s=>{if(!s||!s.playlists||!s.playlists.length)return Jl(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=>Cc(n))||Jl(s,n=>tu(t,n))))return!1}return!0};var pt={liveEdgeDelay:od,duration:ld,seekable:Sy,getMediaInfoForTime:Ey,isEnabled:Kn,isDisabled:Cy,isExcluded:hd,isIncompatible:eu,playlistEnd:cd,isAes:Dy,hasAttribute:dd,estimateSegmentRequestTime:Ay,isLowestEnabledRendition:uo,isAudioOnly:Er,playlistMatch:tu,segmentDurationWithParts:Zo};const{log:fd}=U,hs=(s,e)=>`${s}-${e}`,pd=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,wy=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new pm;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 u=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){u.hasOwnProperty(f)&&delete u[f]}),u.segments&&u.segments.forEach(function(f){["parts","preloadHints"].forEach(function(g){f.hasOwnProperty(g)&&delete f[g]})})),!u.targetDuration){let f=10;u.segments&&u.segments.length&&(f=u.segments.reduce((g,_)=>Math.max(g,_.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${f}`}),u.targetDuration=f}const c=nd(u);if(c.length&&!u.partTargetDuration){const f=c.reduce((g,_)=>Math.max(g,_.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${f}`}),fd.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.")),u.partTargetDuration=f}return u},Ps=(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)}})},md=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},xy=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];md({playlist:t,id:hs(e,t.uri)}),t.resolvedUri=ft(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||fd.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},ky=s=>{Ps(s,e=>{e.uri&&(e.resolvedUri=ft(s.uri,e.uri))})},Iy=(s,e)=>{const t=hs(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:w.location.href,resolvedUri:w.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},gd=(s,e,t=pd)=>{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=Er(s);Ps(s,(r,n,a,u)=>{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let c=0;c<s.playlists.length;c++){const f=s.playlists[c];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}r.playlists=[Ve({},r)]}
vendor: 6,396 bytes, line 182
182r.playlists.forEach(function(c,f){const g=t(n,a,u,c),_=hs(f,g);c.uri?c.resolvedUri=c.resolvedUri||ft(s.uri,c.uri):(c.uri=f===0?g:_,c.resolvedUri=c.uri),c.id=c.id||_,c.attributes=c.attributes||{},s.playlists[c.id]=c,s.playlists[c.uri]=c})}),xy(s),ky(s)};class Zl{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 _d=22,ji=({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},u=r&&!n||i;if(t&&n)a.error=Ve({},t),a.errorType=U.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=U.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=U.Error.NetworkRequestTimeout;else if(u){const c=i?U.Error.NetworkBodyParserFailed:U.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},Py=It("CodecUtils"),yd=function(s){const e=s.attributes||{};if(e.CODECS)return zt(e.CODECS)},Td=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},Oy=(s,e)=>{if(!Td(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},gr=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Ec(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){Py(`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},ec=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},hr=function(s,e){const t=e.attributes||{},i=gr(yd(e)||[]);if(Td(s,e)&&!i.audio&&!Oy(s,e)){const r=gr(gm(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},{EventTarget:Ly}=U,Ry=(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=ad(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 w.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},My=(s,e)=>{if(!s)return e;const t=De(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]=De(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},Ny=(s,e,t)=>{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let u=0;u<r.length;u++){const c=i[u+t],f=r[u];c?(a=c.map||a,n.push(My(c,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},vd=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=ft(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=ft(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=ft(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=ft(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ft(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ft(e,t.uri))})},bd=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},Sd=(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,lo=(s,e,t=Sd)=>{const i=De(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=bd(e);const n=De(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=Ny(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{vd(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,Ps(s,(a,u,c,f)=>{if(a.playlists)for(let g=0;g<a.playlists.length;g++)e.id===a.playlists[g].id&&(a.playlists[g]=n)}),i},co=(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},tc=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:u}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:u})}),{type:e,isLive:t,renditions:i}};class as extends Ly{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=It("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addD
182ateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Zl,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=ft(this.main.uri,e.uri);this.llhls&&(t=Ry(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:ji({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=wy({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:U.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 u=yd(i)||[];return!!gr(u).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(),md({playlist:a,uri:i,id:r});const u=lo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(co(this.media(),!!u)),n.parsedPlaylist=tc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),w.clearTimeout(this.mediaUpdateTimeout),w.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Zl,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(w.clearTimeout(this.finalRenditionTimeout),t){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=w.setTimeout(this.media.bind(this,e,!1),u);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_(co(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;
182const 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"},(u,c)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Cn(e.resolvedUri,c),u)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:c.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(w.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&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=w.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&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=w.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=w.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}
182const 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:ji({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=Cn(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=tc(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,gd(this.main,this.srcUri()),e.playlists.forEac
182h(i=>{i.segments=bd(i),i.segments.forEach(r=>{vd(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||w.location.href;this.main=Iy(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 u=a.resolvedUri,c=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),g=hs(r,f),_=this.createCloneAttributes_(r,a.attributes),k=this.createClonePlaylist_(a,g,e,_);i.playlists[n]=k,i.playlists[g]=k,i.playlists[f]=k}else i.playlists.splice(n,1);delete i.playlists[c],delete i.playlists[u]}}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 u in i.mediaGroups[n][a])i.mediaGroups[n][a][u].playlists.forEac
182h((f,g)=>{const _=i.playlists[f.id],k=_.id,D=_.resolvedUri;delete i.playlists[k],delete i.playlists[D]});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=hs(e.ID,n),u=this.createCloneAttributes_(e.ID,t.attributes),c=this.createClonePlaylist_(t,a,e,u);i.playlists[r]=c,i.playlists[a]=c,i.playlists[n]=c,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 u in r.mediaGroups[n][a]){const c=r.mediaGroups[n][a][u];r.mediaGroups[n][t][u]=Ve({},c);const f=r.mediaGroups[n][t][u],g=this.createCloneURI_(c.resolvedUri,e);f.resolvedUri=g,f.uri=g,f.playlists=[],c.playlists.forEach((_,k)=>{const D=r.playlists[_.id],L=pd(n,t,u),T=hs(t,L);if(D&&!r.playlists[T]){const P=this.createClonePlaylist_(D,T,e),B=P.resolvedUri;r.playlists[T]=P,r.playlists[B]=P}f.playlists[k]=this.createClonePlaylist_(_,T,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),De(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){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const ho=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)},By=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},Uy=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},Ed=function(){const s=function e(t,i){t=De({timeout:45e3},t);const r=e.beforeRequest||U.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||U.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||U.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(U.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const u=U.Vhs.xhr.original===!0?U.xhr:U.Vhs.xhr,c=By(n,t);n.delete(r);const f=u(c||t,function(_,k){return Uy(a,f,_,k),ho(f,_,k,i)}),g=f.abort;return f.abort=function(){return f.aborted=!0,g.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return s.original=!0,s},Fy=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=w.BigInt(s.offset)+w.BigInt(s.length)-w.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},fo=function(s){const e={};return s.byterange&&(e.Range=Fy(s.byterange)),e},qy=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?" ":"")},jy=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},Cd=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];Ac(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},Dn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},Dd=function(s){return s.resolvedUri},Ad=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(jy).join(""),i+=r+" "+n+` 183`;return i},Hy=({bytes:s})=>Ad(s),Vy=s=>{let e="",t;for(t=0;t<s.length;t++)e+=qy(s,t)+" ";return e};var zy=Object.freeze({__proto__:null,createTransferableMessage:Cd,initSegmentId:Dn,segmentKeyId:Dd,hexDump:Ad,tagDump:Hy,textRanges:Vy});const wd=.25,Gy=(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)},Wy=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,Xy=(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 c=0;c<e.segments.length-1;c++){i=e.segments[c];const f=new Date(e.segments[c+1].dateTimeObject);if(t<f)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?Wy(r.videoTimingInfo):r.duration+r.duration*wd,u=new Date(n.getTime()+a*1e3);return t>u?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:pt.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},Ky=(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*wd)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},Yy=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},Qy=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},Jy=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");
183if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=Ky(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=Gy(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},xd=({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(!Qy(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=Xy(s,e);if(!u)return a({message:`${s} was not found in the stream`});const c=u.segment,f=Yy(c.dateTimeObject,s);if(u.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});i(u.estimatedStart+f),n.one("seeked",()=>{xd({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const g=c.start+f,_=()=>a(null,n.currentTime());n.one("seeked",_),r&&n.pause(),i(g)},Ha=(s,e)=>{if(s.readyState===4)return e()},Zy=(s,e,t,i)=>{let r=[],n,a=!1;const u=function(_,k,D,L){return k.abort(),a=!0,t(_,k,D,L)},c=function(_,k){if(a)return;if(_)return _.metadata=ji({requestType:i,request:k,error:_}),u(_,k,"",r);const D=k.responseText.substring(r&&r.byteLength||0,k.responseText.length);if(r=Am(r,wc(D,!0)),n=n||sr(r),r.length<10||n&&r.length<n+2)return Ha(k,()=>u(_,k,"",r));const L=Do(r);return L==="ts"&&r.length<188?Ha(k,()=>u(_,k,"",r)):!L&&r.length<376?Ha(k,()=>u(_,k,"",r)):u(null,k,L,r)},g=e({uri:s,beforeSend(_){_.overrideMimeType("text/plain; charset=x-user-defined"),_.addEventListener("progress",function({total:k,loaded:D}){return ho(_,null,{statusCode:_.status},c)})}},function(_,k){return ho(g,_,k,c)});return g},{EventTarget:e0}=U,ic=function(s,e){if(!Sd(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},t0=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},i0=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=Cg(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return gd(n,e,t0),n},s0=(s,e)=>{Ps(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},r0=(s,e,t)=>{let i=!0,r=De(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 c=Pn(a.sidx);t&&t[c]&&t[c].sidx&&So(a,t[c].sidx,a.sidx.resolvedUri)}const u=lo(r,a,ic);u&&(r=u,i=!1)}return Ps(e,(n,a,u,c)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,g=lo(r,n.playlists[0],ic);g&&(r=g,c in r.mediaGroups[a][u]||(r.mediaGroups[a][u][c]=n),r.mediaGroups[a][u][c].playlists[0]=r.playlists[f],i=!1)}}),s0(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},n0=(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,sc=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=Pn(n);if(!e[a])break;const u=e[a].sidxInfo;n0(u,n)&&(t[a]=e[a])}}return t},a0=(s,e)=>{let i=sc(s.playlists,e);return Ps(s,(r,n,a,u)=>{if(r.playlists&&r.playlists.length){const c=r.playlists;i=De(i,sc(c,e))}}),i};class po extends e0{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_=It("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;
183if(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&&Pn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){w.clearTimeout(this.mediaRequest_),this.mediaRequest_=w.setTimeout(()=>i(!1),0);return}const n=Cn(e.sidx.resolvedUri),a=(c,f)=>{if(this.requestErrored_(c,f,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:_}=f;let k;try{k=kg(de(f.response).subarray(8))}catch(D){D.metadata=ji({requestType:_,request:f,parseFailure:!0}),this.requestErrored_(D,f,t);return}return g[r]={sidxInfo:e.sidx,sidx:k},So(e,k,e.sidx.resolvedUri),i(!0)},u="dash-sidx";this.request=Zy(n,this.vhs_.xhr,(c,f,g,_)=>{if(c)return a(c,f);if(!g||g!=="mp4"){const L=g||"unknown";return a({status:f.status,message:`Unsupported ${L} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:k,length:D}=e.sidx.byterange;if(_.length>=D+k)return a(c,{response:_.subarray(k,k+D),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:fo({byterange:e.sidx.byterange})},a)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},w.clearTimeout(this.minimumUpdatePeriodTimeout_),w.clearTimeout(this.mediaRequest_),w.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,w.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(),w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(w.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=w.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_){w.clearTimeout(this.mediaRequest_),this.mediaRequest_=w.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=ji({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=Cn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncCl
183ientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=Dg(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:ft(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=ji({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_(){w.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=i0({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:U.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=r0(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,u=[];
183i.playlists.forEach(f=>{u.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});const c={duration:n,isLive:!a,renditions:u};t.parsedManifest=c,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_&&(w.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_=w.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_=a0(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=w.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},co(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 Ye={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 o0=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},kd=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},u0=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())}},Id=function(s){return function(){const e=u0(s),t=kd(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}},Pd=function(s){return`var browserWorkerPolyFill = ${kd.toString()}; 184browserWorkerPolyFill(self); 185`+s},Od=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},l0=Pd(Od(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(l,d){o[l]||(o[l]=[]),o[l]=o[l].concat(d)},this.off=function(l,d){var h;return o[l]?(h=o[l].indexOf(d),o[l]=o[l].slice(),o[l].splice(h,1),h>-1):!1},this.trigger=function(l){var d,h,p,m;if(d=o[l],!!d)if(arguments.length===2)for(p=d.length,h=0;h<p;++h)d[h].call(this,arguments[1]);else{for(m=[],h=arguments.length,h=1;h<arguments.length;++h)m.push(arguments[h]);for(p=d.length,h=0;h<p;++h)d[h].apply(this,m)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(l){o.push(l)}),this.on("done",function(l){o.flush(l)}),this.on("partialdone",function(l){o.partialFlush(l)}),this.on("endedtimeline",function(l){o.endTimeline(l)}),this.on("reset",function(l){o.reset(l)}),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 l=new DataView(o.buffer,o.byteOffset,o.byteLength),d;return l.getBigUint64?(d=l.getBigUint64(0),d<Number.MAX_SAFE_INTEGER?
185Number(d):d):l.getUint32(0)*i+l.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,u,c,f,g,_,k,D,L,T,P,B,N,O,H,q,$,R,V,v,C,F,K,j,G,ee,se,Y,Z,J,te,oe,me,le,Te,fe,Se;(function(){var o;if(j={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 j)j.hasOwnProperty(o)&&(j[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);G=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]),le=new Uint8Array([0,0,0,0,0,0,0,0]),Te=le,fe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Se=le,te=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(o){var l=[],d=0,h,p,m;for(h=1;h<arguments.length;h++)l.push(arguments[h]);for(h=l.length;h--;)d+=l[h].byteLength;for(p=new Uint8Array(d+8),m=new DataView(p.buffer,p.byteOffset,p.byteLength),m.setUint32(0,p.byteLength),p.set(o,4),h=0,d=8;h<l.length;h++)p.set(l[h],d),d+=l[h].byteLength;return p},c=function(){return u(j.dinf,u(j.dref,me))},f=function(o){return u(j.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]))},g=function(){return u(j.ftyp,G,ee,G,se)},$=function(o){return u(j.hdlr,J[o])},_=function(o){return u(j.mdat,o)},q=function(o){var l=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&&(l[12]=o.samplerate>>>24&255,l[13]=o.samplerate>>>16&255,l[14]=o.samplerate>>>8&255,l[15]=o.samplerate&255),u(j.mdhd,l)},H=function(o){return u(j.mdia,q(o),$(o.type),D(o))},k=function(o){return u(j.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},D=function(o){return u(j.minf,o.type==="video"?u(j.vmhd,te):u(j.smhd,oe),c(),V(o))},L=function(o,l){for(var d=[],h=l.length;h--;)d[h]=C(l[h]);return u.apply(null,[j.moof,k(o)].concat(d))},T=function(o){for(var l=o.length,d=[];l--;)d[l]=N(o[l]);return u.apply(null,[j.moov,B(4294967295)].concat(d).concat(P(o)))},P=function(o){for(var l=o.length,d=[];l--;)d[l]=F(o[l]);return u.apply(null,[j.mvex].concat(d))},B=function(o){var l=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 u(j.mvhd,l)},R=function(o){var l=o.samples||[],d=new Uint8Array(4+l.length),h,p;for(p=0;p<l.length;p++)h=l[p].flags,d[p+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return u(j.sdtp,d)},V=function(o){return u(j.stbl,v(o),u(j.stts,Se),u(j.stsc,Te),u(j.stsz,fe),u(j.stco,le))},function(){var o,l;v=function(d){return u(j.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),d.type==="video"?o(d):l(d))},o=function(d){var h=d.sps||[],p=d.pps||[],m=[],S=[],E,A;for(E=0;E<h.length;E++)m.push((h[E].byteLength&65280)>>>8),m.push(h[E].byteLength&255),m=m.concat(Array.prototype.slice.call(h[E]));for(E=0;E<p.length;E++)S.push((p[E].byteLength&65280)>>>8),S.push(p[E].byteLength&255),S=S.concat(Array.prototype.slice.call(p[E]));if(A=[j.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,(d.width&65280)>>8,d.width&255,(d.height&65280)>>8,d.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]),u(j.avcC,new Uint8Array([1,d.profileIdc,d.profileCompatibility,d.levelIdc,255].concat([h.length],m,[p.length],S))),u(j.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],d.sarRatio){var x=d.sarRatio[0],M=d.sarRatio[1];A.push(u(j.pasp,new Uint8Array([(x&4278190080)>>24,(x&16711680)>>16,(x&65280)>>8,x&255,(M&4278190080)>>24,(M&16711680)>>16,(M&65280)>>8,M&255])))}return u.apply(null,A)},l=function(d){return u(j.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(d.channelcount&65280)>>8,d.channelcount&255,(d.samplesize&65280)>>8,d.samplesize&255,0,0,0,0,(d.samplerate&65280)>>8,d.samplerate&255,0,0]),f(d))}}(),O=function(o){var l=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 u(j.tkhd,l)},C=function(o){var l,d,h,p,m,S,E;return l=u(j.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),E=Math.floor(o.baseMediaDecodeTime%a),d=u(j.tfdt,new Uint8Array([1,0,0,0,S>>>24&255,S>>>16&255,S>>>8&255,S&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255])),m=92,o.type==="audio"?(h=K(o,m),u(j.traf,l,d,h)):(p=R(o),h=K(o,p.length+m),u(j.traf,l,d,h,p))},N=function(o){return o.duration=o.duration||4294967295,u(j.trak,O(o),H(o))},F=function(o){var l=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"&&(l[l.length-1]=0),u(j.trex,l)},function(){var o,l,d;d=function(h,p){var m=0,S=0,E=0,A=0;return h.length&&(h[0].duration!==void 0&&(m=1),h[0].size!==void 0&&(S=2),h[0].flags!==void 0&&(E=4),h[0].compositionTimeOffset!==void 0&&(A=8)),[0,0,m|S|E|A,1,(h.length&4278190080)>>>24,(h.length&16711680)>>>16,(h.length&65280)>>>8,h.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},l=function(h,p){var m,S,E,A,x,M;for(A=h.samples||[],p+=20+16*A.length,E=d(A,p),S=new Uint8Array(E.length+A.length*16),S.set(E),m=E.length,M=0;M<A.length;M++)x=A[M],S[m++]=(x.duration&4278190080)>>>24,S[m++]=(x.duration&16711680)>>>16,S[m++]=(x.duration&65280)>>>
1858,S[m++]=x.duration&255,S[m++]=(x.size&4278190080)>>>24,S[m++]=(x.size&16711680)>>>16,S[m++]=(x.size&65280)>>>8,S[m++]=x.size&255,S[m++]=x.flags.isLeading<<2|x.flags.dependsOn,S[m++]=x.flags.isDependedOn<<6|x.flags.hasRedundancy<<4|x.flags.paddingValue<<1|x.flags.isNonSyncSample,S[m++]=x.flags.degradationPriority&61440,S[m++]=x.flags.degradationPriority&15,S[m++]=(x.compositionTimeOffset&4278190080)>>>24,S[m++]=(x.compositionTimeOffset&16711680)>>>16,S[m++]=(x.compositionTimeOffset&65280)>>>8,S[m++]=x.compositionTimeOffset&255;return u(j.trun,S)},o=function(h,p){var m,S,E,A,x,M;for(A=h.samples||[],p+=20+8*A.length,E=d(A,p),m=new Uint8Array(E.length+A.length*8),m.set(E),S=E.length,M=0;M<A.length;M++)x=A[M],m[S++]=(x.duration&4278190080)>>>24,m[S++]=(x.duration&16711680)>>>16,m[S++]=(x.duration&65280)>>>8,m[S++]=x.duration&255,m[S++]=(x.size&4278190080)>>>24,m[S++]=(x.size&16711680)>>>16,m[S++]=(x.size&65280)>>>8,m[S++]=x.size&255;return u(j.trun,m)},K=function(h,p){return h.type==="audio"?o(h,p):l(h,p)}}();var We={ftyp:g,mdat:_,moof:L,moov:T,initSegment:function(o){var l=g(),d=T(o),h;return h=new Uint8Array(l.byteLength+d.byteLength),h.set(l),h.set(d,l.byteLength),h}},Ge=function(o){var l,d,h=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,h.byteLength=0,l=0;l<o.length;l++)d=o[l],d.nalUnitType==="access_unit_delimiter_rbsp"?(h.length&&(h.duration=d.dts-h.dts,p.byteLength+=h.byteLength,p.nalCount+=h.length,p.duration+=h.duration,p.push(h)),h=[d],h.byteLength=d.data.byteLength,h.pts=d.pts,h.dts=d.dts):(d.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(h.keyFrame=!0),h.duration=d.dts-h.dts,h.byteLength+=d.data.byteLength,h.push(d));return p.length&&(!h.duration||h.duration<=0)&&(h.duration=p[p.length-1].duration),p.byteLength+=h.byteLength,p.nalCount+=h.length,p.duration+=h.duration,p.push(h),p},Ze=function(o){var l,d,h=[],p=[];for(h.byteLength=0,h.nalCount=0,h.duration=0,h.pts=o[0].pts,h.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,l=0;l<o.length;l++)d=o[l],d.keyFrame?(h.length&&(p.push(h),p.byteLength+=h.byteLength,p.nalCount+=h.nalCount,p.duration+=h.duration),h=[d],h.nalCount=d.length,h.byteLength=d.byteLength,h.pts=d.pts,h.dts=d.dts,h.duration=d.duration):(h.duration+=d.duration,h.nalCount+=d.length,h.byteLength+=d.byteLength,h.push(d));return p.length&&h.duration<=0&&(h.duration=p[p.length-1].duration),p.byteLength+=h.byteLength,p.nalCount+=h.nalCount,p.duration+=h.duration,p.push(h),p},ct=function(o){var l;return!o[0][0].keyFrame&&o.length>1&&(l=o.shift(),o.byteLength-=l.byteLength,o.nalCount-=l.nalCount,o[0][0].dts=l.dts,o[0][0].pts=l.pts,o[0][0].duration+=l.duration),o},Ft=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},zi=function(o,l){var d=Ft();return d.dataOffset=l,d.compositionTimeOffset=o.pts-o.dts,d.duration=o.duration,d.size=4*o.length,d.size+=o.byteLength,o.keyFrame&&(d.flags.dependsOn=2,d.flags.isNonSyncSample=0),d},Gi=function(o,l){var d,h,p,m,S,E=l||0,A=[];for(d=0;d<o.length;d++)for(m=o[d],h=0;h<m.length;h++)S=m[h],p=zi(S,E),E+=p.size,A.push(p);return A},Oe=function(o){var l,d,h,p,m,S,E=0,A=o.byteLength,x=o.nalCount,M=A+4*x,z=new Uint8Array(M),ae=new DataView(z.buffer);for(l=0;l<o.length;l++)for(p=o[l],d=0;d<p.length;d++)for(m=p[d],h=0;h<m.length;h++)S=m[h],ae.setUint32(E,S.data.byteLength),E+=4,z.set(S.data,E),E+=S.data.byteLength;return z},tt=function(o,l){var d,h=l||0,p=[];return d=zi(o,h),p.push(d),p},qe=function(o){var l,d,h=0,p=o.byteLength,m=o.length,S=p+4*m,E=new Uint8Array(S),A=new DataView(E.buffer);for(l=0;l<o.length;l++)d=o[l],A.setUint32(h,d.data.byteLength),h+=4,E.set(d.data,h),h+=d.data.byteLength;return E},wi={groupNalsIntoFrames:Ge,groupFramesIntoGops:Ze,extendFirstKeyFrame:ct,generateSampleTable:Gi,concatenateNalData:Oe,generateSampleTableForFrame:tt,concatenateNalDataForFrame:qe},gt=[33,16,5,32,164,27],ei=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],be=function(o){for(var l=[];o--;)l.push(0);return l},Ie=function(o){return Object.keys(o).reduce(function(l,d){return l[d]=new Uint8Array(o[d].reduce(function(h,p){return h.concat(p)},[])),l},{})},$e,ti=function(){if(!$e){var o={96e3:[gt,[227,64],be(154),[56]],88200:[gt,[231],be(170),[56]],64e3:[gt,[248,192],be(240),[56]],48e3:[gt,[255,192],be(268),[55,148,128],be(54),[112]],44100:[gt,[255,192],be(268),[55,163,128],be(84),[112]],32e3:[gt,[255,192],be(268),[55,234],be(226),[112]],24e3:[gt,[255,192],be(268),[55,255,128],be(268),[111,112],be(126),[224]],16e3:[gt,[255,192],be(268),[55,255,128],be(268),[111,255],be(269),[223,108],be(195),[1,192]],12e3:[ei,be(268),[3,127,248],be(268),[6,255,240],be(268),[13,255,224],be(268),[27,253,128],be(259),[56]],11025:[ei,be(268),[3,127,248],be(268),[6,255,240],be(268),[13,255,224],be(268),[27,255,192],be(268),[55,175,128],be(108),[112]],8e3:[ei,be(268),[3,121,16],be(47),[7]]};$e=Ie(o)}return $e},Os=9e4,Pt,ci,qt,xi,Wi,Xi,ki;Pt=function(o){return o*Os},ci=function(o,l){return o*l},qt=function(o){return o/Os},xi=function(o,l){return o/l},Wi=function(o,l){return Pt(xi(o,l))},Xi=function(o,l){return ci(qt(o),l)},ki=function(o,l,d){return qt(d?o:o-l)};var we={ONE_SECOND_IN_TS:Os,secondsToVideoTs:Pt,secondsToAudioTs:ci,videoTsToSeconds:qt,audioTsToSeconds:xi,audioTsToVideoTs:Wi,videoTsToAudioTs:Xi,metadataTsToSeconds:ki},Cr=ti,hi=we,Ki=function(o){var l,d,h=0;for(l=0;l<o.length;l++)d=o[l],h+=d.data.byteLength;return h},Ls=function(o,l,d,h){var p,m=0,S=0,E=0,A=0,x,M,z;if(l.length&&(p=hi.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),m=Math.ceil(hi.ONE_SECOND_IN_TS/(o.samplerate/1024)),d&&h&&(S=p-Math.max(d,h),E=Math.floor(S/m),A=E*m),!(E<1||A>hi.ONE_SECOND_IN_TS/2))){for(x=Cr()[o.samplerate],x||(x=l[0].data),M=0;M<E;M++)z=l[0],l.splice(0,0,{data:x,dts:z.dts-m,pts:z.pts-m});return o.baseMediaDecodeTime-=Math.floor(hi.videoTsToAudioTs(A,o.samplerate)),A}},Dr=function(o,l,d){return l.minSegmentDts>=d?o:(l.minSegmentDts=1/0,o.filter(function(h){return h.dts>=d?(l.minSegmentDts=Math.min(l.minSegmentDts,h.dts),l.minSegmentPts=l.minSegmentDts,!0):!1}))},Ar=function(o){var l,d,h=[];for(l=0;l<o.length;l++)d=o[l],h.push({size:d.data.byteLength,duration:1024});return h},wr=function(o){var l,d,h=0,p=new Uint8Array(Ki(o));for(l=0;l<o.length;l++)d=o[l],p.set(d.data,h),h+=d.data.byteLength;return p},Yi={prefixWithSilence:Ls,trimAdtsFramesByEarliestDts:Dr,generateSampleTable:Ar,concatenateFrameData:wr},Rs=we.ONE_SECOND_IN_TS,Yn=function(o,l){typeof l.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=l.pts),o.minSegmentPts===void 0?o.minSegmentPts=l.pts:o.minSegmentPts=Math.min(o.minSegmentPts,l.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=l.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,l.pts)
185),typeof l.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=l.dts),o.minSegmentDts===void 0?o.minSegmentDts=l.dts:o.minSegmentDts=Math.min(o.minSegmentDts,l.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=l.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,l.dts))},xr=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},kr=function(o,l){var d,h,p=o.minSegmentDts;return l||(p-=o.timelineStartInfo.dts),d=o.timelineStartInfo.baseMediaDecodeTime,d+=p,d=Math.max(0,d),o.type==="audio"&&(h=o.samplerate/Rs,d*=h,d=Math.floor(d)),d},y={clearDtsInfo:xr,calculateTrackBaseMediaDecodeTime:kr,collectDtsInfo:Yn},b=4,I=128,W=function(o){for(var l=0,d={payloadType:-1,payloadSize:0},h=0,p=0;l<o.byteLength&&o[l]!==I;){for(;o[l]===255;)h+=255,l++;for(h+=o[l++];o[l]===255;)p+=255,l++;if(p+=o[l++],!d.payload&&h===b){var m=String.fromCharCode(o[l+3],o[l+4],o[l+5],o[l+6]);if(m==="GA94"){d.payloadType=h,d.payloadSize=p,d.payload=o.subarray(l,l+p);break}else d.payload=void 0}l+=p,h=0,p=0}return d},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,l){var d=[],h,p,m,S;if(!(l[0]&64))return d;for(p=l[0]&31,h=0;h<p;h++)m=h*3,S={type:l[m+2]&3,pts:o},l[m+2]&4&&(S.ccData=l[m+3]<<8|l[m+4],d.push(S));return d},re=function(o){for(var l=o.byteLength,d=[],h=1,p,m;h<l-2;)o[h]===0&&o[h+1]===0&&o[h+2]===3?(d.push(h+2),h+=2):h++;if(d.length===0)return o;p=l-d.length,m=new Uint8Array(p);var S=0;for(h=0;h<p;S++,h++)S===d[0]&&(S++,d.shift()),m[h]=o[S];return m},ke={parseSei:W,parseUserData:ne,parseCaptionPackets:ce,discardEmulationPreventionBytes:re,USER_DATA_REGISTERED_ITU_T_T35:b},je=t,Xe=ke,Re=function(o){o=o||{},Re.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Ee(0,0),new Ee(0,1),new Ee(1,0),new Ee(1,1)],this.parse708captions_&&(this.cc708Stream_=new ve({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(l){l.on("data",this.trigger.bind(this,"data")),l.on("partialdone",this.trigger.bind(this,"partialdone")),l.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")))};Re.prototype=new je,Re.prototype.push=function(o){var l,d,h;if(o.nalUnitType==="sei_rbsp"&&(l=Xe.parseSei(o.escapedRBSP),!!l.payload&&l.payloadType===Xe.USER_DATA_REGISTERED_ITU_T_T35&&(d=Xe.parseUserData(l),!!d))){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}h=Xe.parseCaptionPackets(o.pts,d),this.captionPackets_=this.captionPackets_.concat(h),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Re.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(l){return o==="flush"?l.flush():l.partialFlush()},this)},Re.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(l,d){l.presortIndex=d}),this.captionPackets_.sort(function(l,d){return l.pts===d.pts?l.presortIndex-d.presortIndex:l.pts-d.pts}),this.captionPackets_.forEach(function(l){l.type<2?this.dispatchCea608Packet(l):this.dispatchCea708Packet(l)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Re.prototype.flush=function(){return this.flushStream("flush")},Re.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Re.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Re.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)},Re.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Re.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Re.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Re.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Qi={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},$t=function(o){var l=Qi[o]||o;return o&4096&&o===l?"":String.fromCharCode(l)},_t=function(o){return 32<=o&&o<=127||160<=o&&o<=255},ht=function(o){this.windowNum=o,this.reset()};ht.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},ht.prototype.getText=function(){return this.rows.join(` 186`)},ht.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ht.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--},ht.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ht.prototype.addText=function(o){this.rows[this.rowIdx]+=o},ht.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var ii=function(o,l,d){this.serviceNum=o,this.text="",this.currentWindow=new ht(-1),this.windows=[],this.stream=d,typeof l=="string"&&this.createTextDecoder(l)};ii.prototype.init=function(o,l){this.startPts=o;for(var d=0;d<8;d++)this.windows[d]=new ht(d),typeof l=="function"&&(this.windows[d].beforeRowOverflow=l)},ii.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]}
186,ii.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(l){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+l})}};var ve=function(o){o=o||{},ve.prototype.init.call(this);var l=this,d=o.captionServices||{},h={},p;Object.keys(d).forEach(m=>{p=d[m],/^SERVICE/.test(m)&&(h[m]=p.encoding)}),this.serviceEncodings=h,this.current708Packet=null,this.services={},this.push=function(m){m.type===3?(l.new708Packet(),l.add708Bytes(m)):(l.current708Packet===null&&l.new708Packet(),l.add708Bytes(m))}};ve.prototype=new je,ve.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ve.prototype.add708Bytes=function(o){var l=o.ccData,d=l>>>8,h=l&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(d),this.current708Packet.data.push(h)},ve.prototype.push708Packet=function(){var o=this.current708Packet,l=o.data,d=null,h=null,p=0,m=l[p++];for(o.seq=m>>6,o.sizeCode=m&63;p<l.length;p++)m=l[p++],d=m>>5,h=m&31,d===7&&h>0&&(m=l[p++],d=m),this.pushServiceBlock(d,p,h),h>0&&(p+=h-1)},ve.prototype.pushServiceBlock=function(o,l,d){var h,p=l,m=this.current708Packet.data,S=this.services[o];for(S||(S=this.initService(o,p));p<l+d&&p<m.length;p++)h=m[p],_t(h)?p=this.handleText(p,S):h===24?p=this.multiByteCharacter(p,S):h===16?p=this.extendedCommands(p,S):128<=h&&h<=135?p=this.setCurrentWindow(p,S):152<=h&&h<=159?p=this.defineWindow(p,S):h===136?p=this.clearWindows(p,S):h===140?p=this.deleteWindows(p,S):h===137?p=this.displayWindows(p,S):h===138?p=this.hideWindows(p,S):h===139?p=this.toggleWindows(p,S):h===151?p=this.setWindowAttributes(p,S):h===144?p=this.setPenAttributes(p,S):h===145?p=this.setPenColor(p,S):h===146?p=this.setPenLocation(p,S):h===143?S=this.reset(p,S):h===8?S.currentWindow.backspace():h===12?S.currentWindow.clearText():h===13?S.currentWindow.pendingNewLine=!0:h===14?S.currentWindow.clearText():h===141&&p++},ve.prototype.extendedCommands=function(o,l){var d=this.current708Packet.data,h=d[++o];return _t(h)&&(o=this.handleText(o,l,{isExtended:!0})),o},ve.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},ve.prototype.initService=function(o,l){var h="SERVICE"+o,d=this,h,p;return h in this.serviceEncodings&&(p=this.serviceEncodings[h]),this.services[o]=new ii(o,p,d),this.services[o].init(this.getPts(l),function(m){d.flushDisplayed(m,d.services[o])}),this.services[o]},ve.prototype.handleText=function(o,l,d){var h=d&&d.isExtended,p=d&&d.isMultiByte,m=this.current708Packet.data,S=h?4096:0,E=m[o],A=m[o+1],x=l.currentWindow,M,z;function ae(Q){return Q.map(he=>("0"+(he&255).toString(16)).slice(-2)).join("")}if(p?(z=[E,A],o++):z=[E],l.textDecoder_&&!h)M=l.textDecoder_.decode(new Uint8Array(z));else if(p){const Q=ae(z);M=String.fromCharCode(parseInt(Q,16))}else M=$t(S|E);return x.pendingNewLine&&!x.isEmpty()&&x.newLine(this.getPts(o)),x.pendingNewLine=!1,x.addText(M),o},ve.prototype.multiByteCharacter=function(o,l){var d=this.current708Packet.data,h=d[o+1],p=d[o+2];return _t(h)&&_t(p)&&(o=this.handleText(++o,l,{isMultiByte:!0})),o},ve.prototype.setCurrentWindow=function(o,l){var d=this.current708Packet.data,h=d[o],p=h&7;return l.setCurrentWindow(p),o},ve.prototype.defineWindow=function(o,l){var d=this.current708Packet.data,h=d[o],p=h&7;l.setCurrentWindow(p);var m=l.currentWindow;return h=d[++o],m.visible=(h&32)>>5,m.rowLock=(h&16)>>4,m.columnLock=(h&8)>>3,m.priority=h&7,h=d[++o],m.relativePositioning=(h&128)>>7,m.anchorVertical=h&127,h=d[++o],m.anchorHorizontal=h,h=d[++o],m.anchorPoint=(h&240)>>4,m.rowCount=h&15,h=d[++o],m.columnCount=h&63,h=d[++o],m.windowStyle=(h&56)>>3,m.penStyle=h&7,m.virtualRowCount=m.rowCount+1,o},ve.prototype.setWindowAttributes=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.winAttr;return h=d[++o],p.fillOpacity=(h&192)>>6,p.fillRed=(h&48)>>4,p.fillGreen=(h&12)>>2,p.fillBlue=h&3,h=d[++o],p.borderType=(h&192)>
186>6,p.borderRed=(h&48)>>4,p.borderGreen=(h&12)>>2,p.borderBlue=h&3,h=d[++o],p.borderType+=(h&128)>>5,p.wordWrap=(h&64)>>6,p.printDirection=(h&48)>>4,p.scrollDirection=(h&12)>>2,p.justify=h&3,h=d[++o],p.effectSpeed=(h&240)>>4,p.effectDirection=(h&12)>>2,p.displayEffect=h&3,o},ve.prototype.flushDisplayed=function(o,l){for(var d=[],h=0;h<8;h++)l.windows[h].visible&&!l.windows[h].isEmpty()&&d.push(l.windows[h].getText());l.endPts=o,l.text=d.join(` 187 188`),this.pushCaption(l),l.startPts=o},ve.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)},ve.prototype.displayWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)h&1<<m&&(l.windows[m].visible=1);return o},ve.prototype.hideWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)h&1<<m&&(l.windows[m].visible=0);return o},ve.prototype.toggleWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)h&1<<m&&(l.windows[m].visible^=1);return o},ve.prototype.clearWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)h&1<<m&&l.windows[m].clearText();return o},ve.prototype.deleteWindows=function(o,l){var d=this.current708Packet.data,h=d[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)h&1<<m&&l.windows[m].reset();return o},ve.prototype.setPenAttributes=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penAttr;return h=d[++o],p.textTag=(h&240)>>4,p.offset=(h&12)>>2,p.penSize=h&3,h=d[++o],p.italics=(h&128)>>7,p.underline=(h&64)>>6,p.edgeType=(h&56)>>3,p.fontStyle=h&7,o},ve.prototype.setPenColor=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penColor;return h=d[++o],p.fgOpacity=(h&192)>>6,p.fgRed=(h&48)>>4,p.fgGreen=(h&12)>>2,p.fgBlue=h&3,h=d[++o],p.bgOpacity=(h&192)>>6,p.bgRed=(h&48)>>4,p.bgGreen=(h&12)>>2,p.bgBlue=h&3,h=d[++o],p.edgeRed=(h&48)>>4,p.edgeGreen=(h&12)>>2,p.edgeBlue=h&3,o},ve.prototype.setPenLocation=function(o,l){var d=this.current708Packet.data,h=d[o],p=l.currentWindow.penLoc;return l.currentWindow.pendingNewLine=!0,h=d[++o],p.row=h&15,h=d[++o],p.column=h&63,o},ve.prototype.reset=function(o,l){var d=this.getPts(o);return this.flushDisplayed(d,l),this.initService(l.serviceNum,o)};var si={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},yt=function(o){return o===null?"":(o=si[o]||o,String.fromCharCode(o))},Dt=14,Tt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ot=function(){for(var o=[],l=Dt+1;l--;)o.push({text:"",indent:0,offset:0});return o},Ee=function(o,l){Ee.prototype.init.call(this),this.field_=o||0,this.dataChannel_=l||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(d){var h,p,m,S,E;if(h=d.ccData&32639,h===this.lastControlCode_){this.lastControlCode_=null;return}if((h&61440)===4096?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),m=h>>>8,S=h&255,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(d.pts),this.flushDisplayed(d.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=d.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(d.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(d.pts);else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(d.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(d.pts),this.flushDisplayed(d.pts),this.shiftRowsUp_(),this.startPts_=d.pts;else if(h===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(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(d.pts),this.displayed_=Ot();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ot();else if(h===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(d.pts),this.displayed_=Ot()),this.mode_="paintOn",this.startPts_=d.pts;else if(this.isSpecialCharacter(m,S))m=(m&3)<<8,E=yt(m|S),this[this.mode_](d.pts,E),this.column_++;else if(this.isExtCharacter(m,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),m=(m&3)<<8,E=yt(m|S),this[this.mode_](d.pts,E),this.column_++;else if(this.isMidRowCode(m,S))this.clearFormatting(d.pts),this[this.mode_](d.pts," "),this.column_++,(S&14)===14&&this.addFormatting(d.pts,["i"]),(S&1)===1&&this.addFormatting(d.pts,["u"]);else if(this.isOffsetControlCode(m,S)){const x=S&3;this.nonDisplayed_[this.row_].offset=x,this.column_+=x}else if(this.isPAC(m,S)){var A=Tt.indexOf(h&7968);
188if(this.mode_==="rollUp"&&(A-this.rollUpRows_+1<0&&(A=this.rollUpRows_-1),this.setRollUp(d.pts,A)),A!==this.row_&&A>=0&&A<=14&&(this.clearFormatting(d.pts),this.row_=A),S&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(d.pts,["u"]),(h&16)===16){const x=(h&14)>>1;this.column_=x*4,this.nonDisplayed_[this.row_].indent+=x}this.isColorPAC(S)&&(S&14)===14&&this.addFormatting(d.pts,["i"])}else this.isNormalChar(m)&&(S===0&&(S=null),E=yt(m),E+=yt(S),this[this.mode_](d.pts,E),this.column_+=E.length)}};Ee.prototype=new je,Ee.prototype.flushDisplayed=function(o){const l=h=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."})},d=[];this.displayed_.forEach((h,p)=>{if(h&&h.text&&h.text.length){try{h.text=h.text.trim()}catch{l(p)}h.text.length&&d.push({text:h.text,line:p+1,position:10+Math.min(70,h.indent*10)+h.offset*2.5})}else h==null&&l(p)}),d.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:d,stream:this.name_})},Ee.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ot(),this.nonDisplayed_=Ot(),this.lastControlCode_=null,this.column_=0,this.row_=Dt,this.rollUpRows_=2,this.formatting_=[]},Ee.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},Ee.prototype.isSpecialCharacter=function(o,l){return o===this.EXT_&&l>=48&&l<=63},Ee.prototype.isExtCharacter=function(o,l){return(o===this.EXT_+1||o===this.EXT_+2)&&l>=32&&l<=63},Ee.prototype.isMidRowCode=function(o,l){return o===this.EXT_&&l>=32&&l<=47},Ee.prototype.isOffsetControlCode=function(o,l){return o===this.OFFSET_&&l>=33&&l<=35},Ee.prototype.isPAC=function(o,l){return o>=this.BASE_&&o<this.BASE_+8&&l>=64&&l<=127},Ee.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ee.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ee.prototype.setRollUp=function(o,l){if(this.mode_!=="rollUp"&&(this.row_=Dt,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Ot(),this.displayed_=Ot()),l!==void 0&&l!==this.row_)for(var d=0;d<this.rollUpRows_;d++)this.displayed_[l-d]=this.displayed_[this.row_-d],this.displayed_[this.row_-d]={text:"",indent:0,offset:0};l===void 0&&(l=this.row_),this.topRow_=l-this.rollUpRows_+1},Ee.prototype.addFormatting=function(o,l){this.formatting_=this.formatting_.concat(l);var d=l.reduce(function(h,p){return h+"<"+p+">"},"");this[this.mode_](o,d)},Ee.prototype.clearFormatting=function(o){if(this.formatting_.length){var l=this.formatting_.reverse().reduce(function(d,h){return d+"</"+h+">"},"");this.formatting_=[],this[this.mode_](o,l)}},Ee.prototype.popOn=function(o,l){var d=this.nonDisplayed_[this.row_].text;d+=l,this.nonDisplayed_[this.row_].text=d},Ee.prototype.rollUp=function(o,l){var d=this.displayed_[this.row_].text;d+=l,this.displayed_[this.row_].text=d},Ee.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<Dt+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}},Ee.prototype.paintOn=function(o,l){var d=this.displayed_[this.row_].text;d+=l,this.displayed_[this.row_].text=d};var di={CaptionStream:Re,Cea608Stream:Ee,Cea708Stream:ve},fi={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},ri=t,Ir=8589934592,pi=4294967296,Ms="shared",Qn=function(o,l){var d=1;for(o>l&&(d=-1);Math.abs(l-o)>pi;)o+=d*Ir;return o},Jn=function(o){var l,d;Jn.prototype.init.call(this),this.type_=o||Ms,this.push=function(h){if(h.type==="metadata"){this.trigger("data",h);return}this.type_!==Ms&&h.type!==this.type_||(d===void 0&&(d=h.dts),h.dts=Qn(h.dts,d),h.pts=Qn(h.pts,d),l=h.dts,this.trigger("data",h))},this.flush=function(){d=l,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){d=void 0,l=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Jn.prototype=new ri;var ru={TimestampRolloverStream:Jn,handleRollover:Qn},af=(o,l,d)=>{if(!o)return-1;for(var h=d;h<o.length;h++)if(o[h]===l)return h;return-1},of={typedArrayIndexOf:af},Pr=of.typedArrayIndexOf,Or={Utf8:3},nu=function(o,l,d){var h,p="";for(h=l;h<d;h++)p+="%"+("00"+o[h].toString(16)).slice(-2);return p},Ns=function(o,l,d){return decodeURIComponent(nu(o,l,d))},Bs=function(o,l,d){return unescape(nu(o,l,d))},Us=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Fs={APIC:function(o){var l=1,d,h,p="-->";o.data[0]===Or.Utf8&&(d=Pr(o.data,0,l),!(d<0)&&(o.mimeType=Bs(o.data,l,d),l=d+1,o.pictureType=
188o.data[l],l++,h=Pr(o.data,0,l),!(h<0)&&(o.description=Ns(o.data,l,h),l=h+1,o.mimeType===p?o.url=Bs(o.data,l,o.data.length):o.pictureData=o.data.subarray(l,o.data.length))))},"T*":function(o){o.data[0]===Or.Utf8&&(o.value=Ns(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var l;o.data[0]===Or.Utf8&&(l=Pr(o.data,0,1),l!==-1&&(o.description=Ns(o.data,1,l),o.value=Ns(o.data,l+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=Bs(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var l;o.data[0]===Or.Utf8&&(l=Pr(o.data,0,1),l!==-1&&(o.description=Ns(o.data,1,l),o.url=Bs(o.data,l+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var l;for(l=0;l<o.data.length;l++)if(o.data[l]===0){o.owner=Bs(o.data,0,l);break}o.privateData=o.data.subarray(l+1),o.data=o.privateData}},uf=function(o){var l,d,h=10,p=0,m=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=Us(o.subarray(6,10)),p+=10;var S=o[5]&64;S&&(h+=4,h+=Us(o.subarray(10,14)),p-=Us(o.subarray(16,20)));do{if(l=Us(o.subarray(h+4,h+8)),l<1)break;d=String.fromCharCode(o[h],o[h+1],o[h+2],o[h+3]);var E={id:d,data:o.subarray(h+10,h+l+10)};E.key=E.id,Fs[E.id]?Fs[E.id](E):E.id[0]==="T"?Fs["T*"](E):E.id[0]==="W"&&Fs["W*"](E),m.push(E),h+=10,h+=l}while(h<p);return m}},au={parseId3Frames:uf,parseSyncSafeInteger:Us,frameParsers:Fs},lf=t,cf=fi,mi=au,Lr;Lr=function(o){var l={descriptor:o&&o.descriptor},d=0,h=[],p=0,m;if(Lr.prototype.init.call(this),this.dispatchType=cf.METADATA_STREAM_TYPE.toString(16),l.descriptor)for(m=0;m<l.descriptor.length;m++)this.dispatchType+=("00"+l.descriptor[m].toString(16)).slice(-2);this.push=function(S){var E,A,x,M,z,ae;if(S.type==="timed-metadata"){if(S.dataAlignmentIndicator&&(p=0,h.length=0),h.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(h.push(S),p+=S.data.byteLength,h.length===1&&(d=mi.parseSyncSafeInteger(S.data.subarray(6,10)),d+=10),!(p<d)){for(E={data:new Uint8Array(d),frames:[],pts:h[0].pts,dts:h[0].dts},z=0;z<d;)E.data.set(h[0].data.subarray(0,d-z),z),z+=h[0].data.byteLength,p-=h[0].data.byteLength,h.shift();A=10,E.data[5]&64&&(A+=4,A+=mi.parseSyncSafeInteger(E.data.subarray(10,14)),d-=mi.parseSyncSafeInteger(E.data.subarray(16,20)));do{if(x=mi.parseSyncSafeInteger(E.data.subarray(A+4,A+8)),x<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ae=String.fromCharCode(E.data[A],E.data[A+1],E.data[A+2],E.data[A+3]),M={id:ae,data:E.data.subarray(A+10,A+x+10)},M.key=M.id,mi.frameParsers[M.id]?mi.frameParsers[M.id](M):M.id[0]==="T"?mi.frameParsers["T*"](M):M.id[0]==="W"&&mi.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,E.pts===void 0&&E.dts===void 0&&(E.pts=M.timeStamp,E.dts=M.timeStamp),this.trigger("timestamp",M)}E.frames.push(M),A+=10,A+=x}while(A<d);this.trigger("data",E)}}}},Lr.prototype=new lf;var hf=Lr,Zn=t,ea=di,Lt=fi,df=ru.TimestampRolloverStream,Rr,qs,Mr,Ji=188,ta=71;Rr=function(){var o=new Uint8Array(Ji),l=0;Rr.prototype.init.call(this),this.push=function(d){var h=0,p=Ji,m;for(l?(m=new Uint8Array(d.byteLength+l),m.set(o.subarray(0,l)),m.set(d,l),l=0):m=d;p<m.byteLength;){if(m[h]===ta&&m[p]===ta){this.trigger("data",m.subarray(h,p)),h+=Ji,p+=Ji;continue}h++,p++}h<m.byteLength&&(o.set(m.subarray(h),0),l=m.byteLength-h)},this.flush=function(){l===Ji&&o[0]===ta&&(this.trigger("data",o),l=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){l=0,this.trigger("reset")}},Rr.prototype=new Zn,qs=function(){var o,l,d,h;qs.prototype.init.call(this),h=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,m){var S=0;m.payloadUnitStartIndicator&&(S+=p[S]+1),m.type==="pat"?l(p.subarray(S),m):d(p.subarray(S),m)},l=function(p,m){m.section_number=p[7],m.last_section_number=p[8],h.pmtPid=(p[10]&31)<<8|p[11],m.pmtPid=h.pmtPid},d=function(p,m){var S,E,A,x;if(p[5]&1){for(h.programMapTable={video:null,audio:null,"timed-metadata":{}},S=(p[1]&15)<<8|p[2],E=3+S-4,A=(p[10]&15)<<8|p[11],x=12+A;x<E;){var M=p[x],z=(p[x+1]&31)<<8|p[x+2];M===Lt.H264_STREAM_TYPE&&h.programMapTable.video===null?h.programMapTable.video=z:M===Lt.ADTS_STREAM_TYPE&&h.programMapTable.audio===null?h.programMapTable.audio=z:M===Lt.METADATA_STREAM_TYPE&&(h.programMapTable["timed-metadata"][z]=M),x+=((p[x+3]&15)<<8|p[x+4])+5}m.programMapTable=h.programMapTable}},this.push=function(p){var m={},S=4;if(m.payloadUnitStartIndicator=!!(p[1]&64),m.pid=p[1]&31,m.pid<<=8,m.pid|=p[2],(p[3]&48)>>>4>1&&(S+=p[S]+1),m.pid===0)m.type="pat",o(p.subarray(S),m),this.trigger("data",m);else if(m.pid===this.pmtPid)for(m.type="pmt",o(p.subarray(S),m),this.trigger("data",m);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
188else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,S,m]):this.processPes_(p,S,m)},this.processPes_=function(p,m,S){S.pid===this.programMapTable.video?S.streamType=Lt.H264_STREAM_TYPE:S.pid===this.programMapTable.audio?S.streamType=Lt.ADTS_STREAM_TYPE:S.streamType=this.programMapTable["timed-metadata"][S.pid],S.type="pes",S.data=p.subarray(m),this.trigger("data",S)}},qs.prototype=new Zn,qs.STREAM_TYPES={h264:27,adts:15},Mr=function(){var o=this,l=!1,d={data:[],size:0},h={data:[],size:0},p={data:[],size:0},m,S=function(A,x){var M;const z=A[0]<<16|A[1]<<8|A[2];x.data=new Uint8Array,z===1&&(x.packetLength=6+(A[4]<<8|A[5]),x.dataAlignmentIndicator=(A[6]&4)!==0,M=A[7],M&192&&(x.pts=(A[9]&14)<<27|(A[10]&255)<<20|(A[11]&254)<<12|(A[12]&255)<<5|(A[13]&254)>>>3,x.pts*=4,x.pts+=(A[13]&6)>>>1,x.dts=x.pts,M&64&&(x.dts=(A[14]&14)<<27|(A[15]&255)<<20|(A[16]&254)<<12|(A[17]&255)<<5|(A[18]&254)>>>3,x.dts*=4,x.dts+=(A[18]&6)>>>1)),x.data=A.subarray(9+A[8]))},E=function(A,x,M){var z=new Uint8Array(A.size),ae={type:x},Q=0,he=0,_e=!1,Ke;if(!(!A.data.length||A.size<9)){for(ae.trackId=A.data[0].pid,Q=0;Q<A.data.length;Q++)Ke=A.data[Q],z.set(Ke.data,he),he+=Ke.data.byteLength;S(z,ae),_e=x==="video"||ae.packetLength<=A.size,(M||_e)&&(A.size=0,A.data.length=0),_e&&o.trigger("data",ae)}};Mr.prototype.init.call(this),this.push=function(A){({pat:function(){},pes:function(){var x,M;switch(A.streamType){case Lt.H264_STREAM_TYPE:x=d,M="video";break;case Lt.ADTS_STREAM_TYPE:x=h,M="audio";break;case Lt.METADATA_STREAM_TYPE:x=p,M="timed-metadata";break;default:return}A.payloadUnitStartIndicator&&E(x,M,!0),x.data.push(A),x.size+=A.data.byteLength},pmt:function(){var x={type:"metadata",tracks:[]};m=A.programMapTable,m.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),l=!0,o.trigger("data",x)}})[A.type]()},this.reset=function(){d.size=0,d.data.length=0,h.size=0,h.data.length=0,this.trigger("reset")},this.flushStreams_=function(){E(d,"video"),E(h,"audio"),E(p,"timed-metadata")},this.flush=function(){if(!l&&m){var A={type:"metadata",tracks:[]};m.video!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&A.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),o.trigger("data",A)}l=!1,this.flushStreams_(),this.trigger("done")}},Mr.prototype=new Zn;var ou={PAT_PID:0,MP2T_PACKET_LENGTH:Ji,TransportPacketStream:Rr,TransportParseStream:qs,ElementaryStream:Mr,TimestampRolloverStream:df,CaptionStream:ea.CaptionStream,Cea608Stream:ea.Cea608Stream,Cea708Stream:ea.Cea708Stream,MetadataStream:hf};for(var ia in Lt)Lt.hasOwnProperty(ia)&&(ou[ia]=Lt[ia]);var ff=ou,pf=t,mf=we.ONE_SECOND_IN_TS,Nr,uu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Nr=function(o){var l,d=0;Nr.prototype.init.call(this),this.skipWarn_=function(h,p){this.trigger("log",{level:"warn",message:`adts ski
188ping bytes ${h} to ${p} in frame ${d} outside syncword`})},this.push=function(h){var p=0,m,S,E,A,x;if(o||(d=0),h.type==="audio"){l&&l.length?(E=l,l=new Uint8Array(E.byteLength+h.data.byteLength),l.set(E),l.set(h.data,E.byteLength)):l=h.data;for(var M;p+7<l.length;){if(l[p]!==255||(l[p+1]&246)!==240){typeof M!="number"&&(M=p),p++;continue}if(typeof M=="number"&&(this.skipWarn_(M,p),M=null),S=(~l[p+1]&1)*2,m=(l[p+3]&3)<<11|l[p+4]<<3|(l[p+5]&224)>>5,A=((l[p+6]&3)+1)*1024,x=A*mf/uu[(l[p+2]&60)>>>2],l.byteLength-p<m)break;this.trigger("data",{pts:h.pts+d*x,dts:h.dts+d*x,sampleCount:A,audioobjecttype:(l[p+2]>>>6&3)+1,channelcount:(l[p+2]&1)<<2|(l[p+3]&192)>>>6,samplerate:uu[(l[p+2]&60)>>>2],samplingfrequencyindex:(l[p+2]&60)>>>2,samplesize:16,data:l.subarray(p+7+S,p+m)}),d++,p+=m}typeof M=="number"&&(this.skipWarn_(M,p),M=null),l=l.subarray(p)}},this.flush=function(){d=0,this.trigger("done")},this.reset=function(){l=void 0,this.trigger("reset")},this.endTimeline=function(){l=void 0,this.trigger("endedtimeline")}},Nr.prototype=new pf;var gf=Nr,lu;lu=function(o){var l=o.byteLength,d=0,h=0;this.length=function(){return 8*l},this.bitsAvailable=function(){return 8*l+h},this.loadWord=function(){var p=o.byteLength-l,m=new Uint8Array(4),S=Math.min(4,l);if(S===0)throw new Error("no bytes available");m.set(o.subarray(p,p+S)),d=new DataView(m.buffer).getUint32(0),h=S*8,l-=S},this.skipBits=function(p){var m;h>p?(d<<=p,h-=p):(p-=h,m=Math.floor(p/8),p-=m*8,l-=m,this.loadWord(),d<<=p,h-=p)},this.readBits=function(p){var m=Math.min(h,p),S=d>>>32-m;return h-=m,h>0?d<<=m:l>0&&this.loadWord(),m=p-m,m>0?S<<m|this.readBits(m):S},this.skipLeadingZeros=function(){var p;for(p=0;p<h;++p)if((d&2147483648>>>p)!==0)return d<<=p,h-=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 _f=lu,cu=t,yf=_f,Br,Ur,hu;Ur=function(){var o=0,l,d;Ur.prototype.init.call(this),this.push=function(h){var p;d?(p=new Uint8Array(d.byteLength+h.data.byteLength),p.set(d),p.set(h.data,d.byteLength),d=p):d=h.data;for(var m=d.byteLength;o<m-3;o++)if(d[o+2]===1){l=o+5;break}for(;l<m;)switch(d[l]){case 0:if(d[l-1]!==0){l+=2;break}else if(d[l-2]!==0){l++;break}o+3!==l-2&&this.trigger("data",d.subarray(o+3,l-2));do l++;while(d[l]!==1&&l<m);o=l-2,l+=3;break;case 1:if(d[l-1]!==0||d[l-2]!==0){l+=3;break}this.trigger("data",d.subarray(o+3,l-2)),o=l-2,l+=3;break;default:l+=3;break}d=d.subarray(o),l-=o,o=0},this.reset=function(){d=null,o=0,this.trigger("reset")},this.flush=function(){d&&d.byteLength>3&&this.trigger("data",d.subarray(o+3)),d=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ur.prototype=new cu,hu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Br=function(){var o=new Ur,l,d,h,p,m,S,E;Br.prototype.init.call(this),l=this,this.push=function(A){A.type==="video"&&(d=A.trackId,h=A.pts,p=A.dts,o.push(A))},o.on("data",function(A){var x={trackId:d,pts:h,dts:p,data:A,nalUnitTypeCode:A[0]&3
1881};switch(x.nalUnitTypeCode){case 5:x.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:x.nalUnitType="sei_rbsp",x.escapedRBSP=m(A.subarray(1));break;case 7:x.nalUnitType="seq_parameter_set_rbsp",x.escapedRBSP=m(A.subarray(1)),x.config=S(x.escapedRBSP);break;case 8:x.nalUnitType="pic_parameter_set_rbsp";break;case 9:x.nalUnitType="access_unit_delimiter_rbsp";break}l.trigger("data",x)}),o.on("done",function(){l.trigger("done")}),o.on("partialdone",function(){l.trigger("partialdone")}),o.on("reset",function(){l.trigger("reset")}),o.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},E=function(A,x){var M=8,z=8,ae,Q;for(ae=0;ae<A;ae++)z!==0&&(Q=x.readExpGolomb(),z=(M+Q+256)%256),M=z===0?M:z},m=function(A){for(var x=A.byteLength,M=[],z=1,ae,Q;z<x-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=x-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 x=0,M=0,z=0,ae=0,Q,he,_e,Ke,vt,_i,Ws,Xs,Ks,Ys,Yr,Le=[1,1],Qs,Mt;if(Q=new yf(A),he=Q.readUnsignedByte(),Ke=Q.readUnsignedByte(),_e=Q.readUnsignedByte(),Q.skipUnsignedExpGolomb(),hu[he]&&(vt=Q.readUnsignedExpGolomb(),vt===3&&Q.skipBits(1),Q.skipUnsignedExpGolomb(),Q.skipUnsignedExpGolomb(),Q.skipBits(1),Q.readBoolean()))for(Yr=vt!==3?8:12,Mt=0;Mt<Yr;Mt++)Q.readBoolean()&&(Mt<6?E(16,Q):E(64,Q));if(Q.skipUnsignedExpGolomb(),_i=Q.readUnsignedExpGolomb(),_i===0)Q.readUnsignedExpGolomb();else if(_i===1)for(Q.skipBits(1),Q.skipExpGolomb(),Q.skipExpGolomb(),Ws=Q.readUnsignedExpGolomb(),Mt=0;Mt<Ws;Mt++)Q.skipExpGolomb();if(Q.skipUnsignedExpGolomb(),Q.skipBits(1),Xs=Q.readUnsignedExpGolomb(),Ks=Q.readUnsignedExpGolomb(),Ys=Q.readBits(1),Ys===0&&Q.skipBits(1),Q.skipBits(1),Q.readBoolean()&&(x=Q.readUnsignedExpGolomb(),M=Q.readUnsignedExpGolomb(),z=Q.readUnsignedExpGolomb(),ae=Q.readUnsignedExpGolomb()),Q.readBoolean()&&Q.readBoolean()){switch(Qs=Q.readUnsignedByte(),Qs){case 1:Le=[1,1];break;case 2:Le=[12,11];break;case 3:Le=[10,11];break;case 4:Le=[16,11];break;case 5:Le=[40,33];break;case 6:Le=[24,11];break;case 7:Le=[20,11];break;case 8:Le=[32,11];break;case 9:Le=[80,33];break;case 10:Le=[18,11];break;case 11:Le=[15,11];break;case 12:Le=[64,33];break;case 13:Le=[160,99];break;case 14:Le=[4,3];break;case 15:Le=[3,2];break;case 16:Le=[2,1];break;case 255:{Le=[Q.readUnsignedByte()<<8|Q.readUnsignedByte(),Q.readUnsignedByte()<<8|Q.readUnsignedByte()];break}}Le&&Le[0]/Le[1]}return{profileIdc:he,levelIdc:_e,profileCompatibility:Ke,width:(Xs+1)*16-x*2-M*2,height:(2-Ys)*(Ks+1)*16-z*2-ae*2,sarRatio:Le}}},Br.prototype=new cu;var Tf={H264Stream:Br},vf=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],du=function(o,l){var d=o[l+6]<<21|o[l+7]<<14|o[l+8]<<7|o[l+9],h=o[l+5],p=(h&16)>>4;return d=d>=0?d:0,p?d+20:d+10},fu=function(o,l){return o.length-l<10||o[l]!==73||o[l+1]!==68||o[l+2]!==51?l:(l+=du(o,l),fu(o,l))},bf=function(o){var l=fu(o,0);return o.length>=l+2&&(o[l]&255)===255&&(o[l+1]&240)===240&&(o[l+1]&22)===16},pu=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Sf=function(o,l,d){var h,p="";for(h=l;h<d;h++)p+="%"+("00"+o[h].toString(16)).slice(-2);return p},Ef=function(o,l,d){return unescape(Sf(o,l,d))},Cf=function(o,l){var d=(o[l+5]&224)>>5,h=o[l+4]<<3,p=o[l+3]&6144;return p|h|d},Df=function(o,l){return o[l]===73&&o[l+1]===68&&o[l+2]===51?"timed-metadata":o[l]&!0&&(o[l+1]&240)===240?"audio":null},Af=function(o){for(var l=0;l+5<o.length;){if(o[l]!==255||(o[l+1]&246)!==240){l++;continue}return vf[(o[l+2]&60)>>>2]}return null},wf=function(o){var l,d,h,p;l=10,o[5]&64&&(l+=4,l+=pu(o.subarray(10,14)));do{if(d=pu(o.subarray(l+4,l+8)),d<1)return null;if(p=String.fromCharCode(o[l],o[l+1],o[l+2],o[l+3]),p==="PRIV"){h=o.subarray(l+10,l+d+10);for(var m=0;m<h.byteLength;m++)if(h[m]===0){var S=Ef(h,0,m);if(S==="com.apple.streaming.transportStreamTimestamp"){var E=h.subarray(m+1),A=(E[3]&1)<<30|E[4]<<22|E[5]<<14|E[6]<<6|E[7]>>>2;return A*=4,A+=E[7]&3,A}break}}l+=10,l+=d}
188while(l<o.byteLength);return null},sa={isLikelyAacData:bf,parseId3TagSize:du,parseAdtsSize:Cf,parseType:Df,parseSampleRate:Af,parseAacTimestamp:wf},xf=t,mu=sa,Fr;Fr=function(){var o=new Uint8Array,l=0;Fr.prototype.init.call(this),this.setTimestamp=function(d){l=d},this.push=function(d){var h=0,p=0,m,S,E,A;for(o.length?(A=o.length,o=new Uint8Array(d.byteLength+A),o.set(o.subarray(0,A)),o.set(d,A)):o=d;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(h=mu.parseId3TagSize(o,p),p+h>o.length))break;S={type:"timed-metadata",data:o.subarray(p,p+h)},this.trigger("data",S),p+=h;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(h=mu.parseAdtsSize(o,p),p+h>o.length))break;E={type:"audio",data:o.subarray(p,p+h),pts:l,dts:l},this.trigger("data",E),p+=h;continue}p++}m=o.length-p,m>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")}},Fr.prototype=new xf;var kf=Fr,If=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Pf=If,Of=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Lf=Of,qr=t,$s=We,js=wi,$r=Yi,Rt=y,ni=ff,jr=we,gu=gf,Rf=Tf.H264Stream,Mf=kf,Nf=sa.isLikelyAacData,Bf=we.ONE_SECOND_IN_TS,_u=Pf,yu=Lf,Hr,Hs,Vr,Ii,Uf=function(o,l){l.stream=o,this.trigger("log",l)},Tu=function(o,l){for(var d=Object.keys(l),h=0;h<d.length;h++){var p=d[h];p==="headOfPipeline"||!l[p].on||l[p].on("log",Uf.bind(o,p))}},vu=function(o,l){var d;if(o.length!==l.length)return!1;for(d=0;d<o.length;d++)if(o[d]!==l[d])return!1;return!0},bu=function(o,l,d,h,p,m){var S=d-l,E=h-l,A=p-d;return{start:{dts:o,pts:o+S},end:{dts:o+E,pts:o+A},prependedContentDuration:m,baseMediaDecodeTime:o}};Hs=function(o,l){var d=[],h,p=0,m=0,S=1/0;l=l||{},h=l.firstSequenceNumber||0,Hs.prototype.init.call(this),this.push=function(E){Rt.collectDtsInfo(o,E),o&&_u.forEach(function(A){o[A]=E[A]}),d.push(E)},this.setEarliestDts=function(E){p=E},this.setVideoBaseMediaDecodeTime=function(E){S=E},this.setAudioAppendStart=function(E){m=E},this.flush=function(){var E,A,x,M,z,ae,Q;if(d.length===0){this.trigger("done","AudioSegmentStream");return}E=$r.trimAdtsFramesByEarliestDts(d,o,p),o.baseMediaDecodeTime=Rt.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),Q=$r.prefixWithSilence(o,E,m,S),o.samples=$r.generateSampleTable(E),x=$s.mdat($r.concatenateFrameData(E)),d=[],A=$s.moof(h,[o]),M=new Uint8Array(A.byteLength+x.byteLength),h++,M.set(A),M.set(x,A.byteLength),Rt.clearDtsInfo(o),z=Math.ceil(Bf*1024/o.samplerate),E.length&&(ae=E.length*z,this.trigger("segmentTimingInfo",bu(jr.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),E[0].dts,E[0].pts,E[0].dts+ae,E[0].pts+ae,Q||0)),this.trigger("timingInfo",{start:E[0].pts,end:E[0].pts+ae})),this.trigger("data",{track:o,boxes:M}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Rt.clearDtsInfo(o),d=[],this.trigger("reset")}},Hs.prototype=new qr,Hr=function(o,l){var d,h=[],p=[],m,S;l=l||{},d=l.firstSequenceNumber||0,Hr.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(E){Rt.collectDtsInfo(o,E),E.nalUnitType==="seq_parameter_set_rbsp"&&!m&&(m=E.config,o.sps=[E.data],yu.forEach(function(A){o[A]=m[A]},this)),E.nalUnitType==="pic_parameter_set_rbsp"&&!S&&(S=E.data,o.pps=[E.data]),h.push(E)},this.flush=function(){for(var E,A,x,M,z,ae,Q=0,he,_e;h.length&&h[0].nalUnitType!=="access_unit_delimiter_rbsp";)h.shift();if(h.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(E=js.groupNalsIntoFrames(h),x=js.groupFramesIntoGops(E),x[0][0].keyFrame||(A=this.getGopForFusion_(h[0],o),A?(Q=A.duration,x.unshift(A),x.byteLength+=A.byteLength,x.nalCount+=A.nalCount,x.pts=A.pts,x.dts=A.dts,x.duration+=A.duration):x=js.extendFirstKeyFrame(x)),p.length){var Ke;if(l.alignGopsAtEnd?Ke=this.alignGopsAtEnd_(x):Ke=this.alignGopsAtStart_(x),!Ke){this.gopCache_.unshift({gop:x.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),h=[],this.resetStream_
188(),this.trigger("done","VideoSegmentStream");return}Rt.clearDtsInfo(o),x=Ke}Rt.collectDtsInfo(o,x),o.samples=js.generateSampleTable(x),z=$s.mdat(js.concatenateNalData(x)),o.baseMediaDecodeTime=Rt.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),this.trigger("processedGopsInfo",x.map(function(vt){return{pts:vt.pts,dts:vt.dts,byteLength:vt.byteLength}})),he=x[0],_e=x[x.length-1],this.trigger("segmentTimingInfo",bu(o.baseMediaDecodeTime,he.dts,he.pts,_e.dts+_e.duration,_e.pts+_e.duration,Q)),this.trigger("timingInfo",{start:x[0].pts,end:x[x.length-1].pts+x[x.length-1].duration}),this.gopCache_.unshift({gop:x.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),h=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),M=$s.moof(d,[o]),ae=new Uint8Array(M.byteLength+z.byteLength),d++,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_(),h=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){Rt.clearDtsInfo(o),m=void 0,S=void 0},this.getGopForFusion_=function(E){var A=45e3,x=1/0,M,z,ae,Q,he;for(he=0;he<this.gopCache_.length;he++)Q=this.gopCache_[he],ae=Q.gop,!(!(o.pps&&vu(o.pps[0],Q.pps[0]))||!(o.sps&&vu(o.sps[0],Q.sps[0])))&&(ae.dts<o.timelineStartInfo.dts||(M=E.dts-ae.dts-ae.duration,M>=-1e4&&M<=A&&(!z||x>M)&&(z=Q,x=M)));return z?z.gop:null},this.alignGopsAtStart_=function(E){var A,x,M,z,ae,Q,he,_e;for(ae=E.byteLength,Q=E.nalCount,he=E.duration,A=x=0;A<p.length&&x<E.length&&(M=p[A],z=E[x],M.pts!==z.pts);){if(z.pts>M.pts){A++;continue}x++,ae-=z.byteLength,Q-=z.nalCount,he-=z.duration}return x===0?E:x===E.length?null:(_e=E.slice(x),_e.byteLength=ae,_e.duration=he,_e.nalCount=Q,_e.pts=_e[0].pts,_e.dts=_e[0].dts,_e)},this.alignGopsAtEnd_=function(E){var A,x,M,z,ae,Q;for(A=p.length-1,x=E.length-1,ae=null,Q=!1;A>=0&&x>=0;){if(M=p[A],z=E[x],M.pts===z.pts){Q=!0;break}if(M.pts>z.pts){A--;continue}A===p.length-1&&(ae=x),x--}if(!Q&&ae===null)return null;var he;if(Q?he=x:he=ae,he===0)return E;var _e=E.slice(he),Ke=_e.reduce(function(vt,_i){return vt.byteLength+=_i.byteLength,vt.duration+=_i.duration,vt.nalCount+=_i.nalCount,vt},{byteLength:0,duration:0,nalCount:0});return _e.byteLength=Ke.byteLength,_e.duration=Ke.duration,_e.nalCount=Ke.nalCount,_e.pts=_e[0].pts,_e.dts=_e[0].dts,_e},this.alignGopsWith=function(E){p=E}},Hr.prototype=new qr,Ii=function(o,l){this.numberOfTracks=0,this.metadataStream=l,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,Ii.prototype.init.call(this),this.push=function(d){if(d.content||d.text)return this.pendingCaptions.push(d);if(d.frames)return this.pendingMetadata.push(d);this.pendingTracks.push(d.track),this.pendingBytes+=d.boxes.byteLength,d.track.type==="video"&&(this.videoTrack=d.track,this.pendingBoxes.push(d.boxes)),d.track.type==="audio"&&(this.audioTrack=d.track,this.pendingBoxes.unshift(d.boxes))}},Ii.prototype=new qr,Ii.prototype.flush=function(o){var l=0,d={captions:[],captionStreams:{},metadata:[],info:{}},h,p,m,S=0,E;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,yu.forEach(function(A){d.info[A]=this.videoTrack[A]},this)):this.audioTrack&&(S=this.audioTrack.timelineStartInfo.pts,_u.forEach(function(A){d.info[A]=this.audioTrack[A]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?d.type=this.pendingTracks[0].type:d.type="combined",this.emittedTracks+=this.pendingTracks.length,m=$s.initSegment(this.pendingTracks),d.initSegment=new Uint8Array(m.byteLength),d.initSegment.set(m),d.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)d.data.set(this.pendingBoxes[E],l),l+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)h=this.pendingCaptions[E],h.startTime=jr.metadataTsToSeconds(h.startPts,S,this.keepOriginalTimestamps),h.endTime=jr.metadataTsToSeconds(h.endPts,S,this.keepOriginalTimestamps),d.captionStream
vendor: 7,043 bytes, line 188
188s[h.stream]=!0,d.captions.push(h);for(E=0;E<this.pendingMetadata.length;E++)p=this.pendingMetadata[E],p.cueTime=jr.metadataTsToSeconds(p.pts,S,this.keepOriginalTimestamps),d.metadata.push(p);for(d.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",d),E=0;E<d.captions.length;E++)h=d.captions[E],this.trigger("caption",h);for(E=0;E<d.metadata.length;E++)p=d.metadata[E],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ii.prototype.setRemux=function(o){this.remuxTracks=o},Vr=function(o){var l=this,d=!0,h,p;Vr.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="aac",m.metadataStream=new ni.MetadataStream,m.aacStream=new Mf,m.audioTimestampRolloverStream=new ni.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new ni.TimestampRolloverStream("timed-metadata"),m.adtsStream=new gu,m.coalesceStream=new Ii(o,m.metadataStream),m.headOfPipeline=m.aacStream,m.aacStream.pipe(m.audioTimestampRolloverStream).pipe(m.adtsStream),m.aacStream.pipe(m.timedMetadataTimestampRolloverStream).pipe(m.metadataStream).pipe(m.coalesceStream),m.metadataStream.on("timestamp",function(S){m.aacStream.setTimestamp(S.timeStamp)}),m.aacStream.on("data",function(S){S.type!=="timed-metadata"&&S.type!=="audio"||m.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:l.baseMediaDecodeTime},codec:"adts",type:"audio"},m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Hs(p,o),m.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h}))}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),Tu(this,m)},this.setupTsPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new ni.MetadataStream,m.packetStream=new ni.TransportPacketStream,m.parseStream=new ni.TransportParseStream,m.elementaryStream=new ni.ElementaryStream,m.timestampRolloverStream=new ni.TimestampRolloverStream,m.adtsStream=new gu,m.h264Stream=new Rf,m.captionStream=new ni.CaptionStream(o),m.coalesceStream=new Ii(o,m.metadataStream),m.headOfPipeline=m.packetStream,m.packetStream.pipe(m.parseStream).pipe(m.elementaryStream).pipe(m.timestampRolloverStream),m.timestampRolloverStream.pipe(m.h264Stream),m.timestampRolloverStream.pipe(m.adtsStream),m.timestampRolloverStream.pipe(m.metadataStream).pipe(m.coalesceStream),m.h264Stream.pipe(m.captionStream).pipe(m.coalesceStream),m.elementaryStream.on("data",function(S){var E;if(S.type==="metadata"){for(E=S.tracks.length;E--;)!h&&S.tracks[E].type==="video"?(h=S.tracks[E],h.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime):!p&&S.tracks[E].type==="audio"&&(p=S.tracks[E],p.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime);h&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new Hr(h,o),m.videoSegmentStream.on("log",l.getLogTrigger_("videoSegmentStream")),m.videoSegmentStream.on("timelineStartInfo",function(A){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=A,m.audioSegmentStream.setEarliestDts(A.dts-l.baseMediaDecodeTime))}),m.videoSegmentStream.on("processedGopsInfo",l.trigger.bind(l,"gopInfo")),m.videoSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"videoSegmentTimingInfo")),m.videoSegmentStream.on("baseMediaDecodeTime",function(A){p&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(A)}),m.videoSegmentStream.on("timingInfo",l.trigger.bind(l,"videoTimingInfo")),m.h264Stream.pipe(m.videoSegmentStream).pipe(m.coalesceStream)),p&&!m.audioSegmentStream&&(m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Hs(p,o),m.audioSegmentStream.on("log",l.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",l.trigger.bind(l,"audioTimingInfo")),m.audioSegmentStream.on("segmentTimingInfo",l.trigger.bind(l,"audioSegmentTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream)),l.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h})}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("id3Frame",function(S){S.dispatchType=m.metadataStream.dispatchType,l.trigger("id3Frame",S)}),m.coalesceStream.on("caption",this.trigger.bind(this,"caption")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),Tu(this,m)},this.setBaseMediaDecodeTime=function(m){var S=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=m),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Rt.clearDtsInfo(p),S.audioTimestampRolloverStream&&S.audioTimestampRolloverStream.discontinuity()),h&&(S.videoSegmentStream&&(S.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,Rt.clearDtsInfo(h),S.captionStream.reset()),S.timestampRolloverStream&&S.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(m){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(m)},this.setRemux=function(m){var S=this.transmuxPipeline_;o.remux=m,S&&S.coalesceStream&&S.coalesceStream.setRemux(m)},this.alignGopsWith=function(m){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(m)},this.getLogTrigger_=function(m){var S=this;return function(E){E.stream=m,S.trigger("log",E)}},this.push=function(m){if(d){var S=Nf(m);S&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!S&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),d=!1}this.transmuxPipeline_.headOfPipeline.push(m)},this.flush=function(){d=!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()}},Vr.prototype=new qr;var Ff={Transmuxer:Vr},qf=function(o){return o>>>0},$f=function(o){return("00"+o.toString(16)).slice(-2)},zr={toUnsigned:qf,toHexString:$f},jf=function(o){var l="";return l+=String.fromCharCode(o[0]),l+=String.fromCharCode(o[1]),l+=String.fromCharCode(o[2]),l+=String.fromCharCode(o[3]),l},Su=jf,Hf=zr.toUnsigned,Vf=Su,Eu=function(o,l){var d=[],h,p,m,S,E;if(!l.length)return null;for(h=0;h<o.byteLength;)p=Hf(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3]),m=Vf(o.subarray(h+4,h+8)),S=p>1?h+p:o.byteLength,m===l[0]&&(l.length===1?d.push(o.subarray(h+8,S)):(E=Eu(o.subarray(h+8,S),l.slice(1)),E.length&&(d=d.concat(E)))),h=S;return d},ra=Eu,zf=zr.toUnsigned,Gf=n.getUint64,Wf=function(o){var l={ver
188sion:o[0],flags:new Uint8Array(o.subarray(1,4))};return l.version===1?l.baseMediaDecodeTime=Gf(o.subarray(4)):l.baseMediaDecodeTime=zf(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),l},na=Wf,Xf=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:l.getUint32(4)},h=d.flags[2]&1,p=d.flags[2]&2,m=d.flags[2]&8,S=d.flags[2]&16,E=d.flags[2]&32,A=d.flags[0]&65536,x=d.flags[0]&131072,M;return M=8,h&&(M+=4,d.baseDataOffset=l.getUint32(12),M+=4),p&&(d.sampleDescriptionIndex=l.getUint32(M),M+=4),m&&(d.defaultSampleDuration=l.getUint32(M),M+=4),S&&(d.defaultSampleSize=l.getUint32(M),M+=4),E&&(d.defaultSampleFlags=l.getUint32(M)),A&&(d.durationIsEmpty=!0),!h&&x&&(d.baseDataOffsetIsMoof=!0),d},Cu=Xf,Kf=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]}},Yf=Kf,Du=Yf,Qf=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},d=new DataView(o.buffer,o.byteOffset,o.byteLength),h=l.flags[2]&1,p=l.flags[2]&4,m=l.flags[1]&1,S=l.flags[1]&2,E=l.flags[1]&4,A=l.flags[1]&8,x=d.getUint32(4),M=8,z;for(h&&(l.dataOffset=d.getInt32(M),M+=4),p&&x&&(z={flags:Du(o.subarray(M,M+4))},M+=4,m&&(z.duration=d.getUint32(M),M+=4),S&&(z.size=d.getUint32(M),M+=4),A&&(l.version===1?z.compositionTimeOffset=d.getInt32(M):z.compositionTimeOffset=d.getUint32(M),M+=4),l.samples.push(z),x--);x--;)z={},m&&(z.duration=d.getUint32(M),M+=4),S&&(z.size=d.getUint32(M),M+=4),E&&(z.flags=Du(o.subarray(M,M+4)),M+=4),A&&(l.version===1?z.compositionTimeOffset=d.getInt32(M):z.compositionTimeOffset=d.getUint32(M),M+=4),l.samples.push(z);return l},Au=Qf,wu={tfdt:na,trun:Au},xu={parseTfdt:wu.tfdt,parseTrun:wu.trun},Jf=function(o){for(var l=0,d=String.fromCharCode(o[l]),h="";d!=="\0";)h+=d,l++,d=String.fromCharCode(o[l]);return h+=d,h},Zf={uint8ToCString:Jf},Gr=Zf.uint8ToCString,ep=n.getUint64,tp=function(o){var l=4,d=o[0],h,p,m,S,E,A,x,M;if(d===0){h=Gr(o.subarray(l)),l+=h.length,p=Gr(o.subarray(l)),l+=p.length;var z=new DataView(o.buffer);m=z.getUint32(l),l+=4,E=z.getUint32(l),l+=4,A=z.getUint32(l),l+=4,x=z.getUint32(l),l+=4}else if(d===1){var z=new DataView(o.buffer);m=z.getUint32(l),l+=4,S=ep(o.subarray(l)),l+=8,A=z.getUint32(l),l+=4,x=z.getUint32(l),l+=4,h=Gr(o.subarray(l)),l+=h.length,p=Gr(o.subarray(l)),l+=p.length}M=new Uint8Array(o.subarray(l,o.byteLength));var ae={scheme_id_uri:h,value:p,timescale:m||1,presentation_time:S,presentation_time_delta:E,event_duration:A,id:x,message_data:M};return sp(d,ae)?ae:void 0},ip=function(o,l,d,h){return o||o===0?o/l:h+d/l},sp=function(o,l){var d=l.scheme_id_uri!=="\0",h=o===0&&ku(l.presentation_time_delta)&&d,p=o===1&&ku(l.presentation_time)&&d;return!(o>1)&&h||p},ku=function(o){return o!==void 0||o!==null},rp={parseEmsgBox:tp,scaleTime:ip},Vs;typeof window<"u"?Vs=window:typeof s<"u"?Vs=s:typeof self<"u"?Vs=self:Vs={};var Iu=Vs,Wr=zr.toUnsigned,zs=zr.toHexString,He=ra,Zi=Su,aa=rp,np=Cu,ap=Au,op=na,up=n.getUint64,Pu,Ou,Lu,Ru,Mu,oa,Nu,ua=Iu,lp=au.parseId3Frames;Pu=function(o){var l={},d=He(o,["moov","trak"]);return d.reduce(function(h,p){var m,S,E,A,x;return m=He(p,["tkhd"])[0],!m||(S=m[0],E=S===0?12:20,A=Wr(m[E]<<24|m[E+1]<<16|m[E+2]<<8|m[E+3]),x=He(p,["mdia","mdhd"])[0],!x)?null:(S=x[0],E=S===0?12:20,h[A]=Wr(x[E]<<24|x[E+1]<<16|x[E+2]<<8|x[E+3]),h)},l)},Ou=function(o,l){var d;d=He(l,["moof","traf"]);var h=d.reduce(function(p,m){var S=He(m,["tfhd"])[0],E=Wr(S[4]<<24|S[5]<<16|S[6]<<8|S[7]),A=o[E]||9e4,x=He(m,["tfdt"])[0],M=new DataView(x.buffer,x.byteOffset,x.byteLength),z;x[0]===1?z=up(x.subarray(4,12)):z=M.getUint32(4);let ae;return typeof z=="bigint"?ae=z/ua.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 h=="bigint"||isFinite(h)?h:0},Lu=function(o,l){var d=He(l,["moof","traf"]),h=0,p=0,m;if(d&&d.length){var S=He(d[0],["tfhd"])[0],E=He(d[0],["trun"])[0],A=He(d[0],["tfdt"])[0];if(S){var x=np(S);m=x.trackId}if(A){var M=op(A);h=M.baseMediaDecodeTime}if(E){var z=ap(E);z.samples&&z.samples.length&&(p=z.samples[0].compositionTimeOffset||0)}}var ae=o[m]||9e4;typeof h=="bigint"&&(p=ua.BigInt(p),ae=ua.BigInt(ae));var Q=(h+p)/ae;return typeof Q=="bigint"&&Q<Number.MAX_SAFE_INTEGER&&(Q=Number(Q)),Q},Ru=function(o){var l=He(o,["moov","trak"]),d=[];return l.forEach(function(h){var p=He(h,["mdia","hdlr"]),m=He(h,["tkhd"]);p.forEach(function(S,E){var A=Zi(S.subarray(8,12)),x=m[E],M,z,ae;A==="vide"&&(M=new DataView(x.buffer,x.byteOffset,x.byteLength),z=M.getUint8(0),ae=z===0?M.getUint32(12):M.getUint32(20),d.push(ae))})}),d},oa=function(o){var l=o[0],d=l===0?12:20;return Wr(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3])},Mu=function(o){var l=He(o,["moov","trak"]),d=[];return l.forEach(function(h){var p={},m=He(h,["tkhd"])[0],S,E;m&&(S=new DataView(m.buffer,m.byteOffset,m.byteLength),E=S.getUint8(0),p.id=E===0?S.getUint32(12):S.getUint32(20));var A=He(h,["mdia","hdlr"])[0];if(A){var x=Zi(A.subarray(8,12));x==="vide"?p.type="video":x==="soun"?p.type="audio":p.type=x}
188var M=He(h,["mdia","minf","stbl","stsd"])[0];if(M){var z=M.subarray(8);p.codec=Zi(z.subarray(4,8));var ae=He(z,[p.codec])[0],Q,he;ae&&(/^[asm]vc[1-9]$/i.test(p.codec)?(Q=ae.subarray(78),he=Zi(Q.subarray(4,8)),he==="avcC"&&Q.length>11?(p.codec+=".",p.codec+=zs(Q[9]),p.codec+=zs(Q[10]),p.codec+=zs(Q[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(Q=ae.subarray(28),he=Zi(Q.subarray(4,8)),he==="esds"&&Q.length>20&&Q[19]!==0?(p.codec+="."+zs(Q[19]),p.codec+="."+zs(Q[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var _e=He(h,["mdia","mdhd"])[0];_e&&(p.timescale=oa(_e)),d.push(p)}),d},Nu=function(o,l=0){var d=He(o,["emsg"]);return d.map(h=>{var p=aa.parseEmsgBox(new Uint8Array(h)),m=lp(p.message_data);return{cueTime:aa.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,l),duration:aa.scaleTime(p.event_duration,p.timescale),frames:m}})};var Gs={findBox:He,parseType:Zi,timescale:Pu,startTime:Ou,compositionStartTime:Lu,videoTrackIds:Ru,tracks:Mu,getTimescaleFromMediaHeader:oa,getEmsgID3:Nu};const{parseTrun:cp}=xu,{findBox:Bu}=Gs;var Uu=Iu,hp=function(o){var l=Bu(o,["moof","traf"]),d=Bu(o,["mdat"]),h=[];return d.forEach(function(p,m){var S=l[m];h.push({mdat:p,traf:S})}),h},dp=function(o,l,d){var h=l,p=d.defaultSampleDuration||0,m=d.defaultSampleSize||0,S=d.trackId,E=[];return o.forEach(function(A){var x=cp(A),M=x.samples;M.forEach(function(z){z.duration===void 0&&(z.duration=p),z.size===void 0&&(z.size=m),z.trackId=S,z.dts=h,z.compositionTimeOffset===void 0&&(z.compositionTimeOffset=0),typeof h=="bigint"?(z.pts=h+Uu.BigInt(z.compositionTimeOffset),h+=Uu.BigInt(z.duration)):(z.pts=h+z.compositionTimeOffset,h+=z.duration)}),E=E.concat(M)}),E},Fu={getMdatTrafPairs:hp,parseSamples:dp},fp=ke.discardEmulationPreventionBytes,pp=di.CaptionStream,la=ra,mp=na,gp=Cu,{getMdatTrafPairs:_p,parseSamples:yp}=Fu,Tp=function(o,l){for(var d=o,h=0;h<l.length;h++){var p=l[h];if(d<p.size)return p;d-=p.size}return null},vp=function(o,l,d){var h=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},m,S,E,A;for(S=0;S+4<o.length;S+=E)if(E=h.getUint32(S),S+=4,!(E<=0))switch(o[S]&31){case 6:var x=o.subarray(S+1,S+1+E),M=Tp(S,l);if(m={nalUnitType:"sei_rbsp",size:E,data:x,escapedRBSP:fp(x),trackId:d},M)m.pts=M.pts,m.dts=M.dts,A=M;else if(A)m.pts=A.pts,m.dts=A.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+S+" for trackId "+d+". See mux.js#223."});break}p.seiNals.push(m);break}return p},bp=function(o,l){var d={},h=_p(o);return h.forEach(function(p){var m=p.mdat,S=p.traf,E=la(S,["tfhd"]),A=gp(E[0]),x=A.trackId,M=la(S,["tfdt"]),z=M.length>0?mp(M[0]).baseMediaDecodeTime:0,ae=la(S,["trun"]),Q,he;l===x&&ae.length>0&&(Q=yp(ae,z,A),he=vp(m,Q,x),d[x]||(d[x]={seiNals:[],logs:[]}),d[x].seiNals=d[x].seiNals.concat(he.seiNals),d[x].logs=d[x].logs.concat(he.logs))}),d},Sp=function(o,l,d){var h;if(l===null)return null;h=bp(o,l);var p=h[l]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:d}},Ep=function(){var o=!1,l,d,h,p,m,S;this.isInitialized=function(){return o},this.init=function(E){l=new pp,o=!0,S=E?E.isPartial:!1,l.on("data",function(A){A.startTime=A.startPts/p,A.endTime=A.endPts/p,m.captions.push(A),m.captionStreams[A.stream]=!0}),l.on("log",function(A){m.logs.push(A)})},this.isNewInit=function(E,A){return E&&E.length===0||A&&typeof A=="object"&&Object.keys(A).length===0?!1:h!==E[0]||p!==A[h]},this.parse=function(E,A,x){var M;if(this.isInitialized()){if(!A||!x)return null;if(this.isNewInit(A,x))h=A[0],p=x[h];else if(h===null||!p)return d.push(E),null}else return null;for(;d.length>0;){var z=d.shift();this.parse(z,A,x)}return M=Sp(E,h,p),M&&M.logs&&(m.logs=m.logs.concat(M.logs)),M===null||!M.seiNals?m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null:(this.pushNals(M.seiNals),this.flushStream(),m)},this.pushNals=function(E){if(!this.isInitialized()||!E||E.length===0)return null;E.forEach(function(A){l.push(A)})},this.flushStream=function(){if(!this.isInitialized())return null;S?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStream
188s={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){d=[],h=null,p=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Cp=Ep;const{parseTfdt:Dp}=xu,gi=ra,{getTimescaleFromMediaHeader:Ap}=Gs,{parseSamples:wp,getMdatTrafPairs:xp}=Fu;var qu=function(){let o=9e4;this.init=function(l){const d=gi(l,["moov","trak","mdia","mdhd"])[0];d&&(o=Ap(d))},this.parseSegment=function(l){const d=[],h=xp(l);let p=0;return h.forEach(function(m){const S=m.mdat,E=m.traf,A=gi(E,["tfdt"])[0],x=gi(E,["tfhd"])[0],M=gi(E,["trun"]);if(A&&(p=Dp(A).baseMediaDecodeTime),M.length&&x){const z=wp(M,p,x);let ae=0;z.forEach(function(Q){const he="utf-8",_e=new TextDecoder(he),Ke=S.slice(ae,ae+Q.size);if(gi(Ke,["vtte"])[0]){ae+=Q.size;return}gi(Ke,["vttc"]).forEach(function(Ws){const Xs=gi(Ws,["payl"])[0],Ks=gi(Ws,["sttg"])[0],Ys=Q.pts/o,Yr=(Q.pts+Q.duration)/o;let Le,Qs;if(Xs)try{Le=_e.decode(Xs)}catch(Mt){console.error(Mt)}if(Ks)try{Qs=_e.decode(Ks)}catch(Mt){console.error(Mt)}Q.duration&&Le&&d.push({cueText:Le,start:Ys,end:Yr,settings:Qs})}),ae+=Q.size})}}),d}},ca=fi,$u=function(o){var l=o[1]&31;return l<<=8,l|=o[2],l},Xr=function(o){return!!(o[1]&64)},Kr=function(o){var l=0;return(o[3]&48)>>>4>1&&(l+=o[4]+1),l},kp=function(o,l){var d=$u(o);return d===0?"pat":d===l?"pmt":l?"pes":null},Ip=function(o){var l=Xr(o),d=4+Kr(o);return l&&(d+=o[d]+1),(o[d+10]&31)<<8|o[d+11]},Pp=function(o){var l={},d=Xr(o),h=4+Kr(o);if(d&&(h+=o[h]+1),!!(o[h+5]&1)){var p,m,S;p=(o[h+1]&15)<<8|o[h+2],m=3+p-4,S=(o[h+10]&15)<<8|o[h+11];for(var E=12+S;E<m;){var A=h+E;l[(o[A+1]&31)<<8|o[A+2]]=o[A],E+=((o[A+3]&15)<<8|o[A+4])+5}return l}},Op=function(o,l){var d=$u(o),h=l[d];switch(h){case ca.H264_STREAM_TYPE:return"video";case ca.ADTS_STREAM_TYPE:return"audio";case ca.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Lp=function(o){var l=Xr(o);if(!l)return null;var d=4+Kr(o);if(d>=o.byteLength)return null;var h=null,p;return p=o[d+7],p&192&&(h={},h.pts=(o[d+9]&14)<<27|(o[d+10]&255)<<20|(o[d+11]&254)<<12|(o[d+12]&255)<<5|(o[d+13]&254)>>>3,h.pts*=4,h.pts+=(o[d+13]&6)>>>1,h.dts=h.pts,p&64&&(h.dts=(o[d+14]&14)<<27|(o[d+15]&255)<<20|(o[d+16]&254)<<12|(o[d+17]&255)<<5|(o[d+18]&254)>>>3,h.dts*=4,h.dts+=(o[d+18]&6)>>>1)),h},ha=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}},Rp=function(o){for(var l=4+Kr(o),d=o.subarray(l),h=0,p=0,m=!1,S;p<d.byteLength-3;p++)if(d[p+2]===1){h=p+5;break}for(;h<d.byteLength;)switch(d[h]){case 0:if(d[h-1]!==0){h+=2;break}else if(d[h-2]!==0){h++;break}p+3!==h-2&&(S=ha(d[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0));do h++;while(d[h]!==1&&h<d.length);p=h-2,h+=3;break;case 1:if(d[h-1]!==0||d[h-2]!==0){h+=3;break}S=ha(d[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0),p=h-2,h+=3;break;default:h+=3;break}return d=d.subarray(p),h-=p,p=0,d&&d.byteLength>3&&(S=ha(d[p+3]&31),S==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0)),m},Mp={parseType:kp,parsePat:Ip,parsePmt:Pp,parsePayloadUnitStartIndicator:Xr,parsePesType:Op,parsePesTime:Lp,videoPacketContainsKeyFrame:Rp},ju=fi,es=ru.handleRollover,Ae={};Ae.ts=Mp,Ae.aac=sa;var Pi=we.ONE_SECOND_IN_TS,nt=188,jt=71,Np=function(o,l){for(var d=0,h=nt,p,m;h<o.byteLength;){if(o[d]===jt&&o[h]===jt){switch(p=o.subarray(d,h),m=Ae.ts.parseType(p,l.pid),m){case"pat":l.pid=Ae.ts.parsePat(p);break;case"pmt":var S=Ae.ts.parsePmt(p);l.table=l.table||{},Object.keys(S).forEach(function(E){l.table[E]=S[E]});break}d+=nt,h+=nt;continue}d++,h++}},Hu=function(o,l,d){for(var h=0,p=nt,m,S,E,A,x,M=!1;p<=o.byteLength;){if(o[h]===jt&&(o[p]===jt||p===o.byteLength)){switch(m=o.subarray(h,p),S=Ae.ts.parseType(m,l.pid),S){case"pes":E=Ae.ts.parsePesType(m,l.table),A=Ae.ts.parsePayloadUnitStartIndicator(m),E==="audio"&&A&&(x=Ae.ts.parsePesTime(m),x&&(x.type="audio",d.audio.push(x),M=!0));break}if(M)break;h+=nt,p+=nt;continue}h++,p++}for(p=o.byteLength,h=p-nt,M=!1;h>=0;){if(o[h]===jt&&(o[p]===jt||p===o.byteLength)){switch(m=o.subarray(h,p),S=Ae.ts.parseType(m,l.pid),S){case"pes":E=Ae.ts.parsePesType(m,l.table),A=Ae.ts.parsePayloadUnitStartIndicator(m),E==="audio"&&A&&(x=Ae.ts.parsePesTime(m),x&&(x.type="audio",d.audio.push(x),M=!0));break}if(M)break;h-=nt,p-=nt;continue}h--,p--}},Bp=function(o,l,d){for(var h=0,p=nt,m,S,E,A,x,M,z,ae,Q=!1,he={data:[],size:0};p<o.byteLength;){if(o[h]===jt&&o[p]===jt){switch(m=o.subarray(h,p),S=Ae.ts.parseType(m,l.pid),S){case"pes":if(E=Ae.ts.parsePesType(m,l.table),A=Ae.ts.parsePayloadUnitStartIndicator(m),E==="video"&&(A&&!Q&&(x=Ae.ts.parsePesTime(m),x&&(x.type="video",d.video.push(x),Q=!0)),!d.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;
188if(Ae.ts.videoPacketContainsKeyFrame(M)){var _e=Ae.ts.parsePesTime(M);_e?(d.firstKeyFrame=_e,d.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(m),he.size+=m.byteLength}break}if(Q&&d.firstKeyFrame)break;h+=nt,p+=nt;continue}h++,p++}for(p=o.byteLength,h=p-nt,Q=!1;h>=0;){if(o[h]===jt&&o[p]===jt){switch(m=o.subarray(h,p),S=Ae.ts.parseType(m,l.pid),S){case"pes":E=Ae.ts.parsePesType(m,l.table),A=Ae.ts.parsePayloadUnitStartIndicator(m),E==="video"&&A&&(x=Ae.ts.parsePesTime(m),x&&(x.type="video",d.video.push(x),Q=!0));break}if(Q)break;h-=nt,p-=nt;continue}h--,p--}},Up=function(o,l){if(o.audio&&o.audio.length){var d=l;(typeof d>"u"||isNaN(d))&&(d=o.audio[0].dts),o.audio.forEach(function(m){m.dts=es(m.dts,d),m.pts=es(m.pts,d),m.dtsTime=m.dts/Pi,m.ptsTime=m.pts/Pi})}if(o.video&&o.video.length){var h=l;if((typeof h>"u"||isNaN(h))&&(h=o.video[0].dts),o.video.forEach(function(m){m.dts=es(m.dts,h),m.pts=es(m.pts,h),m.dtsTime=m.dts/Pi,m.ptsTime=m.pts/Pi}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=es(p.dts,h),p.pts=es(p.pts,h),p.dtsTime=p.dts/Pi,p.ptsTime=p.pts/Pi}}},Fp=function(o){for(var l=!1,d=0,h=null,p=null,m=0,S=0,E;o.length-S>=3;){var A=Ae.aac.parseType(o,S);switch(A){case"timed-metadata":if(o.length-S<10){l=!0;break}if(m=Ae.aac.parseId3TagSize(o,S),m>o.length){l=!0;break}p===null&&(E=o.subarray(S,S+m),p=Ae.aac.parseAacTimestamp(E)),S+=m;break;case"audio":if(o.length-S<7){l=!0;break}if(m=Ae.aac.parseAdtsSize(o,S),m>o.length){l=!0;break}h===null&&(E=o.subarray(S,S+m),h=Ae.aac.parseSampleRate(E)),d++,S+=m;break;default:S++;break}if(l)return null}if(h===null||p===null)return null;var x=Pi/h,M={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+d*1024*x,pts:p+d*1024*x}]};return M},qp=function(o){var l={pid:null,table:null},d={};Np(o,l);for(var h in l.table)if(l.table.hasOwnProperty(h)){var p=l.table[h];switch(p){case ju.H264_STREAM_TYPE:d.video=[],Bp(o,l,d),d.video.length===0&&delete d.video;break;case ju.ADTS_STREAM_TYPE:d.audio=[],Hu(o,l,d),d.audio.length===0&&delete d.audio;break}}return d},$p=function(o,l){var d=Ae.aac.isLikelyAacData(o),h;return d?h=Fp(o):h=qp(o),!h||!h.audio&&!h.video?null:(Up(h,l),h)},jp={inspect:$p,parseAudioPes_:Hu};const Hp=function(o,l){l.on("data",function(d){const h=d.initSegment;d.initSegment={data:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength};const p=d.data;d.data=p.buffer,o.postMessage({action:"data",segment:d,byteOffset:p.byteOffset,byteLength:p.byteLength},[d.data])}),l.on("done",function(d){o.postMessage({action:"done"})}),l.on("gopInfo",function(d){o.postMessage({action:"gopInfo",gopInfo:d})}),l.on("videoSegmentTimingInfo",function(d){const h={start:{decode:we.videoTsToSeconds(d.start.dts),presentation:we.videoTsToSeconds(d.start.pts)},end:{decode:we.videoTsToSeconds(d.end.dts),presentation:we.videoTsToSeconds(d.end.pts)},baseMediaDecodeTime:we.videoTsToSeconds(d.baseMediaDecodeTime)};d.prependedContentDuration&&(h.prependedContentDuration=we.videoTsToSeconds(d.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:h})}),l.on("audioSegmentTimingInfo",function(d){const h={start:{decode:we.videoTsToSeconds(d.start.dts),presentation:we.videoTsToSeconds(d.start.pts)},end:{decode:we.videoTsToSeconds(d.end.dts),presentation:we.videoTsToSeconds(d.end.pts)},baseMediaDecodeTime:we.videoTsToSeconds(d.baseMediaDecodeTime)};d.prependedContentDuration&&(h.prependedContentDuration=we.videoTsToSeconds(d.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:h})}),l.on("id3Frame",function(d){o.postMessage({action:"id3Frame",id3Frame:d})}),l.on("caption",function(d){o.postMessage({action:"caption",caption:d})}),l.on("trackinfo",function(d){o.postMessage({action:"trackinfo",trackInfo:d})}),l.on("audioTimingInfo",function(d){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:we.videoTsToSeconds(d.start),end:we.videoTsToSeconds(d.end)}})}),l.on("videoTimingInfo",function(d){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:we.videoTsToSeconds(d.start),end:we.videoTsToSeconds(d.end)}})}),l.on("log",function(d){o.postMessage({action:"log",log:d})})};class Vu{constructor(l,d){this.options=d||{},this.self=l,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Ff.Transmuxer(this.options),Hp(this.self,this.transmuxer)}pushMp4Captions(l){this.captionParser||(this.captionParser=new Cp,this.captionParser.init());const d=new Uint8Array(l.data,l.byteOffset,l.byteLength),h=this.captionParser.parse(d,l.trackIds,l.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:d.buffer},[d.buffer])}initMp4WebVttParser(l){this.webVttParser||(this.webVttParser=new qu);const d=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.webVttParser.init(d)}getMp4WebVttText(l){this.webVttParser||(this.webVttParser=new qu);const d=new Uint8Array(l.data,l.byteOffset,l.byteLength),h=this.webVttParser.parseSegment(d);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:h||[],data:d.buffer},[d.buffer])}probeMp4StartTime({timescales:l,data:d}){const h=Gs.startTime(l,d);this.self.postMessage({action:"probeMp4StartTime",startTime:h,data:d},[d.buffer])}probeMp4Tracks({data:l}){const d=Gs.tracks(l);this.self.postMessage({action:"probeMp4Tracks",tracks:d,data:l},[l.buffer])}probeEmsgID3({data:l,offset:d}){const h=Gs.getEmsgID3(l,d);this.self.postMessage({action:"probeEmsgID3",id3Frames:h,emsgData:l},[l.buffer])}probeTs({data:l,baseStartTime:d}){const h=typeof d=="number"&&!isNaN(d)?d*we.ONE_SECOND_IN_TS:void 0,p=jp.inspect(l,h);let m=null;p&&(m={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},m.hasVideo&&(m.videoStart=p.video[0].ptsTime),m.hasAudio&&(m.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:m,data:l},[l.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(l){const d=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(d)}reset(){this.transmuxer.reset()}setTimestampOffset(l){const d=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(we.secondsToVideoTs(d)))}setAudioAppendStart(l){this.transmuxer.setAudioAppendStart(Math.ceil(we.secondsToVideoTs(l.appendStart)))}setRemux(l){this.transmuxer.setRemux(l.remux)}flush(l){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(l){this.transmuxer.alignGopsWith(l.gopsToAlignWith.slice())}}
188self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new Vu(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new Vu(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var c0=Id(l0);const h0=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:u,videoFrameDtsTime:c,videoFramePtsTime:f}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:u});const g=s.data.segment.boxes||{data:s.data.segment.data},_={type:i,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof f<"u"&&(_.videoFramePtsTime=f),t(_)},d0=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},f0=(s,e)=>{e.gopInfo=s.data.gopInfo},Ld=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:u,onAudioTimingInfo:c,onVideoTimingInfo:f,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:_,onId3:k,onCaptions:D,onDone:L,onEndedTimeline:T,onTransmuxerLog:P,isEndOfTimeline:B,segment:N,triggerSegmentEventFn:O}=s,H={buffer:[]};let q=B;const $=V=>{e.currentTransmux===s&&(V.data.action==="data"&&h0(V,H,a),V.data.action==="trackinfo"&&u(V.data.trackInfo),V.data.action==="gopInfo"&&f0(V,H),V.data.action==="audioTimingInfo"&&c(V.data.audioTimingInfo),V.data.action==="videoTimingInfo"&&f(V.data.videoTimingInfo),V.data.action==="videoSegmentTimingInfo"&&g(V.data.videoSegmentTimingInfo),V.data.action==="audioSegmentTimingInfo"&&_(V.data.audioSegmentTimingInfo),V.data.action==="id3Frame"&&k([V.data.id3Frame],V.data.id3Frame.dispatchType),V.data.action==="caption"&&D(V.data.caption),V.data.action==="endedtimeline"&&(q=!1,T()),V.data.action==="log"&&P(V.data.log),V.data.type==="transmuxed"&&(q||(e.onmessage=null,d0({transmuxedData:H,callback:L}),Rd(e))))},R=()=>{const V={message:"Received an error message from the transmuxer worker",metadata:{errorType:U.Error.StreamingFailedToTransmuxSegment,segmentInfo:Mi({segment:N})}};L(null,V)};if(e.onmessage=$,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 V=t instanceof ArrayBuffer?t:t.buffer,v=t instanceof ArrayBuffer?0:t.byteOffset;O({type:"segmenttransmuxingstart",segment:N}),e.postMessage({action:"push",data:V,byteOffset:v,byteLength:t.byteLength},[V])}B&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Rd=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():Ld(s.currentTransmux))},rc=(s,e)=>{s.postMessage({action:e}),Rd(s)},Md=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,rc(e,s);return}e.transmuxQueue.push(rc.bind(null,e,s))},p0=s=>{Md("reset",s)},m0=s=>{Md("endTimeline",s)},Nd=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,Ld(s);return}s.transmuxer.transmuxQueue.push(s)},g0=s=>{const e=new c0;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 Va={reset:p0,endTimeline:m0,transmux:Nd,createTransmuxer:g0};const ds=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=Ve({},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 u=[a?s.data:s.data.buffer];e.postMessage(r,u)}else e.postMessage(r)},Yt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Bd="wvtt",mo=s=>{s.forEach(e=>{e.abort()})},_0=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),y0=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},iu=(s,e)=>{const{requestType:t}=e,i=ji({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Yt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Yt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Yt.FAILURE,xhr:e,metadata:i}:null},nc=(s,e,t,i)=>(r,n)=>{const a=n.response,u=iu(r,n);if(u)return t(u,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yt.FAILURE,xhr:n},s);const c=new DataView(a),f=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let _=0;_<e.length;_++)e[_].bytes=f;const g={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:g}),t(null,s)},T0=(s,e)=>{e===Bd&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},v0=(s,e,t)=>{e===Bd&&ds({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},Ud=(s,e)=>{const t=Do(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:Yt.FAILURE,metadata:{mediaType:r}})}ds({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>
188(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"&&T0(s,n.codec))}),e(null))})},b0=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=iu(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,Ud(s,function(u){if(u)return u.xhr=r,u.status=r.status,e(u,s);e(null,s)})},S0=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=iu(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const u=t==="arraybuffer"||!n.responseText?n.response:o0(n.responseText.substring(s.lastReachedChar||0));return s.stats=_0(n),s.key?s.encryptedBytes=new Uint8Array(u):s.bytes=new Uint8Array(u),e(null,s)},E0=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})=>{const L=s.map&&s.map.tracks||{},T=!!(L.audio&&L.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 O=i.bind(null,s,"video","end"),H=()=>Nd({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:T,onData:q=>{q.type=q.type==="combined"?"video":q.type,g(s,q)},onTrackInfo:q=>{t&&(T&&(q.isMuxed=!0),t(s,q))},onAudioTimingInfo:q=>{P&&typeof q.start<"u"&&(P(q.start),P=null),B&&typeof q.end<"u"&&B(q.end)},onVideoTimingInfo:q=>{N&&typeof q.start<"u"&&(N(q.start),N=null),O&&typeof q.end<"u"&&O(q.end)},onVideoSegmentTimingInfo:q=>{const $={pts:{start:q.start.presentation,end:q.end.presentation},dts:{start:q.start.decode,end:q.end.decode}};D({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:$}),r(q)},onAudioSegmentTimingInfo:q=>{const $={pts:{start:q.start.pts,end:q.end.pts},dts:{start:q.start.dts,end:q.end.dts}};D({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:$}),n(q)},onId3:(q,$)=>{a(s,q,$)},onCaptions:q=>{u(s,[q])},isEndOfTimeline:c,onEndedTimeline:()=>{f()},onTransmuxerLog:k,onDone:(q,$)=>{_&&(q.type=q.type==="combined"?"video":q.type,D({type:"segmenttransmuxingcomplete",segment:s}),_($,s,q))},segment:s,triggerSegmentEventFn:D});ds({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:q=>{s.bytes=e=q.data;const $=q.result;$&&(t(s,{hasAudio:$.hasAudio,hasVideo:$.hasVideo,isMuxed:T}),t=null),H()}})},Fd=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})=>{let L=new Uint8Array(e);if(Vg(L)){s.isFmp4=!0;const{tracks:T}=s.map;if(T.text&&(!T.audio||!T.video)){g(s,{data:L,type:"text"}),v0(s,T.text.codec,_);return}const B={isFmp4:!0,hasVideo:!!T.video,hasAudio:!!T.audio};T.audio&&T.audio.codec&&T.audio.codec!=="enca"&&(B.audioCodec=T.audio.codec),T.video&&T.video.codec&&T.video.codec!=="encv"&&(B.videoCodec=T.video.codec),T.video&&T.audio&&(B.isMuxed=!0),t(s,B);const N=(O,H)=>{g(s,{data:L,type:B.hasAudio&&!B.isMuxed?"audio":"video"}),H&&H.length&&a(s,H),O&&O.length&&u(s,O),_(null,s,{})};ds({action:"probeMp4StartTime",timescales:s.map.timescales,data:L,transmuxer:s.transmuxer,callback:({data:O,startTime:H})=>{e=O.buffer,s.bytes=L=O,B.hasAudio&&!B.isMuxed&&i(s,"audio","start",H),B.hasVideo&&i(s,"video","start",H),ds({action:"probeEmsgID3",data:L,transmuxer:s.transmuxer,offset:H,callback:({emsgData:q,id3Frames:$})=>{if(e=q.buffer,s.bytes=L=q,!T.video||!q.byteLength||!s.transmuxer){N(void 0,$);return}ds({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:L,timescales:s.map.timescales,trackIds:[T.video.id],callback:R=>{e=R.data.buffer,s.bytes=L=R.data,R.logs.forEach(function(V){k(De(V,{stream:"mp4CaptionParser"}))}),N(R.captions,$)}})}})}});return}if(!s.transmuxer){_(null,s,{});return}if(typeof s.container>"u"&&(s.container=Do(L)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),_(null,s,{});return}E0({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})},qd=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const u=f=>{if(f.data.source===s){i.removeEventListener("message",u);const g=f.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};i.onerror=()=>{const f="An error occurred in the decryption worker",g=Mi({segment:r}),_={message:f,metadata:{error:new Error(f),errorType:U.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(_,r)},i.addEventListener("message",u);let c;e.bytes.slice?c=e.bytes.slice():c=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(Cd({source:s,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},C0=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})=>{D({type:"segmentdecryptionstart"}),qd({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:_},L=>{e.bytes=L,D({type:"segmentdecryptioncomplete",segment:e}),Fd({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})})},D0=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})=>{let L=0,T=!1;return(P,B)=>{if(!T){if(P)return T=!0,mo(s),_(P,B);if(L+=1,L===s.length){const N=function(){if(B.encryptedBytes)return C0({decryptionWorker:e,segment:B,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D});Fd({segment:B,bytes:B.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:k,triggerSegmentEventFn:D})};if(B.endOfAllRequests=Date.now(),B.map&&B.map.encryptedBytes&&!B.map.bytes)return D({type:"segmentdecryptionstart",segment:B}),qd({decryptionWorker:e,id:B.requestId+"-init",encryptedBytes:B.map.encryptedBytes,key:B.map.key,segment:B,doneFn:_},O=>{B.map.bytes=O,D({type:"segmentdecryptioncomplete",segment:B}),Ud(B,H=>{if(H)return mo(s),_(H,B);N()})});N()}}}},A0=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},w0=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g})=>_=>{if(!_.target.aborted)return s.stats=De(s.stats,y0(_)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(_,s)},x0=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:k,endedTimelineFn:D,dataFn:L,doneFn:T,onTransmuxerLog:P,triggerSegmentEventFn:B})=>{const N=[],O=D0({activeXhrs:N,decryptionWorker:t,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:k,endedTimelineFn:D,dataFn:L,doneFn:T,onTransmuxerLog:P,triggerSegmentEventFn:B});if(i.key&&!i.key.bytes){const V=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&V.push(i.map.
vendor: 4,388 bytes, line 188
188key);const v=De(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=nc(i,V,O,B),F={uri:i.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:F});const K=s(v,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=De(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),j=nc(i,[i.map.key],O,B),G={uri:i.map.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:G});const ee=s(K,j);N.push(ee)}const v=De(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:fo(i.map),requestType:"segment-media-initialization"}),C=b0({segment:i,finishProcessingFn:O,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const F=s(v,C);N.push(F)}const H=De(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:fo(i),requestType:"segment"}),q=S0({segment:i,finishProcessingFn:O,responseType:H.responseType,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const $=s(H,q);$.addEventListener("progress",w0({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:k,endedTimelineFn:D,dataFn:L})),N.push($);const R={};return N.forEach(V=>{V.addEventListener("loadend",A0({loadendState:R,abortFn:r}))}),()=>mo(N)},sn=It("PlaylistSelector"),ac=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||""})},fs=function(s,e){if(!s)return"";const t=w.getComputedStyle(s);return t?t[e]:""},ps=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})},su=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||w.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||w.Number.MAX_VALUE,t-i},k0=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||w.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||w.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let $d=function(s){const{main:e,bandwidth:t,playerWidth:i,playerHeight:r,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:u}=s;if(!e)return;const c={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:a};let f=e.playlists;pt.isAudioOnly(e)&&(f=u.getAudioTrackPlaylists_(),c.audioOnly=!0);let g=f.map(R=>{let V;const v=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,C=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return V=R.attributes&&R.attributes.BANDWIDTH,V=V||w.Number.MAX_VALUE,{bandwidth:V,width:v,height:C,playlist:R}});ps(g,(R,V)=>R.bandwidth-V.bandwidth),g=g.filter(R=>!pt.isIncompatible(R.playlist));let _=g.filter(R=>pt.isEnabled(R.playlist));_.length||(_=g.filter(R=>!pt.isDisabled(R.playlist)));const k=_.filter(R=>R.bandwidth*Ye.BANDWIDTH_VARIANCE<t);let D=k[k.length-1];const L=k.filter(R=>R.bandwidth===D.bandwidth)[0];if(a===!1){const R=L||_[0]||g[0];if(R&&R.playlist){let V="sortedPlaylistReps";return L&&(V="bandwidthBestRep"),_[0]&&(V="enabledPlaylistReps"),sn(`choosing ${ac(R)} using ${V} with options`,c),R.playlist}return sn("could not choose a playlist with options",c),null}const T=k.filter(R=>R.width&&R.height);ps(T,(R,V)=>R.width-V.width);const P=T.filter(R=>R.width===i&&R.height===r);D=P[P.length-1];const B=P.filter(R=>R.bandwidth===D.bandwidth)[0];let N,O,H;B||(N=T.filter(R=>n==="cover"?R.width>i&&R.height>r:R.width>i||R.height>r),O=N.filter(R=>R.width===N[0].width&&R.height===N[0].height),D=O[O.length-1],H=O.filter(R=>R.bandwidth===D.bandwidth)[0]);let q;if(u.leastPixelDiffSelector){const R=T.map(V=>(V.pixelDiff=Math.abs(V.width-i)+Math.abs(V.height-r),V));ps(R,(V,v)=>V.pixelDiff===v.pixelDiff?v.bandwidth-V.bandwidth:V.pixelDiff-v.pixelDiff),q=R[0]}const $=q||H||B||L||_[0]||g[0];if($&&$.playlist){let R="sortedPlaylistReps";return q?R="leastPixelDiffRep":H?R="resolutionPlusOneRep":B?R="resolutionBestRep":L?R="bandwidthBestRep":_[0]&&(R="enabledPlaylistReps"),sn(`choosing ${ac($)} using ${R} with options`,c),$.playlist}
188return sn("could not choose a playlist with options",c),null};const oc=function(){let s=this.useDevicePixelRatio&&w.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),$d({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(fs(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(fs(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?fs(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},I0=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&&w.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),$d({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(fs(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(fs(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?fs(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},P0=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:u,syncController:c}=s,f=e.playlists.filter(L=>!pt.isIncompatible(L));let g=f.filter(pt.isEnabled);g.length||(g=f.filter(L=>!pt.isDisabled(L)));const k=g.filter(pt.hasAttribute.bind(null,"BANDWIDTH")).map(L=>{const P=c.getSyncPoint(L,r,u,t)?1:2,N=pt.estimateSegmentRequestTime(n,i,L)*P-a;return{playlist:L,rebufferingImpact:N}}),D=k.filter(L=>L.rebufferingImpact<=0);return ps(D,(L,T)=>su(T.playlist,L.playlist)),D.length?D[0]:(ps(k,(L,T)=>L.rebufferingImpact-T.rebufferingImpact),k[0]||null)},O0=function(){const s=this.playlists.main.playlists.filter(pt.isEnabled);return ps(s,(t,i)=>su(t,i)),s.filter(t=>!!hr(this.playlists.main,t).video)[0]||null},L0=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 jd(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const R0=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,u=t,c=!1;const f=n[i];f&&(a=f.label,u=f.language,c=f.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:c,label:a,language:u},!1).track}}},M0=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=w.WebKitDataCue||w.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const u=new i(r.startTime+t,r.endTime+t,a.text);u.line=a.line,u.align="left",u.position=a.position,u.positionAlign="line-left",s[n].addCue(u)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},N0=function(s){Object.defineProperties(s.frame,{id:{get(){return U.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return U.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return U.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},B0=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=w.WebKitDataCue||w.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const _=g.cueTime+t;typeof _!="number"||w.isNaN(_)||_<0||!(_<1/0)||!g.frames||!g.frames.length||g.frames.forEach(k=>{const D=new r(_,_,k.value||k.url||k.data||"");D.frame=k,D.value=k,N0(D),n.addCue(D)})}),!n.cues||!n.cues.length))return;const a=n.cues,u=[];for(let g=0;g<a.length;g++)a[g]&&u.push(a[g]);const c=u.reduce((g,_)=>{const k=g[_.startTime]||[];return k.push(_),g[_.startTime]=k,g},{}),f=Object.keys(c).sort((g,_)=>Number(g)-Number(_));f.forEach((g,_)=>{const k=c[g],D=isFinite(i)?i:g,L=Number(f[_+1])||D;
188k.forEach(T=>{T.endTime=L})})},U0={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"},F0=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),q0=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=w.WebKitDataCue||w.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(F0.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:U0[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()})},uc=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,U.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},nr=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)},$0=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}},j0=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Ni.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},H0=(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)},V0=(s,e,t,i)=>{const r=Math.ceil((e-i)*Ni.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Ni.ONE_SECOND_IN_TS),a=s.slice();let u=s.length;for(;u--&&!(s[u].pts<=n););if(u===-1)return a;let c=u+1;for(;c--&&!(s[c].pts<=r););return c=Math.max(c,0),a.splice(c,u-c+1),a},z0=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},G0=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]},ir=1,W0=500,lc=s=>typeof s=="number"&&isFinite(s),rn=1/60,X0=(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,K0=(s,e,t)=>{let i=e-Ye.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},ss=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:u=[]},mediaIndex:c,partIndex:f,timeline:g}=s,_=u.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 D=typeof f=="number",L=s.segment.uri?"segment":"pre-segment",T=D?ad({preloadSegment:i})-1:0;return`${L} [${n+c}/${n+_}]`+(D?` part [${f}/${T}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(D?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${k}] playlist [${a}]`},cc=s=>`${s}TimingInfo`,Y0=({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,go=({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},Q0=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)},J0=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},vi=s=>{const e=s.pendingSegment_;if(!e)return;if(go({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&Q0(s.timelineChangeController_)){if(J0(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},Z0=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=w.BigInt(n)-w.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},hc=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+Xt:!1,e2=(s,e)=>{if(e!=="hls")return null;const t=Z0({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=hc({segmentDuration:t,maxDuration:i*2}),n=hc({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`;
vendor: 4,455 bytes, line 188
188return r||n?{severity:r?"warn":"info",message:a}:null},Mi=({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 _o extends U.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_=It(`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_():vi(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(Ve({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():vi(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(Ve({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():vi(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():vi(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Va.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_&&w.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_())}
188abort(){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,w.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_&&Va.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Je();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=Dn(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=Dd(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: 189currentTime: ${this.currentTime_()} 190bufferedEnd: ${ja(this.buffered_())} 191`,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 u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const c=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=c}}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_&&(w.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"}))}
191resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Va.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_=V0(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const u in this.inbandTextTracks_)nr(e,t,this.inbandTextTracks_[u]);nr(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),W0)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Mi({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=ja(e)||0,i=Jo(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 u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=G0(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const k=a[this.mediaIndex],D=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=k.end?k.end:t,k.parts&&k.parts[D+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=D+1):u.mediaIndex=this.mediaIndex+1}else{let k,D,L;const T=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 192For TargetTime: ${T}. 193CurrentTime: ${this.currentTime_()} 194BufferedEnd: ${t} 195Fetch At Buffer: ${this.fetchAtBuffer_} 196`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const P=this.getSyncInfoFromMediaSequenceSync_(T);if(!P){const B="No sync info found while using media sequence sync";return this.error({message:B,metadata:{errorType:U.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,D=P.partIndex,L=P.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const P=pt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:T,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});k=P.segmentIndex,D=P.partIndex,L=P.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${T}`:`currentTime ${T}`,u.mediaIndex=k,u.startOfSegment=L,u.partIndex=D,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const c=a[u.mediaIndex];let f=c&&typeof u.partIndex=="number"&&c.parts&&c.parts[u.partIndex];if(!c||typeof u.partIndex=="number"&&!f)return null;typeof u.partIndex!="number"&&c.parts&&(u.partIndex=0,f=c.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&f&&!g&&!f.independent)if(u.partIndex===0){const k=a[u.mediaIndex-1],D=k.parts&&k.parts.length&&k.parts[k.parts.length-1];D&&D.independent&&(u.mediaIndex-=1,u.partIndex=k.parts.length-1,u.independent="previous segment")}else c.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const _=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}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:u,forceTimestampOffset:c,getMediaInfoForTime:f}=e,g=i.segments[r],_=typeof u=="number"&&g.parts[u],k={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:_?u:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:_&&_.duration||g.duration,segment:g,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},D=typeof c<"u"?c:this.isPendingTimestampOffset_;k.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:D});
196const L=ja(this.sourceUpdater_.audioBuffered());return typeof L=="number"&&(k.audioAppendStart=L-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(k.gopsToAlignWith=j0(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),k}timestampOffsetForSegment_(e){return Y0(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=pt.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=yy(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const u=P0({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const f=n-a-u.rebufferingImpact;let g=.5;a<=Xt&&(g=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=u.playlist.attributes.BANDWIDTH*Ye.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${ss(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:Mi({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||{},z0(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_():vi(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=cc(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():vi(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 u=n[a.stream];u.startTime=Math.min(u.startTime,a.startTime+r),u.endTime=Math.max(u.endTime,a.endTime+r),u.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:u,endTime:c,captions:f}=n[a],g=this.inbandTextTracks_;this.logger_(`adding cues from ${u} -> ${c} for ${a}`),R0(g,this.vhs_.tech_,a),nr(u,c,g[a]),M0({captionArray:f,inbandTextTracks:g,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_()?!go({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||go({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_()){vi(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.ke
196y,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[cc(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=Dn(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: "+Bi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Bi(a).join(", "));const u=n.length?n.start(0):0,c=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(c-u<=ir&&g-f<=ir){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Bi(n).join(", ")}, video buffer: ${Bi(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_()-ir;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 ${ir}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=w.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},ir*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===_d){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:U.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const u=[r];let c=r.byteLength;i&&(u.unshift(i),c+=i.byteLength),n=L0({bytes:c,segments:u})}const a={segmentInfo:Mi({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_()){vi(this),this.loadQueue_.push(()=>{const t=Ve({},e,{forceTimestampOffset:!0});Ve(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_
196(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 197${jd(e.uri)} 198${ss(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=x0({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:u,level:c,stream:f})=>{this.logger_(`${ss(e)} logged from transmuxer stream ${f} as a ${c}: ${u}`)},triggerSegmentEventFn:({type:u,segment:c,keyInfo:f,trackInfo:g,timingInfo:_})=>{const D={segmentInfo:Mi({segment:c})};f&&(D.keyInfo=f),g&&(D.trackInfo=g),_&&(D.timingInfo=_),this.trigger({type:u,metadata:D})}})}trimBackBuffer_(e){const t=K0(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},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===t.timeline&&(u.videoTimingInfo?a.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(a.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),t.key){const c=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=c}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<rn){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${rn}`);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===Yt.ABORTED)return;if(this.pause(),e.code===Yt.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_=H0(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:u,audioTimingInfo:c}){if(typeof e<"u")return e;if(!a)return c.start;const f=t.segments[i-1];return i===0||!f||typeof f.start>"u"||f.end!==r+n?r:u.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,u=!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++,u&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}
198checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=X0(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 c={segmentInfo:Mi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:c})}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=e2(e,this.sourceType_);if(t&&(t.severity==="warn"?U.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 ${ss(e)}`);return}this.logger_(`Appended ${ss(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"} ${ss(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<rn){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${rn}`);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(!lc(i)||!lc(r))return;nr(i,r,this.segmentMetadataTrack_);const n=w.WebKitDataCue||w.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.ur
198i,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},u=JSON.stringify(a),c=new n(i,r,u);c.value=a,this.segmentMetadataTrack_.addCue(c)}}function oi(){}const Hd=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},t2=["video","audio"],yo=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},i2=(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},ms=(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(),ms("audio",e),ms("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||yo(s,e))){if(i.type!==s){if(t=i2(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,ms(s,e);return}}},Vd=(s,e)=>{const t=e[`${s}Buffer`],i=Hd(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},Gt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,bt={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(Gt(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===_d?"(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(Gt(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`];Gt(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){U.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){U.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(Gt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){U.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Hd(s),r=gs(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(Vd(s,e),!!Gt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){U.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=gs(s);if(!Gt(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const c={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:c}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(f){c.errorType=U.Error.StreamingCodecsChangeError,c.error=f,f.metadata=c,t.error_=f,t.trigger("error"),U.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},St=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),ms(s,e)},dc=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=my(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_`])}ms(s,e)};class zd extends U.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>ms("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=It("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=dc("video",this),this.onAudioUpdateEnd_=dc("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())}
198triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){St({type:"mediaSource",sourceUpdater:this,action:bt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){St({type:e,sourceUpdater:this,action:bt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){U.log.error("removeSourceBuffer is not supported!");return}St({type:"mediaSource",sourceUpdater:this,action:bt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!U.browser.IS_FIREFOX&&w.MediaSource&&w.MediaSource.prototype&&typeof w.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return w.SourceBuffer&&w.SourceBuffer.prototype&&typeof w.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){U.log.error("changeType is not supported!");return}St({type:e,sourceUpdater:this,action:bt.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(St({type:r,sourceUpdater:this,action:bt.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(c=>{this.appendBuffer.apply(this,c)})}}audioBuffered(){return Gt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Je()}videoBuffered(){return Gt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Je()}buffered(){const e=Gt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Gt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():_y(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=oi){St({type:"mediaSource",sourceUpdater:this,action:bt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=oi){typeof e!="string"&&(e=void 0),St({type:"mediaSource",sourceUpdater:this,action:bt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=oi){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}St({type:"audio",sourceUpdater:this,action:bt.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=oi){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}St({type:"video",sourceUpdater:this,action:bt.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(yo("audio",this)||yo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(St({type:"audio",sourceUpdater:this,action:bt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(St({type:"video",sourceUpdater:this,action:bt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&St({type:"audio",sourceUpdater:this,action:bt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&St({type:"video",sourceUpdater:this,action:bt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),t2.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Vd(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const fc=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),s2=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},pc=new Uint8Array(` 199 200`.split("").map(s=>s.charCodeAt(0)));
200class r2 extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class n2 extends _o{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 Je();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Je([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Dn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=pc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(pc,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){nr(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===Yt.TIMEOUT&&this.handleTimeout_(),e.code===Yt.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 w.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(u){this.stopForError({message:u.message,metadata:{errorType:U.Error.StreamingVttParserError,error:u}});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(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new w.VTTCue(u.startTime,u.endTime,u.text):u)}),$0(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 w.VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(u=>{const c=u.split(":"),f=c[0],g=c[1];a[f]=isNaN(g)?g:Number(g)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof w.WebVTT!="function")throw new r2;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof w.TextDecoder=="function"?t=new w.TextDecoder("utf8"):(t=w.WebVTT.StringDecoder(),i=!0);const r=new w.WebVTT.Parser(w,w.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{U.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=fc(a)),r.parse(a)}let n=e.bytes;i&&(n=fc(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,c=n/Ni.ONE_SECOND_IN_TS-a+t.mapping;
vendor: 4,839 bytes, lines 200-203
200if(e.cues.forEach(f=>{const g=f.endTime-f.startTime,_=this.handleRollover_(f.startTime+c,t.time);f.startTime=Math.max(_,0),f.endTime=Math.max(_+g,0)}),!i.syncInfo){const f=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(f,g-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*Ni.ONE_SECOND_IN_TS;const r=t*Ni.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Ni.ONE_SECOND_IN_TS}}const a2=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},o2=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=a2(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 w.VTTCue(i,i+a.duration,a.cueOut),r.adStartTime=i,r.adEndTime=i+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[u,c]=a.cueOutCont.split("/").map(parseFloat);r=new w.VTTCue(i,i+a.duration,""),r.adStartTime=i-u,r.adEndTime=r.adStartTime+c,e.addCue(r)}i+=a.duration}};class mc{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 u2{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 Gd{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=` 201`,a=i,u=t;this.start_=a,e.forEach((c,f)=>{const g=this.storage_.get(u),_=a,k=_+c.duration,D=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),L=new mc({start:_,end:k,appended:D,segmentIndex:f});c.syncInfo=L;let T=a;const P=(c.parts||[]).map((B,N)=>{const O=T,H=T+B.duration,q=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[N]&&g.partsSyncInfo[N].isAppended),$=new mc({start:O,end:H,appended:q,segmentIndex:f,partIndex:N});return T=H,n+=`Media Sequence: ${u}.${N} | Range: ${O} --> ${H} | Appended: ${q} 202`,B.syncInfo=$,$});r.set(u,new u2(L,P)),n+=`${jd(c.resolvedUri)} | Media Sequence: ${u} | Range: ${_} --> ${k} | Appended: ${D} 203`,u++,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 u=0;u<n;u++){const c=t[u];a-=c.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class gc extends Gd{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 l2=86400,za=[{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 u=a.getSyncInfoForTime(r);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const u=oo(e);r=r||0;for(let c=0;c<u.length;c++){const f=e.endList||r===0?c:u.length-(c+1),g=u[f],_=g.segment,k=s.timelineToDatetimeMappings[_.timeline];if(!k||!_.dateTimeObject)continue;let L=_.dateTimeObject.getTime()/1e3+k;
203if(_.parts&&typeof g.partIndex=="number")for(let P=0;P<g.partIndex;P++)L+=_.parts[P].duration;const T=Math.abs(r-L);if(a!==null&&(T===0||a<T))break;a=T,n={time:L,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return n}},{name:"Segment",run:(s,e,t,i,r)=>{let n=null,a=null;r=r||0;const u=oo(e);for(let c=0;c<u.length;c++){const f=e.endList||r===0?c:u.length-(c+1),g=u[f],_=g.segment,k=g.part&&g.part.start||_&&_.start;if(_.timeline===i&&typeof k<"u"){const D=Math.abs(r-k);if(a!==null&&a<D)break;(!n||a===null||a>=D)&&(a=D,n={time:k,segmentIndex:g.segmentIndex,partIndex:g.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 u=0;u<e.discontinuityStarts.length;u++){const c=e.discontinuityStarts[u],f=e.discontinuitySequence+u+1,g=s.discontinuities[f];if(g){const _=Math.abs(r-g.time);if(a!==null&&a<_)break;(!n||a===null||a>=_)&&(a=_,n={time:g.time,segmentIndex:c,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 c2 extends U.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Gd,i=new gc(t),r=new gc(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=It("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return za.find(({name:c})=>c==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const u of a){const{syncPoint:c,strategy:f}=u,{segmentIndex:g,time:_}=c;if(g<0)continue;const k=e.segments[g],D=_,L=D+k.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${g}. Time: [${D} -> ${L}]}`),r>=D&&r<L)return this.logger_("Found sync point with exact match: ",c),c}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+cr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let u=0;u<za.length;u++){const c=za[u],f=c.run(this,e,t,i,r,n);f&&(f.strategy=c.name,a.push({strategy:c.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 u=Math.abs(e[a].syncPoint[t.key]-t.value);u<r&&(r=u,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>l2){U.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],u,c;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}]`)),u=e.startOfSegment,c=t.end+a.mapping;else if(a)u=t.start+a.mapping,c=t.end+a.mapping;else return!1;return n&&(n.start=u,n.end=c),(!r.start||u<r.start)&&(r.start=u),r.end=c,!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,u=n-e.mediaIndex,c=Math.abs(u);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>c){let f;u<0?f=i.start-cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=i.end+cr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class h2 extends U.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 d2=Pd(Od(function(){var s=function(){function T(){this.listeners={}}var P=T.prototype;return P.on=function(N,O){this.listeners[N]||(this.listeners[N]=[]),this.listeners[N].push(O)},P.off=function(N,O){if(!this.listeners[N])return!1;var H=this.listeners[N].indexOf(O);return this.listeners[N]=this.listeners[N].slice(0),this.listeners[N].splice(H,1),H>
203-1},P.trigger=function(N){var O=this.listeners[N];if(O)if(arguments.length===2)for(var H=O.length,q=0;q<H;++q)O[q].call(this,arguments[1]);else for(var $=Array.prototype.slice.call(arguments,1),R=O.length,V=0;V<R;++V)O[V].apply(this,$)},P.dispose=function(){this.listeners={}},P.pipe=function(N){this.on("data",function(O){N.push(O)})},T}();function e(T){return T.subarray(0,T.byteLength-T[T.byteLength-1])}const t=function(){const T=[[[],[],[],[],[]],[[],[],[],[],[]]],P=T[0],B=T[1],N=P[4],O=B[4];let H,q,$;const R=[],V=[];let v,C,F,K,j,G;for(H=0;H<256;H++)V[(R[H]=H<<1^(H>>7)*283)^H]=H;for(q=$=0;!N[q];q^=v||1,$=V[$]||1)for(K=$^$<<1^$<<2^$<<3^$<<4,K=K>>8^K&255^99,N[q]=K,O[K]=q,F=R[C=R[v=R[q]]],G=F*16843009^C*65537^v*257^q*16843008,j=R[K]*257^K*16843008,H=0;H<4;H++)P[H][q]=j=j<<24^j>>>8,B[H][K]=G=G<<24^G>>>8;for(H=0;H<5;H++)P[H]=P[H].slice(0),B[H]=B[H].slice(0);return T};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,O;const H=this._tables[0][4],q=this._tables[1],$=P.length;let R=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");const V=P.slice(0),v=[];for(this._key=[V,v],B=$;B<4*$+28;B++)O=V[B-1],(B%$===0||$===8&&B%$===4)&&(O=H[O>>>24]<<24^H[O>>16&255]<<16^H[O>>8&255]<<8^H[O&255],B%$===0&&(O=O<<8^O>>>24^R<<24,R=R<<1^(R>>7)*283)),V[B]=V[B-$]^O;for(N=0;B;N++,B--)O=V[N&3?B:B-4],B<=4||N<4?v[N]=O:v[N]=q[0][H[O>>>24]]^q[1][H[O>>16&255]]^q[2][H[O>>8&255]]^q[3][H[O&255]]}decrypt(P,B,N,O,H,q){const $=this._key[1];let R=P^$[0],V=O^$[1],v=N^$[2],C=B^$[3],F,K,j;const G=$.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<G;ee++)F=Z[R>>>24]^J[V>>16&255]^te[v>>8&255]^oe[C&255]^$[se],K=Z[V>>>24]^J[v>>16&255]^te[C>>8&255]^oe[R&255]^$[se+1],j=Z[v>>>24]^J[C>>16&255]^te[R>>8&255]^oe[V&255]^$[se+2],C=Z[C>>>24]^J[R>>16&255]^te[V>>8&255]^oe[v&255]^$[se+3],se+=4,R=F,V=K,v=j;for(ee=0;ee<4;ee++)H[(3&-ee)+q]=me[R>>>24]<<24^me[V>>16&255]<<16^me[v>>8&255]<<8^me[C&255]^$[se++],F=R,R=V,V=v,v=C,C=F}}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(T){return T<<24|(T&65280)<<8|(T&16711680)>>8|T>>>24},u=function(T,P,B){const N=new Int32Array(T.buffer,T.byteOffset,T.byteLength>>2),O=new r(Array.prototype.slice.call(P)),H=new Uint8Array(T.byteLength),q=new Int32Array(H.buffer);let $,R,V,v,C,F,K,j,G;for($=B[0],R=B[1],V=B[2],v=B[3],G=0;G<N.length;G+=4)C=a(N[G]),F=a(N[G+1]),K=a(N[G+2]),j=a(N[G+3]),O.decrypt(C,F,K,j,q,G),q[G]=a(q[G]^$),q[G+1]=a(q[G+1]^R),q[G+2]=a(q[G+2]^V),q[G+3]=a(q[G+3]^v),$=C,R=F,V=K,v=j;return H};class c{constructor(P,B,N,O){const H=c.STEP,q=new Int32Array(P.buffer),$=new Uint8Array(P.byteLength);let R=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(q.subarray(R,R+H),B,N,$)),R=H;R<q.length;R+=H)N=new Uint32Array([a(q[R-4]),a(q[R-3]),a(q[R-2]),a(q[R-1])]),this.asyncStream_.push(this.decryptChunk_(q.subarray(R,R+H),B,N,$));this.asyncStream_.push(function(){O(null,e($))})}static get STEP(){return 32e3}decryptChunk_(P,B,N,O){return function(){const H=u(P,B,N);O.set(H,P.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof f<"u"?g=f:typeof self<"u"?g=self:g={};var _=g,k=function(P){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(P):P&&P.buffer instanceof ArrayBuffer},D=_.BigInt||Number;D("0x1"),D("0x100"),D("0x10000"),D("0x1000000"),D("0x100000000"),D("0x10000000000"),D("0x1000000000000"),D("0x100000000000000"),D("0x10000000000000000"),function(){var T=new Uint16Array([65484]),P=new Uint8Array(T.buffer,T.byteOffset,T.byteLength);return P[0]===255?"big":P[0]===204?"little":"unknown"}();const L=function(T){const P={};return Object.keys(T).forEach(B=>{const N=T[B];k(N)?P[B]={bytes:N.buffer,byteOffset:N.byteOffset,byteLength:N.byteLength}:P[B]=N}),P};self.onmessage=function(T){const P=T.data,B=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),N=new Uint32Array(P.key.bytes,P.key.byteOffset,P.ke
203y.byteLength/4),O=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new c(B,N,O,function(H,q){self.postMessage(L({source:P.source,decrypted:q}),[q.buffer])})}}));var f2=Id(d2);const p2=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Wd=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},To=(s,e)=>{e.activePlaylistLoader=s,s.load()},m2=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),u=r.activePlaylistLoader,c=r.lastGroup_;if(!(a&&c&&a.id===c.id)&&(r.lastGroup_=a,r.lastTrack_=n,Wd(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){u&&i.resetEverything();return}t.resyncLoader(),To(a.playlistLoader,r)}},g2=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},_2=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),u=n.getActiveGroup(),c=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=u,n.lastTrack_=a,Wd(i,n),!!u)){if(u.isMainPlaylist){if(!a||!f||a.id===f.id)return;const g=e.vhs.playlistController_,_=g.selectPlaylist();if(g.media()===_)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),g.fastQualityChange_(_);return}if(s==="AUDIO"){if(!u.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(c===u.playlistLoader){To(u.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),To(u.playlistLoader,n)}},An={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(c=>c.default)[0]||n[0]).id,u=t.tracks[a];if(r===u){i({error:{message:"Problem encountered loading the default audio track."}});return}U.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in t.tracks)t.tracks[c].enabled=t.tracks[c]===u;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;U.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},_c={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",An[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const u=e.media();n.playlist(u,r),n.track(a.activeTrack()),(!i.paused()||u.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",An[s](s,t))}},y2={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:u,tracks:c,logger_:f}},mainPlaylistLoader:g}=e,_=Er(g.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},_&&(a[s].main.default.playlists=g.main.playlists));for(const k in a[s]){u[k]||(u[k]=[]);for(const D in a[s][k]){let L=a[s][k][D],T;if(_?(f(`AUDIO group '${k}' label '${D}' is a main playlist`),L.isMainPlaylist=!0,T=null):i==="vhs-json"&&L.playlists?T=new as(L.playlists[0],t,n):L.resolvedUri?T=new as(L.resolvedUri,t,n):L.playlists&&i==="dash"?T=new po(L.playlists[0],t,n,g):T=null,L=De({id:D,playlistLoader:T},L),_c[s](s,L.playlistLoader,e),u[k].push(L),typeof c[D]>"u"){const P=new U.AudioTrack({id:D,kind:p2(L),enabled:!1,language:L.language,default:L.default,label:D});c[D]=P}}}r.on("error",An[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:u},mediaTypes:{[s]:{groups:c,tracks:f}},mainPlaylistLoader:g}=e;for(const _ in u[s]){c[_]||(c[_]=[]);for(const k in u[s][_]){if(!i.options_.useForcedSubtitles&&u[s][_][k].forced)continue;let D=u[s][_][k],L;if(r==="hls")L=new as(D.resolvedUri,i,a);else if(r==="dash"){if(!D.playlists.filter(P=>P.excludeUntil!==1/0).length)return;L=new po(D.playlists[0],i,a,g)}else r==="vhs-json"&&(L=new as(D.playlists?D.playlists[0]:D.resolvedUri,i,a));if(D=De({id:k,playlistLoader:L},D),_c[s](s,D.playlistLoader,e),c[_].push(D),typeof f[k]>"u"){const T=t.addRemoteTextTrack({id:k,kind:"subtitles",default:D.default&&D.autoselect,language:D.language,label:k},!1).track;f[k]=T}}}n.on("error",An[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 u in i[s][a]){const c=i[s][a][u];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let g={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(f[g.instreamId]&&(g=De(g,f[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(De({id:u},c)),typeof n[u]>
203"u"){const _=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[u]=_}}}}},Xd=(s,e)=>{for(let t=0;t<s.length;t++)if(tu(e,s[t])||s[t].playlists&&Xd(s[t].playlists,e))return!0;return!1},T2=(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 u=Object.keys(r);if(!a)if(s==="AUDIO"&&u.length>1&&Er(e.main))for(let c=0;c<u.length;c++){const f=r[u[c]];if(Xd(f,n)){a=f;break}}else r.main?a=r.main:u.length===1&&(a=r[u[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(c=>c.id===t.id)[0]||null},v2={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}},b2=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},S2=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{y2[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=T2(f,s),e[f].activeTrack=v2[f](f,s),e[f].onGroupChanged=m2(f,s),e[f].onGroupChanging=g2(f,s),e[f].onTrackChanged=_2(f,s),e[f].getActiveGroup=b2(f,s)});const u=e.AUDIO.activeGroup();if(u){const f=(u.filter(_=>_.default)[0]||u[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 c=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const f in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[f])},E2=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:oi,activeTrack:oi,getActiveGroup:oi,onGroupChanged:oi,onTrackChanged:oi,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class yc{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_=ft(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 C2 extends U.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new yc,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_=It("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=ft(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)=>
vendor: 11,127 bytes, line 203
203{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 u;try{u=JSON.parse(this.request_.responseText)}catch(f){const g={errorType:U.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(u);const c={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new w.URL(e),i=new w.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(w.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new w.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_=w.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){w.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 yc}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&&(ft(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const D2=(s,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(null,i)},e)}},A2=10;let bi;const w2=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],x2=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},k2=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:u,log:c}){if(!i)return U.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 c(`${f} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!ns(e,t).length;if(!s.endList)return!g&&typeof s.partTargetDuration=="number"?(c(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${f} as current playlist is live`),!0);const _=Jo(e,t),k=u?Ye.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ye.MAX_BUFFER_LOW_WATER_LINE;if(a<k)return c(`${f} as duration < max low water line (${a} < ${k})`),!0;const D=i.attributes.BANDWIDTH,L=s.attributes.BANDWIDTH;if(D<L&&(!u||_<n)){let T=`${f} as next bandwidth < current bandwidth (${D} < ${L})`;return u&&(T+=` and forwardBuffer < bufferHighWaterLine (${_} < ${n})`),c(T),!0}if((!u||D>L)&&_>=r){let T=`${f} as forwardBuffer >= bufferLowWaterLine (${_} >= ${r})`;return u&&(T+=` and next bandwidth > current bandwidth (${D} > ${L})`),c(T),!0}return c(`not ${f} as no switching criteria met`),!1};class I2 extends U.EventTarget{constructor(e){super(),this.fastQualityChange_=D2(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:u,playlistExclusionDuration:c,enableLowInitialPlaylist:f,sourceType:g,cacheEncryptionKeys:_,bufferBasedABR:k,leastPixelDiffSelector:D,captionServices:L,experimentalUseMMS:T}=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),bi=a,this.bufferBasedABR=!!k,this.leastPixelDiffSelector=!!D,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=u,this.playlistExclusionDuration=c,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_=E2(),T&&w.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new w.ManagedMediaSource,this.usingManagedMediaSource_=!0,U.log("Using ManagedMediaSource")):w.MediaSource&&(this.mediaSource=new w.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_=Je(),this.hasPlayed_=!1,this.syncController_=new c2(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new f2,this.sourceUpdater_=new zd(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new h2,this.keyStatusMap_=new Map;const B={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:L,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:_,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new po(t,this.vhs_,De(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new as(t,this.vhs_,De(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new _o(De(B,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new _o(De(B,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new n2(De(B,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((H,q)=>{function $(){r.off("vttjserror",R),H()}function R(){r.off("vttjsloaded",$),q()}r.one("vttjsloaded",$),r.one("vttjserror",R),r.addWebVttScript_()})}),e);const N=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new C2(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_())),w2.forEach(H=>{this[H+"_"]=x2.bind(this,H)}),this.logger_=It("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 O=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(O,()=>{const H=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-H,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 u={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e
vendor: 5,607 bytes, line 203
203=>{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(u=>u.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=w.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(w.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 u=i.main||r.length&&i[r[0]];for(const c in u)if(u[c].default){n={label:c};break}}if(!n)return t;const a=[];for(const u in i)if(i[u][n.label]){const c=i[u][n.label];if(c.playlists&&c.playlists.length)a.push.apply(a,c.playlists);else if(c.uri)a.push(c);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){const g=e.playlists[f];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===u&&a.push(g)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;uo(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()),S2({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;uo(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(Ve({},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 u in i.AUDIO[a])i.AUDIO[a][u].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"}),bi.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_.pen
vendor: 2,979 bytes, line 203
203dingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return k2({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:A2}))});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",()=>
203{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(Ve({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(Ve({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(Ve({},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;n<0?r=Math.max(i+n,t.start(0)):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=bi.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Kt;const u=a.end(a.length-1);return u-n<=Kt&&r-u<=Kt}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(Kn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return U.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 L=this.pathwayAttribute_(e),T=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(L),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(L)},T);return}let D=!1;r.forEach(L=>{if(L===e)return;const T=L.excludeUntil;typeof T<"u"&&T!==1/0&&(D=!0,delete L.excludeUntil)}),D&&(U.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+i*1e3,e.excludeUntil=u,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:U.log.warn,g=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const _=c.targetDuration/2*1e3||5*1e3,k=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=_;return this.switchMedia_(c,"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.forEac
203h(a=>{const u=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;u&&i.push(u)}),["main","audio","subtitle"].forEach(a=>{const u=this[`${a}SegmentLoader_`];u&&(e===a||e==="all")&&i.push(u)}),i.forEach(a=>t.forEach(u=>{typeof a[u]=="function"&&a[u]()}))}setCurrentTime(e){const t=ns(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:bi.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 u=r.start,c=r.end;if(!isFinite(u)||!isFinite(c))return null;const f=bi.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),g=Math.max(u,c-f);return Je([[u,g]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=bi.Playlist.seekable(i,n,bi.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:Je([[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 [${rd(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=bi.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=hr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||ym),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||ol}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||ol,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,g)=>f?ar(g,this.usingManagedMediaSource_):Da(g),u={};let c;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const g=e[f].isFmp4?"browser":"muxer";u[g]=u[g]||[],u[g].push(r[f]),f==="audio"&&(c=g)}}),n&&c&&t.attributes.AUDIO){const f=t.attributes.AUDIO;
203this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===f&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${c} does not support codec(s): "${r.audio}"`)}if(Object.keys(u).length){const f=Object.keys(u).reduce((g,_)=>(g&&(g+=", "),g+=`${_} does not support codec(s): "${u[_].join(",")}"`,g),"")+".";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(g=>{const _=(zt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,k=(zt(r[g]||"")[0]||{}).type;_&&k&&_.toLowerCase()!==k.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),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=hr(this.main,r),a=[];n.audio&&!Da(n.audio)&&!ar(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Da(n.video)&&!ar(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=gr(zt(e)),n=ec(r),a=r.video&&zt(r.video)[0]||null,u=r.audio&&zt(r.audio)[0]||null;
203Object.keys(i).forEach(c=>{const f=i[c];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const g=[],_=hr(this.mainPlaylistLoader_.main,f),k=ec(_);if(!(!_.audio&&!_.video)){if(k!==n&&g.push(`codec count "${k}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const D=_.video&&zt(_.video)[0]||null,L=_.audio&&zt(_.audio)[0]||null;D&&a&&D.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${D.type}" !== "${a.type}"`),L&&u&&L.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${L.type}" !== "${u.type}"`)}g.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),o2(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ye.GOAL_BUFFER_LENGTH,i=Ye.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ye.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ye.BUFFER_LOW_WATER_LINE,i=Ye.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ye.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ye.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ye.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){uc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),q0({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();uc(this.inbandTextTracks_,e,this.tech_),B0({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(Ve({},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 u of t.playlists){const c=u.attributes.serviceLocation;if(c&&(a.push(c),!n.has(c)))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;
vendor: 1,068 bytes, line 203
203Object.keys(i).forEach(a=>{const u=i[a],c=this.pathwayAttribute_(u),f=c&&e!==c;u.excludeUntil===1/0&&u.lastExcludeReason_==="content-steering"&&!f&&(delete u.excludeUntil,delete u.lastExcludeReason_,n=!0);const _=!u.excludeUntil&&u.excludeUntil!==1/0;!r.has(u.id)&&f&&_&&(r.add(u.id),u.excludeUntil=1/0,u.lastExcludeReason_="content-steering",this.logger_(`excluding ${u.id} for ${u.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const u=this.mediaTypes_[a];if(u.activePlaylistLoader){const c=u.activePlaylistLoader.media_;c&&c.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,u]of i.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(u),this.contentSteeringController_.excludePathway(a));for(const[a,u]of r.entries()){const c=i.get(a);if(!c){t.filter(g=>
vendor: 7,774 bytes, line 203
203g.attributes["PATHWAY-ID"]===u["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(u,g)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(c,u)||(this.mainPlaylistLoader_.updateOrDeleteClone(u,!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",u=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,c=i.lastExcludeReason_===t&&i.excludeUntil===1/0;u?u&&c&&(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,U.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:s2(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 P2=(s,e,t)=>i=>{const r=s.main.playlists[e],n=eu(r),a=Kn(r);if(typeof i>"u")return a;i?delete r.disabled:r.disabled=!0;const u={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:u})):s.trigger({type:"renditiondisabled",metadata:u})),i};class O2{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=hr(r.main(),t),this.playlist=t,this.id=i,this.enabled=P2(e.playlists,t.id,n)}}const L2=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=Er(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!eu(i)).map((i,r)=>new O2(s,i,i.id)):[]}},Tc=["seeking","seeked","pause","playing","error"];class R2 extends U.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_=It("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,u=["main","subtitle","audio"],c={};u.forEach(g=>{c[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",c[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",c[g].reset),this.tech_.on(["seeked","seeking"],c[g].reset)});const f=g=>{["main","audio"].forEach(_=>{a[`${_}SegmentLoader_`][g]("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(Tc,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(Tc,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",c[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",c[g].reset),this.tech_.off(["seeked","seeking"],c[g].reset)}),this.checkCurrentTimeTimeout_&&w.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&w.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=w.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=Ty(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:Bi(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+Kt>=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(Je([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,
203i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const L=t.start(0);n=L+(L===t.end(0)?0:Kt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${rd(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,u=this.tech_.buffered(),c=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,g=this.media(),_=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Xt)*2,k=[c,f];for(let L=0;L<k.length;L++){if(!k[L])continue;if(Jo(k[L],i)<_)return!1}const D=tn(u,i);return D.length===0?!1:(n=D.start(0)+Kt,this.logger_(`Buffered region starts (${D.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=ns(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 u=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${u}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(u),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=tn(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)+Kt;const a=!i.endList,u=typeof i.partTargetDuration=="number";return a&&(u||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=ns(e,i-3),a=ns(e,i),u=ns(t,i);u.length&&!a.length&&n.length&&(r={start:n.end(0),end:u.end(0)})}else tn(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=tn(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)+Xt);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=gy(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 M2={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},Kd=function(s,e){let t=0,i=0;const r=De(M2,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(g){g!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(g),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},u=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"){U.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(s,a)},c=function(){s.off("loadedmetadata",n),s.off("error",u),s.off("dispose",c)},f=function(g){c(),Kd(s,g)};s.on("error",u),s.on("dispose",c),s.reloadSourceOnError=f},N2=function(s){Kd(this,s)};var Yd="3.17.0",B2="7.1.0",U2="1.3.1",F2="7.2.0",q2="4.0.2";const Be={PlaylistLoader:as,Playlist:pt,utils:zy,STANDARD_PLAYLIST_SELECTOR:oc,INITIAL_PLAYLIST_SELECTOR:O0,lastBandwidthSelector:oc,mov
203ingAverageBandwidthSelector:I0,comparePlaylistBandwidth:su,comparePlaylistResolution:k0,xhr:Ed()};Object.keys(Ye).forEach(s=>{Object.defineProperty(Be,s,{get(){return U.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Ye[s]},set(e){if(U.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){U.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}Ye[s]=e}})});const Qd="videojs-vhs",Jd=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"})},$2=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),Jd(s,e.playlists)};Be.canPlaySource=function(){return U.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const j2=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=gr(zt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=gs(i.video),n=gs(i.audio),a={};for(const u in s)a[u]={},n&&(a[u].audioContentType=n),r&&(a[u].videoContentType=r),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(a[u].pssh=e.contentProtection[u].pssh),typeof s[u]=="string"&&(a[u].url=s[u]);return De(s,a)},H2=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const u=i.contentProtection[a];return u&&u.pssh&&(n[a]={pssh:u.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),V2=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=H2(r,Object.keys(e)),a=[],u=[];return n.forEach(c=>{u.push(new Promise((f,g)=>{s.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,g)=>{s.eme.initializeMediaKeys({keySystems:c},_=>{if(_){g(_);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(u)])},z2=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=j2(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(U.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Zd=()=>
203{if(!w.localStorage)return null;const s=w.localStorage.getItem(Qd);if(!s)return null;try{return JSON.parse(s)}catch{return null}},G2=s=>{if(!w.localStorage)return!1;let e=Zd();e=e?De(e,s):s;try{w.localStorage.setItem(Qd,JSON.stringify(e))}catch{return!1}return e},W2=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,ef=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},tf=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},sf=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},rf=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Be.supportsNativeHls=function(){if(!ie||!ie.createElement)return!1;const s=ie.createElement("video");return U.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}();Be.supportsNativeDash=function(){return!ie||!ie.createElement||!U.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ie.createElement("video").canPlayType("application/dash+xml"))}();Be.supportsTypeNatively=s=>s==="hls"?Be.supportsNativeHls:s==="dash"?Be.supportsNativeDash:!1;Be.isSupported=function(){return U.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Be.xhr.onRequest=function(s){ef(Be.xhr,s)};Be.xhr.onResponse=function(s){tf(Be.xhr,s)};Be.xhr.offRequest=function(s){sf(Be.xhr,s)};Be.xhr.offResponse=function(s){rf(Be.xhr,s)};const X2=U.getComponent("Component");class nf extends X2{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=It("VhsHandler"),t.options_&&t.options_.playerId){const r=U.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_=De(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||!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_.llhl
vendor: 7,240 bytes, line 203
203s=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=Zd();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=Ye.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ye.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=W2(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Be,this.options_.sourceType=Dc(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new I2(this.options_);const i=De({liveRangeSafeTimeDelta:Kt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new R2(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=U.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?Be.movingAverageBandwidthSelector(.55):Be.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Be.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=w.navigator.connection||w.navigator.mozConnection||w.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&a){const c=a.downlink*1e3*1e3;c>=u&&n>=u?n=Math.max(n,c):n=c}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(){U.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:()=>Bi(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:()=>Bi(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&&G2({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{L2(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_=w.URL.createObjectURL(this.playlistController_.mediaSource),(U.browser.IS_ANY_SAFARI||U.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"),V2({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
203ys 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=z2({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=U.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{$2(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Jd(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Yd,"mux.js":B2,"mpd-parser":U2,"m3u8-parser":F2,"aes-decrypter":q2}}version(){return this.constructor.version()}canChangeType(){return zd.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_&&w.URL.revokeObjectURL&&(w.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Jy({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return xd({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=>{ef(this.xhr,e)},this.xhr.onResponse=e=>{tf(this.xhr,e)},this.xhr.offRequest=e=>{sf(this.xhr,e)},this.xhr.offResponse=e=>{rf(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(Ve({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(Ve({},r))})})}}const wn={name:"videojs-http-streaming",VERSION:Yd,canHandleSource(s,e={}){const t=De(U.options,e);return!t.vhs.experimentalUseMMS&&!ar("avc1.4d400d,mp4a.40.2",!1)?!1:wn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=De(U.options,t);return e.vhs=new nf(s,e,i),e.vhs.xhr=Ed(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=Dc(s);if(!t)return"";const i=wn.getOverrideNative(e);return!Be.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(U.browser.IS_ANY_SAFARI||U.browser.IS_IOS),{overrideNative:i=t}=e;return i}},K2=()=>ar("avc1.4d400d,mp4a.40.2",!0);K2()&&U.getTech("Html5").registerSourceHandler(wn,0);U.VhsHandler=nf;U.VhsSourceHandler=wn;U.Vhs=Be;U.use||U.registerComponent("Vhs",Be);U.options.vhs=U.options.vhs||{};(!U.getPlugin||!U.getPlugin("reloadSourceOnError"))&&U.registerPlugin("reloadSourceOnError",N2);export{U as default};
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.