1import{p as sn,q as ys,w as Xp}from"./components-DV900qE8.js";const Kp={},Yp=Object.freeze(Object.defineProperty({__proto__:null,default:Kp},Symbol.toStringTag,{value:"Module"}));var aa,Vu;function En(){if(Vu)return aa;Vu=1;var s;return typeof window<"u"?s=window:typeof sn<"u"?s=sn:typeof self<"u"?s=self:s={},aa=s,aa}var Qp=En();const A=ys(Qp),Jp=Xp(Yp);var oa,Hu;function bc(){if(Hu)return oa;Hu=1;var s=typeof sn<"u"?sn:typeof window<"u"?window:{},e=Jp,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),oa=t,oa}var Zp=bc();const se=ys(Zp);var Gr={exports:{}},ua={exports:{}},zu;function em(){return zu||(zu=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}(ua)),ua.exports}var la,Gu;function tm(){if(Gu)return la;Gu=1,la=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 la}var ca,Wu;function im(){if(Wu)return ca;Wu=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),y;!(y=g()).done;){var w=y.value;try{c=w(c)}catch{}}return c},r}();return ca=i,ca}var da,Xu;function sm(){if(Xu)return da;Xu=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 da=s,da}var ha,Ku;function rm(){if(Ku)return ha;Ku=1;var s=En(),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 ha=e,ha}var Yu;function nm(){if(Yu)return Gr.exports;Yu=1;var s=En(),e=em(),t=tm(),i=im(),r=sm();f.httpHandler=rm(),f.requestInterceptorsStorage=new i,f.responseInterceptorsStorage=new i,f.retryManager=new r;/** 3 * @license 4 * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/> 5 * Copyright (c) 2014 David Björklund 6 * Available under the MIT license 7 * <https://github.com/kesla/parse-headers/blob/master/LICENCE> 8 */var n=function(O){var T={};return O&&O.trim().split(` 9`).forEach(function(P){var B=P.indexOf(":"),M=P.slice(0,B).trim().toLowerCase(),L=P.slice(B+1).trim();typeof T[M]>"u"?T[M]=L:Array.isArray(T[M])?T[M].push(L):T[M]=[T[M],L]}),T};Gr.exports=f,Gr.exports.default=f,f.XMLHttpRequest=s.XMLHttpRequest||w,f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(S){f[S==="delete"?"del":S]=function(O,T,P){return T=c(O,T,P),T.method=S.toUpperCase(),g(T)}});function a(S,O){for(var T=0;T<S.length;T++)O(S[T])}function u(S){for(var O in S)if(S.hasOwnProperty(O))return!1;return!0}function c(S,O,T){var P=S;return t(O)?(T=O,typeof S=="string"&&(P={uri:S})):P=e({},O,{uri:S}),P.callback=T,P}function f(S,O,T){return O=c(S,O,T),g(O)}function g(S){if(typeof S.callback>"u")throw new Error("callback argument missing");if(S.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var O={uri:S.uri||S.url,headers:S.headers||{},body:S.body,metadata:S.metadata||{},retry:S.retry,timeout:S.timeout},T=f.requestInterceptorsStorage.execute(S.requestType,O);S.uri=T.uri,S.headers=T.headers,S.body=T.body,S.metadata=T.metadata,S.retry=T.retry,S.timeout=T.timeout}var P=!1,B=function(Z,J,te){P||(P=!0,S.callback(Z,J,te))};function M(){$.readyState===4&&!f.responseInterceptorsStorage.getIsEnabled()&&setTimeout(q,0)}function L(){var K=void 0;if($.response?K=$.response:K=$.responseText||y($),Q)try{K=JSON.parse(K)}catch{}return K}function z(K){if(clearTimeout(ie),clearTimeout(S.retryTimeout),K instanceof Error||(K=new Error(""+(K||"Unknown XMLHttpRequest Error"))),K.statusCode=0,!G&&f.retryManager.getIsEnabled()&&S.retry&&S.retry.shouldRetry()){S.retryTimeout=setTimeout(function(){S.retry.moveToNextAttempt(),S.xhr=$,g(S)},S.retry.getCurrentFuzzedDelay());return}if(S.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var Z={headers:re.headers||{},body:re.body,responseUrl:$.responseURL,responseType:$.responseType},J=f.responseInterceptorsStorage.execute(S.requestType,Z);re.body=J.body,re.headers=J.headers}return B(K,re)}function q(){if(!G){var K;clearTimeout(ie),clearTimeout(S.retryTimeout),S.useXDR&&$.status===void 0?K=200:K=$.status===1223?204:$.status;var Z=re,J=null;if(K!==0?(Z={body:L(),statusCode:K,method:C,headers:{},url:v,rawRequest:$},$.getAllResponseHeaders&&(Z.headers=n($.getAllResponseHeaders()))):J=new Error("Internal XMLHttpRequest Error"),S.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var te={headers:Z.headers||{},body:Z.body,responseUrl:$.responseURL,responseType:$.responseType},ee=f.responseInterceptorsStorage.execute(S.requestType,te);Z.body=ee.body,Z.headers=ee.headers}return B(J,Z,Z.body)}}var $=S.xhr||null;$||(S.cors||S.useXDR?$=new f.XDomainRequest:$=new f.XMLHttpRequest);var R,G,v=$.url=S.uri||S.url,C=$.method=S.method||"GET",U=S.body||S.data,H=$.headers=S.headers||{},V=!!S.sync,Q=!1,ie,re={body:void 0,headers:{},statusCode:0,method:C,url:v,rawRequest:$};if("json"in S&&S.json!==!1&&(Q=!0,H.accept||H.Accept||(H.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(H["content-type"]||H["Content-Type"]||(H["Content-Type"]="application/json"),U=JSON.stringify(S.json===!0?U:S.json))),$.onreadystatechange=M,$.onload=q,$.onerror=z,$.onprogress=function(){},$.onabort=function(){G=!0,clearTimeout(S.retryTimeout)},$.ontimeout=z,$.open(C,v,!V,S.username,S.password),V||($.withCredentials=!!S.withCredentials),!V&&S.timeout>0&&(ie=setTimeout(function(){if(!G){G=!0,$.abort("timeout");var K=new Error("XMLHttpRequest timeout");K.code="ETIMEDOUT",z(K)}},S.timeout)),$.setRequestHeader)for(R in H)H.hasOwnProperty(R)&&$.setRequestHeader(R,H[R]);else if(S.headers&&!u(S.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in S&&($.responseType=S.responseType),"beforeSend"in S&&typeof S.beforeSend=="function"&&S.beforeSend($),$.send(U||null),$}function y(S){try{if(S.responseType==="document")return S.responseXML;var O=S.responseXML&&S.responseXML.documentElement.nodeName==="parsererror";if(S.responseType===""&&!O)return S.responseXML}catch{}return null}function w(){}return Gr.exports}var am=nm();const xc=ys(am);var fa={exports:{}},pa,Qu;function om(){if(Qu)return pa;Qu=1;var s=bc(),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}}();
9function 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(H,V,Q,ie){return(H|0)*3600+(V|0)*60+(Q|0)+(ie|0)/1e3}var U=v.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return U?U[3]?C(U[1],U[2],U[3].replace(":",""),U[4]):U[1]>59?C(U[1],U[2],0,U[4]):C(0,U[1],U[2],U[4]):null}function r(){this.values=e(null)}r.prototype={set:function(v,C){!this.get(v)&&C!==""&&(this.values[v]=C)},get:function(v,C,U){return U?this.has(v)?this.values[v]:C[U]:this.has(v)?this.values[v]:C},has:function(v){return v in this.values},alt:function(v,C,U){for(var H=0;H<U.length;++H)if(C===U[H]){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,U,H){var V=H?v.split(H):[v];for(var Q in V)if(typeof V[Q]=="string"){var ie=V[Q].split(U);if(ie.length===2){var re=ie[0].trim(),K=ie[1].trim();C(re,K)}}}function a(v,C,U){var H=v;function V(){var re=i(v);if(re===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+H);return v=v.replace(/^[^\sa-zA-Z-]+/,""),re}function Q(re,K){var Z=new r;n(re,function(J,te){switch(J){case"region":for(var ee=U.length-1;ee>=0;ee--)if(U[ee].id===te){Z.set(J,U[ee].region);break}break;case"vertical":Z.alt(J,te,["rl","lr"]);break;case"line":var fe=te.split(","),me=fe[0];Z.integer(J,me),Z.percent(J,me)&&Z.set("snapToLines",!1),Z.alt(J,me,["auto"]),fe.length===2&&Z.alt("lineAlign",fe[1],["start","center","end"]);break;case"position":fe=te.split(","),Z.percent(J,fe[0]),fe.length===2&&Z.alt("positionAlign",fe[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/),K.region=Z.get("region",null),K.vertical=Z.get("vertical","");try{K.line=Z.get("line","auto")}catch{}K.lineAlign=Z.get("lineAlign","start"),K.snapToLines=Z.get("snapToLines",!0),K.size=Z.get("size",100);try{K.align=Z.get("align","center")}catch{K.align=Z.get("align","middle")}try{K.position=Z.get("position","auto")}catch{K.position=Z.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},K.align)}K.positionAlign=Z.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},K.align)}function ie(){v=v.replace(/^\s+/,"")}if(ie(),C.startTime=V(),ie(),v.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+H);v=v.substr(3),ie(),C.endTime=V(),ie(),Q(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"},y={rt:"ruby"};function w(v,C){function U(){if(!C)return null;function me(he){return C=C.substr(he.length),he}var _e=C.match(/^([^<]*)(<[^>]*>?)?/);return me(_e[1]?_e[1]:_e[2])}function H(me){return u.innerHTML=me,me=u.textContent,u.textContent="",me}function V(me,_e){return!y[_e.localName]||y[_e.localName]===me.localName}function Q(me,_e){var he=c[me];if(!he)return null;var Ke=v.document.createElement(he),Je=g[me];return Je&&_e&&(Ke[Je]=_e.trim()),Ke}for(var ie=v.document.createElement("div"),re=ie,K,Z=[];(K=U())!==null;){if(K[0]==="<"){if(K[1]==="/"){Z.length&&Z[Z.length-1]===K.substr(2).replace(">","")&&(Z.pop(),re=re.parentNode);continue}var J=i(K.substr(1,K.length-2)),te;if(J){te=v.document.createProcessingInstruction("timestamp",J),re.appendChild(te);continue}var ee=K.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||(te=Q(ee[1],ee[3]),!te)||!V(re,te))continue;if(ee[2]){var fe=ee[2].split(".");fe.forEach(function(me){var _e=/^bg_/.test(me),he=_e?me.slice(3):me;if(f.hasOwnProperty(he)){var Ke=_e?"background-color":"color",Je=f[he];
9te.style[Ke]=Je}}),te.className=fe.join(" ")}Z.push(ee[1]),re.appendChild(te),re=te;continue}re.appendChild(v.document.createTextNode(H(K)))}return ie}var S=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function O(v){for(var C=0;C<S.length;C++){var U=S[C];if(v>=U[0]&&v<=U[1])return!0}return!1}function T(v){var C=[],U="",H;if(!v||!v.childNodes)return"ltr";function V(re,K){for(var Z=K.childNodes.length-1;Z>=0;Z--)re.push(K.childNodes[Z])}function Q(re){if(!re||!re.length)return null;var K=re.pop(),Z=K.textContent||K.innerText;if(Z){var J=Z.match(/^.*(\n|\r)/);return J?(re.length=0,J[0]):Z}if(K.tagName==="ruby")return Q(re);if(K.childNodes)return V(re,K),Q(re)}for(V(C,v);U=Q(C);)for(var ie=0;ie<U.length;ie++)if(H=U.charCodeAt(ie),O(H))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,U=C.textTrackList,H=0,V=0;V<U.length&&U[V]!==C;V++)U[V].mode==="showing"&&H++;return++H*-1}function B(){}B.prototype.applyStyles=function(v,C){C=C||this.div;for(var U in v)v.hasOwnProperty(U)&&(C.style[U]=v[U])},B.prototype.formatStyle=function(v,C){return v===0?0:v+C};function M(v,C,U){B.call(this),this.cue=C,this.cueDiv=w(v,C.text);var H={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(H,this.cueDiv),this.div=v.document.createElement("div"),H={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:U.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(H),this.div.appendChild(this.cueDiv);var V=0;switch(C.positionAlign){case"start":case"line-left":V=C.position;break;case"center":V=C.position-C.size/2;break;case"end":case"line-right":V=C.position-C.size;break}C.vertical===""?this.applyStyles({left:this.formatStyle(V,"%"),width:this.formatStyle(C.size,"%")}):this.applyStyles({top:this.formatStyle(V,"%"),height:this.formatStyle(C.size,"%")}),this.move=function(Q){this.applyStyles({top:this.formatStyle(Q.top,"px"),bottom:this.formatStyle(Q.bottom,"px"),left:this.formatStyle(Q.left,"px"),right:this.formatStyle(Q.right,"px"),height:this.formatStyle(Q.height,"px"),width:this.formatStyle(Q.width,"px")})}}M.prototype=e(B.prototype),M.prototype.constructor=M;function L(v){var C,U,H,V;if(v.div){U=v.div.offsetHeight,H=v.div.offsetWidth,V=v.div.offsetTop;var Q=(Q=v.div.childNodes)&&(Q=Q[0])&&Q.getClientRects&&Q.getClientRects();v=v.div.getBoundingClientRect(),C=Q?Math.max(Q[0]&&Q[0].height||0,v.height/Q.length):0}this.left=v.left,this.right=v.right,this.top=v.top||V,this.height=v.height||U,this.bottom=v.bottom||V+(v.height||U),this.width=v.width||H,this.lineHeight=C!==void 0?C:v.lineHeight}L.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}},L.prototype.overlaps=function(v){return this.left<v.right&&this.right>v.left&&this.top<v.bottom&&this.bottom>v.top},L.prototype.overlapsAny=function(v){for(var C=0;C<v.length;C++)if(this.overlaps(v[C]))return!0;return!1},L.prototype.within=function(v){return this.top>=v.top&&this.bottom<=v.bottom&&this.left>=v.left&&this.right<=v.right},L.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}}
9,L.prototype.intersectPercentage=function(v){var C=Math.max(0,Math.min(this.right,v.right)-Math.max(this.left,v.left)),U=Math.max(0,Math.min(this.bottom,v.bottom)-Math.max(this.top,v.top)),H=C*U;return H/(this.height*this.width)},L.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}},L.getSimpleBoxPosition=function(v){var C=v.div?v.div.offsetHeight:v.tagName?v.offsetHeight:0,U=v.div?v.div.offsetWidth:v.tagName?v.offsetWidth:0,H=v.div?v.div.offsetTop:v.tagName?v.offsetTop:0;v=v.div?v.div.getBoundingClientRect():v.tagName?v.getBoundingClientRect():v;var V={left:v.left,right:v.right,top:v.top||H,height:v.height||C,bottom:v.bottom||H+(v.height||C),width:v.width||U};return V};function z(v,C,U,H){function V(he,Ke){for(var Je,$e=new L(he),Ze=1,bt=0;bt<Ke.length;bt++){for(;he.overlapsOppositeAxis(U,Ke[bt])||he.within(U)&&he.overlapsAny(H);)he.move(Ke[bt]);if(he.within(U))return he;var Ye=he.intersectPercentage(U);Ze>Ye&&(Je=new L(he),Ze=Ye),he=new L($e)}return Je||$e}var Q=new L(C),ie=C.cue,re=P(ie),K=[];if(ie.snapToLines){var Z;switch(ie.vertical){case"":K=["+y","-y"],Z="height";break;case"rl":K=["+x","-x"],Z="width";break;case"lr":K=["-x","+x"],Z="width";break}var J=Q.lineHeight,te=J*Math.round(re),ee=U[Z]+J,fe=K[0];Math.abs(te)>ee&&(te=te<0?-1:1,te*=Math.ceil(ee/J)*J),re<0&&(te+=ie.vertical===""?U.height:U.width,K=K.reverse()),Q.move(fe,te)}else{var me=Q.lineHeight/U.height*100;switch(ie.lineAlign){case"center":re-=me/2;break;case"end":re-=me;break}switch(ie.vertical){case"":C.applyStyles({top:C.formatStyle(re,"%")});break;case"rl":C.applyStyles({left:C.formatStyle(re,"%")});break;case"lr":C.applyStyles({right:C.formatStyle(re,"%")});break}K=["+y","-x","+x","-y"],Q=new L(C)}var _e=V(Q,K);C.move(_e.toCSSCompatValues(U))}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:w(v,C)};var $=.05,R="sans-serif",G="1.5%";return q.processCues=function(v,C,U){if(!v||!C||!U)return null;for(;U.firstChild;)U.removeChild(U.firstChild);var H=v.document.createElement("div");H.style.position="absolute",H.style.left="0",H.style.right="0",H.style.top="0",H.style.bottom="0",H.style.margin=G,U.appendChild(H);function V(J){for(var te=0;te<J.length;te++)if(J[te].hasBeenReset||!J[te].displayState)return!0;return!1}if(!V(C)){for(var Q=0;Q<C.length;Q++)H.appendChild(C[Q].displayState);return}var ie=[],re=L.getSimpleBoxPosition(H),K=Math.round(re.height*$*100)/100,Z={font:K+"px "+R};(function(){for(var J,te,ee=0;ee<C.length;ee++)te=C[ee],J=new M(v,te,Z),H.appendChild(J.div),z(v,J,re,ie),te.displayState=J.div,ie.push(L.getSimpleBoxPosition(J))})()},q.Parser=function(v,C,U){U||(U=C,C={}),C||(C={}),this.window=v,this.vttjs=C,this.state="INITIAL",this.buffer="",this.decoder=U||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 U(){for(var J=C.buffer,te=0;te<J.length&&J[te]!=="\r"&&J[te]!==` 10`;)++te;var ee=J.substr(0,te);return J[te]==="\r"&&++te,J[te]===` 11`&&++te,C.buffer=J.substr(te),ee}function H(J){var te=new r;if(n(J,function(fe,me){switch(fe){case"id":te.set(fe,me);break;case"width":te.percent(fe,me);break;case"lines":te.integer(fe,me);break;case"regionanchor":case"viewportanchor":var _e=me.split(",");if(_e.length!==2)break;var he=new r;if(he.percent("x",_e[0]),he.percent("y",_e[1]),!he.has("x")||!he.has("y"))break;te.set(fe+"X",he.get("x")),te.set(fe+"Y",he.get("y"));break;case"scroll":te.alt(fe,me,["up"]);break}},/=/,/\s/),te.has("id")){var ee=new(C.vttjs.VTTRegion||C.window.VTTRegion);ee.width=te.get("width",100),ee.lines=te.get("lines",3),ee.regionAnchorX=te.get("regionanchorX",0),ee.regionAnchorY=te.get("regionanchorY",100),ee.viewportAnchorX=te.get("viewportanchorX",0),ee.viewportAnchorY=te.get("viewportanchorY",100),ee.scroll=te.get("scroll",""),C.onregion&&C.onregion(ee),C.regionList.push({id:te.get("id"),region:ee})}}function V(J){var te=new r;n(J,function(ee,fe){switch(ee){case"MPEGT":te.integer(ee+"S",fe);break;case"LOCA":te.set(ee+"L",i(fe));break}},/[^\d]:/,/,/),C.ontimestampmap&&C.ontimestampmap({MPEGTS:te.get("MPEGTS"),LOCAL:te.get("LOCAL")})}function Q(J){J.match(/X-TIMESTAMP-MAP/)?n(J,function(te,ee){switch(te){case"X-TIMESTAMP-MAP":V(ee);break}},/=/):n(J,function(te,ee){switch(te){case"Region":H(ee);break}},/:/)}try{var ie;if(C.state==="INITIAL"){if(!/\r\n|\n/.test(C.buffer))return this;ie=U();var re=ie.match(/^WEBVTT([ \t].*)?$/);if(!re||!re[0])throw new t(t.Errors.BadSignature);C.state="HEADER"}for(var K=!1;C.buffer;){if(!/\r\n|\n/.test(C.buffer))return this;switch(K?K=!1:ie=U(),C.state){case"HEADER":/:/.test(ie)?Q(ie):ie||(C.state="ID");continue;case"NOTE":ie||(C.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(ie)){C.state="NOTE";break}if(!ie)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",ie.indexOf("-->")===-1){C.cue.id=ie;continue}case"CUE":try{a(ie,C.cue,C.regionList)}catch(J){C.reportOrThrowError(J),C.cue=null,C.state="BADCUE";continue}C.state="CUETEXT";continue;case"CUETEXT":var Z=ie.indexOf("-->")!==-1;if(!ie||Z&&(K=!0)){C.oncue&&C.oncue(C.cue),C.cue=null,C.state="ID";continue}C.cue.text&&(C.cue.text+=` 12`),C.cue.text+=ie.replace(/\u2028/g,` 13`).replace(/u2029/g,` 14`);continue;case"BADCUE":ie||(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+=` 15 16`,v.parse()),v.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(C){v.reportOrThrowError(C)}return v.onflush&&v.onflush(),this}},pa=q,pa}var ma,Ju;function um(){if(Ju)return ma;Ju=1;
16var 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,y=a,w=u,S=c,O=null,T="",P=!0,B="auto",M="start",L="auto",z="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 y},set:function(R){if(typeof R!="number")throw new TypeError("Start time must be set to a number.");y=R,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return w},set:function(R){if(typeof R!="number")throw new TypeError("End time must be set to a number.");w=R,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return S},set:function(R){S=""+R,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return O},set:function(R){O=R,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return T},set:function(R){var G=i(R);if(G===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");T=G,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 M},set:function(R){var G=r(R);G?(M=G,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return L},set:function(R){if(R<0||R>100)throw new Error("Position must be between 0 and 100.");L=R,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return z},set:function(R){var G=r(R);G?(z=G,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 G=r(R);if(!G)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");$=G,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},ma=n,ma}var ga,Zu;function lm(){if(Zu)return ga;Zu=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(y){if(!t(y))throw new Error("Width must be between 0 and 100.");r=y}},lines:{enumerable:!0,get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");n=y}},regionAnchorY:{enumerable:!0,get:function(){return u},set:function(y){if(!t(y))throw new Error("RegionAnchorX must be between 0 and 100.");u=y}},regionAnchorX:{enumerable:!0,get:function(){return a}
16,set:function(y){if(!t(y))throw new Error("RegionAnchorY must be between 0 and 100.");a=y}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(y){if(!t(y))throw new Error("ViewportAnchorY must be between 0 and 100.");f=y}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(y){if(!t(y))throw new Error("ViewportAnchorX must be between 0 and 100.");c=y}},scroll:{enumerable:!0,get:function(){return g},set:function(y){var w=e(y);w===!1?console.warn("Scroll: an invalid or illegal string was specified."):g=w}}})}return ga=i,ga}var el;function cm(){if(el)return fa.exports;el=1;var s=En(),e=fa.exports={WebVTT:om(),VTTCue:um(),VTTRegion:lm()};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(),fa.exports}var dm=cm();const tl=ys(dm);function qe(){return qe=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},qe.apply(null,arguments)}var il="https://example.com",hm=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=A.location&&A.location.href||"");var i=/^\/\//.test(e),r=!A.location&&!/\/\//i.test(e);e=new A.URL(e,A.location||il);var n=new URL(t,e);return r?n.href.slice(il.length):i?n.href.slice(n.protocol.length):n.href},mo=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}(),fm=function(e){return A.atob?A.atob(e):Buffer.from(e,"base64").toString("binary")};function pm(s){for(var e=fm(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class mm extends mo{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(` 17`);t>-1;t=this.buffer.indexOf(` 18`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const gm=" ",_a=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},_m=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},at=function(s){const e={};if(!s)return e;const t=s.split(_m());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},sl=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 ym extends mo{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=qe(_a(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=_a(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=sl(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 18
18,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(gm)),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=_a(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]+$/;
18for(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=sl(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 Tm=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),pi=function(s){const e={};return Object.keys(s).forEach(function(t){e[Tm(t)]=s[t]}),e},ya=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 vm extends mo{constructor(e={}){super(),this.lineStream=new mm,this.parseStream=new ym,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 y=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let w=0,S=0;const O={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(T){let P,B;if(t.manifest.definitions){for(const M in t.manifest.definitions)if(T.uri&&(T.uri=T.uri.replace(`{$${M}}`,t.manifest.definitions[M])),T.attributes)for(const L in T.attributes)typeof T.attributes[L]=="string"&&(T.attributes[L]=T.attributes[L].replace(`{$${M}}`,t.manifest.definitions[M]))}({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 M={};"length"in T&&(r.byterange=M,M.length=T.length,"offset"in T||(T.offset=w)),"offset"in T&&(r.byterange=M,M.offset=T.offset),w=M.offset+M.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:pm(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,y=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 18
18,"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={}),qe(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 M=this.manifest.mediaGroups[T.attributes.TYPE];M[T.attributes["GROUP-ID"]]=M[T.attributes["GROUP-ID"]]||{},P=M[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(){y+=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:M}=this;this.lastProgramDateTime=new Date(T.dateTimeString).getTime(),M===null&&this.manifest.segments.reduceRight((L,z)=>(z.programDateTime=L-z.duration*1e3,z.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,ya.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=pi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",T.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const M=this.manifest.segments.length,L=pi(T.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=S),S=L.byterange.offset+L.byterange.length);const z=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${z} for segment #${M}`,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 M=this.manifest.serverControl=pi(T.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ya.call(this,this.manifest),M.canSkipDateranges&&!M.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 M=this.manifest.segments.length,L=pi(T.attributes),z=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=z?S:0,z&&(S=L.byterange.offset+L.byterange.length)));const q=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${q} for segment #${M}`,T.attributes,["TYPE","URI"]),!!L.type)for(let $=0;$<r.preloadHints.length-1;$++){const R=r.preloadHints[$];R.type&&R.type===L.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${q} for segment #${M} has the same TYPE ${L.type} as preload hint #${$}`})}},"rendition-report"(){const M=pi(T.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(M);const L=this.manifest.renditionReports.length-1,z=["LAST-MSN","URI"];u&&z.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${L}`,T.attributes,z)},"part-inf"(){this.manifest.partInf=pi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",T.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ya.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(pi(T.attributes));const M=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${M}`,T.attributes,["ID","START-DATE"]);const L=this.manifest.dateRanges[M];L.endDate&&L.startDate&&new Date(L.endDate)<new Date(L.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),L.duration&&L.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),L.plannedDuration&&L.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const z=!!L.endOnNext;if(z&&!L.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
18=YES attribute must have a CLASS attribute"}),z&&(L.duration||L.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),L.duration&&L.endDate){const $=L.startDate.getTime()+L.duration*1e3;this.manifest.dateRanges[M].endDate=new Date($)}if(!O[L.id])O[L.id]=L;else{for(const $ in O[L.id])if(L[$]&&JSON.stringify(O[L.id][$])!==JSON.stringify(L[$])){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===L.id);this.manifest.dateRanges[q]=qe(this.manifest.dateRanges[q],L),O[L.id]=qe(O[L.id],L),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=pi(T.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",T.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const M=(L,z)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=z};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 L=this.params.get(T.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${T.attributes.QUERYPARAM}`});return}M(T.attributes.QUERYPARAM,decodeURIComponent(L));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}M(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}M(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:y}),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=y,n&&(r.map=n),S=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(` 19`),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 Mi={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^/},bm=["video","audio","text"],rl=["Video","Audio","Text"],Sc=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})},jt=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;bm.forEach(function(a){var u=Mi[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},xm=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 jt(n.playlists[0].attributes.CODECS)}return null},Ec=function(e){return e===void 0&&(e=""),Mi.audio.test(e.trim().toLowerCase())},Sm=function(e){return e===void 0&&(e=""),Mi.text.test(e.trim().toLowerCase())},ls=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Sc(n.trim())}),i="video";t.length===1&&Ec(t[0])?i="audio":t.length===1&&Sm(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Mi.mp4.test(n)})?r="mp4":t.every(function(n){return Mi.webm.test(n)})?r="webm":t.every(function(n){return Mi.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},tr=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),A.MediaSource&&A.MediaSource.isTypeSupp
19orted&&A.MediaSource.isTypeSupported(ls(e))||t&&A.ManagedMediaSource&&A.ManagedMediaSource.isTypeSupported&&A.ManagedMediaSource.isTypeSupported(ls(e))||!1},Ta=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<rl.length;i++){var r=rl[i];if(Mi["muxer"+r].test(t))return!0}return!1})},nl="mp4a.40.2",Em="avc1.4d400d",Cm=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Am=/^application\/dash\+xml/i,Cc=function(e){return Cm.test(e)?"hls":Am.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},Dm=function(e){return e.toString(2).length},wm=function(e){return Math.ceil(Dm(e)/8)},Ac=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},km=function(e){return Ac(e)},le=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!km(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))},Qe=A.BigInt||Number,$a=[Qe("0x1"),Qe("0x100"),Qe("0x10000"),Qe("0x1000000"),Qe("0x100000000"),Qe("0x10000000000"),Qe("0x1000000000000"),Qe("0x100000000000000"),Qe("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 Im=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=le(e);var c=u?"reduce":"reduceRight",f=e[c]?e[c]:Array.prototype[c],g=f.call(e,function(w,S,O){var T=u?O:Math.abs(O+1-e.length);return w+Qe(S)*$a[T]},Qe(0));if(n){var y=$a[e.length]/Qe(2)-Qe(1);g=Qe(g),g>y&&(g-=y,g-=y,g-=Qe(2))}return Number(g)},Pm=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=Qe(e);for(var a=wm(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/$a[c]&Qe(255)),e<0&&(u[f]=Math.abs(~u[f]),u[f]-=c===0?1:2)}return u},Dc=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},Lm=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 le(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=le(u),n.set(u,a),a+=u.byteLength}),n},Oe=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=le(e),t=le(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(g,y){var w=c[y]?c[y]&e[a+y]:e[a+y];return g===w})},va={exports:{}},al;function Om(){return al||(al=1,function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,u={buildAbsoluteURL:function(c,f,g){if(g=g||{},c=c.trim(),f=f.trim(),!f){if(!g.alwaysNormalize)return c;var y=u.parseURL(c);if(!y)throw new Error("Error trying to parse base URL.");return y.path=u.normalizePath(y.path),u.buildURLFromParts(y)}var w=u.parseURL(f);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return g.alwaysNormalize?(w.path=u.normalizePath(w.path),u.buildURLFromParts(w)):f;var S=u.parseURL(c);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var O=r.exec(S.path);S.netLoc=O[1],S.path=O[2]}S.netLoc&&!S.path&&(S.path="/");var T={scheme:S.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(T.netLoc=S.netLoc,w.path[0]!=="/"))if(!w.path)T.path=S.path,w.params||(T.params=S.params,w.query||(T.query=S.query));else{var P=S.path,B=P.substring(0,P.lastIndexOf("/")+1)+w.path;T.path=u.normalizePath(B)}return T.path===null&&(T.path=g.alwaysNormalize?u.normalizePath(w.path):w.path),u.buildURLFromParts(T)},parseURL:function(c){var f=i.exec(c);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(n,"");c.length!==(c=c.replace(a,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};s.exports=u})()}(va)),va.exports}var Rm=Om();const ol=ys(Rm);var ul="http://example.com",go=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=A.location&&A.location.href||"");var i=typeof A.URL=="function",r=/^\/\//.test(e),n=!A.location&&!/\/\//i.test(e);
19if(i?e=new A.URL(e,A.location||ul):/\/\//i.test(e)||(e=ol.buildAbsoluteURL(A.location&&A.location.href||"",e)),i){var a=new URL(t,e);return n?a.href.slice(ul.length):r?a.href.slice(a.protocol.length):a.href}return ol.buildAbsoluteURL(e,t)},Nm=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)}})},Mm=function(e){return A.atob?A.atob(e):Buffer.from(e,"base64").toString("binary")};function Bm(s){for(var e=Mm(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}var Ws={},ei={},Ii={},ll;function Cn(){if(ll)return Ii;ll=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 Ii.assign=t,Ii.find=s,Ii.freeze=e,Ii.MIME_TYPE=i,Ii.NAMESPACE=r,Ii}var cl;function wc(){if(cl)return ei;cl=1;var s=Cn(),e=s.find,t=s.NAMESPACE;function i(_){return _!==""}function r(_){return _?_.split(/[\t\n\f\r ]+/).filter(i):[]}function n(_,b){return _.hasOwnProperty(b)||(_[b]=!0),_}function a(_){if(!_)return[];var b=r(_);return Object.keys(b.reduce(n,{}))}function u(_){return function(b){return _&&_.indexOf(b)!==-1}}function c(_,b){for(var I in _)Object.prototype.hasOwnProperty.call(_,I)&&(b[I]=_[I])}function f(_,b){var I=_.prototype;if(!(I instanceof b)){let j=function(){};j.prototype=b.prototype,j=new j,c(I,j),_.prototype=I=j}I.constructor!=_&&(typeof _!="function"&&console.error("unknown Class:"+_),I.constructor=_)}var g={},y=g.ELEMENT_NODE=1,w=g.ATTRIBUTE_NODE=2,S=g.TEXT_NODE=3,O=g.CDATA_SECTION_NODE=4,T=g.ENTITY_REFERENCE_NODE=5,P=g.ENTITY_NODE=6,B=g.PROCESSING_INSTRUCTION_NODE=7,M=g.COMMENT_NODE=8,L=g.DOCUMENT_NODE=9,z=g.DOCUMENT_TYPE_NODE=10,q=g.DOCUMENT_FRAGMENT_NODE=11,$=g.NOTATION_NODE=12,R={},G={};R.INDEX_SIZE_ERR=(G[1]="Index size error",1),R.DOMSTRING_SIZE_ERR=(G[2]="DOMString size error",2);var v=R.HIERARCHY_REQUEST_ERR=(G[3]="Hierarchy request error",3);R.WRONG_DOCUMENT_ERR=(G[4]="Wrong document",4),R.INVALID_CHARACTER_ERR=(G[5]="Invalid character",5),R.NO_DATA_ALLOWED_ERR=(G[6]="No data allowed",6),R.NO_MODIFICATION_ALLOWED_ERR=(G[7]="No modification allowed",7);var C=R.NOT_FOUND_ERR=(G[8]="Not found",8);R.NOT_SUPPORTED_ERR=(G[9]="Not supported",9);var U=R.INUSE_ATTRIBUTE_ERR=(G[10]="Attribute in use",10);R.INVALID_STATE_ERR=(G[11]="Invalid state",11),R.SYNTAX_ERR=(G[12]="Syntax error",12),R.INVALID_MODIFICATION_ERR=(G[13]="Invalid modification",13),R.NAMESPACE_ERR=(G[14]="Invalid namespace",14),R.INVALID_ACCESS_ERR=(G[15]="Invalid access",15);function H(_,b){if(b instanceof Error)var I=b;else I=this,Error.call(this,G[_]),this.message=G[_],Error.captureStackTrace&&Error.captureStackTrace(this,H);return I.code=_,b&&(this.message=this.message+": "+b),I}H.prototype=Error.prototype,c(R,H);function V(){}V.prototype={length:0,item:function(_){return _>=0&&_<this.length?this[_]:null},toString:function(_,b){for(var I=[],j=0;j<this.length;j++)ci(this[j],I,_,b);return I.join("")},filter:function(_){return Array.prototype.filter.call(this,_)},indexOf:function(_){return Array.prototype.indexOf.call(this,_)}};function Q(_,b){this._node=_,this._refresh=b,ie(this)}function ie(_){var b=_._node._inc||_._node.ownerDocument._inc;if(_._inc!==b){var I=_._refresh(_._node);if(br(_,"length",I.length),!_.$$length||I.length<_.$$length)for(var j=I.length;j in _;j++)Object.prototype.hasOwnProperty.call(_,j)&&delete _[j];c(I,_),_._inc=b}}Q.prototype.item=function(_){return ie(this),this[_]||null},f(Q,V);function re(){}function K(_,b){for(var I=_.length;I--;)if(_[I]===b)return I}function Z(_,b,I,j){if(j?b[K(b,j)]=I:b[b.length++]=I,_){I.ownerElement=_;var ne=_.ownerDocument;ne&&(j&&Ke(ne,_,j),he(ne,_,I))}}function J(_,b,I){var j=K(b,I);if(j>=0){for(var ne=b.length-1;j<ne;)b[j]=b[++j];if(b.length=ne,_){var de=_.ownerDocument;de&&(Ke(de,_,I),I.ownerElement=null)}}else throw new H(C,new Error(_.tagName+"@"+I))}re.prototype={length:0,item:V.prototype.item,getNamedItem:function(_){for(var b=this.length;b--;){var I=this[b];if(I.nodeName==_)return I}},setNamedItem:function(_){var b=_.ownerElement;if(b&&b!=this._ownerElement)throw new H(U);var I=this.getNamedItem(_.nodeName);return Z(this._ownerElement,this,_,I),I},setNamedItemNS:function(_){var b=_.ownerElement,I;if(b&&b!=this._ownerElement)throw new H(U);return I=this.getNamedItemNS(_.namespaceURI,_.localName),Z(this._ownerElement,this,_,I),I},removeNamedItem:function(_){var b=this.getNamedItem(_);return J(this._ownerElement,this,b),b},removeNamedItemNS:function(_,b){var I=this.getNamedItemNS(_,b);return J(this._ownerElement,this,I),I},getNamedItemNS:function(_,b){for(var I=this.length;I--;){var j=this[I];if(j.localName==b&&j.namespaceURI==_)return j}return null}};function te(){}te.prototype={hasFeature:function(_,b){return!0},createDocument:function(_,b,I){var j=new _e;if(j.implementation=this,j.childNodes=new V,j.doctype=I||null,I&&j.appendChild(I),b){var ne=j.createElementNS(_,b);j.appendChild(ne)}return j},createDocumentType:function(_,b,I){var j=new li;return j.name=_,j.nodeName=_,j.publicId=b||"",j.systemId=I||"",j}};function ee(){}ee.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(_,b){return xt(this,_,b)},replaceChild:function(_,b){xt(this,_,b,pt),b&&this.removeChild(b)},removeChild:function(_){return $e(this,_)},appendChild:function(_){return this.insertBefore(_,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(_){return Is(this.ownerDocument||this,this,_)},normalize:function(){for(var _=this.firstChild;_;){var b=_.nextSibling;b&&b.nodeType==S&&_.nodeType==S?(this.removeChild(b),_.appendData(b.data)):(_.normalize(),_=b)}},isSupported:function(_,b){return this.ownerDocument.implementation.hasFeature(_,b)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(_){for(var b=this;b;){var I=b._nsMap;
vendor: 12,249 bytes, line 19
19if(I){for(var j in I)if(Object.prototype.hasOwnProperty.call(I,j)&&I[j]===_)return j}b=b.nodeType==w?b.ownerDocument:b.parentNode}return null},lookupNamespaceURI:function(_){for(var b=this;b;){var I=b._nsMap;if(I&&Object.prototype.hasOwnProperty.call(I,_))return I[_];b=b.nodeType==w?b.ownerDocument:b.parentNode}return null},isDefaultNamespace:function(_){var b=this.lookupPrefix(_);return b==null}};function fe(_){return _=="<"&&"<"||_==">"&&">"||_=="&"&&"&"||_=='"'&&"""||"&#"+_.charCodeAt()+";"}c(g,ee),c(g,ee.prototype);function me(_,b){if(b(_))return!0;if(_=_.firstChild)do if(me(_,b))return!0;while(_=_.nextSibling)}function _e(){this.ownerDocument=this}function he(_,b,I){_&&_._inc++;var j=I.namespaceURI;j===t.XMLNS&&(b._nsMap[I.prefix?I.localName:""]=I.value)}function Ke(_,b,I,j){_&&_._inc++;var ne=I.namespaceURI;ne===t.XMLNS&&delete b._nsMap[I.prefix?I.localName:""]}function Je(_,b,I){if(_&&_._inc){_._inc++;var j=b.childNodes;if(I)j[j.length++]=I;else{for(var ne=b.firstChild,de=0;ne;)j[de++]=ne,ne=ne.nextSibling;j.length=de,delete j[j.length]}}}function $e(_,b){var I=b.previousSibling,j=b.nextSibling;return I?I.nextSibling=j:_.firstChild=j,j?j.previousSibling=I:_.lastChild=I,b.parentNode=null,b.previousSibling=null,b.nextSibling=null,Je(_.ownerDocument,_),b}function Ze(_){return _&&(_.nodeType===ee.DOCUMENT_NODE||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.ELEMENT_NODE)}function bt(_){return _&&(rt(_)||ni(_)||Ye(_)||_.nodeType===ee.DOCUMENT_FRAGMENT_NODE||_.nodeType===ee.COMMENT_NODE||_.nodeType===ee.PROCESSING_INSTRUCTION_NODE)}function Ye(_){return _&&_.nodeType===ee.DOCUMENT_TYPE_NODE}function rt(_){return _&&_.nodeType===ee.ELEMENT_NODE}function ni(_){return _&&_.nodeType===ee.TEXT_NODE}function He(_,b){var I=_.childNodes||[];if(e(I,rt)||Ye(b))return!1;var j=e(I,Ye);return!(b&&j&&I.indexOf(j)>I.indexOf(b))}function ai(_,b){var I=_.childNodes||[];function j(de){return rt(de)&&de!==b}if(e(I,j))return!1;var ne=e(I,Ye);return!(b&&ne&&I.indexOf(ne)>I.indexOf(b))}function Ve(_,b,I){if(!Ze(_))throw new H(v,"Unexpected parent node type "+_.nodeType);if(I&&I.parentNode!==_)throw new H(C,"child not in parent");if(!bt(b)||Ye(b)&&_.nodeType!==ee.DOCUMENT_NODE)throw new H(v,"Unexpected node type "+b.nodeType+" for parent node type "+_.nodeType)}function Vi(_,b,I){var j=_.childNodes||[],ne=b.childNodes||[];if(b.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(rt);if(de.length>1||e(ne,ni))throw new H(v,"More than one element or text in fragment");if(de.length===1&&!He(_,I))throw new H(v,"Element in fragment can not be inserted before doctype")}if(rt(b)&&!He(_,I))throw new H(v,"Only one element can be added and only after doctype");if(Ye(b)){if(e(j,Ye))throw new H(v,"Only one doctype is allowed");var Ae=e(j,rt);if(I&&j.indexOf(Ae)<j.indexOf(I))throw new H(v,"Doctype can only be inserted before an element");if(!I&&Ae)throw new H(v,"Doctype can not be appended since element is present")}}function pt(_,b,I){var j=_.childNodes||[],ne=b.childNodes||[];if(b.nodeType===ee.DOCUMENT_FRAGMENT_NODE){var de=ne.filter(rt);if(de.length>1||e(ne,ni))throw new H(v,"More than one element or text in fragment");if(de.length===1&&!ai(_,I))throw new H(v,"Element in fragment can not be inserted before doctype")}if(rt(b)&&!ai(_,I))throw new H(v,"Only one element can be added and only after doctype");if(Ye(b)){if(e(j,function(mt){return Ye(mt)&&mt!==I}))throw new H(v,"Only one doctype is allowed");var Ae=e(j,rt);if(I&&j.indexOf(Ae)<j.indexOf(I))throw new H(v,"Doctype can only be inserted before an element")}}function xt(_,b,I,j){Ve(_,b,I),_.nodeType===ee.DOCUMENT_NODE&&(j||Vi)(_,b,I);var ne=b.parentNode;if(ne&&ne.removeChild(b),b.nodeType===q){var de=b.firstChild;if(de==null)return b;var Ae=b.lastChild}else de=Ae=b;var et=I?I.previousSibling:_.lastChild;de.previousSibling=et,Ae.nextSibling=I,et?et.nextSibling=de:_.firstChild=de,I==null?_.lastChild=Ae:I.previousSibling=Ae;do{de.parentNode=_;var mt=_.ownerDocument||_;Te(de,mt)}while(de!==Ae&&(de=de.nextSibling));return Je(_.ownerDocument||_,_),b.nodeType==q&&(b.firstChild=b.lastChild=null),b}function Te(_,b){if(_.ownerDocument!==b){if(_.ownerDocument=b,_.nodeType===y&&_.attributes)for(var I=0;I<_.attributes.length;I++){var j=_.attributes.item(I);j&&(j.ownerDocument=b)}for(var ne=_.firstChild;ne;)Te(ne,b),ne=ne.nextSibling}}function ke(_,b){b.parentNode&&b.parentNode.removeChild(b),b.parentNode=_,b.previousSibling=_.lastChild,b.nextSibling=null,b.previousSibling?b.previousSibling.nextSibling=b:_.firstChild=b,_.lastChild=b,Je(_.ownerDocument,_,b);var I=_.ownerDocument||_;return Te(b,I),b}_e.prototype={nodeName:"#document",nodeType:L,doctype:null,documentElement:null,_inc:1,insertBefore:function(_,b){if(_.nodeType==q){for(var I=_.firstChild;I;){var j=I.nextSibling;this.insertBefore(I,b),I=j}return _}return xt(this,_,b),Te(_,this),this.documentElement===null&&_.nodeType===y&&(this.documentElement=_),_},removeChild:function(_){return this.documentElement==_&&(this.documentElement=null),$e(this,_)},replaceChild:function(_,b){xt(this,_,b,pt),Te(_,this),b&&this.removeChild(b),rt(_)&&(this.documentElement=_)},importNode:function(_,b){return vr(this,_,b)},getElementById:function(_){var b=null;return me(this.documentElement,function(I){if(I.nodeType==y&&I.getAttribute("id")==_)return b=I,!0}),b},getElementsByClassName:function(_){var b=a(_);return new Q(this,function(I){var j=[];return b.length>0&&me(I.documentElement,function(ne){if(ne!==I&&ne.nodeType===y){var de=ne.getAttribute("class");if(de){var Ae=_===de;if(!Ae){var et=a(de);Ae=b.every(u(et))}Ae&&j.push(ne)}}}),j})},createElement:function(_){var b=new Pe;b.ownerDocument=this,b.nodeName=_,b.tagName=_,b.localName=_,b.childNodes=new V;var I=b.attributes=new re;return I._ownerElement=b,b},createDocumentFragment:function(){var _=new be;return _.ownerDocument=this,_.childNodes=new V,_},createTextNode:function(_){var b=new Si;return b.ownerDocument=this,b.appendData(_),b},createComment:function(_){var b=new Ei;return b.ownerDocument=this,b.appendData(_),b},createCDATASection:function(_){var b=new ui;return b.ownerDocument=this,b.appendData(_),b},createProcessingInstruction:function(_,b){var I=new ws;return I.ownerDocument=this,I.tagName=I.nodeName=I.target=_,I.nodeValue=I.data=b,I},createAttribute:function(_){var b=new oi;return b.ownerDocument=this,b.name=_,b.nodeName=_,b.localName=_,b.specified=!0,b},createEntityReference:function(_){var b=new Hi;return b.ownerDocument=this,b.nodeName=_,b},createElementNS:function(_,b){var I=new Pe,j=b.split(":"),ne=I.attributes=new re;return I.childNodes=new V,I.ownerDocument=this,I.nodeName=b,I.tagName=b,I.namespaceURI=_,j.length==2?(I.prefix=j[0],I.localName=j[1]):I.localName=b,ne._ownerElement=I,I},createAttributeNS:function(_,b){var I=new oi,j=b.split(":");return I.ownerDocument=this,I.nodeName=b,I.name=b,I.namespaceURI=_,I.specified=!0,j.length==2?(I.prefix=j[0],I.localName=j[1]):I.localName=b,I}},f(_e,ee);function Pe(){this._nsMap={}}Pe.prototype={nodeType:y,hasAttribute:function(_){return this.getAttributeNode(_)!=null},getAttribute:function(_){var b=this.getAttributeNode(_);return b&&b.value||""},getAttributeNode:function(_){return this.attributes.getNamedItem(_)},setAttribute:function(_,b){var I=this.ownerDocument.createAttribute(_);I.value=I.nodeValue=""+b,this.setAttributeNode(I)},removeAttribute:function(_){var b=this.getAttributeNode(_);b&&this.removeAttributeNode(b)},appendChild:function(_){return _.nodeType===q?this.insertBefore(_,null):ke(this,_)},setAttributeNode:function(_){return this.attributes.setNamedItem(_)},setAttributeNodeNS:function(_){return this.attributes.setNamedItemNS(_)},removeAttributeNode:function(_){return this.attributes.removeNamedItem(_.nodeName)},removeAttributeNS:function(_,b){var I=this.getAttributeNodeNS(_,b);I&&this.removeAttributeNode(I)},hasAttributeNS:function(_,b){return this.getAttributeNodeNS(_,b)!=null},getAttributeNS:function(_,b){var I=this.getAttributeNodeNS(_,b);return I&&I.value||""},setAttributeNS:function(_,b,I){var j=this.ownerDocument.createAttributeNS(_,b);j.value=j.nodeValue=""+I,this.setAttributeNode(j)},getAttributeNodeNS:function(_,b){return this.attributes.getNamedItemNS(_,b)},getElementsByTagName:function(_){return new Q(this,function(b){var I=[];return me(b,function(j){j!==b&&j.nodeType==y&&(_==="*"||j.tagName==_)&&I.push(j)}),I})},getElementsByTagNameNS:function(_,b){return new Q(this,function(I){var j=[];return me(I,function(ne){ne!==I&&ne.nodeType===y&&(_==="*"||ne.namespaceURI===_)&&(b==="*"||ne.localName==b)&&j.push(ne)}),j})}},_e.prototype.getElementsByTagName=Pe.prototype.getElementsByTagName,_e.prototype.getElementsByTagNameNS=Pe.prototype.getElementsByTagNameNS,f(Pe,ee);function oi(){}oi.prototype.nodeType=w,f(oi,ee);function Qt(){}Qt.prototype={data:"",substringData:function(_,b){return this.data.substring(_,_+b)},appendData:function(_){_=this.data+_,this.nodeValue=this.data=_,this.length=_.length},insertData:function(_,b){this.replaceData(_,0,b)},appendChild:function(_){throw new Error(G[v])},deleteData:function(_,b){this.replaceData(_,b,"")},replaceData:function(_,b,I){var j=this.data.substring(0,_),ne=this.data.substring(_+b);I=j+I+ne,this.nodeValue=this.data=I,this.length=I.length}},f(Qt,ee);function Si(){}Si.prototype={nodeName:"#text",nodeType:S,splitText:function(_){var b=this.data,I=b.substring(_);b=b.substring(0,_),this.data=this.nodeValue=b,this.length=b.length;var j=this.ownerDocument.createTextNode(I);return this.parentNode&&this.parentNode.insertBefore(j,this.nextSibling),j}},f(Si,Qt);function Ei(){}Ei.prototype={nodeName:"#comment",nodeType:M},f(Ei,Qt);function ui(){}ui.prototype={nodeName:"#cdata-section",nodeType:O},f(ui,Qt);function li(){}li.prototype.nodeType=z,f(li,ee);function As(){}As.prototype.nodeType=$,f(As,ee);function Ds(){}Ds.prototype.nodeType=P,f(Ds,ee);function Hi(){}Hi.prototype.nodeType=T,f(Hi,ee);function be(){}be.prototype.nodeName="#document-fragment",be.prototype.nodeType=q,f(be,ee);function ws(){}ws.prototype.nodeType=B,f(ws,ee);function Ci(){}Ci.prototype.serializeToString=function(_,b,I){return yr.call(_,b,I)},ee.prototype.toString=yr;function yr(_,b){var I=[],j=this.nodeType==9&&this.documentElement||this,ne=j.prefix,de=j.namespaceURI;if(de&&ne==null){var ne=j.lookupPrefix(de);if(ne==null)var Ae=[{namespace:de,prefix:null}]}return ci(this,I,_,b,Ae),I.join("")}function Tr(_,b,I){var j=_.prefix||"",ne=_.namespaceURI;if(!ne||j==="xml"&&ne===t.XML||ne===t.XMLNS)return!1;for(var de=I.length;de--;){var Ae=I[de];if(Ae.prefix===j)return Ae.namespace!==ne}return!0}function ks(_,b,I){_.push(" ",b,'="',I.replace(/[<>&"\t\n\r]/g,fe),'"')}function ci(_,b,I,j,ne){if(ne||(ne=[]),j)if(_=j(_),_){if(typeof _=="string"){b.push(_);return}}else return;switch(_.nodeType){case y:var de=_.attributes,Ae=de.length,De=_.firstChild,et=_.tagName;I=t.isHTML(_.namespaceURI)||I;var mt=et;if(!I&&!_.prefix&&_.namespaceURI){for(var Ft,St=0;St<de.length;St++)if(de.item(St).name==="xmlns"){Ft=de.item(St).value;break}if(!Ft)for(var Pt=ne.length-1;Pt>=0;Pt--){var Et=ne[Pt];if(Et.prefix===""&&Et.namespace===_.namespaceURI){Ft=Et.namespace;break}}if(Ft!==_.namespaceURI)for(var Pt=ne.length-1;Pt>=0;Pt--){var Et=ne[Pt];if(Et.namespace===_.namespaceURI){Et.prefix&&(mt=Et.prefix+":"+et);break}}}b.push("<",mt);for(var Be=0;Be<Ae;Be++){var Ct=de.item(Be);Ct.prefix=="xmlns"?ne.push({prefix:Ct.localName,namespace:Ct.value}):Ct.nodeName=="xmlns"&&ne.push({prefix:"",namespace:Ct.value})}for(var Be=0;Be<Ae;Be++){var Ct=de.item(Be);if(Tr(Ct,I,ne)){var Jt=Ct.prefix||"",Ut=Ct.namespaceURI;ks(b,Jt?"xmlns:"+Jt:"xmlns",Ut),ne.push({prefix:Jt,namespace:Ut})}ci(Ct,b,I,j,ne)}if(et===mt&&Tr(_,I,ne)){var Jt=_.prefix||"",Ut=_.namespaceURI;ks(b,Jt?"xmlns:"+Jt:"xmlns",Ut),ne.push({prefix:Jt,namespace:Ut})}if(De||I&&!/^(?:meta|link|img|br|hr|input)$/i.test(et)){if(b.push(">"),I&&/^script$/i.test(et))for(;De;)De.data?b.push(De.data):ci(De,b,I,j,ne.slice()),De=De.nextSibling;else for(;De;)ci(De,b,I,j,ne.slice()),De=De.nextSibling;b.push("</",mt,">")}else b.push("/>");return;case L:case q:for(var De=_.firstChild;De;)ci(De,b,I,j,ne.slice()),De=De.nextSibling;return;case w:return ks(b,_.name,_.value);case S:return b.push(_.data.replace(/[<&>]/g,fe));
vendor: 2,201 bytes, line 19
19case O:return b.push("<![CDATA[",_.data,"]]>");case M:return b.push("<!--",_.data,"-->");case z:var Ai=_.publicId,ve=_.systemId;if(b.push("<!DOCTYPE ",_.name),Ai)b.push(" PUBLIC ",Ai),ve&&ve!="."&&b.push(" ",ve),b.push(">");else if(ve&&ve!=".")b.push(" SYSTEM ",ve,">");else{var xr=_.internalSubset;xr&&b.push(" [",xr,"]"),b.push(">")}return;case B:return b.push("<?",_.target," ",_.data,"?>");case T:return b.push("&",_.nodeName,";");default:b.push("??",_.nodeName)}}function vr(_,b,I){var j;switch(b.nodeType){case y:j=b.cloneNode(!1),j.ownerDocument=_;case q:break;case w:I=!0;break}if(j||(j=b.cloneNode(!1)),j.ownerDocument=_,j.parentNode=null,I)for(var ne=b.firstChild;ne;)j.appendChild(vr(_,ne,I)),ne=ne.nextSibling;return j}function Is(_,b,I){var j=new b.constructor;for(var ne in b)if(Object.prototype.hasOwnProperty.call(b,ne)){var de=b[ne];typeof de!="object"&&de!=j[ne]&&(j[ne]=de)}switch(b.childNodes&&(j.childNodes=new V),j.ownerDocument=_,j.nodeType){case y:var Ae=b.attributes,et=j.attributes=new re,mt=Ae.length;et._ownerElement=j;for(var Ft=0;Ft<mt;Ft++)j.setAttributeNode(Is(_,Ae.item(Ft),!0));break;case w:I=!0}if(I)for(var St=b.firstChild;St;)j.appendChild(Is(_,St,I)),St=St.nextSibling;return j}function br(_,b,I){_[b]=I}try{if(Object.defineProperty){let _=function(b){switch(b.nodeType){case y:case q:var I=[];for(b=b.firstChild;b;)b.nodeType!==7&&b.nodeType!==8&&I.push(_(b)),b=b.nextSibling;return I.join("");default:return b.nodeValue}};Object.defineProperty(Q.prototype,"length",{get:function(){return ie(this),this.$$length}}),Object.defineProperty(ee.prototype,"textContent",{get:function(){return _(this)},set:function(b){switch(this.nodeType){case y:case q:for(;this.firstChild;)this.removeChild(this.firstChild);(b||String(b))&&this.appendChild(this.ownerDocument.createTextNode(b));break;default:this.data=b,this.value=b,this.nodeValue=b}}}),br=function(b,I,j){b["$$"+I]=j}}}catch{}return ei.DocumentType=li,ei.DOMException=H,ei.DOMImplementation=te,ei.Element=Pe,ei.Node=ee,ei.NodeList=V,ei.XMLSerializer=Ci,ei}var Xs={},ba={},dl;function Fm(){return dl||(dl=1,function(s){var e=Cn().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e
vendor: 14,815 bytes, line 19
19({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:
19` 20`
vendor: 9,925 bytes, line 20
20,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:"
20 ",target:"â",Tau:"Τ",tau:"Ï",tbrk:"â´",Tcaron:"Ť",tcaron:"Å¥",Tcedil:"Å¢",tcedil:"Å£",Tcy:"Т",tcy:"Ñ",tdot:"â",telrec:"â",Tfr:"ð",tfr:"ð±",there4:"â´",Therefore:"â´",therefore:"â´",Theta:"Î",theta:"θ",thetasym:"Ï",thetav:"Ï",thickapprox:"â",thicksim:"â¼",ThickSpace:"ââ",thinsp:"â",ThinSpace:"â",thkap:"â",thksim:"â¼",THORN:"Ã",thorn:"þ",Tilde:"â¼",tilde:"Ë",TildeEqual:"â",TildeFullEqual:"â
",TildeTilde:"â",times:"Ã",timesb:"â ",timesbar:"⨱",timesd:"⨰",tint:"â",toea:"⤨",top:"â¤",topbot:"â¶",topcir:"⫱",Topf:"ð",topf:"ð¥",topfork:"â«",tosa:"⤩",tprime:"â´",TRADE:"â¢",trade:"â¢",triangle:"âµ",triangledown:"â¿",triangleleft:"â",trianglelefteq:"â´",triangleq:"â",triangleright:"â¹",trianglerighteq:"âµ",tridot:"â¬",trie:"â",triminus:"⨺",TripleDot:"â",triplus:"⨹",trisb:"â§",tritime:"⨻",trpezium:"â¢",Tscr:"ð¯",tscr:"ð",TScy:"Ц",tscy:"Ñ",TSHcy:"Ð",tshcy:"Ñ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"â¬",twoheadleftarrow:"â",twoheadrightarrow:"â ",Uacute:"Ã",uacute:"ú",Uarr:"â",uArr:"â",uarr:"â",Uarrocir:"â¥",Ubrcy:"Ð",ubrcy:"Ñ",Ubreve:"Ŭ",ubreve:"Å",Ucirc:"Ã",ucirc:"û",Ucy:"У",ucy:"Ñ",udarr:"â
",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"ð",ufr:"ð²",Ugrave:"Ã",ugrave:"ù",uHar:"⥣",uharl:"â¿",uharr:"â¾",uhblk:"â",ulcorn:"â",ulcorner:"â",ulcrop:"â",ultri:"â¸",Umacr:"Ū",umacr:"Å«",uml:"¨",UnderBar:"_",UnderBrace:"â",UnderBracket:"âµ",UnderParenthesis:"â",Union:"â",UnionPlus:"â",Uogon:"Ų",uogon:"ų",Uopf:"ð",uopf:"ð¦",UpArrow:"â",Uparrow:"â",uparrow:"â",UpArrowBar:"â¤",UpArrowDownArrow:"â
",UpDownArrow:"â",Updownarrow:"â",updownarrow:"â",UpEquilibrium:"⥮",upharpoonleft:"â¿",upharpoonright:"â¾",uplus:"â",UpperLeftArrow:"â",UpperRightArrow:"â",Upsi:"Ï",upsi:"Ï
",upsih:"Ï",Upsilon:"Î¥",upsilon:"Ï
",UpTee:"â¥",UpTeeArrow:"â¥",upuparrows:"â",urcorn:"â",urcorner:"â",urcrop:"â",Uring:"Å®",uring:"ů",urtri:"â¹",Uscr:"ð°",uscr:"ð",utdot:"â°",Utilde:"Ũ",utilde:"Å©",utri:"âµ",utrif:"â´",uuarr:"â",Uuml:"Ã",uuml:"ü",uwangle:"⦧",vangrt:"â¦",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"â
",varphi:"Ï",varpi:"Ï",varpropto:"â",vArr:"â",varr:"â",varrho:"ϱ",varsigma:"Ï",varsubsetneq:"âï¸",varsubsetneqq:"â«ï¸",varsupsetneq:"âï¸",varsupsetneqq:"â«ï¸",vartheta:"Ï",vartriangleleft:"â²",vartriangleright:"â³",Vbar:"â««",vBar:"⫨",vBarv:"â«©",Vcy:"Ð",vcy:"в",VDash:"â«",Vdash:"â©",vDash:"â¨",vdash:"â¢",Vdashl:"⫦",Vee:"â",vee:"â¨",veebar:"â»",veeeq:"â",vellip:"â®",Verbar:"â",verbar:"|",Vert:"â",vert:"|",VerticalBar:"â£",VerticalLine:"|",VerticalSeparator:"â",VerticalTilde:"â",VeryThinSpace:"â",Vfr:"ð",vfr:"ð³",vltri:"â²",vnsub:"ââ",vnsup:"ââ",Vopf:"ð",vopf:"ð§",vprop:"â",vrtri:"â³",Vscr:"ð±",vscr:"ð",vsubnE:"â«ï¸",vsubne:"âï¸",vsupnE:"â«ï¸",vsupne:"âï¸",Vvdash:"âª",vzigzag:"â¦",Wcirc:"Å´",wcirc:"ŵ",wedbar:"â©",Wedge:"â",wedge:"â§",wedgeq:"â",weierp:"â",Wfr:"ð",wfr:"ð´",Wopf:"ð",wopf:"ð¨",wp:"â",wr:"â",wreath:"â",Wscr:"ð²",wscr:"ð",xcap:"â",xcirc:"â¯",xcup:"â",xdtri:"â½",Xfr:"ð",xfr:"ðµ",xhArr:"âº",xharr:"â·",Xi:"Î",xi:"ξ",xlArr:"â¸",xlarr:"âµ",xmap:"â¼",xnis:"â»",xodot:"â¨",Xopf:"ð",xopf:"ð©",xoplus:"â¨",xotime:"â¨",xrArr:"â¹",xrarr:"â¶",Xscr:"ð³",xscr:"ð",xsqcup:"â¨",xuplus:"â¨",xutri:"â³",xvee:"â",xwedge:"â",Yacute:"Ã",yacute:"ý",YAcy:"Я",yacy:"Ñ",Ycirc:"Ŷ",ycirc:"Å·",Ycy:"Ы",ycy:"Ñ",yen:"Â¥",Yfr:"ð",yfr:"ð¶",YIcy:"Ð",yicy:"Ñ",Yopf:"ð",yopf:"ðª",Yscr:"ð´",yscr:"ð",YUcy:"Ю",yucy:"Ñ",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"Ð",zcy:"з",Zdot:"Å»",zdot:"ż",zeetrf:"â¨",ZeroWidthSpace:"â",Zeta:"Î",zeta:"ζ",Zfr:"â¨",zfr:"ð·",ZHcy:"Ð",zhcy:"ж",zigrarr:"â",Zopf:"â¤",zopf:"ð«",Zscr:"ðµ",zscr:"ð",zwj:"â",zwnj:"â"}),s.entityMap=s.HTML_ENTITIES}(ba)),ba}var Wr={},hl;
vendor: 11,381 bytes, lines 20-23
20function Um(){if(hl)return Wr;hl=1;var s=Cn().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,y=7;function w(v,C){this.message=v,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,w)}w.prototype=new Error,w.prototype.name=w.name;function S(){}S.prototype={parse:function(v,C,U){var H=this.domBuilder;H.startDocument(),z(C,C={}),O(v,C,U,H,this.errorHandler),H.endDocument()}};function O(v,C,U,H,V){function Q(ke){if(ke>65535){ke-=65536;var Pe=55296+(ke>>10),oi=56320+(ke&1023);return String.fromCharCode(Pe,oi)}else return String.fromCharCode(ke)}function ie(ke){var Pe=ke.slice(1,-1);return Object.hasOwnProperty.call(U,Pe)?U[Pe]:Pe.charAt(0)==="#"?Q(parseInt(Pe.substr(1).replace("x","0x"))):(V.error("entity not found:"+ke),ke)}function re(ke){if(ke>_e){var Pe=v.substring(_e,ke).replace(/&#?\w+;/g,ie);ee&&K(_e),H.characters(Pe,0,ke-_e),_e=ke}}function K(ke,Pe){for(;ke>=J&&(Pe=te.exec(v));)Z=Pe.index,J=Z+Pe[0].length,ee.lineNumber++;ee.columnNumber=ke-Z+1}for(var Z=0,J=0,te=/.*(?:\r\n?|\n)|.*$/g,ee=H.locator,fe=[{currentNSMap:C}],me={},_e=0;;){try{var he=v.indexOf("<",_e);if(he<0){if(!v.substr(_e).match(/^\s*$/)){var Ke=H.doc,Je=Ke.createTextNode(v.substr(_e));Ke.appendChild(Je),H.currentElement=Je}return}switch(he>_e&&re(he),v.charAt(he+1)){case"/":var Ve=v.indexOf(">",he+3),$e=v.substring(he+2,Ve).replace(/[ \t\n\r]+$/g,""),Ze=fe.pop();Ve<0?($e=v.substring(he+2).replace(/[\s<].*/,""),V.error("end tag name: "+$e+" is not complete:"+Ze.tagName),Ve=he+1+$e.length):$e.match(/\s</)&&($e=$e.replace(/[\s<].*/,""),V.error("end tag name: "+$e+" maybe not complete"),Ve=he+1+$e.length);var bt=Ze.localNSMap,Ye=Ze.tagName==$e,rt=Ye||Ze.tagName&&Ze.tagName.toLowerCase()==$e.toLowerCase();if(rt){if(H.endElement(Ze.uri,Ze.localName,$e),bt)for(var ni in bt)Object.prototype.hasOwnProperty.call(bt,ni)&&H.endPrefixMapping(ni);Ye||V.fatalError("end tag name: "+$e+" is not match the current start tagName:"+Ze.tagName)}else fe.push(Ze);Ve++;break;case"?":ee&&K(he),Ve=$(v,he,H);break;case"!":ee&&K(he),Ve=q(v,he,H,V);break;default:ee&&K(he);var He=new R,ai=fe[fe.length-1].currentNSMap,Ve=P(v,he,He,ai,ie,V),Vi=He.length;if(!He.closed&&L(v,Ve,He.tagName,me)&&(He.closed=!0,U.nbsp||V.warning("unclosed xml attribute")),ee&&Vi){for(var pt=T(ee,{}),xt=0;xt<Vi;xt++){var Te=He[xt];K(Te.offset),Te.locator=T(ee,{})}H.locator=pt,B(He,H,ai)&&fe.push(He),H.locator=ee}else B(He,H,ai)&&fe.push(He);s.isHTML(He.uri)&&!He.closed?Ve=M(v,Ve,He.tagName,ie,H):Ve++}}catch(ke){if(ke instanceof w)throw ke;V.error("element parse error: "+ke),Ve=-1}Ve>_e?_e=Ve:re(Math.max(he,_e)+1)}}function T(v,C){return C.lineNumber=v.lineNumber,C.columnNumber=v.columnNumber,C}function P(v,C,U,H,V,Q){function ie(ee,fe,me){U.attributeNames.hasOwnProperty(ee)&&Q.fatalError("Attribute "+ee+" redefined"),U.addValue(ee,fe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,V),me)}for(var re,K,Z=++C,J=r;;){var te=v.charAt(Z);switch(te){case"=":if(J===n)re=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&&(Q.warning('attribute value must after "="'),re=v.slice(C,Z)),C=Z+1,Z=v.indexOf(te,C),Z>0)K=v.slice(C,Z),ie(re,K,C-1),J=f;else throw new Error("attribute value no end '"+te+"' match");else if(J==c)K=v.slice(C,Z),ie(re,K,C),Q.warning('attribute "'+re+'" missed start quot('+te+")!!"),C=Z+1,J=f;else throw new Error('attribute value must after "="');break;case"/":switch(J){case r:U.setTagName(v.slice(C,Z));case f:case g:case y:J=y,U.closed=!0;case c:case n:break;case a:U.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return Q.error("unexpected end of input"),J==r&&U.setTagName(v.slice(C,Z)),Z;case">":switch(J){case r:U.setTagName(v.slice(C,Z));case f:case g:case y:break;case c:case n:K=v.slice(C,Z),K.slice(-1)==="/"&&(U.closed=!0,K=K.slice(0,-1));case a:J===a&&(K=re),J==c?(Q.warning('attribute "'+K+'" missed quot(")!'),ie(re,K,C)):((!s.isHTML(H[""])||!K.match(/^(?:disabled|checked|selected)$/i))&&Q.warning('attribute "'+K+'" missed value!! "'+K+'" instead!!'),ie(K,K,C));break;case u:throw new Error("attribute value missed!!")}return Z;case"Â":te=" ";default:if(te<=" ")switch(J){case r:U.setTagName(v.slice(C,Z)),J=g;break;case n:re=v.slice(C,Z),J=a;break;case c:var K=v.slice(C,Z);Q.warning('attribute "'+K+'" missed quot(")!!'),ie(re,K,C);case f:J=g;break}else switch(J){case a:U.tagName,(!s.isHTML(H[""])||!re.match(/^(?:disabled|checked|selected)$/i))&&Q.warning('attribute "'+re+'" missed value!! "'+re+'" instead2!!'),ie(re,re,C),C=Z,J=n;break;case f:Q.warning('attribute space is required"'+re+'"!!');case g:J=n,C=Z;break;case u:J=c,C=Z;break;case y:throw new Error("elements closed character '/' and '>' must be connected to")}}Z++}}function B(v,C,U){for(var H=v.tagName,V=null,te=v.length;te--;){var Q=v[te],ie=Q.qName,re=Q.value,ee=ie.indexOf(":");if(ee>0)var K=Q.prefix=ie.slice(0,ee),Z=ie.slice(ee+1),J=K==="xmlns"&&Z;else Z=ie,K=null,J=ie==="xmlns"&&"";Q.localName=Z,J!==!1&&(V==null&&(V={},z(U,U={})),U[J]=V[J]=re,Q.uri=s.XMLNS,C.startPrefixMapping(J,re))}for(var te=v.length;te--;){Q=v[te];var K=Q.prefix;K&&(K==="xml"&&(Q.uri=s.XML),K!=="xmlns"&&(Q.uri=U[K||""]))}var ee=H.indexOf(":");ee>0?(K=v.prefix=H.slice(0,ee),Z=v.localName=H.slice(ee+1)):(K=null,Z=v.localName=H);var fe=v.uri=U[K||""];if(C.startElement(fe,Z,H,v),v.closed){if(C.endElement(fe,Z,H),V)for(K in V)Object.prototype.hasOwnProperty.call(V,K)&&C.endPrefixMapping(K)}else return v.currentNSMap=U,v.localNSMap=V,!0}function M(v,C,U,H,V){if(/^(?:script|textarea)$/i.test(U)){var Q=v.indexOf("</"+U+">",C),ie=v.substring(C+1,Q);if(/[&<]/.test(ie))return/^script$/i.test(U)?(V.characters(ie,0,ie.length),Q):(ie=ie.replace(/&#?\w+;/g,H),V.characters(ie,0,ie.length),Q)}return C+1}function L(v,C,U,H){var V=H[U];return V==null&&(V=v.lastIndexOf("</"+U+">"),V<C&&(V=v.lastIndexOf("</"+U)),H[U]=V),V<C}function z(v,C){for(var U in v)Object.prototype.hasOwnProperty.call(v,U)&&(C[U]=v[U])}function q(v,C,U,H){var V=v.charAt(C+2);switch(V){case"-":if(v.charAt(C+3)==="-"){var Q=v.indexOf("-->",C+4);return Q>C?(U.comment(v,C+4,Q-C-4),Q+3):(H.error("Unclosed comment"),-1)}else return-1;default:if(v.substr(C+3,6)=="CDATA["){var Q=v.indexOf("]]>",C+9);return U.startCDATA(),U.characters(v,C+9,Q-C-9),U.endCDATA(),Q+3}var ie=G(v,C),re=ie.length;if(re>1&&/!doctype/i.test(ie[0][0])){var K=ie[1][0],Z=!1,J=!1;re>3&&(/^public$/i.test(ie[2][0])?(Z=ie[3][0],J=re>4&&ie[4][0]):/^system$/i.test(ie[2][0])&&(J=ie[3][0]));var te=ie[re-1];return U.startDTD(K,Z,J),U.endDTD(),te.index+te[0].length}}return-1}function $(v,C,U){var H=v.indexOf("?>",C);if(H){var V=v.substring(C,H).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return V?(V[0].length,U.processingInstruction(V[1],V[2]),H+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,U){if(!i.test(v))throw new Error("invalid attribute:"+v);this.attributeNames[v]=this.length,this[this.length++]={qName:v,value:C,offset:U}},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 G(v,C){var U,H=[],V=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(V.lastIndex=C,V.exec(v);U=V.exec(v);)if(H.push(U),U[1])return H}return Wr.XMLReader=S,Wr.ParseError=w,Wr}var fl;function qm(){if(fl)return Xs;fl=1;var s=Cn(),e=wc(),t=Fm(),i=Um(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,u=i.XMLReader;function c(P){return P.replace(/\r[\n\u0085]/g,` 21`).replace(/[\r\u0085\u2028]/g,` 22`)}function f(P){this.options=P||{locator:{}}}f.prototype.parseFromString=function(P,B){var M=this.options,L=new u,z=M.domBuilder||new y,q=M.errorHandler,$=M.locator,R=M.xmlns||{},G=/\/x?html?$/.test(B),v=G?t.HTML_ENTITIES:t.XML_ENTITIES;$&&z.setDocumentLocator($),L.errorHandler=g(q,z,$),L.domBuilder=M.domBuilder||z,G&&(R[""]=n.HTML),R.xml=R.xml||n.XML;var C=M.normalizeLineEndings||c;return P&&typeof P=="string"?L.parse(C(P),R,v):L.errorHandler.error("invalid doc source"),z.doc};function g(P,B,M){if(!P){if(B instanceof y)return B;P=B}var L={},z=P instanceof Function;M=M||{};function q($){var R=P[$];!R&&z&&(R=P.length==2?function(G){P($,G)}:P),L[$]=R&&function(G){R("[xmldom "+$+"] "+G+S(M))}||function(){}}return q("warning"),q("error"),q("fatalError"),L}function y(){this.cdata=!1}function w(P,B){B.lineNumber=P.lineNumber,B.columnNumber=P.columnNumber}y.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(P,B,M,L){var z=this.doc,q=z.createElementNS(P,M||B),$=L.length;T(this,q),this.currentElement=q,this.locator&&w(this.locator,q);for(var R=0;R<$;R++){var P=L.getURI(R),G=L.getValue(R),M=L.getQName(R),v=z.createAttributeNS(P,M);this.locator&&w(L.getLocator(R),v),v.value=v.nodeValue=G,q.setAttributeNode(v)}},endElement:function(P,B,M){var L=this.currentElement;L.tagName,this.currentElement=L.parentNode},startPrefixMapping:function(P,B){},endPrefixMapping:function(P){},processingInstruction:function(P,B){var M=this.doc.createProcessingInstruction(P,B);this.locator&&w(this.locator,M),T(this,M)},ignorableWhitespace:function(P,B,M){},characters:function(P,B,M){if(P=O.apply(this,arguments),P){if(this.cdata)var L=this.doc.createCDATASection(P);else var L=this.doc.createTextNode(P);this.currentElement?this.currentElement.appendChild(L):/^\s*$/.test(P)&&this.doc.appendChild(L),this.locator&&w(this.locator,L)}},skippedEntity:function(P){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(P){(this.locator=P)&&(P.lineNumber=0)},comment:function(P,B,M){P=O.apply(this,arguments);var L=this.doc.createComment(P);this.locator&&w(this.locator,L),T(this,L)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(P,B,M){var L=this.doc.implementation;if(L&&L.createDocumentType){var z=L.createDocumentType(P,B,M);this.locator&&w(this.locator,z),T(this,z),this.doc.doctype=z}},warning:function(P){console.warn("[xmldom warning] "+P,S(this.locator))},error:function(P){console.error("[xmldom error] "+P,S(this.locator))},fatalError:function(P){throw new a(P,this.locator)}};function S(P){if(P)return` 23@`+(P.systemId||"")+"#[line:"+P.lineNumber+",col:"+P.columnNumber+"]"}function O(P,B,M){return typeof P=="string"?P.substr(B,M):P.length>=B+M||B?new java.lang.String(P,B,M)+"":P}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(P){y.prototype[P]=function(){return null}});function T(P,B){P.currentElement?P.currentElement.appendChild(B):P.doc.appendChild(B)}return Xs.__DOMHandler=y,Xs.normalizeLineEndings=c,Xs.DOMParser=f,Xs}var pl;function $m(){if(pl)return Ws;pl=1;var s=wc();return Ws.DOMImplementation=s.DOMImplementation,Ws.XMLSerializer
23=s.XMLSerializer,Ws.DOMParser=qm().DOMParser,Ws}var jm=$m();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const ml=s=>!!s&&typeof s=="object",We=(...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]):ml(e[i])&&ml(t[i])?e[i]=We(e[i],t[i]):e[i]=t[i]}),e),{}),kc=s=>Object.keys(s).map(e=>s[e]),Vm=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},cs=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},Hm=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),zm=(s,e)=>kc(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var ds={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const or=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:go(s||"",e)};if(t||i){const a=(t||i).split("-");let u=A.BigInt?A.BigInt(a[0]):parseInt(a[0],10),c=A.BigInt?A.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=A.BigInt(c)-A.BigInt(u)+A.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},Gm=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=A.BigInt(s.offset)+A.BigInt(s.length)-A.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},gl=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),Wm={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=gl(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=gl(s.endNumber),g=(e+t)/1e3,y=i+a,S=g+u-y,O=Math.ceil(S*r/n),T=Math.floor((g-y-c)*r/n),P=Math.floor((g-y)*r/n);return{start:Math.max(0,T),end:typeof f=="number"?f:Math.min(O,P)}}},Xm=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}},_o=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:u}=Wm[e](s),c=Vm(a,u).map(Xm(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(ds.NO_BASE_URL);const f=or({baseUrl:e,source:t.sourceURL,range:t.range}),g=or({baseUrl:e,source:e,indexRange:r});if(g.map=f,c){const y=_o(s);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else i&&(g.duration=i,g.timeline=n);return g.presentationTime=a||n,g.number=u,[g]},yo=(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=[],y=s.endList?"static":"dynamic",w=s.sidx.timeline;let S=w,O=s.mediaSequence||0,T;typeof e.firstOffset=="bigint"?T=A.BigInt(u)+e.firstOffset:T=u+e.firstOffset;for(let P=0;P<f.length;P++){const B=e.references[P],M=B.referencedSize,L=B.subsegmentDuration;let z;typeof T=="bigint"?z=T+A.BigInt(M)-A.BigInt(1):z=T+M-1;const q=`${T}-${z}`,R=Pc({baseUrl:t,timescale:c,timeline:n,periodStart:w,presentationTime:S,number:O,duration:L,sourceDuration:r,indexRange:q,type:y})[0];i&&(R.map=i),g.push(R),typeof T=="bigint"?T+=A.BigInt(M):T+=M,S+=L/c,O++}return s.segments=g,s},Km=["AUDIO","SUBTITLES"],Ym=1/60,Lc=s=>zm(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),Qm=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},_l=s=>{let e=[];return Nm(s,Km,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},yl=({playlist:s,mediaSequence:e})=>
23{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=Qm(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)<Ym});if(a===-1){yl({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--),yl({playlist:i,mediaSequence:r.segments[a].number})})},Zm=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(_l(s)),i=e.playlists.concat(_l(e));return e.timelineStarts=Lc([s.timelineStarts,e.timelineStarts]),Jm({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},An=s=>s&&s.uri+"-"+Gm(s.byterange),xa=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=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=Hm(i.segments||[],"discontinuity"),i))},To=(s,e)=>{const t=An(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&yo(s,i,s.sidx.resolvedUri),s},eg=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=To(s[t],e);return s},tg=({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},ig=({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},sg=(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 y=u?` (${u})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});const g=To(tg(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},rg=(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(To(ig(i),e)),t},{}),ng=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),{}),ag=({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.c
23ontentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},og=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",ug=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",lg=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",cg=(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})})},Tl=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],dg=({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=xa(s.filter(og)).map(ag),y=xa(s.filter(ug)),w=xa(s.filter(lg)),S=s.map(z=>z.attributes.captionServices).filter(Boolean),O={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:eg(g,i)};f>=0&&(O.minimumUpdatePeriod=f*1e3),e&&(O.locations=e),t&&(O.contentSteering=t),u==="dynamic"&&(O.suggestedPresentationDelay=c),n&&n.length>0&&(O.eventStream=n);const T=O.playlists.length===0,P=y.length?sg(y,i,T):null,B=w.length?rg(w,i):null,M=g.concat(Tl(P),Tl(B)),L=M.map(({timelineStarts:z})=>z);return O.timelineStarts=Lc(L),cg(M,O.timelineStarts),P&&(O.mediaGroups.AUDIO.audio=P),B&&(O.mediaGroups.SUBTITLES.subs=B),S.length&&(O.mediaGroups["CLOSED-CAPTIONS"].cc=ng(S)),r?Zm({oldManifest:r,newManifest:O}):O},hg=(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,w=f+c-g;return Math.ceil((w*a-e)/t)},Oc=(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 y=0;y<e.length;y++){const w=e[y],S=w.d,O=w.r||0,T=w.t||0;g<0&&(g=T),T&&T>g&&(g=T);let P;if(O<0){const L=y+1;L===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?P=hg(s,g,S):P=(n*a-g)/S:P=(e[L].t-g)/S}else P=O+1;const B=u+f.length+P;let M=u+f.length;for(;M<B;)f.push({number:M,duration:S/a,time:g,timeline:c}),g+=S,M++}return f},fg=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,pg=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}`},vl=(s,e)=>s.replace(fg,pg(e)),mg=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?_o(s):Oc(s,e),gg=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}
vendor: 4,115 bytes, line 23
23=s,r=or({baseUrl:s.baseUrl,source:vl(i.sourceURL,t),range:i.range});return mg(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const u=vl(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:go(s.baseUrl||"",u),map:r,number:a.number,presentationTime:g}})},_g=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=or({baseUrl:t,source:i.sourceURL,range:i.range}),n=or({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},yg=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(ds.SEGMENT_TIME_UNSPECIFIED);const n=i.map(c=>_g(s,c));let a;return t&&(a=_o(s)),e&&(a=Oc(s,e)),a.map((c,f)=>{if(n[f]){const g=n[f],y=s.timescale||1,w=s.presentationTimeOffset||0;return g.timeline=c.timeline,g.duration=c.duration,g.number=c.number,g.presentationTime=r+(c.time-w)/y,g}}).filter(c=>c)},Tg=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=gg,t=We(s,e.template)):e.base?(i=Pc,t=We(s,e.base)):e.list&&(i=yg,t=We(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},vg=s=>s.map(Tg),Re=(s,e)=>Ic(s.childNodes).filter(({tagName:t})=>t===e),hr=s=>s.textContent.trim(),bg=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Xi=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,y,w,S]=u.slice(1);return parseFloat(c||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(g||0)*86400+parseFloat(y||0)*3600+parseFloat(w||0)*60+parseFloat(S||0)},xg=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),bl={mediaPresentationDuration(s){return Xi(s)},availabilityStartTime(s){return xg(s)/1e3},minimumUpdatePeriod(s){return Xi(s)},suggestedPresentationDelay(s){return Xi(s)},type(s){return s},timeShiftBufferDepth(s){return Xi(s)},start(s){return Xi(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return bg(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)?Xi(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}},je=s=>s&&s.attributes?Ic(s.attributes).reduce((e,t)=>{const i=bl[t.name]||bl.DEFAULT;return e[t.name]=i(t.value),e},{}):{},Sg={"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"},Dn=(s,e)=>e.length?cs(s.map(function(t){return e.map(function(i){const r=hr(i),n=go(t.baseUrl,r),a=We(je(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,vo=s=>{const e=Re(s,"SegmentTemplate")[0],t=Re(s,"SegmentList")[0],i=t&&Re(t,"SegmentURL").map(y=>We({tag:"SegmentURL"},je(y))),r=Re(s,"SegmentBase")[0],n=t||e,a=n&&Re(n,"SegmentTimeline")[0],u=t||r||e,c=u&&Re(u,"Initialization")[0],f=e&&je(e);f&&c?f.initialization=c&&je(c):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const g={template:f,segmentTimeline:a&&Re(a,"S").map(y=>je(y)),list:t&&We(je(t),{segmentUrls:i,initialization:je(c)}),base:r&&We(je(r),{initialization:je(c)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},Eg=(s,e,t)=>i=>{const r=Re(i,"BaseURL"),n=Dn(e,r),a=We(s,je(i)),u=vo(i);return n.map(c=>({segmentInfo:We(t,u),attributes:We(a,c)}))},Cg=s=>s.reduce((e,t)=>{const i=je(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=Sg[i.schemeIdUri];if(r){e[r]={attributes:i};
23const n=Re(t,"cenc:pssh")[0];if(n){const a=hr(n);e[r].pssh=a&&Bm(a)}}return e},{}),Ag=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})},Dg=s=>cs(Re(s.node,"EventStream").map(e=>{const t=je(e),i=t.schemeIdUri;return Re(e,"Event").map(r=>{const n=je(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:hr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),wg=(s,e,t)=>i=>{const r=je(i),n=Dn(e,Re(i,"BaseURL")),a=Re(i,"Role")[0],u={role:je(a)};let c=We(s,r,u);const f=Re(i,"Accessibility")[0],g=Ag(je(f));g&&(c=We(c,{captionServices:g}));const y=Re(i,"Label")[0];if(y&&y.childNodes.length){const P=y.childNodes[0].nodeValue.trim();c=We(c,{label:P})}const w=Cg(Re(i,"ContentProtection"));Object.keys(w).length&&(c=We(c,{contentProtection:w}));const S=vo(i),O=Re(i,"Representation"),T=We(t,S);return cs(O.map(Eg(c,n,T)))},kg=(s,e)=>(t,i)=>{const r=Dn(e,Re(t.node,"BaseURL")),n=We(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Re(t.node,"AdaptationSet"),u=vo(t.node);return cs(a.map(wg(n,r,u)))},Ig=(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=We({serverURL:hr(s[0])},je(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Pg=({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,Lg=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Re(s,"Period");if(!a.length)throw new Error(ds.INVALID_NUMBER_OF_PERIOD);const u=Re(s,"Location"),c=je(s),f=Dn([{baseUrl:t}],Re(s,"BaseURL")),g=Re(s,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=i,c.clientOffset=r,u.length&&(c.locations=u.map(hr));const y=[];return a.forEach((w,S)=>{const O=je(w),T=y[S-1];O.start=Pg({attributes:O,priorPeriodAttributes:T?T.attributes:null,mpdType:c.type}),y.push({node:w,attributes:O})}),{locations:c.locations,contentSteeringInfo:Ig(g,n),representationInfo:cs(y.map(kg(c,f))),eventStream:cs(y.map(Dg))}},Rc=s=>{if(s==="")throw new Error(ds.DASH_EMPTY_MANIFEST);const e=new jm.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(ds.DASH_INVALID_XML);return i},Og=s=>{const e=Re(s,"UTCTiming")[0];if(!e)return null;const t=je(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(ds.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Rg=(s,e={})=>{const t=Lg(Rc(s),e),i=vg(t.representationInfo);return dg({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Ng=s=>Og(Rc(s));var Sa,xl;function Mg(){if(xl)return Sa;xl=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?
23Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return Sa={getUint64:e,MAX_UINT32:s},Sa}var Ea,Sl;function Bg(){if(Sl)return Ea;Sl=1;var s=Mg().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 Ea=e,Ea}var Fg=Bg();const Ug=ys(Fg);var qg=le([73,68,51]),$g=function(e,t){t===void 0&&(t=0),e=le(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},Js=function s(e,t){return t===void 0&&(t=0),e=le(e),e.length-t<10||!Oe(e,qg,{offset:t})?t:(t+=$g(e,t),s(e,t))},El=function(e){return typeof e=="string"?Dc(e):e},jg=function(e){return Array.isArray(e)?e.map(function(t){return El(t)}):[El(e)]},Vg=function s(e,t,i){i===void 0&&(i=!1),t=jg(t),e=le(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);Oe(u,t[0])&&(t.length===1?r.push(f):r.push.apply(r,s(f,t.slice(1),i))),n=c}return r},Xr={EBML:le([26,69,223,163]),DocType:le([66,130]),Segment:le([24,83,128,103]),SegmentInfo:le([21,73,169,102]),Tracks:le([22,84,174,107]),Track:le([174]),TrackNumber:le([215]),DefaultDuration:le([35,227,131]),TrackEntry:le([174]),TrackType:le([131]),FlagDefault:le([136]),CodecID:le([134]),CodecPrivate:le([99,162]),VideoTrack:le([224]),AudioTrack:le([225]),Cluster:le([31,67,182,117]),Timestamp:le([231]),TimestampScale:le([42,215,177]),BlockGroup:le([160]),BlockDuration:le([155]),Block:le([161]),SimpleBlock:le([163])},ja=[128,64,32,16,8,4,2,1],Hg=function(e){for(var t=1,i=0;i<ja.length&&!(e&ja[i]);i++)t++;return t},rn=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=Hg(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=ja[n-1]),{length:n,value:Im(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"?Pm(e):e},zg=function(e){return Array.isArray(e)?e.map(function(t){return Cl(t)}):[Cl(e)]},Gg=function s(e,t,i){if(i>=t.length)return t.length;var r=rn(t,i,!1);if(Oe(e.bytes,r.bytes))return i;var n=rn(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Al=function s(e,t){t=zg(t),e=le(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=rn(e,r,!1),a=rn(e,r+n.length),u=r+n.length+a.length;a.value===127&&(a.value=Gg(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);Oe(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},Wg=le([0,0,0,1]),Xg=le([0,0,1]),Kg=le([0,0,3]),Yg=function(e){for(var t=[],i=1;i<e.length-2;)Oe(e.subarray(i,i+3),Kg)&&(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},Nc=function(e,t,i,r){e=le(e),i=[].concat(i);for(var n=0,a,u=0;n<e.length&&(u<r||a);){var c=void 0;if(Oe(e.subarray(n),Wg)?c=4:Oe(e.subarray(n),Xg)&&(c=3),!c){n++;continue}if(u++,a)return Yg(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)},Qg=function(e,t,i){return Nc(e,"h264",t,i)},Jg=function(e,t,i){return Nc(e,"h265",t,i)},ot={webm:le([119,101,98,109]),matroska:le([109,97,116,114,111,115,107,97]),flac:le([102,76,97,67]),ogg:le([79,103,103,83]),ac3:le([11,119]),riff:le([82,73,70,70]),avi:le([65,86,73]),wav:le([87,65,86,69]),"3gp":le([102,116,121,112,51,103]),mp4:le([102,116,121,112]),fmp4:le([115,116,121,112]),mov:le([102,116,121,112,113,116]),moov:le([109,111,111,118]),moof:le([109,111,111,102])},hs={aac:function(e){var t=Js(e);return Oe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Js(e);return Oe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Al(e,[Xr.EBML,Xr.DocType])[0];return Oe(t,ot.webm)},mkv:function(e){var t=Al(e,[Xr.EBML,Xr.DocType])[0];return Oe(t,ot.matroska)},mp4:function(e){if(hs["3gp"](e)||hs.mov(e))return!1;if(Oe(e,ot.mp4,{offset:4})||Oe(e,ot.fmp4,{offset:4})||Oe(e,ot.moof,{offset:4})||Oe(e,ot.moov,{offset:4}))return!0},mov:function(e){return Oe(e,ot.mov,{offset:4})},"3gp":function(e){return Oe(e,ot["3gp"],{offset:4})},ac3:function(e){var t=Js(e);return Oe(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=Js(e);return Oe(e,ot.flac,{offset:t})},ogg:function(e){return Oe(e,ot.ogg)},avi:function(e){return Oe(e,ot.riff)&&Oe(e,ot.avi,{offset:8})},wav:function(e){return Oe(e,ot.riff)&&Oe(e,ot.wav,{offset:8})},h264:function(e){return Qg(e,7,3).length},h265:function(e){return Jg(e,[32,33],3).length}},Va=Object.keys(hs).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);
23Va.forEach(function(s){var e=hs[s];hs[s]=function(t){return e(le(t))}});var Zg=hs,bo=function(e){e=le(e);for(var t=0;t<Va.length;t++){var i=Va[t];if(Zg[i](e))return i}return""},e0=function(e){return Vg(e,["moof"]).length>0},Ca,Dl;function t0(){if(Dl)return Ca;Dl=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)},Ca={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:u},Ca}var Ri=t0();/** 24 * @license 25 * Video.js 8.23.4 <http://videojs.com/> 26 * Copyright Brightcove, Inc. <https://www.brightcove.com/> 27 * Available under Apache License Version 2.0 28 * <https://github.com/videojs/video.js/blob/main/LICENSE> 29 * 30 * Includes vtt.js <https://github.com/mozilla/vtt.js> 31 * Available under Apache License Version 2.0 32 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE> 33 */var Ha="8.23.4";const ti={},vi=function(s,e){return ti[s]=ti[s]||[],e&&(ti[s]=ti[s].concat(e)),ti[s]},i0=function(s,e){vi(s,e)},Mc=function(s,e){const t=vi(s).indexOf(e);return t<=-1?!1:(ti[s]=ti[s].slice(),ti[s].splice(t,1),!0)},s0=function(s,e){vi(s,[].concat(e).map(t=>{const i=(...r)=>(Mc(s,i),t(...r));return i}))},nn={prefixed:!0},Zr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],wl=Zr[0];let Zs;for(let s=0;s<Zr.length;s++)if(Zr[s][1]in se){Zs=Zr[s];break}if(Zs){for(let s=0;s<Zs.length;s++)nn[wl[s]]=Zs[s];nn.prefixed=Zs[0]!==wl[0]}let ct=[];const r0=(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+":"),ct){ct.push([].concat(n));const g=ct.length-1e3;ct.splice(0,g>0?g:0)}if(!A.console)return;let f=A.console[i];!f&&i==="debug"&&(f=A.console.info||A.console.log),!(!f||!a||!u.test(i))&&f[Array.isArray(n)?"apply":"call"](A.console,n)};function za(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=r0(s,n,t),n.createLogger=(a,u,c)=>{const f=u!==void 0?u:e,g=c!==void 0?c:t,y=`${s} ${f} ${a}`;return za(y,f,g)},n.createNewLogger=(a,u,c)=>za(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=()=>ct?[].concat(ct):[],n.history.filter=a=>(ct||[]).filter(u=>new RegExp(`.*${a}.*`).test(u[0])),n.history.clear=()=>{ct&&(ct.length=0)},n.history.disable=()=>{ct!==null&&(ct.length=0,ct=null)},n.history.enable=()=>{ct===null&&(ct=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const ye=za("VIDEOJS"),Bc=ye.createLogger,n0=Object.prototype.toString,Fc=function(s){return Xt(s)?Object.keys(s):[]};function es(s,e){Fc(s).forEach(t=>e(s[t],t))}function Uc(s,e,t=0){return Fc(s).reduce((i,r)=>e(i,s[r],r),t)}function Xt(s){return!!s&&typeof s=="object"}function fs(s){return Xt(s)&&n0.call(s)==="[object Object]"&&s.constructor===Object}function Ce(...s){const e={};return s.forEach(t=>{t&&es(t,(i,r)=>{if(!fs(i)){e[r]=i;return}fs(e[r])||(e[r]={}),e[r]=Ce(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 wn(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var a0=Object.freeze({__proto__:null,each:es,reduce:Uc,isObject:Xt,isPlain:fs,merge:Ce,values:qc,defineLazyProperty:wn});let xo=!1,$c=null,Mt=!1,jc,Vc=!1,ts=!1,is=!1,Kt=!1,So=null,kn=null;const o0=!!(A.cast&&A.cast.framework&&A.cast.framework.CastReceiverContext);let Hc=null,an=!1,In=!1,on=!1,Pn=!1,un=!1,ln=!1,cn=!1;const ur=!!(Ts()&&("ontouchstart"in A||A.navigator.maxTouchPoints||A.DocumentTouch&&A.document instanceof A.DocumentTouch)),mi=A.navigator&&A.navigator.userAgentData;mi&&mi.platform&&mi.brands&&(Mt=mi.platform==="Android",ts=!!mi.brands.find(s=>s.brand==="Microsoft Edge"),is=!!mi.brands.find(s=>s.brand==="Chromium"),Kt=!ts&&is,So=kn=(mi.brands.find(s=>s.brand==="Chromium")||{}).version||null,In=mi.platform==="Windows");if(!is){const s=A.navigator&&A.navigator.userAgent||"";xo=/iPod/i.test(s),$c=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Mt=/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}(),Vc=/Firefox/i.test(s),ts=/Edg/i.test(s),is=/Chrome/i.test(s)||/CriOS/i.test(s),Kt=!ts&&is,So=kn=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Hc=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}(),un=/Tizen/i.test(s),ln=/Web0S/i.test(s),cn=un||ln,an=/Safari/i.test(s)&&!Kt&&!Mt&&!ts&&!cn,In=/Windows/i.test(s),on=/iPad/i.test(s)||an&&ur&&!/iPhone/i.test(s),Pn=/iPhone/i.test(s)&&!on}const tt=Pn||on||xo,Ln=(an||tt)&&!Kt;var zc=Object.freeze({__proto__:null,get IS_IPOD(){return xo},get IOS_VERSION(){return $c},get IS_ANDROID(){return Mt},get ANDROID_VERSION(){return jc},get IS_FIREFOX(){return Vc},get IS_EDGE(){return ts},get IS_CHROMIUM(){return is},get IS_CHROME(){return Kt},get CHROMIUM_VERSION(){return So},get CHROME_VERSION(){return kn},IS_CHROMECAST_RECEIVER:o0,get IE_VERSION(){return Hc},get IS_SAFARI(){return an},get IS_WINDOWS(){return In},get IS_IPAD(){return on},get IS_IPHONE(){return Pn},get IS_TIZEN(){return un},get IS_WEBOS(){return ln},get IS_SMART_TV(){return cn},TOUCH_ENABLED:ur,IS_IOS:tt,IS_ANY_SAFARI:Ln});function kl(s){return typeof s=="string"&&!!s.trim()}
33function u0(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ts(){return se===A.document}function vs(s){return Xt(s)&&s.nodeType===1}function Gc(){try{return A.parent!==A.self}catch{return!0}}function Wc(s){return function(e,t){if(!kl(e))return se[s](null);kl(t)&&(t=se.querySelector(t));const i=vs(t)?t:se;return i[s]&&i[s](e)}}function ce(s="div",e={},t={},i){const r=se.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?xi(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&Eo(r,i),r}function xi(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Ga(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ir(s,e){return u0(e),s.classList.contains(e)}function Bi(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function On(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+/).forEach(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 yi(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 ps(s,e,t){s.setAttribute(e,t)}function Rn(s,e){s.removeAttribute(e)}function Qc(){se.body.focus(),se.onselectstart=function(){return!1}}function Jc(){se.onselectstart=function(){return!0}}function ms(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(gs(s,"height"))),t.width||(t.width=parseFloat(gs(s,"width"))),t}}function lr(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!==se[nn.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Nn(s,e){const t={x:0,y:0};if(tt){let g=s;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=gs(g,"transform");
33if(/^matrix/.test(y)){const w=y.slice(7,-1).split(/,\s/).map(Number);t.x+=w[4],t.y+=w[5]}else if(/^matrix3d/.test(y)){const w=y.slice(9,-1).split(/,\s/).map(Number);t.x+=w[12],t.y+=w[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&A.WebKitCSSMatrix){const w=A.getComputedStyle(g.assignedSlot.parentElement).transform,S=new A.WebKitCSSMatrix(w);t.x+=S.m41,t.y+=S.m42}g=g.parentNode||g.host}}const i={},r=lr(e.target),n=lr(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,tt&&(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 Xt(s)&&s.nodeType===3}function Mn(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function ed(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),vs(e)||Zc(e))return e;if(typeof e=="string"&&/\S/.test(e))return se.createTextNode(e)}).filter(e=>e)}function Eo(s,e){return ed(e).forEach(t=>s.appendChild(t)),s}function td(s,e){return Eo(Mn(s),e)}function cr(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const bi=Wc("querySelector"),id=Wc("querySelectorAll");function gs(s,e){if(!s||!e)return"";if(typeof A.getComputedStyle=="function"){let t;try{t=A.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function sd(s){[...se.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=se.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const i=se.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var rd=Object.freeze({__proto__:null,isReal:Ts,isEl:vs,isInFrame:Gc,createEl:ce,textContent:xi,prependTo:Ga,hasClass:ir,addClass:Bi,removeClass:On,toggleClass:Xc,setAttributes:Kc,getAttributes:yi,getAttribute:Yc,setAttribute:ps,removeAttribute:Rn,blockTextSelection:Qc,unblockTextSelection:Jc,getBoundingClientRect:ms,findPosition:lr,getPointerPosition:Nn,isTextNode:Zc,emptyEl:Mn,normalizeContent:ed,appendContent:Eo,insertContent:td,isSingleLeftClick:cr,$:bi,$$:id,computedStyle:gs,copyStyleSheetsToWindow:sd});let nd=!1,Wa;const l0=function(){if(Wa.options.autoSetup===!1)return;const s=Array.prototype.slice.call(se.getElementsByTagName("video")),e=Array.prototype.slice.call(se.getElementsByTagName("audio")),t=Array.prototype.slice.call(se.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&&Wa(a);else{Xa(1);break}}else nd||Xa(1)};function Xa(s,e){Ts()&&(e&&(Wa=e),A.setTimeout(l0,s))}function Ka(){nd=!0,A.removeEventListener("load",Ka)}Ts()&&(se.readyState==="complete"?Ka():A.addEventListener("load",Ka));const ad=function(s){const e=se.createElement("style");return e.className=s,e},od=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var lt=new WeakMap;const c0=3;let d0=c0;function wt(){return d0++}function Il(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 Co(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Bn(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||A.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||se),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=se.documentElement,a=se.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 Kr;
vendor: 5,231 bytes, line 33
33const h0=function(){if(typeof Kr!="boolean"){Kr=!1;try{const s=Object.defineProperty({},"passive",{get(){Kr=!0}});A.addEventListener("test",null,s),A.removeEventListener("test",null,s)}catch{}}return Kr},f0=["touchstart","touchmove"];function Tt(s,e,t){if(Array.isArray(e))return Co(Tt,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=wt()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Bn(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;h0()&&f0.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function it(s,e,t){if(!lt.has(s))return;const i=lt.get(s);if(!i.handlers)return;if(Array.isArray(e))return Co(it,s,e,t);const r=function(a,u){i.handlers[u]=[],Il(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);Il(s,e)}}function bs(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=Bn(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)bs.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 Fn(s,e,t){if(Array.isArray(e))return Co(Fn,s,e,t);const i=function(){it(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||wt(),Tt(s,e,i)}function Ao(s,e,t){const i=function(){it(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||wt(),Tt(s,e,i)}var p0=Object.freeze({__proto__:null,fixEvent:Bn,on:Tt,off:it,trigger:bs,one:Fn,any:Ao});const kt=30,we=function(s,e,t){e.guid||(e.guid=wt());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Yt=function(s,e){let t=A.performance.now();return function(...r){const n=A.performance.now();n-t>=e&&(s(...r),t=n)}},ud=function(s,e,t,i=A){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 m0=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:kt,bind_:we,throttle:Yt,debounce:ud});let Ks;class vt{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Tt(this,e,t),this.addEventListener=i}off(e,t){it(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Fn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ao(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Bn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),bs(this,e)}queueTrigger(e){Ks||(Ks=new Map);const t=e.type||e;let i=Ks.get(this);i||(i=new Map,Ks.set(this,i));const r=i.get(t);i.delete(t),A.clearTimeout(r);const n=A.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,Ks.delete(this)),this.trigger(e)},0);i.set(t,n)}}vt.prototype.allowedEvents_={};vt.prototype.addEventListener=vt.prototype.on;vt.prototype.removeEventListener=vt.prototype.off;vt.prototype.dispatchEvent=vt.prototype.trigger;const Un=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,si=s=>s instanceof vt||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),g0=(s,e)=>{si(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Ya=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,dn=(s,e,t)=>{if(!s||!s.nodeName&&!si(s))throw new Error(`Invalid target for ${Un(e)}#${t}; must be a DOM node or evented object.`)},ld=(s,e,t)=>{if(!Ya(s))throw new Error(`Invalid event type for ${Un(e)}#${t}; must be a non-empty string or array.`)},cd=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Un(e)}#${t}; must be a function.`)},Aa=(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]),dn(r,s,t),ld(n,s,t),cd(a,s,t),a=we(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Pi=(s,e,t,i)=>{dn(s,s,e),s.nodeName?p0[e](s,t,i):s[e](t,i)},_0={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Aa(this,s,"on");if(Pi(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,Pi(this,"on","dispose",n),Pi(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Aa(this,s,"one");if(e)Pi(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Pi(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Aa(this,s,"any");
vendor: 4,113 bytes, line 33
33if(e)Pi(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Pi(t,"any",i,n)}},off(s,e,t){if(!s||Ya(s))it(this.eventBusEl_,s,e);else{const i=s,r=e;dn(i,this,"off"),ld(r,this,"off"),cd(t,this,"off"),t=we(this,t),this.off("dispose",t),i.nodeName?(it(i,r,t),it(i,"dispose",t)):si(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){dn(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Ya(t))throw new Error(`Invalid event type for ${Un(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return bs(this.eventBusEl_,s,e)}};function Do(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_=ce("span",{className:"vjs-event-bus"});return Object.assign(s,_0),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)}),A.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const y0={state:{},setState(s){typeof s=="function"&&(s=s());let e;return es(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&si(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function dd(s,e){return Object.assign(s,y0),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&si(s)&&s.on("statechanged",s.handleStateChanged),s}const sr=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())},hd=function(s,e){return Fe(s)===Fe(e)};var T0=Object.freeze({__proto__:null,toLowerCase:sr,toTitleCase:Fe,titleCaseEquals:hd});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_=Ce({},this.options_),t=this.options_=Ce(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_${wt()}`}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&&(Do(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),dd(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_=Ce(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ce(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,y){const w=t[y-1];let S=w;return typeof w>"u"&&(S=g),S})),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]}
33getDescendant(...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=ce("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=se.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=se.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_[sr(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_:vs(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_[sr(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 bi(e,t||this.contentEl())}$$(e,t){return id(e,t||this.contentEl())}hasClass(e){return ir(this.el_,e)}addClass(...e){Bi(this.el_,...e)}removeClass(...e){On(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){ps(this.el_,e,t)}removeAttribute(e){Rn(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=gs(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=A.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
vendor: 2,870 bytes, line 33
33=null,n===!0&&A.performance.now()-e<r&&(u.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=we(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=we(this,e),this.clearTimersOnDispose_(),i=A.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),A.clearTimeout(e)),e}setInterval(e,t){e=we(this,e),this.clearTimersOnDispose_();const i=A.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),A.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=we(this,e),t=A.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=we(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),A.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=A.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"||A.getComputedStyle(n).height==="0px"||A.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>(se.documentElement.clientWidth||A.innerWidth)||a.y<0||a.y>
33(se.documentElement.clientHeight||A.innerHeight))return!1;let u=se.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_[sr(e)]=t,t}static getComponent(e){if(!(!e||!X.components_))return X.components_[e]}}X.registerComponent("Component",X);function v0(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 Pl(s,e,t,i){return v0(s,i,t.length-1),t[i][e]}function Da(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:Pl.bind(null,"start",0,s),end:Pl.bind(null,"end",1,s)},A.Symbol&&A.Symbol.iterator&&(e[A.Symbol.iterator]=()=>(s||[]).values()),e}function Nt(s,e){return Array.isArray(s)?Da(s):s===void 0||e===void 0?Da():Da([[s,e]])}const fd=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 wo=fd;function pd(s){wo=s}function md(){wo=fd}function $i(s,e=s){return wo(s,e)}var b0=Object.freeze({__proto__:null,createTimeRanges:Nt,createTimeRange:Nt,setFormatTime:pd,resetFormatTime:md,formatTime:$i});function gd(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 Me(s){if(s instanceof Me)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Xt(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Me.defaultMessages[this.code]||"")}Me.prototype.code=0;Me.prototype.message="";Me.prototype.status=null;Me.prototype.metadata=null;Me.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Me.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."};Me.MEDIA_ERR_CUSTOM=0;Me.prototype.MEDIA_ERR_CUSTOM=0;Me.MEDIA_ERR_ABORTED=1;Me.prototype.MEDIA_ERR_ABORTED=1;Me.MEDIA_ERR_NETWORK=2;Me.prototype.MEDIA_ERR_NETWORK=2;Me.MEDIA_ERR_DECODE=3;Me.prototype.MEDIA_ERR_DECODE=3;Me.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Me.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Me.MEDIA_ERR_ENCRYPTED=5;Me.prototype.MEDIA_ERR_ENCRYPTED=5;function rr(s){return s!=null&&typeof s.then=="function"}function Ht(s){rr(s)&&s.then(null,e=>{})}const Qa=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}})})},x0=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=Qa(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(Qa))}
vendor: 4,653 bytes, line 33
33,S0=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 Ja={textTracksToJson:x0,jsonToTextTracks:S0,trackToJson:Qa};const wa="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_=ce("div",{className:`${wa}-content`},{role:"document"}),this.descEl_=ce("p",{className:`${wa}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),xi(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`${wa} 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(),td(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"),Mn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=se.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}se.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 A.HTMLAnchorElement||t instanceof A.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof A.HTMLInputElement||t instanceof A.HTMLSelectElement||t instanceof A.HTMLTextAreaElement||t instanceof A.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof A.HTMLIFrameElement||t instanceof A.HTMLObjectElement||t instanceof A.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}
vendor: 4,836 bytes, line 33
33xs.prototype.options_={pauseOnOpen:!0,temporary:!0};X.registerComponent("ModalDialog",xs);class ji extends vt{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})},si(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}ji.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in ji.prototype.allowedEvents_)ji.prototype["on"+s]=null;const ka=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 _d extends ji{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){ka(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&ka(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,ka(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 Ia=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 yd extends ji{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Ia(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&&Ia(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Ia(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 ko extends ji{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class E0{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 hn{constructor(e){hn.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 C0={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},A0={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"}
33,D0={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ll={disabled:"disabled",hidden:"hidden",showing:"showing"};class Io extends vt{constructor(e={}){super();const t={id:e.id||"vjs_track_"+wt(),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 Po=function(s){return new URL(s,se.baseURI)},Td=function(s){return new URL(s,se.baseURI).href},Lo=function(s){if(typeof s=="string"){const t=s.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},qn=function(s,e=A.location){return Po(s).origin!==e.origin};var w0=Object.freeze({__proto__:null,parseUrl:Po,getAbsoluteURL:Td,getFileExtension:Lo,isCrossOrigin:qn});const Ol=function(s,e){const t=new A.WebVTT.Parser(A,A.vttjs,A.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&&(A.console&&A.console.groupCollapsed&&A.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>ye.error(r)),A.console&&A.console.groupEnd&&A.console.groupEnd()),t.flush()},Rl=function(s,e){const t={uri:s},i=qn(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),xc(t,we(this,function(n,a,u){if(n)return ye.error(n,a);e.loaded_=!0,typeof A.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 fr extends Io{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ce(e,{kind:D0[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Ll[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 hn(this.cues_),a=new hn(this.activeCues_);let u=!1;this.timeupdateHandler=we(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){Ll[f]&&i!==f&&(i=f,!this.preload_&&i!=="disabled"&&this.cues.length===0&&Rl(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 y=0,w=this.cues.length;y<w;y++){const S=this.cues[y];S.startTime<=f&&S.endTime>=f&&g.push(S)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let y=0;y<g.length;y++)this.activeCues_.indexOf(g[y])===-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")&&Rl(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 A.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 Ja.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}}}}fr.prototype.allowedEvents_={cuechange:"cuechange"};class vd extends Io{constructor(e={}){const t=Ce(e,{kind:A0[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 bd extends Io{constructor(e={}){const t=Ce(e,{kind:C0[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 ri extends vt{constructor(e={}){super();let t;const i=new fr(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=ri.NONE,i.addEventListener("loadeddata",()=>{t=ri.LOADED,this.trigger({type:"load",target:this})})}}ri.prototype.allowedEvents_={load:"load"};ri.NONE=0;ri.LOADING=1;ri.LOADED=2;ri.ERROR=3;
33const Dt={audio:{ListClass:_d,TrackClass:vd,capitalName:"Audio"},video:{ListClass:yd,TrackClass:bd,capitalName:"Video"},text:{ListClass:ko,TrackClass:fr,capitalName:"Text"}};Object.keys(Dt).forEach(function(s){Dt[s].getterName=`${s}Tracks`,Dt[s].privateName=`${s}Tracks_`});const _s={remoteText:{ListClass:ko,TrackClass:fr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:E0,TrackClass:ri,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ut=Object.assign({},Dt,_s);_s.names=Object.keys(_s);Dt.names=Object.keys(Dt);ut.names=[].concat(_s.names).concat(Dt.names);function k0(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new ut.text.TrackClass(r);return n.addTrack(a),a}class pe 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(we(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 gd(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(Dt.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 Me(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 33-68
33initTrackListeners(){Dt.names.forEach(e=>{const t=Dt[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(!A.WebVTT)if(se.body.contains(this.el())){if(!this.options_["vtt.js"]&&fs(tl)&&Object.keys(tl).length>0){this.trigger("vttjsloaded");return}const e=se.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}),A.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 k0(this,e,t,i)}createRemoteTextTrack(e){const t=Ce(e,{tech:this});return new _s.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=wt();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 pe.canPlayType(e.type)}static isTech(e){return e.prototype instanceof pe||e instanceof pe||e===pe}static registerTech(e,t){if(pe.techs_||(pe.techs_={}),!pe.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!pe.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!pe.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Fe(e),pe.techs_[e]=t,pe.techs_[sr(e)]=t,e!=="Tech"&&pe.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(pe.techs_&&pe.techs_[e])return pe.techs_[e];if(e=Fe(e),A&&A.videojs&&A.videojs[e])return ye.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),A.videojs[e]}}}ut.names.forEach(function(s){const e=ut[s];pe.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});pe.prototype.featuresVolumeControl=!0;pe.prototype.featuresMuteControl=!0;pe.prototype.featuresFullscreenResize=!1;pe.prototype.featuresPlaybackRate=!1;pe.prototype.featuresProgressEvents=!1;pe.prototype.featuresSourceset=!1;pe.prototype.featuresTimeupdateEvents=!1;pe.prototype.featuresNativeTextTracks=!1;pe.prototype.featuresVideoFrameCallback=!1;pe.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",pe);pe.registerTech("Tech",pe);pe.defaultTechOrder_=[];const Fi={},fn={},pn={};function I0(s,e){Fi[s]=Fi[s]||[],Fi[s].push(e)}function P0(s,e,t){s.setTimeout(()=>Li(e,Fi[e.type],t,s),1)}function L0(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function O0(s,e,t){return s.reduceRight(Oo(t),e[t]())}function R0(s,e,t,i){return e[t](s.reduce(Oo(t),i))}function Nl(s,e,t,i=null){const r="call"+Fe(t),n=s.reduce(Oo(r),i),a=n===pn,u=a?null:e[t](n);return B0(s,t,u,a),u}const N0={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},M0={setCurrentTime:1,setMuted:1,setVolume:1},Ml={play:1,pause:1};function Oo(s){return(e,t)=>e===pn?pn:t[s]?t[s](e):e}function B0(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function F0(s){fn.hasOwnProperty(s.id())&&delete fn[s.id()]}function U0(s,e){const t=fn[s.id()];let i=null;if(t==null)return i=e(s),fn[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 Li(s={},e=[],t,i,r=[],n=!1){const[a,...u]=e;if(typeof a=="string")Li(s,Fi[a],t,i,r,n);else if(a){const c=U0(i,a);if(!c.setSource)return r.push(c),Li(s,u,t,i,r,n);c.setSource(Object.assign({},s),function(f,g){if(f)return Li(s,u,t,i,r,n);r.push(c),Li(g,s.type===g.type?u:Fi[g.type],t,i,r,n)})}else u.length?Li(s,u,t,i,r,n):n?t(s,r):Li(s,Fi["*"],t,i,r,!0)}const q0={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"},mn=function(s=""){const e=Lo(s);return q0[e.toLowerCase()]||""},$0=(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 mn(e)},xd=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=xd(t),Array.isArray(t)?e=e.concat(t):Xt(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[Bl({src:s})]:Xt(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[Bl(s)]:s=[];return s};function Bl(s){if(!s.type){const e=mn(s.src);e&&(s.type=e)}return s}var j0=`<svg xmlns="http://www.w3.org/2000/svg"> 34 <defs> 35 <symbol viewBox="0 0 48 48" id="vjs-icon-play"> 36 <path d="M16 10v28l22-14z"></path> 37 </symbol> 38 <symbol viewBox="0 0 48 48" id="vjs-icon-pause"> 39 <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path> 40 </symbol> 41 <symbol viewBox="0 0 48 48" id="vjs-icon-audio"> 42 <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> 43 </symbol> 44 <symbol viewBox="0 0 48 48" id="vjs-icon-captions"> 45 <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> 46 </symbol> 47 <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles"> 48 <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> 49 </symbol> 50 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter"> 51 <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path> 52 </symbol> 53 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit"> 54 <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path> 55 </symbol> 56 <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle"> 57 <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> 58 </symbol> 59 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute"> 60 <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> 61 </symbol> 62 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low"> 63 <path d="M14 18v12h8l10 10V8L22 18h-8z"></path> 64 </symbol> 65 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium"> 66 <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> 67 </symbol> 68 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
69 <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> 70 </symbol> 71 <symbol viewBox="0 0 48 48" id="vjs-icon-spinner"> 72 <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> 73 </symbol> 74 <symbol viewBox="0 0 24 24" id="vjs-icon-hd"> 75 <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> 76 </symbol> 77 <symbol viewBox="0 0 48 48" id="vjs-icon-chapters"> 78 <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path> 79 </symbol> 80 <symbol viewBox="0 0 40 40" id="vjs-icon-downloading"> 81 <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> 82 </symbol> 83 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download"> 84 <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> 85 </symbol> 86 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done"> 87 <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> 88 </symbol> 89 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off"> 90 <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> 91 </symbol> 92 <symbol viewBox="0 0 48 48" id="vjs-icon-share"> 93 <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> 94 </symbol> 95 <symbol viewBox="0 0 48 48" id="vjs-icon-cog"> 96 <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> 97 </symbol> 98 <symbol viewBox="0 0 48 48" id="vjs-icon-square"> 99 <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> 100 </symbol> 101 <symbol viewBox="0 0 48 48" id="vjs-icon-circle"> 102 <circle cx="24" cy="24" r="20"></circle> 103 </symbol> 104 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline"> 105 <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> 106 </symbol> 107 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle"> 108 <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> 109 </symbol> 110 <symbol viewBox="0 0 48 48" id="vjs-icon-cancel"> 111 <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> 112 </symbol> 113 <symbol viewBox="0 0 48 48" id="vjs-icon-replay"> 114 <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-
1147.16 16-16-7.16-16-16-16z"></path> 115 </symbol> 116 <symbol viewBox="0 0 48 48" id="vjs-icon-repeat"> 117 <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path> 118 </symbol> 119 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5"> 120 <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> 121 </symbol> 122 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10"> 123 <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> 124 </symbol> 125 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30"> 126 <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> 127 </symbol> 128 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5"> 129 <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> 130 </symbol> 131 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10"> 132 <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> 133 </symbol> 134 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30"> 135 <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> 136 </symbol> 137 <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description"> 138 <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> 139 </symbol> 140 <symbol viewBox="0 0 48 48" id="vjs-icon-next-item"> 141 <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path> 142 </symbol> 143 <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item"> 144 <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path> 145 </symbol>
146 <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle"> 147 <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> 148 </symbol> 149 <symbol viewBox="0 0 48 48" id="vjs-icon-cast"> 150 <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> 151 </symbol> 152 <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter"> 153 <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> 154 </symbol> 155 <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit"> 156 <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> 157 <path fill="none" d="M-1-3h24v24H-1z"></path> 158 </symbol> 159 <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook"> 160 <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path> 161 </symbol> 162 <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin"> 163 <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> 164 </symbol> 165 <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter"> 166 <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"/> 167 </symbol> 168 <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr"> 169 <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> 170 </symbol> 171 <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest"> 172 <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> 173 </symbol> 174 </defs> 175</svg>`;const Fl=un?10009:ln?461:8,Ki={codes:{play:415,pause:19,ff:417,rw:412,back:Fl},names:{415:"play",19:"pause",417:"ff",412:"rw",[Fl]:"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 V0 extends vt{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(Ki.isEventKey(t,"play")||Ki.isEventKey(t,"pause")||Ki.isEventKey(t,"ff")||Ki.isEventKey(t,"rw")){t.preventDefault();const i=Ki.getEventName(t);this.performMediaAction_(i)}else Ki.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
175ocusable()&&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},y={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:g,center:y}},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
175sedComponent: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 H0 extends X{constructor(e,t,i){const r=Ce({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=pe.getTech(u);if(u||(c=X.getComponent(u)),c&&c.isSupported()){e.loadTech_(u);break}}else e.src(t.playerOptions.sources)}}X.registerComponent("MediaLoader",H0);class $n 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=ce(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ce("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,xi(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",$n);class Za extends $n{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 ce("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(ce("picture",{className:"vjs-poster",tabIndex:-1},{},ce("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()?Ht(this.player_.play()):this.player_.pause())}}Za.prototype.crossorigin=Za.prototype.crossOrigin;X.registerComponent("PosterImage",Za);const At="#222",ql="#ccc",z0={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',
175script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Pa(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 $t(s,e,t){try{s.style[e]=t}catch{return}}function $l(s){return s?`${s}px`:""}class G0 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(we(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=A.screen.orientation||A,u=A.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 A.WebVTT=="function"&&A.WebVTT.processCues(A,[],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)),!A.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="",$t(a,"position","relative"),$t(a,"height",f-c+"px"),$t(a,"top","unset"),cn?$t(a,"bottom",f+"px"):$t(a,"bottom","0px"),u.length>0&&u.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!A.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)),$t(this.el_,"insetInline",$l(n)),$t(this.el_,"insetBlock",$l(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&&$t(a.firstChild,"color",Pa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&$t(a.firstChild,"backgroundColor",Pa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?$t(a,"backgroundColor",Pa(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 ${ql}, 0 1px ${ql}, -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=A.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=z0[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof A.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])}A.WebVTT.processCues(A,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;Bi(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&ps(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}X.registerComponent("TextTrackDisplay",G0);class W0 extends X{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
175Video Player"),i=ce("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",W0);class st extends $n{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=ce(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(ce("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",st);class Sd extends st{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){Ht(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();rr(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Sd.prototype.controlText_="Play Video";X.registerComponent("BigPlayButton",Sd);class X0 extends st{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",X0);class Ed extends st{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()?Ht(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))}}Ed.prototype.controlText_="Play";X.registerComponent("PlayToggle",Ed);class Ss 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=ce("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}Â `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ce("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=$i(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_=se.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Ss.prototype.labelText_="Time";Ss.prototype.controlText_="Time";X.registerComponent("TimeDisplay",Ss);class Ro extends Ss{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)}}Ro.prototype.labelText_="Current Time";Ro.prototype.controlText_="Current Time";X.registerComponent("CurrentTimeDisplay",Ro);class No extends Ss{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);
vendor: 11,811 bytes, line 175
175this.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)}}No.prototype.labelText_="Duration";No.prototype.controlText_="Duration";X.registerComponent("DurationDisplay",No);class K0 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",K0);class Mo extends Ss{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(ce("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)}}Mo.prototype.labelText_="Remaining Time";Mo.prototype.controlText_="Remaining Time";X.registerComponent("RemainingTimeDisplay",Mo);class Y0 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_=ce("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ce("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}Â `})),this.contentEl_.appendChild(se.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",Y0);class Cd extends st{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_=ce("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()}}Cd.prototype.controlText_="Seek to live, currently playing live";X.registerComponent("SeekToLive",Cd);function pr(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var Q0=Object.freeze({__proto__:null,clamp:pr});class Bo 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"&&!Kt&&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(pr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Nn(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",Bo);const La=(s,e)=>pr(s/e*100,0,100).toFixed(2)+"%";class J0 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=ce("span",{className:"vjs-control-text"}),i=ce("span",{textContent:this.localize("Loaded")}),r=se.createTextNode(": ");return this.percentageEl_=ce("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=La(n,r);this.percent_!==u&&(this.el_.style.width=u,xi(this.percentageEl_,u),this.percent_=u);for(let c=0;c<i.length;c++){const f=i.start(c),g=i.end(c);let y=a[c];y||(y=this.el_.appendChild(ce()),a[c]=y),!(y.dataset.start===f&&y.dataset.end===g)&&(y.dataset.start=f,y.dataset.end=g,y.style.left=La(f,n),y.style.width=La(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",J0);class Z0 extends X{constructor(e,t){super(e,t),this.update=Yt(we(this,this.update),kt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=lr(this.el_),n=ms(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>r.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(i)}write(e){xi(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?"":"-")+$i(c,u)}else n=$i(i,a);this.update(e,t,n),r&&r()})}}X.registerComponent("TimeTooltip",Z0);class Fo extends X{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Yt(we(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)}}Fo.prototype.options_={children:[]};!tt&&!Mt&&Fo.prototype.options_.children.push("timeTooltip");X.registerComponent("PlayProgressBar",Fo);class Ad extends X{constructor(e,t){super(e,t),this.update=Yt(we(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`})}}Ad.prototype.options_={children:["timeTooltip"]};X.registerComponent("MouseTimeDisplay",Ad);class jn extends Bo{constructor(e,t){t=Ce(jn.prototype.options_,t),t.children=[...t.children];const i=e.options_.disableSeekWhileScrubbingOnMobile&&(tt||Mt)||e.options_.disableSeekWhileScrubbingOnSTV;(!tt&&!Mt||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=we(this,this.update),this.update=Yt(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 se&&"visibilityState"in se&&this.on(se,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){se.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(se.visibilityState==="hidden")return;
175const 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}",[$i(i,n),$i(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(ms(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;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){cr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!cr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),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?Ht(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 se&&"visibilityState"in se&&this.off(se,"visibilitychange",this.toggleVisibility_),super.dispose()}}jn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};X.registerComponent("SeekBar",jn);class Dd extends X{constructor(e,t){super(e,t),this.handleMouseMove=Yt(we(this,this.handleMouseMove),kt),this.throttledHandleMouseSeek=Yt(we(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=lr(n);let u=Nn(n,e).x;u=pr(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_}
175disable(){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&&Ht(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()}}Dd.prototype.options_={children:["seekBar"]};X.registerComponent("ProgressControl",Dd);class wd extends st{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(){se.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in A?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 se.exitPictureInPicture=="function"&&super.show()}}wd.prototype.controlText_="Picture-in-Picture";X.registerComponent("PictureInPictureToggle",wd);class kd extends st{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),se[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()}}kd.prototype.controlText_="Fullscreen";X.registerComponent("FullscreenToggle",kd);const e_=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 t_ extends X{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}
vendor: 8,531 bytes, line 175
175X.registerComponent("VolumeLevel",t_);class i_ extends X{constructor(e,t){super(e,t),this.update=Yt(we(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=ms(this.el_),a=ms(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){xi(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",i_);class Id extends X{constructor(e,t){super(e,t),this.update=Yt(we(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`})}}Id.prototype.options_={children:["volumeLevelTooltip"]};X.registerComponent("MouseVolumeLevelDisplay",Id);class Vn extends Bo{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){cr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=ms(i),n=this.vertical();let a=Nn(i,e);a=n?a.y:a.x,a=pr(a,0,1),t.update(r,a,n)}cr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Vn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!tt&&!Mt&&Vn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Vn.prototype.playerEvent="volumechange";X.registerComponent("VolumeBar",Vn);class Pd extends X{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||fs(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),e_(this,e),this.throttledHandleMouseMove=Yt(we(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)}}Pd.prototype.options_={children:["volumeBar"]};X.registerComponent("VolumeControl",Pd);const s_=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 Ld extends st{constructor(e,t){super(e,t),s_(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"),tt&&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),On(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Bi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Ld.prototype.controlText_="Mute";X.registerComponent("MuteToggle",Ld);class Od extends X{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||fs(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"),Tt(se,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),it(se,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Od.prototype.options_={children:["muteToggle","volumeControl"]};X.registerComponent("VolumePanel",Od);class Rd extends st{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]))}}Rd.prototype.controlText_="Skip Forward";X.registerComponent("SkipForward",Rd);class Nd extends st{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}
175 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]))}}Nd.prototype.controlText_="Skip Backward";X.registerComponent("SkipBackward",Nd);class Md 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_=ce(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_),Tt(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||se.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",Md);class Uo extends X{constructor(e,t={}){super(e,t),this.menuButton_=new st(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=st.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(),Tt(se,"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 Md(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ce("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=st.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"),it(se,"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"),tt&&Gc())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
175se"))}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",Uo);class qo extends Uo{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=we(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",qo);class mr extends $n{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=ce("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",mr);class gr extends mr{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 A.Event!="object")try{u=new A.Event("change")}catch{}u||(u=se.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",gr);class Bd extends gr{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",Bd);class Es extends qo{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=gr){let i;this.label_&&(i=`${this.label_} off`),e.push(new Bd(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",Es);class Fd extends mr{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",Fd);
vendor: 29,447 bytes, lines 175-176
175class $o extends Es{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{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 Fd(this.player_,{track:this.track_,cue:n});e.push(a)}return e}}$o.prototype.kind_="chapters";$o.prototype.controlText_="Chapters";X.registerComponent("ChaptersButton",$o);class jo extends Es{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=we(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()}`}}jo.prototype.kind_="descriptions";jo.prototype.controlText_="Descriptions";X.registerComponent("DescriptionsButton",jo);class Vo extends Es{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()}`}}Vo.prototype.kind_="subtitles";Vo.prototype.controlText_="Subtitles";X.registerComponent("SubtitlesButton",Vo);class Ho extends gr{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",Ho);class zo extends Es{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 Ho(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}zo.prototype.kind_="captions";zo.prototype.controlText_="Captions";X.registerComponent("CaptionsButton",zo);class Ud extends gr{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(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ce("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}X.registerComponent("SubsCapsMenuItem",Ud);class Go extends Es{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 Ho(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Ud),e}}Go.prototype.kinds_=["captions","subtitles"];Go.prototype.controlText_="Subtitles";X.registerComponent("SubsCapsButton",Go);class qd extends mr{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(ce("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ce("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",qd);class $d extends qo{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 qd(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}$d.prototype.controlText_="Audio Track";X.registerComponent("AudioTrackButton",$d);class Wo extends mr{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)}}Wo.prototype.contentElType="button";X.registerComponent("PlaybackRateMenuItem",Wo);class jd extends Uo{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_=ce("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 Wo(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")}}jd.prototype.controlText_="Playback Rate";X.registerComponent("PlaybackRateMenuButton",jd);class Vd 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",Vd);class r_ extends Vd{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"Â "})}}X.registerComponent("CustomControlSpacer",r_);class Hd extends X{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Hd.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",Hd);class zd 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):""}}zd.prototype.options_=Object.assign({},xs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});X.registerComponent("ErrorDisplay",zd);class Gd 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(),ce("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${wt()}`)+"-"+t[1].replace(/\W+/g,""),r=ce("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",Gd);class Ui extends X{constructor(e,t={}){super(e,t);const i=ce("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_${wt()}`;if(this.options_.type==="colors"){f=ce("span",{className:u});const w=ce("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});w.setAttribute("for",g),f.appendChild(w)}const y=new Gd(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:c});this.addChild(y),this.options_.type==="colors"&&(f.appendChild(y.el()),this.el().appendChild(f))}}createEl(){return ce("fieldset",{className:this.options_.className})}}X.registerComponent("TextTrackFieldset",Ui);class Wd extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ui(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 Ui(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 Ui(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 ce("div",{className:"vjs-track-settings-colors"})}}X.registerComponent("TextTrackSettingsColors",Wd);class Xd extends X{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Ui(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 Ui(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 Ui(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 ce("div",{className:"vjs-track-settings-font"})}}X.registerComponent("TextTrackSettingsFont",Xd);class Kd extends X{constructor(e,t={}){super(e,t);const i=new st(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 st(e,{controlText:r,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=r,this.addChild(n)}createEl(){return ce("div",{className:"vjs-track-settings-controls"})}}X.registerComponent("TrackSettingsControls",Kd);const Oa="vjs-text-track-settings",jl=["#000","Black"],Vl=["#00F","Blue"],Hl=["#0FF","Cyan"],zl=["#0F0","Green"],Gl=["#F0F","Magenta"],Wl=["#F00","Red"],Xl=["#FFF","White"],Kl=["#FF0","Yellow"],Ra=["1","Opaque"],Na=["0.5","Semi-Transparent"],Yl=["0","Transparent"],Ti={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[jl,Xl,Wl,zl,Vl,Kl,Gl,Hl],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ra,Na,Yl],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Xl,jl,Wl,zl,Vl,Kl,Gl,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:[Ra,Na],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:[Yl,Na,Ra],className:"vjs-window-opacity vjs-opacity"}};Ti.windowColor.options=Ti.backgroundColor.options;function Yd(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function n_(s,e){const t=s.options[s.options.selectedIndex].value;return Yd(t,e)}function a_(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(Yd(s.options[i].value,t)===e){s.selectedIndex=i;break}}}class o_ 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=ce("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 Wd(e,{textTrackComponentid:this.id_,selectConfigs:Ti,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new Xd(e,{textTrackComponentid:this.id_,selectConfigs:Ti,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new Kd(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()}),es(Ti,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 Uc(Ti,(e,t,i)=>{const r=n_(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){es(Ti,(t,i)=>{a_(this.$(t.selector),e[i],t.parser)})}setDefaults(){es(Ti,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(A.localStorage.getItem(Oa))}catch(t){ye.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?A.localStorage.setItem(Oa,JSON.stringify(e)):A.localStorage.removeItem(Oa)}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",o_);class u_ extends X{constructor(e,t){let i=t.ResizeObserver||A.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=Ce({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||A.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ud(()=>{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(){it(this,"resize",n),it(this,"unload",a),a=null};Tt(this.el_.contentWindow,"unload",a),Tt(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",u_);const l_={trackingThreshold:20,liveTolerance:15};class c_ extends X{constructor(e,t){const i=Ce(l_,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(A.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",c_);class d_ extends X{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ce("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${wt()}`}),description:ce("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${wt()}`})},ce("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];Mn(a),n&&xi(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",d_);const h_={initialDisplay:4e3,position:[],takeFocus:!1};class f_ extends st{constructor(e,t){t=Ce(h_,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=ce("button",{},{type:"button",class:this.buildCSSClass()},ce("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",f_);const eo=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},p_=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=se.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=se.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",A.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Qd=(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},m_=s=>Qd([s.el(),A.HTMLMediaElement.prototype,A.Element.prototype,p_],"innerHTML"),Ql=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=m_(s),r=n=>(...a)=>{const u=n.apply(e,a);return eo(s),u};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",Ce(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_)},g_=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Td(A.Element.prototype.getAttribute.call(this,"src")):""},set(s){return A.Element.prototype.setAttribute.call(this,"src",s),s}}),__=s=>Qd([s.el(),A.HTMLMediaElement.prototype,g_],"src"),y_=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=__(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ce(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 eo(s)||(s.triggerSourceset(""),Ql(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):eo(s)||Ql(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class oe extends pe{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")&&qn(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. 176This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(ur||Pn)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),oe.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){y_(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})}};
176i(),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=Dt[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[_s.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_(){Dt.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),oe.disposeMediaElement(e),e=i}else{e=se.createElement("video");const i=this.options_.tag&&yi(this.options_.tag),r=Ce({},i);(!ur||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"&&ps(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?ps(e,r,r):Rn(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&&Ln?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&&Mt&&Kt&&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)Ht(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=ce("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(){oe.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=se.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),A.performance&&(e.creationTime=A.performance.now()),e}}wn(oe,"TEST_VID",function(){if(!Ts())return;const s=se.createElement("video"),e=se.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});oe.isSupported=function(){try{oe.TEST_VID.volume=.5}catch{return!1}return!!(oe.TEST_VID&&oe.TEST_VID.canPlayType)};oe.canPlayType=function(s){return oe.TEST_VID.canPlayType(s)};oe.canPlaySource=function(s,e){return oe.canPlayType(s.type)};oe.canControlVolume=function(){try{const s=oe.TEST_VID.volume;oe.TEST_VID.volume=s/2+.1;const e=s!==oe.TEST_VID.volume;return e&&tt?(A.setTimeout(()=>{oe&&oe.prototype&&(oe.prototype.featuresVolumeControl=s!==oe.TEST_VID.volume)}),!1):e}catch{return!1}};oe.canMuteVolume=function(){try{const s=oe.TEST_VID.muted;return oe.TEST_VID.muted=!s,oe.TEST_VID.muted?ps(oe.TEST_VID,"muted","muted"):Rn(oe.TEST_VID,"muted","muted"),s!==oe.TEST_VID.muted}catch{return!1}};oe.canControlPlaybackRate=function(){if(Mt&&Kt&&kn<58)return!1;try{const s=oe.TEST_VID.playbackRate;return oe.TEST_VID.playbackRate=s/2+.1,s!==oe.TEST_VID.playbackRate}catch{return!1}};oe.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(se.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(se.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(se.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(se.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};oe.supportsNativeTextTracks=function(){return Ln||tt&&Kt};oe.supportsNativeVideoTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.videoTracks)};oe.supportsNativeAudioTracks=function(){return!!(oe.TEST_VID&&oe.TEST_VID.audioTracks)};oe.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
176h(function([s,e]){wn(oe.prototype,s,()=>oe[e](),!0)});oe.prototype.featuresVolumeControl=oe.canControlVolume();oe.prototype.movingMediaElementInDOM=!tt;oe.prototype.featuresFullscreenResize=!0;oe.prototype.featuresProgressEvents=!0;oe.prototype.featuresTimeupdateEvents=!0;oe.prototype.featuresVideoFrameCallback=!!(oe.TEST_VID&&oe.TEST_VID.requestVideoFrameCallback);oe.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{}}()}};oe.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){oe.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){oe.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){oe.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){oe.prototype["set"+Fe(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){oe.prototype[s]=function(){return this.el_[s]()}});pe.withSourceHandlers(oe);oe.nativeSourceHandler={};oe.nativeSourceHandler.canPlayType=function(s){try{return oe.TEST_VID.canPlayType(s)}catch{return""}};oe.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return oe.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Lo(s.src);return oe.nativeSourceHandler.canPlayType(`video/${t}`)}return""};oe.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};oe.nativeSourceHandler.dispose=function(){};oe.registerSourceHandler(oe.nativeSourceHandler);pe.registerTech("Html5",oe);const Jd=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ma={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},to=["tiny","xsmall","small","medium","large","xlarge","huge"],en={};to.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;en[s]=`vjs-layout-${e}`});const T_={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class xe extends X{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${wt()}`,t=Object.assign(xe.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_=nn,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 176
176ight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&yi(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(u){a[u.toLowerCase()]=t.languages[u]}),this.languages_=a}else this.languages_=xe.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(),Do(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Tt(se,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ce(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 A.DOMParser().parseFromString(j0,"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 V0(this),this.addClass("vjs-spatial-navigation-enabled")),ur&&this.addClass("vjs-touch-enabled"),tt||this.addClass("vjs-workinghover"),xe.players[this.id_]=this;const n=Ha.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"),it(se,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),it(se,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),xe.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),F0(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=yi(e);if(r){for(t=this.el_=e,e=this.tag=se.createElement("video");t.children.length;)e.appendChild(t.firstChild);ir(t,"video-js")||Bi(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",Kt&&In&&(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
176h(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),A.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ad("vjs-styles-dimensions");const c=bi(".vjs-styles-defaults"),f=bi("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);Bi(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Ga(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,si(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),g0(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(A.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),od(this.styleEl_,` 177 .${r} { 178 width: ${e}px; 179 height: ${t}px; 180 } 181 182 .${r}.vjs-fluid:not(.vjs-audio-only-mode) { 183 padding-top: ${a*100}%; 184 } 185 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Fe(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(pe.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};
185ut.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=pe.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(we(this,this.handleTechReady_),!0),Ja.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Jd.forEach(c=>{this.on(this.tech_,c,f=>this[`handleTech${Fe(c)}_`](f))}),Object.keys(Ma).forEach(c=>{this.on(this.tech_,c,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ma[c]}_`].bind(this),event:f});return}this[`handleTech${Ma[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)&&Ga(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_=Ja.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
185what you're doing. 186See https://github.com/videojs/video.js/issues/2617 for more info. 187`),this.tech_}version(){return{"video.js":Ha}}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(rr(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(),rr(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!rr(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=$0(this,t)),this.cache_.source=Ce({},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=yi(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")}
187handleTechSeeked_(){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()?Ht(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()&&!se.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=se[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 M0)return R0(this.middleware_,this.tech_,e,t);if(e in Ml)return Nl(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 N0)return O0(this.middleware_,this.tech_,e);if(e in Ml)return Nl(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=Ht){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Ln||tt);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 gd(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=se[this.fsApi_.exitFullscreen]();return e&&Ht(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=se.documentElement.style.overflow,Tt(se,"keydown",this.boundFullWindowOnEscKey_),se.documentElement.style.overflow="hidden",Bi(se.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,it(se,"keydown",this.boundFullWindowOnEscKey_),se.documentElement.style.overflow=this.docOrigOverflow,On(se.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&&A.documentPictureInPicture){const e=se.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(ce("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),A.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(sd(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 se&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(A.documentPictureInPicture&&A.documentPictureInPicture.window)return A.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in se)return se.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");se[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=pe.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,pe.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(y=>c.some(w=>{if(g=f(y,w),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=xd(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]),P0(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}L0(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?hd(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();Ht(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}),si(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(
187))}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(vi("beforeerror").forEach(t=>{const i=t(this,e);if(!(Xt(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 Me(e),this.addClass("vjs-error"),ye.error(`(CODE:${this.error_.code} ${Me.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),vi("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=we(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==i)&&(t=y.screenX,i=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},u=function(y){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&&!tt&&!Mt&&(c.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(y){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 y=this.options_.inactivityTimeout;y<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};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}
187defaultPlaybackRate(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(),si(this)&&this.trigger("languagechange"))}languages(){return Ce(xe.prototype.options_.languages,this.languages_)}toJSON(){const e=Ce(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=Ce(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<to.length;i++){const r=to[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(en[e]),this.addClass(en[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({},T_,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 en[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=Ce(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:mn(u)}]),i&&this.crossOrigin(i),c&&this.src(c),u&&this.poster(u),Array.isArray(f)&&f.forEach(y=>
187this.addRemoteTextTrack(y,!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:mn(r.poster)}]),r}return Ce(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=yi(e),r=i["data-setup"];if(ir(e,"vjs-fill")&&(i.fill=!0),ir(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(yi(c)):f==="track"&&t.tracks.push(yi(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"))}}xe.prototype.videoTracks=()=>{};xe.prototype.audioTracks=()=>{};xe.prototype.textTracks=()=>{};xe.prototype.remoteTextTracks=()=>{};xe.prototype.remoteTextTrackEls=()=>{};ut.names.forEach(function(s){const e=ut[s];xe.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});xe.prototype.crossorigin=xe.prototype.crossOrigin;xe.players={};const Ys=A.navigator;xe.prototype.options_={techOrder:pe.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ys&&(Ys.languages&&Ys.languages[0]||Ys.userLanguage||Ys.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};Jd.forEach(function(s){xe.prototype[`handleTech${Fe(s)}_`]=function(){return this.trigger(s)}});X.registerComponent("Player",xe);const gn="plugin",ss="activePlugins_",Qi={},_n=s=>Qi.hasOwnProperty(s),tn=s=>_n(s)?Qi[s]:void 0,Zd=(s,e)=>{s[ss]=s[ss]||{},s[ss][e]=!0},yn=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},v_=function(s,e){const t=function(){yn(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return Zd(this,s),yn(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},Jl=(s,e)=>(e.prototype.name=s,function(...t){yn(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,yn(this,i.getEventHash()),i});class ft{constructor(e){if(this.constructor===ft)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Do(this),delete this.trigger,dd(this,this.constructor.defaultState),Zd(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 bs(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[ss][e]=!1,this.player=this.state=null,t[e]=Jl(e,Qi[e])}static isBasic(e){const t=typeof e=="string"?tn(e):e;return typeof t=="function"&&!ft.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}.`);
187if(_n(e))ye.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(xe.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 Qi[e]=t,e!==gn&&(ft.isBasic(t)?xe.prototype[e]=v_(e,t):xe.prototype[e]=Jl(e,t)),t}static deregisterPlugin(e){if(e===gn)throw new Error("Cannot de-register base plugin.");_n(e)&&(delete Qi[e],delete xe.prototype[e])}static getPlugins(e=Object.keys(Qi)){let t;return e.forEach(i=>{const r=tn(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=tn(e);return t&&t.VERSION||""}}ft.getPlugin=tn;ft.BASE_PLUGIN_NAME=gn;ft.registerPlugin(gn,ft);xe.prototype.usingPlugin=function(s){return!!this[ss]&&this[ss][s]===!0};xe.prototype.hasPlugin=function(s){return!!_n(s)};function b_(s,e){let t=!1;return function(...i){return t||ye.warn(s),t=!0,e.apply(this,i)}}function Bt(s,e,t,i){return b_(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var x_={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 eh=s=>s.indexOf("#")===0?s.slice(1):s;function F(s,e,t){let i=F.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"?bi("#"+eh(s)):s;if(!vs(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof A.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)),vi("beforesetup").forEach(c=>{const f=c(r,Ce(e));if(!Xt(f)||Array.isArray(f)){ye.error("please return an object in beforesetup hooks");return}e=Ce(e,f)});const u=X.getComponent("Player");return i=new u(r,e,t),vi("setup").forEach(c=>c(i)),i}F.hooks_=ti;F.hooks=vi;F.hook=i0;F.hookOnce=s0;F.removeHook=Mc;if(A.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ts()){let s=bi(".vjs-styles-defaults");if(!s){s=ad("vjs-styles-defaults");const e=bi("head");e&&e.insertBefore(s,e.firstChild),od(s,` 188 .video-js { 189 width: 300px; 190 height: 150px; 191 } 192 193 .vjs-fluid:not(.vjs-audio-only-mode) { 194 padding-top: 56.25% 195 } 196 `)}}Xa(1,F);F.VERSION=Ha;F.options=xe.prototype.options_;F.getPlayers=()=>xe.players;F.getPlayer=s=>{const e=xe.players;let t;if(typeof s=="string"){const i=eh(s),r=e[i];if(r)return r;t=bi("#"+i)}else t=s;if(vs(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};F.getAllPlayers=()=>Object.keys(xe.players).map(s=>xe.players[s]).filter(Boolean);F.players=xe.players;F.getComponent=X.getComponent;F.registerComponent=(s,e)=>(pe.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));F.getTech=pe.getTech;F.registerTech=pe.registerTech;F.use=I0;Object.defineProperty(F,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(F.middleware,"TERMINATOR",{value:pn,writeable:!1,enumerable:!0});F.browser=zc;F.obj=a0;F.mergeOptions=Bt(9,"videojs.mergeOptions","videojs.obj.merge",Ce);F.defineLazyProperty=Bt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",wn);F.bind=Bt(9,"videojs.bind","native Function.prototype.bind",we);F.registerPlugin=ft.registerPlugin;F.deregisterPlugin=ft.deregisterPlugin;F.plugin=(s,e)=>(ye.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ft.registerPlugin(s,e));F.getPlugins=ft.getPlugins;F.getPlugin=ft.getPlugin;F.getPluginVersion=ft.getPluginVersion;F.addLanguage=function(s,e){return s=(""+s).toLowerCase(),F.options.languages=Ce(F.options.languages,{[s]:e}),F.options.languages[s]};F.log=ye;F.createLogger=Bc;F.time=b0;F.createTimeRange=Bt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Nt);
vendor: 4,284 bytes, lines 196-198
196F.createTimeRanges=Bt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Nt);F.formatTime=Bt(9,"videojs.formatTime","videojs.time.formatTime",$i);F.setFormatTime=Bt(9,"videojs.setFormatTime","videojs.time.setFormatTime",pd);F.resetFormatTime=Bt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",md);F.parseUrl=Bt(9,"videojs.parseUrl","videojs.url.parseUrl",Po);F.isCrossOrigin=Bt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",qn);F.EventTarget=vt;F.any=Ao;F.on=Tt;F.one=Fn;F.off=it;F.trigger=bs;F.xhr=xc;F.TrackList=ji;F.TextTrack=fr;F.TextTrackList=ko;F.AudioTrack=vd;F.AudioTrackList=_d;F.VideoTrack=bd;F.VideoTrackList=yd;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{F[s]=function(){return ye.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),rd[s].apply(null,arguments)}});F.computedStyle=Bt(9,"videojs.computedStyle","videojs.dom.computedStyle",gs);F.dom=rd;F.fn=m0;F.num=Q0;F.str=T0;F.url=w0;F.Error=x_;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class S_{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 Tn extends F.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new S_(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}}Tn.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in Tn.prototype.allowedEvents_)Tn.prototype["on"+s]=null;var th="4.1.0";const E_=function(s,e){const t=s.qualityLevels,i=new Tn,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=th,i},ih=function(s){return E_(this,F.obj.merge({},s))};F.registerPlugin("qualityLevels",ih);ih.VERSION=th;/*! @name @videojs/http-streaming @version 3.17.2 @license Apache-2.0 */const dt=hm,vn=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,It=s=>F.log.debug?F.log.debug.bind(F,"VHS:",`${s} >`):function(){};function Se(...s){const e=F.obj||F;return(e.merge||e.mergeOptions).apply(e,s)}function Xe(...s){const e=F.time||F;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function C_(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 197`;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i}) 198`}return e}const zt=1/30,Gt=zt*3,sh=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 Xe(t)},Ji=function(s,e){return sh(s,function(t,i){return t-Gt<=e&&i+Gt>=e})},Yr=function(s,e){return sh(s,function(t){return t-zt>=e})},A_=function(s){if(s.length<2)return Xe();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 Xe(e)},D_=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return Xe();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;
198u++)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 Xe(a)},rh=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(", ")},w_=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Ni=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},k_=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},Ba=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},Xo=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},Ko=(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},io=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),[]),nh=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},ah=({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},oh=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=nh(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},I_=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+=Ko(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},P_=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+=Ko(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},uh=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=I_(s,e);if(i.precise)return i.result;const r=P_(s,e);return r.precise?r.result:i.result+t},lh=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 A.Infinity}return uh(s,e,t)},nr=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},ch=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return lh(s);if(e===null)return null;e=e||0;let r=uh(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:oh(null,s),r-=i),Math.max(0,r)},L_=function(s,e,t){const r=e||0;let n=ch(s,e,!0,t);return n===null?Xe():(n<r&&(n=r),Xe(r,n))},O_=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const u=io(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];if(a+=g.duration,n){if(a<0)continue}else if(a+zt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-nr({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 y=g.duration>zt,w=a===0,S=y&&a+zt>=0;if(!((w||S)&&f!==u.length-1)){if(n){if(a>0)continue}else if(a-zt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r
198+nr({defaultDuration:s.targetDuration,durationList:u,startIndex:c,endIndex:f})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},dh=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},Yo=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Hn=function(s){const e=dh(s);return!s.disabled&&!e},R_=function(s){return s.disabled},N_=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},hh=function(s,e){return e.attributes&&e.attributes[s]},M_=function(s,e,t,i=0){return hh("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},so=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>Hn(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},Qo=(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),Zl=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},_r=s=>{if(!s||!s.playlists||!s.playlists.length)return Zl(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=>Ec(n))||Zl(s,n=>Qo(t,n))))return!1}return!0};var ht={liveEdgeDelay:oh,duration:lh,seekable:L_,getMediaInfoForTime:O_,isEnabled:Hn,isDisabled:R_,isExcluded:dh,isIncompatible:Yo,playlistEnd:ch,isAes:N_,hasAttribute:hh,estimateSegmentRequestTime:M_,isLowestEnabledRendition:so,isAudioOnly:_r,playlistMatch:Qo,segmentDurationWithParts:Ko};const{log:fh}=F,rs=(s,e)=>`${s}-${e}`,ph=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,B_=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new vm;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,y)=>Math.max(g,y.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${f}`}),u.targetDuration=f}const c=nh(u);if(c.length&&!u.partTargetDuration){const f=c.reduce((g,y)=>Math.max(g,y.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${f}`}),fh.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},Cs=(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)}})},mh=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},F_=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];mh({playlist:t,id:rs(e,t.uri)}),t.resolvedUri=dt(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||fh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},U_=s=>{Cs(s,e=>{e.uri&&(e.resolvedUri=dt(s.uri,e.uri))})},q_=(s,e)=>{const t=rs(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A.location.href,resolvedUri:A.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},gh=(s,e,t=ph)=>{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=_r(s);
vendor: 6,629 bytes, line 198
198Cs(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=[qe({},r)]}r.playlists.forEach(function(c,f){const g=t(n,a,u,c),y=rs(f,g);c.uri?c.resolvedUri=c.resolvedUri||dt(s.uri,c.uri):(c.uri=f===0?g:y,c.resolvedUri=c.uri),c.id=c.id||y,c.attributes=c.attributes||{},s.playlists[c.id]=c,s.playlists[c.uri]=c})}),F_(s),U_(s)};class ec{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 _h=22,qi=({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=qe({},t),a.errorType=F.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=F.Error.NetworkRequestAborted;else if(e.timedout)a.errorType=F.Error.NetworkRequestTimeout;else if(u){const c=i?F.Error.NetworkBodyParserFailed:F.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},$_=It("CodecUtils"),yh=function(s){const e=s.attributes||{};if(e.CODECS)return jt(e.CODECS)},Th=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},j_=(s,e)=>{if(!Th(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},dr=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(Sc(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){$_(`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},tc=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},ar=function(s,e){const t=e.attributes||{},i=dr(yh(e)||[]);if(Th(s,e)&&!i.audio&&!j_(s,e)){const r=dr(xm(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},{EventTarget:V_}=F,H_=(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=ah(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 A.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},z_=(s,e)=>{if(!s)return e;const t=Se(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]=Se(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},G_=(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(z_(c,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},vh=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=dt(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=dt(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=dt(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=dt(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=dt(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=dt(e,t.uri))})},bh=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},xh=(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,ro=(s,e,t=xh)=>{const i=Se(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=bh(e);const n=Se(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=G_(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{vh(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,Cs(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},no=(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},ic=(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 Zi extends V_{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
198ateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new ec,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=dt(this.main.uri,e.uri);this.llhls&&(t=H_(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:qi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const i=B_({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(i){this.error=i,this.error.metadata={errorType:F.Error.StreamingHlsPlaylistParserError,error:i}}}excludeAudioOnlyVariants(e){const t=i=>{const r=i.attributes||{},{width:n,height:a}=r.RESOLUTION||{};if(n&&a)return!0;const u=yh(i)||[];return!!dr(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(),mh({playlist:a,uri:i,id:r});const u=ro(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_(no(this.media(),!!u)),n.parsedPlaylist=ic(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),A.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new ec,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(A.clearTimeout(this.finalRenditionTimeout),t){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A.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_(no(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;
198const 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=vn(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&&(A.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&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A.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&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=A.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=A.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}
198const 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:qi({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=vn(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=ic(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,gh(this.main,this.srcUri()),e.playlists.forEac
198h(i=>{i.segments=bh(i),i.segments.forEach(r=>{vh(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||A.location.href;this.main=q_(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=rs(r,f),y=this.createCloneAttributes_(r,a.attributes),w=this.createClonePlaylist_(a,g,e,y);i.playlists[n]=w,i.playlists[g]=w,i.playlists[f]=w}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
198h((f,g)=>{const y=i.playlists[f.id],w=y.id,S=y.resolvedUri;delete i.playlists[w],delete i.playlists[S]});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=rs(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]=qe({},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((y,w)=>{const S=r.playlists[y.id],O=ph(n,t,u),T=rs(t,O);if(S&&!r.playlists[T]){const P=this.createClonePlaylist_(S,T,e),B=P.resolvedUri;r.playlists[T]=P,r.playlists[B]=P}f.playlists[w]=this.createClonePlaylist_(y,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),Se(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){const t=new Set;if(!e||!e.contentProtection)return t;for(const i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){const r=e.contentProtection[i].attributes.keyId;t.add(r.toLowerCase())}return t}}const ao=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)},W_=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},X_=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},Sh=function(){const s=function e(t,i){t=Se({timeout:45e3},t);const r=e.beforeRequest||F.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||F.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||F.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(F.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const u=F.Vhs.xhr.original===!0?F.xhr:F.Vhs.xhr,c=W_(n,t);n.delete(r);const f=u(c||t,function(y,w){return X_(a,f,y,w),ao(f,y,w,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},K_=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=A.BigInt(s.offset)+A.BigInt(s.length)-A.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},oo=function(s){const e={};return s.byterange&&(e.Range=K_(s.byterange)),e},Y_=function(s,e){return s.start(e)+"-"+s.end(e)},Q_=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},J_=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},Eh=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},bn=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},Ch=function(s){return s.resolvedUri},Ah=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(Q_).join(""),n=e.slice(a*t,a*t+t).map(J_).join(""),i+=r+" "+n+` 199`;return i},Z_=({bytes:s})=>Ah(s),ey=s=>{let e="",t;for(t=0;t<s.length;t++)e+=Y_(s,t)+" ";return e};var ty=Object.freeze({__proto__:null,createTransferableMessage:Eh,initSegmentId:bn,segmentKeyId:Ch,hexDump:Ah,tagDump:Z_,textRanges:ey});const Dh=.25,iy=(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)},sy=s=>
199s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,ry=(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?sy(r.videoTimingInfo):r.duration+r.duration*Dh,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:ht.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},ny=(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*Dh)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},ay=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},oy=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},uy=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=ny(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=iy(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},wh=({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(!oy(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=ry(s,e);if(!u)return a({message:`${s} was not found in the stream`});const c=u.segment,f=ay(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",()=>{wh({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const g=c.start+f,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),i(g)},Fa=(s,e)=>{if(s.readyState===4)return e()},ly=(s,e,t,i)=>{let r=[],n,a=!1;const u=function(y,w,S,O){return w.abort(),a=!0,t(y,w,S,O)},c=function(y,w){if(a)return;if(y)return y.metadata=qi({requestType:i,request:w,error:y}),u(y,w,"",r);const S=w.responseText.substring(r&&r.byteLength||0,w.responseText.length);if(r=Lm(r,Dc(S,!0)),n=n||Js(r),r.length<10||n&&r.length<n+2)return Fa(w,()=>u(y,w,"",r));const O=bo(r);return O==="ts"&&r.length<188?Fa(w,()=>u(y,w,"",r)):!O&&r.length<376?Fa(w,()=>u(y,w,"",r)):u(null,w,O,r)},g=e({uri:s,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:w,loaded:S}){return ao(y,null,{statusCode:y.status},c)})}},function(y,w){return ao(g,y,w,c)});return g},{EventTarget:cy}=F,sc=function(s,e){if(!xh(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},dy=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},hy=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=Rg(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return gh(n,e,dy),n},fy=(s,e)=>{Cs(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},py=(s,e,t)=>{let i=!0,r=Se(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=An(a.sidx);t&&t[c]&&t[c].sidx&&yo(a,t[c].sidx,a.sidx.resolvedUri)}const u=ro(r,a,sc);u&&(r=u,i=!1)}return Cs(e,(n,a,u,c)=>{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,g=ro(r,n.playlists[0],sc);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)}}),fy(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},my=(s,e)=>
199(!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,rc=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=An(n);if(!e[a])break;const u=e[a].sidxInfo;my(u,n)&&(t[a]=e[a])}}return t},gy=(s,e)=>{let i=rc(s.playlists,e);return Cs(s,(r,n,a,u)=>{if(r.playlists&&r.playlists.length){const c=r.playlists;i=Se(i,rc(c,e))}}),i};class uo extends cy{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;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const r=e.sidx&&An(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){A.clearTimeout(this.mediaRequest_),this.mediaRequest_=A.setTimeout(()=>i(!1),0);return}const n=vn(e.sidx.resolvedUri),a=(c,f)=>{if(this.requestErrored_(c,f,t))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=f;let w;try{w=Ug(le(f.response).subarray(8))}catch(S){S.metadata=qi({requestType:y,request:f,parseFailure:!0}),this.requestErrored_(S,f,t);return}return g[r]={sidxInfo:e.sidx,sidx:w},yo(e,w,e.sidx.resolvedUri),i(!0)},u="dash-sidx";this.request=ly(n,this.vhs_.xhr,(c,f,g,y)=>{if(c)return a(c,f);if(!g||g!=="mp4"){const O=g||"unknown";return a({status:f.status,message:`Unsupported ${O} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}const{offset:w,length:S}=e.sidx.byterange;if(y.length>=S+w)return a(c,{response:y.subarray(w,w+S),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:oo({byterange:e.sidx.byterange})},a)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A.clearTimeout(this.minimumUpdatePeriodTimeout_),A.clearTimeout(this.mediaRequest_),A.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,A.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(),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(A.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A.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")}
199start(){if(this.started=!0,!this.isMain_){A.clearTimeout(this.mediaRequest_),this.mediaRequest_=A.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=qi({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=vn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=Ng(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:dt(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=qi({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_(){A.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=hy({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:F.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=py(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=[];
199i.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_&&(A.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_=A.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_=gy(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=A.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},no(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 Ge={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 _y=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},kh=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},yy=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())}},Ih=function(s){return function(){const e=yy(s),t=kh(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}},Ph=function(s){return`var browserWorkerPolyFill = ${kh.toString()}; 200browserWorkerPolyFill(self); 201`+s},Lh=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},Ty=Ph(Lh(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(l,h){o[l]||(o[l]=[]),o[l]=o[l].concat(h)},this.off=function(l,h){var d;return o[l]?(d=o[l].indexOf(h),o[l]=o[l].slice(),o[l].splice(d,1),d>-1):!1},this.trigger=function(l){var h,d,p,m;if(h=o[l],!!h)if(arguments.length===2)for(p=h.length,d=0;d<p;++d)h[d].call(this,arguments[1]);else{for(m=[],d=arguments.length,d=1;d<arguments.length;++d)m.push(arguments[d]);for(p=h.length,d=0;d<p;++d)h[d].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),h;return l.getBigUint64?(h=l.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?
201Number(h):h):l.getUint32(0)*i+l.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,u,c,f,g,y,w,S,O,T,P,B,M,L,z,q,$,R,G,v,C,U,H,V,Q,ie,re,K,Z,J,te,ee,fe,me,_e,he,Ke;(function(){var o;if(V={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 V)V.hasOwnProperty(o)&&(V[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);Q=new Uint8Array([105,115,111,109]),re=new Uint8Array([97,118,99,49]),ie=new Uint8Array([0,0,0,1]),K=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:K,audio:Z},fe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ee=new Uint8Array([0,0,0,0,0,0,0,0]),me=new Uint8Array([0,0,0,0,0,0,0,0]),_e=me,he=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ke=me,te=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(o){var l=[],h=0,d,p,m;for(d=1;d<arguments.length;d++)l.push(arguments[d]);for(d=l.length;d--;)h+=l[d].byteLength;for(p=new Uint8Array(h+8),m=new DataView(p.buffer,p.byteOffset,p.byteLength),m.setUint32(0,p.byteLength),p.set(o,4),d=0,h=8;d<l.length;d++)p.set(l[d],h),h+=l[d].byteLength;return p},c=function(){return u(V.dinf,u(V.dref,fe))},f=function(o){return u(V.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(V.ftyp,Q,ie,Q,re)},$=function(o){return u(V.hdlr,J[o])},y=function(o){return u(V.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(V.mdhd,l)},z=function(o){return u(V.mdia,q(o),$(o.type),S(o))},w=function(o){return u(V.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},S=function(o){return u(V.minf,o.type==="video"?u(V.vmhd,te):u(V.smhd,ee),c(),G(o))},O=function(o,l){for(var h=[],d=l.length;d--;)h[d]=C(l[d]);return u.apply(null,[V.moof,w(o)].concat(h))},T=function(o){for(var l=o.length,h=[];l--;)h[l]=M(o[l]);return u.apply(null,[V.moov,B(4294967295)].concat(h).concat(P(o)))},P=function(o){for(var l=o.length,h=[];l--;)h[l]=U(o[l]);return u.apply(null,[V.mvex].concat(h))},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(V.mvhd,l)},R=function(o){var l=o.samples||[],h=new Uint8Array(4+l.length),d,p;for(p=0;p<l.length;p++)d=l[p].flags,h[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return u(V.sdtp,h)},G=function(o){return u(V.stbl,v(o),u(V.stts,Ke),u(V.stsc,_e),u(V.stsz,he),u(V.stco,me))},function(){var o,l;v=function(h){return u(V.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),h.type==="video"?o(h):l(h))},o=function(h){var d=h.sps||[],p=h.pps||[],m=[],x=[],E,D;for(E=0;E<d.length;E++)m.push((d[E].byteLength&65280)>>>8),m.push(d[E].byteLength&255),m=m.concat(Array.prototype.slice.call(d[E]));for(E=0;E<p.length;E++)x.push((p[E].byteLength&65280)>>>8),x.push(p[E].byteLength&255),x=x.concat(Array.prototype.slice.call(p[E]));if(D=[V.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(V.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],m,[p.length],x))),u(V.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var k=h.sarRatio[0],N=h.sarRatio[1];D.push(u(V.pasp,new Uint8Array([(k&4278190080)>>24,(k&16711680)>>16,(k&65280)>>8,k&255,(N&4278190080)>>24,(N&16711680)>>16,(N&65280)>>8,N&255])))}return u.apply(null,D)},l=function(h){return u(V.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),L=function(o){var 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(V.tkhd,l)},C=function(o){var l,h,d,p,m,x,E;return l=u(V.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])),x=Math.floor(o.baseMediaDecodeTime/a),E=Math.floor(o.baseMediaDecodeTime%a),h=u(V.tfdt,new Uint8Array([1,0,0,0,x>>>24&255,x>>>16&255,x>>>
2018&255,x&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255])),m=92,o.type==="audio"?(d=H(o,m),u(V.traf,l,h,d)):(p=R(o),d=H(o,p.length+m),u(V.traf,l,h,d,p))},M=function(o){return o.duration=o.duration||4294967295,u(V.trak,L(o),z(o))},U=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(V.trex,l)},function(){var o,l,h;h=function(d,p){var m=0,x=0,E=0,D=0;return d.length&&(d[0].duration!==void 0&&(m=1),d[0].size!==void 0&&(x=2),d[0].flags!==void 0&&(E=4),d[0].compositionTimeOffset!==void 0&&(D=8)),[0,0,m|x|E|D,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},l=function(d,p){var m,x,E,D,k,N;for(D=d.samples||[],p+=20+16*D.length,E=h(D,p),x=new Uint8Array(E.length+D.length*16),x.set(E),m=E.length,N=0;N<D.length;N++)k=D[N],x[m++]=(k.duration&4278190080)>>>24,x[m++]=(k.duration&16711680)>>>16,x[m++]=(k.duration&65280)>>>8,x[m++]=k.duration&255,x[m++]=(k.size&4278190080)>>>24,x[m++]=(k.size&16711680)>>>16,x[m++]=(k.size&65280)>>>8,x[m++]=k.size&255,x[m++]=k.flags.isLeading<<2|k.flags.dependsOn,x[m++]=k.flags.isDependedOn<<6|k.flags.hasRedundancy<<4|k.flags.paddingValue<<1|k.flags.isNonSyncSample,x[m++]=k.flags.degradationPriority&61440,x[m++]=k.flags.degradationPriority&15,x[m++]=(k.compositionTimeOffset&4278190080)>>>24,x[m++]=(k.compositionTimeOffset&16711680)>>>16,x[m++]=(k.compositionTimeOffset&65280)>>>8,x[m++]=k.compositionTimeOffset&255;return u(V.trun,x)},o=function(d,p){var m,x,E,D,k,N;for(D=d.samples||[],p+=20+8*D.length,E=h(D,p),m=new Uint8Array(E.length+D.length*8),m.set(E),x=E.length,N=0;N<D.length;N++)k=D[N],m[x++]=(k.duration&4278190080)>>>24,m[x++]=(k.duration&16711680)>>>16,m[x++]=(k.duration&65280)>>>8,m[x++]=k.duration&255,m[x++]=(k.size&4278190080)>>>24,m[x++]=(k.size&16711680)>>>16,m[x++]=(k.size&65280)>>>8,m[x++]=k.size&255;return u(V.trun,m)},H=function(d,p){return d.type==="audio"?o(d,p):l(d,p)}}();var Je={ftyp:g,mdat:y,moof:O,moov:T,initSegment:function(o){var l=g(),h=T(o),d;return d=new Uint8Array(l.byteLength+h.byteLength),d.set(l),d.set(h,l.byteLength),d}},$e=function(o){var l,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,l=0;l<o.length;l++)h=o[l],h.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=h.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[h],d.byteLength=h.data.byteLength,d.pts=h.pts,d.dts=h.dts):(h.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=h.dts-d.dts,d.byteLength+=h.data.byteLength,d.push(h));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},Ze=function(o){var l,h,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=o[0].pts,d.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++)h=o[l],h.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[h],d.nalCount=h.length,d.byteLength=h.byteLength,d.pts=h.pts,d.dts=h.dts,d.duration=h.duration):(d.duration+=h.duration,d.nalCount+=h.length,d.byteLength+=h.byteLength,d.push(h));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},bt=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},Ye=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},rt=function(o,l){var h=Ye();return h.dataOffset=l,h.compositionTimeOffset=o.pts-o.dts,h.duration=o.duration,h.size=4*o.length,h.size+=o.byteLength,o.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},ni=function(o,l){var h,d,p,m,x,E=l||0,D=[];for(h=0;h<o.length;
201h++)for(m=o[h],d=0;d<m.length;d++)x=m[d],p=rt(x,E),E+=p.size,D.push(p);return D},He=function(o){var l,h,d,p,m,x,E=0,D=o.byteLength,k=o.nalCount,N=D+4*k,W=new Uint8Array(N),ae=new DataView(W.buffer);for(l=0;l<o.length;l++)for(p=o[l],h=0;h<p.length;h++)for(m=p[h],d=0;d<m.length;d++)x=m[d],ae.setUint32(E,x.data.byteLength),E+=4,W.set(x.data,E),E+=x.data.byteLength;return W},ai=function(o,l){var h,d=l||0,p=[];return h=rt(o,d),p.push(h),p},Ve=function(o){var l,h,d=0,p=o.byteLength,m=o.length,x=p+4*m,E=new Uint8Array(x),D=new DataView(E.buffer);for(l=0;l<o.length;l++)h=o[l],D.setUint32(d,h.data.byteLength),d+=4,E.set(h.data,d),d+=h.data.byteLength;return E},Vi={groupNalsIntoFrames:$e,groupFramesIntoGops:Ze,extendFirstKeyFrame:bt,generateSampleTable:ni,concatenateNalData:He,generateSampleTableForFrame:ai,concatenateNalDataForFrame:Ve},pt=[33,16,5,32,164,27],xt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Te=function(o){for(var l=[];o--;)l.push(0);return l},ke=function(o){return Object.keys(o).reduce(function(l,h){return l[h]=new Uint8Array(o[h].reduce(function(d,p){return d.concat(p)},[])),l},{})},Pe,oi=function(){if(!Pe){var o={96e3:[pt,[227,64],Te(154),[56]],88200:[pt,[231],Te(170),[56]],64e3:[pt,[248,192],Te(240),[56]],48e3:[pt,[255,192],Te(268),[55,148,128],Te(54),[112]],44100:[pt,[255,192],Te(268),[55,163,128],Te(84),[112]],32e3:[pt,[255,192],Te(268),[55,234],Te(226),[112]],24e3:[pt,[255,192],Te(268),[55,255,128],Te(268),[111,112],Te(126),[224]],16e3:[pt,[255,192],Te(268),[55,255,128],Te(268),[111,255],Te(269),[223,108],Te(195),[1,192]],12e3:[xt,Te(268),[3,127,248],Te(268),[6,255,240],Te(268),[13,255,224],Te(268),[27,253,128],Te(259),[56]],11025:[xt,Te(268),[3,127,248],Te(268),[6,255,240],Te(268),[13,255,224],Te(268),[27,255,192],Te(268),[55,175,128],Te(108),[112]],8e3:[xt,Te(268),[3,121,16],Te(47),[7]]};Pe=ke(o)}return Pe},Qt=9e4,Si,Ei,ui,li,As,Ds,Hi;Si=function(o){return o*Qt},Ei=function(o,l){return o*l},ui=function(o){return o/Qt},li=function(o,l){return o/l},As=function(o,l){return Si(li(o,l))},Ds=function(o,l){return Ei(ui(o),l)},Hi=function(o,l,h){return ui(h?o:o-l)};var be={ONE_SECOND_IN_TS:Qt,secondsToVideoTs:Si,secondsToAudioTs:Ei,videoTsToSeconds:ui,audioTsToSeconds:li,audioTsToVideoTs:As,videoTsToAudioTs:Ds,metadataTsToSeconds:Hi},ws=oi,Ci=be,yr=function(o){var l,h,d=0;for(l=0;l<o.length;l++)h=o[l],d+=h.data.byteLength;return d},Tr=function(o,l,h,d){var p,m=0,x=0,E=0,D=0,k,N,W;if(l.length&&(p=Ci.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),m=Math.ceil(Ci.ONE_SECOND_IN_TS/(o.samplerate/1024)),h&&d&&(x=p-Math.max(h,d),E=Math.floor(x/m),D=E*m),!(E<1||D>Ci.ONE_SECOND_IN_TS/2))){for(k=ws()[o.samplerate],k||(k=l[0].data),N=0;N<E;N++)W=l[0],l.splice(0,0,{data:k,dts:W.dts-m,pts:W.pts-m});return o.baseMediaDecodeTime-=Math.floor(Ci.videoTsToAudioTs(D,o.samplerate)),D}},ks=function(o,l,h){return l.minSegmentDts>=h?o:(l.minSegmentDts=1/0,o.filter(function(d){return d.dts>=h?(l.minSegmentDts=Math.min(l.minSegmentDts,d.dts),l.minSegmentPts=l.minSegmentDts,!0):!1}))},ci=function(o){var l,h,d=[];for(l=0;l<o.length;l++)h=o[l],d.push({size:h.data.byteLength,duration:1024});return d},vr=function(o){var l,h,d=0,p=new Uint8Array(yr(o));for(l=0;l<o.length;l++)h=o[l],p.set(h.data,d),d+=h.data.byteLength;return p},Is={prefixWithSilence:Tr,trimAdtsFramesByEarliestDts:ks,generateSampleTable:ci,concatenateFrameData:vr},br=be.ONE_SECOND_IN_TS,_=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)),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))},b=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},I=function(o,l){var h,d,p=o.minSegmentDts;return l||(p-=o.timelineStartInfo.dts),h=o.timelineStartInfo.baseMediaDecodeTime,h+=p,h=Math.max(0,h),o.type==="audio"&&(d=o.samplerate/br,h*=d,h=Math.floor(h)),h},j={clearDtsInfo:b,calculateTrackBaseMediaDecodeTime:I,collectDtsInfo:_},ne=4,de=128,Ae=function(o){for(var l=0,h={payloadType:-1,payloadSize:0},d=0,p=0;l<o.byteLength&&o[l]!==de;){for(;o[l]===255;)d+=255,l++;for(d+=o[l++];o[l]===255;)p+=255,l++;if(p+=o[l++],!h.payload&&d===ne){var m=String.fromCharCode(o[l+3],o[l+4],o[l+5],o[l+6]);if(m==="GA94"){h.payloadType=d,h.payloadSize=p,h.payload=o.subarray(l,l+p);break}else h.payload=void 0}l+=p,d=0,p=0}return h},et=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)},mt=function(o,l){var h=[],d,p,m,x;if(!(l[0]&64))return h;for(p=l[0]&31,d=0;d<p;d++)m=d*3,x={type:l[m+2]&3,pts:o},l[m+2]&4&&(x.ccData=l[m+3]<<8|l[m+4],h.push(x));return h},Ft=function(o){for(var l=o.byteLength,h=[],d=1,p,m;d<l-2;
201)o[d]===0&&o[d+1]===0&&o[d+2]===3?(h.push(d+2),d+=2):d++;if(h.length===0)return o;p=l-h.length,m=new Uint8Array(p);var x=0;for(d=0;d<p;x++,d++)x===h[0]&&(x++,h.shift()),m[d]=o[x];return m},St={parseSei:Ae,parseUserData:et,parseCaptionPackets:mt,discardEmulationPreventionBytes:Ft,USER_DATA_REGISTERED_ITU_T_T35:ne},Pt=t,Et=St,Be=function(o){o=o||{},Be.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Le(0,0),new Le(0,1),new Le(1,0),new Le(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")))};Be.prototype=new Pt,Be.prototype.push=function(o){var l,h,d;if(o.nalUnitType==="sei_rbsp"&&(l=Et.parseSei(o.escapedRBSP),!!l.payload&&l.payloadType===Et.USER_DATA_REGISTERED_ITU_T_T35&&(h=Et.parseUserData(l),!!h))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=Et.parseCaptionPackets(o.pts,h),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},Be.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(l){return o==="flush"?l.flush():l.partialFlush()},this)},Be.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(l,h){l.presortIndex=h}),this.captionPackets_.sort(function(l,h){return l.pts===h.pts?l.presortIndex-h.presortIndex:l.pts-h.pts}),this.captionPackets_.forEach(function(l){l.type<2?this.dispatchCea608Packet(l):this.dispatchCea708Packet(l)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},Be.prototype.flush=function(){return this.flushStream("flush")},Be.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Be.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},Be.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)},Be.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},Be.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},Be.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},Be.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Ct={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},Jt=function(o){var l=Ct[o]||o;return o&4096&&o===l?"":String.fromCharCode(l)},Ut=function(o){return 32<=o&&o<=127||160<=o&&o<=255},De=function(o){this.windowNum=o,this.reset()};De.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},De.prototype.getText=function(){return this.rows.join(` 202`)},De.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},De.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--},De.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},De.prototype.addText=function(o){this.rows[this.rowIdx]+=o},De.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var Ai=function(o,l,h){this.serviceNum=o,this.text="",this.currentWindow=new De(-1),this.windows=[],this.stream=h,typeof l=="string"&&this.createTextDecoder(l)};Ai.prototype.init=function(o,l){this.startPts=o;for(var h=0;h<8;h++)this.windows[h]=new De(h),typeof l=="function"&&(this.windows[h].beforeRowOverflow=l)},Ai.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]}
202,Ai.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,h=o.captionServices||{},d={},p;Object.keys(h).forEach(m=>{p=h[m],/^SERVICE/.test(m)&&(d[m]=p.encoding)}),this.serviceEncodings=d,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 Pt,ve.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ve.prototype.add708Bytes=function(o){var l=o.ccData,h=l>>>8,d=l&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},ve.prototype.push708Packet=function(){var o=this.current708Packet,l=o.data,h=null,d=null,p=0,m=l[p++];for(o.seq=m>>6,o.sizeCode=m&63;p<l.length;p++)m=l[p++],h=m>>5,d=m&31,h===7&&d>0&&(m=l[p++],h=m),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},ve.prototype.pushServiceBlock=function(o,l,h){var d,p=l,m=this.current708Packet.data,x=this.services[o];for(x||(x=this.initService(o,p));p<l+h&&p<m.length;p++)d=m[p],Ut(d)?p=this.handleText(p,x):d===24?p=this.multiByteCharacter(p,x):d===16?p=this.extendedCommands(p,x):128<=d&&d<=135?p=this.setCurrentWindow(p,x):152<=d&&d<=159?p=this.defineWindow(p,x):d===136?p=this.clearWindows(p,x):d===140?p=this.deleteWindows(p,x):d===137?p=this.displayWindows(p,x):d===138?p=this.hideWindows(p,x):d===139?p=this.toggleWindows(p,x):d===151?p=this.setWindowAttributes(p,x):d===144?p=this.setPenAttributes(p,x):d===145?p=this.setPenColor(p,x):d===146?p=this.setPenLocation(p,x):d===143?x=this.reset(p,x):d===8?x.currentWindow.backspace():d===12?x.currentWindow.clearText():d===13?x.currentWindow.pendingNewLine=!0:d===14?x.currentWindow.clearText():d===141&&p++},ve.prototype.extendedCommands=function(o,l){var h=this.current708Packet.data,d=h[++o];return Ut(d)&&(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 d="SERVICE"+o,h=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new Ai(o,p,h),this.services[o].init(this.getPts(l),function(m){h.flushDisplayed(m,h.services[o])}),this.services[o]},ve.prototype.handleText=function(o,l,h){var d=h&&h.isExtended,p=h&&h.isMultiByte,m=this.current708Packet.data,x=d?4096:0,E=m[o],D=m[o+1],k=l.currentWindow,N,W;function ae(Y){return Y.map(ue=>("0"+(ue&255).toString(16)).slice(-2)).join("")}if(p?(W=[E,D],o++):W=[E],l.textDecoder_&&!d)N=l.textDecoder_.decode(new Uint8Array(W));else if(p){const Y=ae(W);N=String.fromCharCode(parseInt(Y,16))}else N=Jt(x|E);return k.pendingNewLine&&!k.isEmpty()&&k.newLine(this.getPts(o)),k.pendingNewLine=!1,k.addText(N),o},ve.prototype.multiByteCharacter=function(o,l){var h=this.current708Packet.data,d=h[o+1],p=h[o+2];return Ut(d)&&Ut(p)&&(o=this.handleText(++o,l,{isMultiByte:!0})),o},ve.prototype.setCurrentWindow=function(o,l){var h=this.current708Packet.data,d=h[o],p=d&7;return l.setCurrentWindow(p),o},ve.prototype.defineWindow=function(o,l){var h=this.current708Packet.data,d=h[o],p=d&7;l.setCurrentWindow(p);var m=l.currentWindow;return d=h[++o],m.visible=(d&32)>>5,m.rowLock=(d&16)>>4,m.columnLock=(d&8)>>3,m.priority=d&7,d=h[++o],m.relativePositioning=(d&128)>>7,m.anchorVertical=d&127,d=h[++o],m.anchorHorizontal=d,d=h[++o],m.anchorPoint=(d&240)>>4,m.rowCount=d&15,d=h[++o],m.columnCount=d&63,d=h[++o],m.windowStyle=(d&56)>>3,m.penStyle=d&7,m.virtualRowCount=m.rowCount+1,o},ve.prototype.setWindowAttributes=function(o,l){var h=this.current708Packet.data,d=h[o],p=l.currentWindow.winAttr;return d=h[++o],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++o],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++o],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>
2022,p.justify=d&3,d=h[++o],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,o},ve.prototype.flushDisplayed=function(o,l){for(var h=[],d=0;d<8;d++)l.windows[d].visible&&!l.windows[d].isEmpty()&&h.push(l.windows[d].getText());l.endPts=o,l.text=h.join(` 203 204`),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 h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible=1);return o},ve.prototype.hideWindows=function(o,l){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible=0);return o},ve.prototype.toggleWindows=function(o,l){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&(l.windows[m].visible^=1);return o},ve.prototype.clearWindows=function(o,l){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&l.windows[m].clearText();return o},ve.prototype.deleteWindows=function(o,l){var h=this.current708Packet.data,d=h[++o],p=this.getPts(o);this.flushDisplayed(p,l);for(var m=0;m<8;m++)d&1<<m&&l.windows[m].reset();return o},ve.prototype.setPenAttributes=function(o,l){var h=this.current708Packet.data,d=h[o],p=l.currentWindow.penAttr;return d=h[++o],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++o],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,o},ve.prototype.setPenColor=function(o,l){var h=this.current708Packet.data,d=h[o],p=l.currentWindow.penColor;return d=h[++o],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++o],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++o],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,o},ve.prototype.setPenLocation=function(o,l){var h=this.current708Packet.data,d=h[o],p=l.currentWindow.penLoc;return l.currentWindow.pendingNewLine=!0,d=h[++o],p.row=d&15,d=h[++o],p.column=d&63,o},ve.prototype.reset=function(o,l){var h=this.getPts(o);return this.flushDisplayed(h,l),this.initService(l.serviceNum,o)};var xr={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},Sr=function(o){return o===null?"":(o=xr[o]||o,String.fromCharCode(o))},Er=14,af=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Di=function(){for(var o=[],l=Er+1;l--;)o.push({text:"",indent:0,offset:0});return o},Le=function(o,l){Le.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(h){var d,p,m,x,E;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),m=d>>>8,x=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===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(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=Di();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Di();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=Di()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(m,x))m=(m&3)<<8,E=Sr(m|x),this[this.mode_](h.pts,E),this.column_++;else if(this.isExtCharacter(m,x))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=Sr(m|x),this[this.mode_](h.pts,E),this.column_++;else if(this.isMidRowCode(m,x))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(x&14)===14&&this.addFormatting(h.pts,["i"]),(x&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(m,x)){const k=x&3;this.nonDisplayed_[this.row_].offset=k,this.column_+=k}else if(this.isPAC(m,x)){var D=af.indexOf(d&7968);
204if(this.mode_==="rollUp"&&(D-this.rollUpRows_+1<0&&(D=this.rollUpRows_-1),this.setRollUp(h.pts,D)),D!==this.row_&&D>=0&&D<=14&&(this.clearFormatting(h.pts),this.row_=D),x&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const k=(d&14)>>1;this.column_=k*4,this.nonDisplayed_[this.row_].indent+=k}this.isColorPAC(x)&&(x&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(m)&&(x===0&&(x=null),E=Sr(m),E+=Sr(x),this[this.mode_](h.pts,E),this.column_+=E.length)}};Le.prototype=new Pt,Le.prototype.flushDisplayed=function(o){const l=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{l(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&l(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:h,stream:this.name_})},Le.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Di(),this.nonDisplayed_=Di(),this.lastControlCode_=null,this.column_=0,this.row_=Er,this.rollUpRows_=2,this.formatting_=[]},Le.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},Le.prototype.isSpecialCharacter=function(o,l){return o===this.EXT_&&l>=48&&l<=63},Le.prototype.isExtCharacter=function(o,l){return(o===this.EXT_+1||o===this.EXT_+2)&&l>=32&&l<=63},Le.prototype.isMidRowCode=function(o,l){return o===this.EXT_&&l>=32&&l<=47},Le.prototype.isOffsetControlCode=function(o,l){return o===this.OFFSET_&&l>=33&&l<=35},Le.prototype.isPAC=function(o,l){return o>=this.BASE_&&o<this.BASE_+8&&l>=64&&l<=127},Le.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Le.prototype.isNormalChar=function(o){return o>=32&&o<=127},Le.prototype.setRollUp=function(o,l){if(this.mode_!=="rollUp"&&(this.row_=Er,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Di(),this.displayed_=Di()),l!==void 0&&l!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[l-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};l===void 0&&(l=this.row_),this.topRow_=l-this.rollUpRows_+1},Le.prototype.addFormatting=function(o,l){this.formatting_=this.formatting_.concat(l);var h=l.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,h)},Le.prototype.clearFormatting=function(o){if(this.formatting_.length){var l=this.formatting_.reverse().reduce(function(h,d){return h+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,l)}},Le.prototype.popOn=function(o,l){var h=this.nonDisplayed_[this.row_].text;h+=l,this.nonDisplayed_[this.row_].text=h},Le.prototype.rollUp=function(o,l){var h=this.displayed_[this.row_].text;h+=l,this.displayed_[this.row_].text=h},Le.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<Er+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}},Le.prototype.paintOn=function(o,l){var h=this.displayed_[this.row_].text;h+=l,this.displayed_[this.row_].text=h};var eu={CaptionStream:Be,Cea608Stream:Le,Cea708Stream:ve},Cr={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},of=t,uf=8589934592,lf=4294967296,tu="shared",zn=function(o,l){var h=1;for(o>l&&(h=-1);Math.abs(l-o)>lf;)o+=h*uf;return o},Gn=function(o){var l,h;Gn.prototype.init.call(this),this.type_=o||tu,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==tu&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=zn(d.dts,h),d.pts=zn(d.pts,h),l=d.dts,this.trigger("data",d))},this.flush=function(){h=l,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,l=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Gn.prototype=new of;var iu={TimestampRolloverStream:Gn,handleRollover:zn},cf=(o,l,h)=>
204{if(!o)return-1;for(var d=h;d<o.length;d++)if(o[d]===l)return d;return-1},df={typedArrayIndexOf:cf},Ar=df.typedArrayIndexOf,Dr={Utf8:3},su=function(o,l,h){var d,p="";for(d=l;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},Ps=function(o,l,h){return decodeURIComponent(su(o,l,h))},Ls=function(o,l,h){return unescape(su(o,l,h))},Os=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Rs={APIC:function(o){var l=1,h,d,p="-->";o.data[0]===Dr.Utf8&&(h=Ar(o.data,0,l),!(h<0)&&(o.mimeType=Ls(o.data,l,h),l=h+1,o.pictureType=o.data[l],l++,d=Ar(o.data,0,l),!(d<0)&&(o.description=Ps(o.data,l,d),l=d+1,o.mimeType===p?o.url=Ls(o.data,l,o.data.length):o.pictureData=o.data.subarray(l,o.data.length))))},"T*":function(o){o.data[0]===Dr.Utf8&&(o.value=Ps(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var l;o.data[0]===Dr.Utf8&&(l=Ar(o.data,0,1),l!==-1&&(o.description=Ps(o.data,1,l),o.value=Ps(o.data,l+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=Ls(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var l;o.data[0]===Dr.Utf8&&(l=Ar(o.data,0,1),l!==-1&&(o.description=Ps(o.data,1,l),o.url=Ls(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=Ls(o.data,0,l);break}o.privateData=o.data.subarray(l+1),o.data=o.privateData}},hf=function(o){var l,h,d=10,p=0,m=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=Os(o.subarray(6,10)),p+=10;var x=o[5]&64;x&&(d+=4,d+=Os(o.subarray(10,14)),p-=Os(o.subarray(16,20)));do{if(l=Os(o.subarray(d+4,d+8)),l<1)break;h=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var E={id:h,data:o.subarray(d+10,d+l+10)};E.key=E.id,Rs[E.id]?Rs[E.id](E):E.id[0]==="T"?Rs["T*"](E):E.id[0]==="W"&&Rs["W*"](E),m.push(E),d+=10,d+=l}while(d<p);return m}},ru={parseId3Frames:hf,parseSyncSafeInteger:Os,frameParsers:Rs},ff=t,pf=Cr,di=ru,wr;wr=function(o){var l={descriptor:o&&o.descriptor},h=0,d=[],p=0,m;if(wr.prototype.init.call(this),this.dispatchType=pf.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(x){var E,D,k,N,W,ae;if(x.type==="timed-metadata"){if(x.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(x.data.length<10||x.data[0]!==73||x.data[1]!==68||x.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(x),p+=x.data.byteLength,d.length===1&&(h=di.parseSyncSafeInteger(x.data.subarray(6,10)),h+=10),!(p<h)){for(E={data:new Uint8Array(h),frames:[],pts:d[0].pts,dts:d[0].dts},W=0;W<h;)E.data.set(d[0].data.subarray(0,h-W),W),W+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();D=10,E.data[5]&64&&(D+=4,D+=di.parseSyncSafeInteger(E.data.subarray(10,14)),h-=di.parseSyncSafeInteger(E.data.subarray(16,20)));do{if(k=di.parseSyncSafeInteger(E.data.subarray(D+4,D+8)),k<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ae=String.fromCharCode(E.data[D],E.data[D+1],E.data[D+2],E.data[D+3]),N={id:ae,data:E.data.subarray(D+10,D+k+10)},N.key=N.id,di.frameParsers[N.id]?di.frameParsers[N.id](N):N.id[0]==="T"?di.frameParsers["T*"](N):N.id[0]==="W"&&di.frameParsers["W*"](N),N.owner==="com.apple.streaming.transportStreamTimestamp"){var Y=N.data,ue=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;ue*=4,ue+=Y[7]&3,N.timeStamp=ue,E.pts===void 0&&E.dts===void 0&&(E.pts=N.timeStamp,E.dts=N.timeStamp),this.trigger("timestamp",N)}E.frames.push(N),D+=10,D+=k}while(D<h);this.trigger("data",E)}}}},wr.prototype=new ff;var mf=wr,Wn=t,Xn=eu,Lt=Cr,gf=iu.TimestampRolloverStream,kr,Ns,Ir,zi=188,Kn=71;kr=function(){var o=new Uint8Array(zi),l=0;kr.prototype.init.call(this),this.push=function(h){var d=0,p=zi,m;for(l?(m=new Uint8Array(h.byteLength+l),m.set(o.subarray(0,l)),m.set(h,l),l=0):m=h;p<m.byteLength;){if(m[d]===Kn&&m[p]===Kn){this.trigger("data",m.subarray(d,p)),d+=zi,p+=zi;continue}d++,p++}d<m.byteLength&&(o.set(m.subarray(d),0),l=m.byteLength-d)},this.flush=function(){l===zi&&o[0]===Kn&&(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")}},kr.prototype=new Wn,Ns=function(){var o,l,h,d;Ns.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,m){var x=0;m.payloadUnitStartIndicator&&(x+=p[x]+1),m.type==="pat"?l(p.subarray(x),m):h(p.subarray(x),m)},l=function(p,m){m.section_number=p[7],m.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],m.pmtPid=d.pmtPid},h=function(p,m){var x,E,D,k;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},x=(p[1]&15)<<8|p[2],E=3+x-4,D=(p[10]&15)<<8|p[11],k=12+D;k<E;){var N=p[k],W=(p[k+1]&31)<<8|p[k+2];N===Lt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=W:N===Lt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=W:N===Lt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][W]=N),k+=((p[k+3]&15)<<8|p[k+4])+5}m.programMapTable=d.programMapTable}},this.push=function(p){var m={},x=4;if(m.payloadUnitStartIndicator=!!(p[1]&64),m.pid=p[1]&31,m.pid<<=8,m.pid|=p[2],(p[3]&48)>>>4>1&&(x+=p[x]+1),m.pid===0)m.type="pat",o(p.subarray(x),m),this.trigger("data",m);else if(m.pid===this.pmtPid)for(m.type="pmt",o(p.subarray(x),m),this.trigger("data",m);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
204else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,x,m]):this.processPes_(p,x,m)},this.processPes_=function(p,m,x){x.pid===this.programMapTable.video?x.streamType=Lt.H264_STREAM_TYPE:x.pid===this.programMapTable.audio?x.streamType=Lt.ADTS_STREAM_TYPE:x.streamType=this.programMapTable["timed-metadata"][x.pid],x.type="pes",x.data=p.subarray(m),this.trigger("data",x)}},Ns.prototype=new Wn,Ns.STREAM_TYPES={h264:27,adts:15},Ir=function(){var o=this,l=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},m,x=function(D,k){var N;const W=D[0]<<16|D[1]<<8|D[2];k.data=new Uint8Array,W===1&&(k.packetLength=6+(D[4]<<8|D[5]),k.dataAlignmentIndicator=(D[6]&4)!==0,N=D[7],N&192&&(k.pts=(D[9]&14)<<27|(D[10]&255)<<20|(D[11]&254)<<12|(D[12]&255)<<5|(D[13]&254)>>>3,k.pts*=4,k.pts+=(D[13]&6)>>>1,k.dts=k.pts,N&64&&(k.dts=(D[14]&14)<<27|(D[15]&255)<<20|(D[16]&254)<<12|(D[17]&255)<<5|(D[18]&254)>>>3,k.dts*=4,k.dts+=(D[18]&6)>>>1)),k.data=D.subarray(9+D[8]))},E=function(D,k,N){var W=new Uint8Array(D.size),ae={type:k},Y=0,ue=0,ge=!1,ze;if(!(!D.data.length||D.size<9)){for(ae.trackId=D.data[0].pid,Y=0;Y<D.data.length;Y++)ze=D.data[Y],W.set(ze.data,ue),ue+=ze.data.byteLength;x(W,ae),ge=k==="video"||ae.packetLength<=D.size,(N||ge)&&(D.size=0,D.data.length=0),ge&&o.trigger("data",ae)}};Ir.prototype.init.call(this),this.push=function(D){({pat:function(){},pes:function(){var k,N;switch(D.streamType){case Lt.H264_STREAM_TYPE:k=h,N="video";break;case Lt.ADTS_STREAM_TYPE:k=d,N="audio";break;case Lt.METADATA_STREAM_TYPE:k=p,N="timed-metadata";break;default:return}D.payloadUnitStartIndicator&&E(k,N,!0),k.data.push(D),k.size+=D.data.byteLength},pmt:function(){var k={type:"metadata",tracks:[]};m=D.programMapTable,m.video!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),l=!0,o.trigger("data",k)}})[D.type]()},this.reset=function(){h.size=0,h.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){E(h,"video"),E(d,"audio"),E(p,"timed-metadata")},this.flush=function(){if(!l&&m){var D={type:"metadata",tracks:[]};m.video!==null&&D.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&D.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),o.trigger("data",D)}l=!1,this.flushStreams_(),this.trigger("done")}},Ir.prototype=new Wn;var nu={PAT_PID:0,MP2T_PACKET_LENGTH:zi,TransportPacketStream:kr,TransportParseStream:Ns,ElementaryStream:Ir,TimestampRolloverStream:gf,CaptionStream:Xn.CaptionStream,Cea608Stream:Xn.Cea608Stream,Cea708Stream:Xn.Cea708Stream,MetadataStream:mf};for(var Yn in Lt)Lt.hasOwnProperty(Yn)&&(nu[Yn]=Lt[Yn]);var _f=nu,yf=t,Tf=be.ONE_SECOND_IN_TS,Pr,au=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Pr=function(o){var l,h=0;Pr.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts ski
204ping bytes ${d} to ${p} in frame ${h} outside syncword`})},this.push=function(d){var p=0,m,x,E,D,k;if(o||(h=0),d.type==="audio"){l&&l.length?(E=l,l=new Uint8Array(E.byteLength+d.data.byteLength),l.set(E),l.set(d.data,E.byteLength)):l=d.data;for(var N;p+7<l.length;){if(l[p]!==255||(l[p+1]&246)!==240){typeof N!="number"&&(N=p),p++;continue}if(typeof N=="number"&&(this.skipWarn_(N,p),N=null),x=(~l[p+1]&1)*2,m=(l[p+3]&3)<<11|l[p+4]<<3|(l[p+5]&224)>>5,D=((l[p+6]&3)+1)*1024,k=D*Tf/au[(l[p+2]&60)>>>2],l.byteLength-p<m)break;this.trigger("data",{pts:d.pts+h*k,dts:d.dts+h*k,sampleCount:D,audioobjecttype:(l[p+2]>>>6&3)+1,channelcount:(l[p+2]&1)<<2|(l[p+3]&192)>>>6,samplerate:au[(l[p+2]&60)>>>2],samplingfrequencyindex:(l[p+2]&60)>>>2,samplesize:16,data:l.subarray(p+7+x,p+m)}),h++,p+=m}typeof N=="number"&&(this.skipWarn_(N,p),N=null),l=l.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){l=void 0,this.trigger("reset")},this.endTimeline=function(){l=void 0,this.trigger("endedtimeline")}},Pr.prototype=new yf;var vf=Pr,ou;ou=function(o){var l=o.byteLength,h=0,d=0;this.length=function(){return 8*l},this.bitsAvailable=function(){return 8*l+d},this.loadWord=function(){var p=o.byteLength-l,m=new Uint8Array(4),x=Math.min(4,l);if(x===0)throw new Error("no bytes available");m.set(o.subarray(p,p+x)),h=new DataView(m.buffer).getUint32(0),d=x*8,l-=x},this.skipBits=function(p){var m;d>p?(h<<=p,d-=p):(p-=d,m=Math.floor(p/8),p-=m*8,l-=m,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var m=Math.min(d,p),x=h>>>32-m;return d-=m,d>0?h<<=m:l>0&&this.loadWord(),m=p-m,m>0?x<<m|this.readBits(m):x},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if((h&2147483648>>>p)!==0)return h<<=p,d-=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 bf=ou,uu=t,xf=bf,Lr,Or,lu;Or=function(){var o=0,l,h;Or.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var m=h.byteLength;o<m-3;o++)if(h[o+2]===1){l=o+5;break}for(;l<m;)switch(h[l]){case 0:if(h[l-1]!==0){l+=2;break}else if(h[l-2]!==0){l++;break}o+3!==l-2&&this.trigger("data",h.subarray(o+3,l-2));do l++;while(h[l]!==1&&l<m);o=l-2,l+=3;break;case 1:if(h[l-1]!==0||h[l-2]!==0){l+=3;break}this.trigger("data",h.subarray(o+3,l-2)),o=l-2,l+=3;break;default:l+=3;break}h=h.subarray(o),l-=o,o=0},this.reset=function(){h=null,o=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(o+3)),h=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Or.prototype=new uu,lu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Lr=function(){var o=new Or,l,h,d,p,m,x,E;Lr.prototype.init.call(this),l=this,this.push=function(D){D.type==="video"&&(h=D.trackId,d=D.pts,p=D.dts,o.push(D))},o.on("data",function(D){var k={trackId:h,pts:d,dts:p,data:D,nalUnitTypeCode:D[0]&31};switch(k.nalUnitTypeCode){case 5:k.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:k.nalUnitType="sei_rbsp",k.escapedRBSP=m(D.subarray(1));break;case 7:k.nalUnitType="seq_parameter_set_rbsp",k.escapedRBSP=m(D.subarray(1)),k.config=x(k.escapedRBSP);break;case 8:k.nalUnitType="pic_parameter_set_rbsp";break;case 9:k.nalUnitType="access_unit_delimiter_rbsp";break}l.trigger("data",k)}),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(D,k){var N=8,W=8,ae,Y;for(ae=0;ae<D;ae++)W!==0&&(Y=k.readExpGolomb(),W=(N+Y+256)%256),N=W===0?N:W},m=function(D){for(var k=D.byteLength,N=[],W=1,ae,Y;W<k-2;)D[W]===0&&D[W+1]===0&&D[W+2]===3?(N.push(W+2),W+=2):W++;if(N.length===0)return D;ae=k-N.length,Y=new Uint8Array(ae);var ue=0;for(W=0;W<ae;ue++,W++)ue===N[0]&&(ue++,N.shift()),Y[W]=D[ue];return Y},x=function(D){var k=0,N=0,W=0,ae=0,Y,ue,ge,ze,gt,fi,js,Vs,Hs,zs,zr,Ie=[1,1],Gs,Rt;if(Y=new xf(D),ue=Y.readUnsignedByte(),ze=Y.readUnsignedByte(),ge=Y.readUnsignedByte(),Y.skipUnsignedExpGolomb(),lu[ue]&&(gt=Y.readUnsignedExpGolomb(),gt===3&&Y.skipBits(1),Y.skipUnsignedExpGolomb(),Y.skipUnsignedExpGolomb(),Y.skipBits(1),Y.readBoolean()))for(zr=gt!==3?8:12,Rt=0;Rt<zr;Rt++)Y.readBoolean()&&(Rt<6?E(16,Y):E(64,Y));if(Y.skipUnsignedExpGolomb(),fi=Y.readUnsignedExpGolomb(),fi===0)Y.readUnsignedExpGolomb();else if(fi===1)for(Y.skipBits(1),Y.skipExpGolomb(),Y.skipExpGolomb(),js=Y.readUnsignedExpGolomb(),Rt=0;Rt<js;Rt++)Y.skipExpGolomb();if(Y.skipUnsignedExpGolomb(),Y.skipBits(1),Vs=Y.readUnsignedExpGolomb(),Hs=Y.readUnsignedExpGolomb(),zs=Y.readBits(1),zs===0&&Y.skipBits(1),Y.skipBits(1),Y.readBoolean()&&(k=Y.readUnsignedExpGolomb(),N=Y.readUnsignedExpGolomb(),W=Y.readUnsignedExpGolomb(),ae=Y.readUnsignedExpGolomb()),Y.readBoolean()&&Y.readBoolean()){switch(Gs=Y.readUnsignedByte(),Gs
204){case 1:Ie=[1,1];break;case 2:Ie=[12,11];break;case 3:Ie=[10,11];break;case 4:Ie=[16,11];break;case 5:Ie=[40,33];break;case 6:Ie=[24,11];break;case 7:Ie=[20,11];break;case 8:Ie=[32,11];break;case 9:Ie=[80,33];break;case 10:Ie=[18,11];break;case 11:Ie=[15,11];break;case 12:Ie=[64,33];break;case 13:Ie=[160,99];break;case 14:Ie=[4,3];break;case 15:Ie=[3,2];break;case 16:Ie=[2,1];break;case 255:{Ie=[Y.readUnsignedByte()<<8|Y.readUnsignedByte(),Y.readUnsignedByte()<<8|Y.readUnsignedByte()];break}}Ie&&Ie[0]/Ie[1]}return{profileIdc:ue,levelIdc:ge,profileCompatibility:ze,width:(Vs+1)*16-k*2-N*2,height:(2-zs)*(Hs+1)*16-W*2-ae*2,sarRatio:Ie}}},Lr.prototype=new uu;var Sf={H264Stream:Lr},Ef=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],cu=function(o,l){var h=o[l+6]<<21|o[l+7]<<14|o[l+8]<<7|o[l+9],d=o[l+5],p=(d&16)>>4;return h=h>=0?h:0,p?h+20:h+10},du=function(o,l){return o.length-l<10||o[l]!==73||o[l+1]!==68||o[l+2]!==51?l:(l+=cu(o,l),du(o,l))},Cf=function(o){var l=du(o,0);return o.length>=l+2&&(o[l]&255)===255&&(o[l+1]&240)===240&&(o[l+1]&22)===16},hu=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Af=function(o,l,h){var d,p="";for(d=l;d<h;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},Df=function(o,l,h){return unescape(Af(o,l,h))},wf=function(o,l){var h=(o[l+5]&224)>>5,d=o[l+4]<<3,p=o[l+3]&6144;return p|d|h},kf=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},If=function(o){for(var l=0;l+5<o.length;){if(o[l]!==255||(o[l+1]&246)!==240){l++;continue}return Ef[(o[l+2]&60)>>>2]}return null},Pf=function(o){var l,h,d,p;l=10,o[5]&64&&(l+=4,l+=hu(o.subarray(10,14)));do{if(h=hu(o.subarray(l+4,l+8)),h<1)return null;if(p=String.fromCharCode(o[l],o[l+1],o[l+2],o[l+3]),p==="PRIV"){d=o.subarray(l+10,l+h+10);for(var m=0;m<d.byteLength;m++)if(d[m]===0){var x=Df(d,0,m);if(x==="com.apple.streaming.transportStreamTimestamp"){var E=d.subarray(m+1),D=(E[3]&1)<<30|E[4]<<22|E[5]<<14|E[6]<<6|E[7]>>>2;return D*=4,D+=E[7]&3,D}break}}l+=10,l+=h}while(l<o.byteLength);return null},Qn={isLikelyAacData:Cf,parseId3TagSize:cu,parseAdtsSize:wf,parseType:kf,parseSampleRate:If,parseAacTimestamp:Pf},Lf=t,fu=Qn,Rr;Rr=function(){var o=new Uint8Array,l=0;Rr.prototype.init.call(this),this.setTimestamp=function(h){l=h},this.push=function(h){var d=0,p=0,m,x,E,D;for(o.length?(D=o.length,o=new Uint8Array(h.byteLength+D),o.set(o.subarray(0,D)),o.set(h,D)):o=h;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(d=fu.parseId3TagSize(o,p),p+d>o.length))break;x={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",x),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=fu.parseAdtsSize(o,p),p+d>o.length))break;E={type:"audio",data:o.subarray(p,p+d),pts:l,dts:l},this.trigger("data",E),p+=d;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")}},Rr.prototype=new Lf;var Of=Rr,Rf=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Nf=Rf,Mf=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Bf=Mf,Nr=t,Ms=Je,Bs=Vi,Mr=Is,Ot=j,Zt=_f,Br=be,pu=vf,Ff=Sf.H264Stream,Uf=Of,qf=Qn.isLikelyAacData,$f=be.ONE_SECOND_IN_TS,mu=Nf,gu=Bf,Fr,Fs,Ur,wi,jf=function(o,l){l.stream=o,this.trigger("log",l)},_u=function(o,l){for(var h=Object.keys(l),d=0;d<h.length;d++){var p=h[d];p==="headOfPipeline"||!l[p].on||l[p].on("log",jf.bind(o,p))}},yu=function(o,l){var h;if(o.length!==l.length)return!1;for(h=0;h<o.length;h++)if(o[h]!==l[h])return!1;return!0},Tu=function(o,l,h,d,p,m){var x=h-l,E=d-l,D=p-h;return{start:{dts:o,pts:o+x},end:{dts:o+E,pts:o+D},prependedContentDuration:m,baseMediaDecodeTime:o}};Fs=function(o,l){var h=[],d,p=0,m=0,x=1/0;l=l||{},d=l.firstSequenceNumber||0,Fs.prototype.init.call(this),this.push=function(E){Ot.collectDtsInfo(o,E),o&&mu.forEach(function(D){o[D]=E[D]}),h.push(E)},this.setEarliestDts=function(E){p=E},this.setVideoBaseMediaDecodeTime=function(E){x=E},this.setAudioAppendStart=function(E){m=E},this.flush=function(){var E,D,k,N,W,ae,Y;if(h.length===0){this.trigger("done","AudioSegmentStream");return}E=Mr.trimAdtsFramesByEarliestDts(h,o,p),o.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),Y=Mr.prefixWithSilence(o,E,m,x),o.samples=Mr.generateSampleTable(E),k=Ms.mdat(Mr.concatenateFrameData(E)),h=[],D=Ms.moof(d,[o]),N=new Uint8Array(D.byteLength+k.byteLength),d++,N.set(D),N.set(k,D.byteLength),Ot.clearDtsInfo(o),W=Math.ceil($f*1024/o.samplerate),E.length&&(ae=E.length*W,this.trigger("segmentTimingInfo",Tu(Br.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),E[0].dts,E[0].pts,E[0].dts+ae,E[0].pts+ae,Y||0)),this.trigger("timingInfo",{start:E[0].pts,end:E[0].pts+ae})),this.trigger("data",{track:o,boxes:N}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Ot.clearDtsInfo(o),h=[],this.trigger("reset")}},Fs.prototype=new Nr,Fr=function(o,l){var h,d=[],p=[],m,x;l=l||{},h=l.firstSequenceNumber||0,Fr.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(E){Ot.collectDtsInfo(o,E),E.nalUnitType==="seq_parameter_set_rbsp"&&!m&&(m=E.config,o.sps=[E.data],gu.forEach(function(D){o[D]=m[D]},this)),E.nalUnitType==="pic_parameter_set_rbsp"&&!x&&(x=E.data,o.pps=[E.data]),d.push(E)},this.flush=function(){for(var E,D,k,N,W,ae,Y=0,ue,ge;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();
204if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(E=Bs.groupNalsIntoFrames(d),k=Bs.groupFramesIntoGops(E),k[0][0].keyFrame||(D=this.getGopForFusion_(d[0],o),D?(Y=D.duration,k.unshift(D),k.byteLength+=D.byteLength,k.nalCount+=D.nalCount,k.pts=D.pts,k.dts=D.dts,k.duration+=D.duration):k=Bs.extendFirstKeyFrame(k)),p.length){var ze;if(l.alignGopsAtEnd?ze=this.alignGopsAtEnd_(k):ze=this.alignGopsAtStart_(k),!ze){this.gopCache_.unshift({gop:k.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Ot.clearDtsInfo(o),k=ze}Ot.collectDtsInfo(o,k),o.samples=Bs.generateSampleTable(k),W=Ms.mdat(Bs.concatenateNalData(k)),o.baseMediaDecodeTime=Ot.calculateTrackBaseMediaDecodeTime(o,l.keepOriginalTimestamps),this.trigger("processedGopsInfo",k.map(function(gt){return{pts:gt.pts,dts:gt.dts,byteLength:gt.byteLength}})),ue=k[0],ge=k[k.length-1],this.trigger("segmentTimingInfo",Tu(o.baseMediaDecodeTime,ue.dts,ue.pts,ge.dts+ge.duration,ge.pts+ge.duration,Y)),this.trigger("timingInfo",{start:k[0].pts,end:k[k.length-1].pts+k[k.length-1].duration}),this.gopCache_.unshift({gop:k.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),N=Ms.moof(h,[o]),ae=new Uint8Array(N.byteLength+W.byteLength),h++,ae.set(N),ae.set(W,N.byteLength),this.trigger("data",{track:o,boxes:ae}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){Ot.clearDtsInfo(o),m=void 0,x=void 0},this.getGopForFusion_=function(E){var D=45e3,k=1/0,N,W,ae,Y,ue;for(ue=0;ue<this.gopCache_.length;ue++)Y=this.gopCache_[ue],ae=Y.gop,!(!(o.pps&&yu(o.pps[0],Y.pps[0]))||!(o.sps&&yu(o.sps[0],Y.sps[0])))&&(ae.dts<o.timelineStartInfo.dts||(N=E.dts-ae.dts-ae.duration,N>=-1e4&&N<=D&&(!W||k>N)&&(W=Y,k=N)));return W?W.gop:null},this.alignGopsAtStart_=function(E){var D,k,N,W,ae,Y,ue,ge;for(ae=E.byteLength,Y=E.nalCount,ue=E.duration,D=k=0;D<p.length&&k<E.length&&(N=p[D],W=E[k],N.pts!==W.pts);){if(W.pts>N.pts){D++;continue}k++,ae-=W.byteLength,Y-=W.nalCount,ue-=W.duration}return k===0?E:k===E.length?null:(ge=E.slice(k),ge.byteLength=ae,ge.duration=ue,ge.nalCount=Y,ge.pts=ge[0].pts,ge.dts=ge[0].dts,ge)},this.alignGopsAtEnd_=function(E){var D,k,N,W,ae,Y;for(D=p.length-1,k=E.length-1,ae=null,Y=!1;D>=0&&k>=0;){if(N=p[D],W=E[k],N.pts===W.pts){Y=!0;break}if(N.pts>W.pts){D--;continue}D===p.length-1&&(ae=k),k--}if(!Y&&ae===null)return null;var ue;if(Y?ue=k:ue=ae,ue===0)return E;var ge=E.slice(ue),ze=ge.reduce(function(gt,fi){return gt.byteLength+=fi.byteLength,gt.duration+=fi.duration,gt.nalCount+=fi.nalCount,gt},{byteLength:0,duration:0,nalCount:0});return ge.byteLength=ze.byteLength,ge.duration=ze.duration,ge.nalCount=ze.nalCount,ge.pts=ge[0].pts,ge.dts=ge[0].dts,ge},this.alignGopsWith=function(E){p=E}},Fr.prototype=new Nr,wi=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,wi.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},wi.prototype=new Nr,wi.prototype.flush=function(o){var l=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,m,x=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?(x=this.videoTrack.timelineStartInfo.pts,gu.forEach(function(D){h.info[D]=this.videoTrack[D]},this)):this.audioTrack&&(x=this.audioTrack.timelineStartInfo.pts,mu.forEach(function(D){h.info[D]=this.audioTrack[D]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,m=Ms.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(m.byteLength),h.initSegment.set(m),h.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)h.data.set(this.pendingBoxes[E],l),l+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)d=this.pendingCaptions[E],d.startTime=Br.metadataTsToSeconds(d.startPts,x,this.keepOriginalTimestamps),d.endTime=Br.metadataTsToSeconds(d.endPts,x,this.keepOriginalTimestamps),h.captionStream
vendor: 7,043 bytes, line 204
204s[d.stream]=!0,h.captions.push(d);for(E=0;E<this.pendingMetadata.length;E++)p=this.pendingMetadata[E],p.cueTime=Br.metadataTsToSeconds(p.pts,x,this.keepOriginalTimestamps),h.metadata.push(p);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),E=0;E<h.captions.length;E++)d=h.captions[E],this.trigger("caption",d);for(E=0;E<h.metadata.length;E++)p=h.metadata[E],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},wi.prototype.setRemux=function(o){this.remuxTracks=o},Ur=function(o){var l=this,h=!0,d,p;Ur.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 Zt.MetadataStream,m.aacStream=new Uf,m.audioTimestampRolloverStream=new Zt.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new Zt.TimestampRolloverStream("timed-metadata"),m.adtsStream=new pu,m.coalesceStream=new wi(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(x){m.aacStream.setTimestamp(x.timeStamp)}),m.aacStream.on("data",function(x){x.type!=="timed-metadata"&&x.type!=="audio"||m.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:l.baseMediaDecodeTime},codec:"adts",type:"audio"},m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new Fs(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:!!d}))}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),_u(this,m)},this.setupTsPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new Zt.MetadataStream,m.packetStream=new Zt.TransportPacketStream,m.parseStream=new Zt.TransportParseStream,m.elementaryStream=new Zt.ElementaryStream,m.timestampRolloverStream=new Zt.TimestampRolloverStream,m.adtsStream=new pu,m.h264Stream=new Ff,m.captionStream=new Zt.CaptionStream(o),m.coalesceStream=new wi(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(x){var E;if(x.type==="metadata"){for(E=x.tracks.length;E--;)!d&&x.tracks[E].type==="video"?(d=x.tracks[E],d.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime):!p&&x.tracks[E].type==="audio"&&(p=x.tracks[E],p.timelineStartInfo.baseMediaDecodeTime=l.baseMediaDecodeTime);d&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new Fr(d,o),m.videoSegmentStream.on("log",l.getLogTrigger_("videoSegmentStream")),m.videoSegmentStream.on("timelineStartInfo",function(D){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=D,m.audioSegmentStream.setEarliestDts(D.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(D){p&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(D)}),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 Fs(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:!!d})}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("id3Frame",function(x){x.dispatchType=m.metadataStream.dispatchType,l.trigger("id3Frame",x)}),m.coalesceStream.on("caption",this.trigger.bind(this,"caption")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),_u(this,m)},this.setBaseMediaDecodeTime=function(m){var x=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=m),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(p),x.audioTimestampRolloverStream&&x.audioTimestampRolloverStream.discontinuity()),d&&(x.videoSegmentStream&&(x.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,Ot.clearDtsInfo(d),x.captionStream.reset()),x.timestampRolloverStream&&x.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(m){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(m)},this.setRemux=function(m){var x=this.transmuxPipeline_;o.remux=m,x&&x.coalesceStream&&x.coalesceStream.setRemux(m)},this.alignGopsWith=function(m){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(m)},this.getLogTrigger_=function(m){var x=this;return function(E){E.stream=m,x.trigger("log",E)}},this.push=function(m){if(h){var x=qf(m);x&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!x&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(m)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ur.prototype=new Nr;var Vf={Transmuxer:Ur},Hf=function(o){return o>>>0},zf=function(o){return("00"+o.toString(16)).slice(-2)},qr={toUnsigned:Hf,toHexString:zf},Gf=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},vu=Gf,Wf=qr.toUnsigned,Xf=vu,bu=function(o,l){var h=[],d,p,m,x,E;if(!l.length)return null;for(d=0;d<o.byteLength;)p=Wf(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),m=Xf(o.subarray(d+4,d+8)),x=p>1?d+p:o.byteLength,m===l[0]&&(l.length===1?h.push(o.subarray(d+8,x)):(E=bu(o.subarray(d+8,x),l.slice(1)),E.length&&(h=h.concat(E)))),d=x;return h},Jn=bu,Kf=qr.toUnsigned,Yf=n.getUint64,Qf=function(o){var l={ver
204sion:o[0],flags:new Uint8Array(o.subarray(1,4))};return l.version===1?l.baseMediaDecodeTime=Yf(o.subarray(4)):l.baseMediaDecodeTime=Kf(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),l},Zn=Qf,Jf=function(o){var l=new DataView(o.buffer,o.byteOffset,o.byteLength),h={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:l.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,m=h.flags[2]&8,x=h.flags[2]&16,E=h.flags[2]&32,D=h.flags[0]&65536,k=h.flags[0]&131072,N;return N=8,d&&(N+=4,h.baseDataOffset=l.getUint32(12),N+=4),p&&(h.sampleDescriptionIndex=l.getUint32(N),N+=4),m&&(h.defaultSampleDuration=l.getUint32(N),N+=4),x&&(h.defaultSampleSize=l.getUint32(N),N+=4),E&&(h.defaultSampleFlags=l.getUint32(N)),D&&(h.durationIsEmpty=!0),!d&&k&&(h.baseDataOffsetIsMoof=!0),h},xu=Jf,Zf=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]}},ep=Zf,Su=ep,tp=function(o){var l={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},h=new DataView(o.buffer,o.byteOffset,o.byteLength),d=l.flags[2]&1,p=l.flags[2]&4,m=l.flags[1]&1,x=l.flags[1]&2,E=l.flags[1]&4,D=l.flags[1]&8,k=h.getUint32(4),N=8,W;for(d&&(l.dataOffset=h.getInt32(N),N+=4),p&&k&&(W={flags:Su(o.subarray(N,N+4))},N+=4,m&&(W.duration=h.getUint32(N),N+=4),x&&(W.size=h.getUint32(N),N+=4),D&&(l.version===1?W.compositionTimeOffset=h.getInt32(N):W.compositionTimeOffset=h.getUint32(N),N+=4),l.samples.push(W),k--);k--;)W={},m&&(W.duration=h.getUint32(N),N+=4),x&&(W.size=h.getUint32(N),N+=4),E&&(W.flags=Su(o.subarray(N,N+4)),N+=4),D&&(l.version===1?W.compositionTimeOffset=h.getInt32(N):W.compositionTimeOffset=h.getUint32(N),N+=4),l.samples.push(W);return l},Eu=tp,Cu={tfdt:Zn,trun:Eu},Au={parseTfdt:Cu.tfdt,parseTrun:Cu.trun},ip=function(o){for(var l=0,h=String.fromCharCode(o[l]),d="";h!=="\0";)d+=h,l++,h=String.fromCharCode(o[l]);return d+=h,d},sp={uint8ToCString:ip},$r=sp.uint8ToCString,rp=n.getUint64,np=function(o){var l=4,h=o[0],d,p,m,x,E,D,k,N;if(h===0){d=$r(o.subarray(l)),l+=d.length,p=$r(o.subarray(l)),l+=p.length;var W=new DataView(o.buffer);m=W.getUint32(l),l+=4,E=W.getUint32(l),l+=4,D=W.getUint32(l),l+=4,k=W.getUint32(l),l+=4}else if(h===1){var W=new DataView(o.buffer);m=W.getUint32(l),l+=4,x=rp(o.subarray(l)),l+=8,D=W.getUint32(l),l+=4,k=W.getUint32(l),l+=4,d=$r(o.subarray(l)),l+=d.length,p=$r(o.subarray(l)),l+=p.length}N=new Uint8Array(o.subarray(l,o.byteLength));var ae={scheme_id_uri:d,value:p,timescale:m||1,presentation_time:x,presentation_time_delta:E,event_duration:D,id:k,message_data:N};return op(h,ae)?ae:void 0},ap=function(o,l,h,d){return o||o===0?o/l:d+h/l},op=function(o,l){var h=l.scheme_id_uri!=="\0",d=o===0&&Du(l.presentation_time_delta)&&h,p=o===1&&Du(l.presentation_time)&&h;return!(o>1)&&d||p},Du=function(o){return o!==void 0||o!==null},up={parseEmsgBox:np,scaleTime:ap},Us;typeof window<"u"?Us=window:typeof s<"u"?Us=s:typeof self<"u"?Us=self:Us={};var wu=Us,jr=qr.toUnsigned,qs=qr.toHexString,Ue=Jn,Gi=vu,ea=up,lp=xu,cp=Eu,dp=Zn,hp=n.getUint64,ku,Iu,Pu,Lu,Ou,ta,Ru,ia=wu,fp=ru.parseId3Frames;ku=function(o){var l={},h=Ue(o,["moov","trak"]);return h.reduce(function(d,p){var m,x,E,D,k;return m=Ue(p,["tkhd"])[0],!m||(x=m[0],E=x===0?12:20,D=jr(m[E]<<24|m[E+1]<<16|m[E+2]<<8|m[E+3]),k=Ue(p,["mdia","mdhd"])[0],!k)?null:(x=k[0],E=x===0?12:20,d[D]=jr(k[E]<<24|k[E+1]<<16|k[E+2]<<8|k[E+3]),d)},l)},Iu=function(o,l){var h;h=Ue(l,["moof","traf"]);var d=h.reduce(function(p,m){var x=Ue(m,["tfhd"])[0],E=jr(x[4]<<24|x[5]<<16|x[6]<<8|x[7]),D=o[E]||9e4,k=Ue(m,["tfdt"])[0],N=new DataView(k.buffer,k.byteOffset,k.byteLength),W;k[0]===1?W=hp(k.subarray(4,12)):W=N.getUint32(4);let ae;return typeof W=="bigint"?ae=W/ia.BigInt(D):typeof W=="number"&&!isNaN(W)&&(ae=W/D),ae<Number.MAX_SAFE_INTEGER&&(ae=Number(ae)),ae<p&&(p=ae),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},Pu=function(o,l){var h=Ue(l,["moof","traf"]),d=0,p=0,m;if(h&&h.length){var x=Ue(h[0],["tfhd"])[0],E=Ue(h[0],["trun"])[0],D=Ue(h[0],["tfdt"])[0];if(x){var k=lp(x);m=k.trackId}if(D){var N=dp(D);d=N.baseMediaDecodeTime}if(E){var W=cp(E);W.samples&&W.samples.length&&(p=W.samples[0].compositionTimeOffset||0)}}var ae=o[m]||9e4;typeof d=="bigint"&&(p=ia.BigInt(p),ae=ia.BigInt(ae));var Y=(d+p)/ae;return typeof Y=="bigint"&&Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y},Lu=function(o){var l=Ue(o,["moov","trak"]),h=[];return l.forEach(function(d){var p=Ue(d,["mdia","hdlr"]),m=Ue(d,["tkhd"]);p.forEach(function(x,E){var D=Gi(x.subarray(8,12)),k=m[E],N,W,ae;D==="vide"&&(N=new DataView(k.buffer,k.byteOffset,k.byteLength),W=N.getUint8(0),ae=W===0?N.getUint32(12):N.getUint32(20),h.push(ae))})}),h},ta=function(o){var l=o[0],h=l===0?12:20;return jr(o[h]<<24|o[h+1]<<16|o[h+2]<<8|o[h+3])},Ou=function(o){var l=Ue(o,["moov","trak"]),h=[];return l.forEach(function(d){var p={},m=Ue(d,["tkhd"])[0],x,E;m&&(x=new DataView(m.buffer,m.byteOffset,m.byteLength),E=x.getUint8(0),p.id=E===0?x.getUint32(12):x.getUint32(20));var D=Ue(d,["mdia","hdlr"])[0];if(D){var k=Gi(D.subarray(8,12));k==="vide"?p.type="video":k==="soun"?p.type="audio":p.type=k}var N=Ue(d,["mdia","minf","stbl","stsd"])[0];if(N){var W=N.subarray(8);p.codec=Gi(W.subarray(4,8));var ae=Ue(W,[p.codec])[0],Y,ue;ae&&(/^[asm]vc[1-9]$/i.test(p.codec)?(Y=ae.subarray(78),ue=Gi(Y.subarray(4,8)),ue==="avcC"&&Y.length>
20411?(p.codec+=".",p.codec+=qs(Y[9]),p.codec+=qs(Y[10]),p.codec+=qs(Y[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(Y=ae.subarray(28),ue=Gi(Y.subarray(4,8)),ue==="esds"&&Y.length>20&&Y[19]!==0?(p.codec+="."+qs(Y[19]),p.codec+="."+qs(Y[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var ge=Ue(d,["mdia","mdhd"])[0];ge&&(p.timescale=ta(ge)),h.push(p)}),h},Ru=function(o,l=0){var h=Ue(o,["emsg"]);return h.map(d=>{var p=ea.parseEmsgBox(new Uint8Array(d)),m=fp(p.message_data);return{cueTime:ea.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,l),duration:ea.scaleTime(p.event_duration,p.timescale),frames:m}})};var $s={findBox:Ue,parseType:Gi,timescale:ku,startTime:Iu,compositionStartTime:Pu,videoTrackIds:Lu,tracks:Ou,getTimescaleFromMediaHeader:ta,getEmsgID3:Ru};const{parseTrun:pp}=Au,{findBox:Nu}=$s;var Mu=wu,mp=function(o){var l=Nu(o,["moof","traf"]),h=Nu(o,["mdat"]),d=[];return h.forEach(function(p,m){var x=l[m];d.push({mdat:p,traf:x})}),d},gp=function(o,l,h){var d=l,p=h.defaultSampleDuration||0,m=h.defaultSampleSize||0,x=h.trackId,E=[];return o.forEach(function(D){var k=pp(D),N=k.samples;N.forEach(function(W){W.duration===void 0&&(W.duration=p),W.size===void 0&&(W.size=m),W.trackId=x,W.dts=d,W.compositionTimeOffset===void 0&&(W.compositionTimeOffset=0),typeof d=="bigint"?(W.pts=d+Mu.BigInt(W.compositionTimeOffset),d+=Mu.BigInt(W.duration)):(W.pts=d+W.compositionTimeOffset,d+=W.duration)}),E=E.concat(N)}),E},Bu={getMdatTrafPairs:mp,parseSamples:gp},_p=St.discardEmulationPreventionBytes,yp=eu.CaptionStream,sa=Jn,Tp=Zn,vp=xu,{getMdatTrafPairs:bp,parseSamples:xp}=Bu,Sp=function(o,l){for(var h=o,d=0;d<l.length;d++){var p=l[d];if(h<p.size)return p;h-=p.size}return null},Ep=function(o,l,h){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},m,x,E,D;for(x=0;x+4<o.length;x+=E)if(E=d.getUint32(x),x+=4,!(E<=0))switch(o[x]&31){case 6:var k=o.subarray(x+1,x+1+E),N=Sp(x,l);if(m={nalUnitType:"sei_rbsp",size:E,data:k,escapedRBSP:_p(k),trackId:h},N)m.pts=N.pts,m.dts=N.dts,D=N;else if(D)m.pts=D.pts,m.dts=D.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+x+" for trackId "+h+". See mux.js#223."});break}p.seiNals.push(m);break}return p},Cp=function(o,l){var h={},d=bp(o);return d.forEach(function(p){var m=p.mdat,x=p.traf,E=sa(x,["tfhd"]),D=vp(E[0]),k=D.trackId,N=sa(x,["tfdt"]),W=N.length>0?Tp(N[0]).baseMediaDecodeTime:0,ae=sa(x,["trun"]),Y,ue;l===k&&ae.length>0&&(Y=xp(ae,W,D),ue=Ep(m,Y,k),h[k]||(h[k]={seiNals:[],logs:[]}),h[k].seiNals=h[k].seiNals.concat(ue.seiNals),h[k].logs=h[k].logs.concat(ue.logs))}),h},Ap=function(o,l,h){var d;if(l===null)return null;d=Cp(o,l);var p=d[l]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Dp=function(){var o=!1,l,h,d,p,m,x;this.isInitialized=function(){return o},this.init=function(E){l=new yp,o=!0,x=E?E.isPartial:!1,l.on("data",function(D){D.startTime=D.startPts/p,D.endTime=D.endPts/p,m.captions.push(D),m.captionStreams[D.stream]=!0}),l.on("log",function(D){m.logs.push(D)})},this.isNewInit=function(E,D){return E&&E.length===0||D&&typeof D=="object"&&Object.keys(D).length===0?!1:d!==E[0]||p!==D[d]},this.parse=function(E,D,k){var N;if(this.isInitialized()){if(!D||!k)return null;if(this.isNewInit(D,k))d=D[0],p=k[d];else if(d===null||!p)return h.push(E),null}else return null;for(;h.length>0;){var W=h.shift();this.parse(W,D,k)}return N=Ap(E,d,p),N&&N.logs&&(m.logs=m.logs.concat(N.logs)),N===null||!N.seiNals?m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null:(this.pushNals(N.seiNals),this.flushStream(),m)},this.pushNals=function(E){if(!this.isInitialized()||!E||E.length===0)return null;E.forEach(function(D){l.push(D)})},this.flushStream=function(){if(!this.isInitialized())return null;x?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,m?this.clearParsedCaptions():m={captions:[],captionStream
204s:{},logs:[]},this.resetCaptionStream()},this.reset()},wp=Dp;const{parseTfdt:kp}=Au,hi=Jn,{getTimescaleFromMediaHeader:Ip}=$s,{parseSamples:Pp,getMdatTrafPairs:Lp}=Bu;var Fu=function(){let o=9e4;this.init=function(l){const h=hi(l,["moov","trak","mdia","mdhd"])[0];h&&(o=Ip(h))},this.parseSegment=function(l){const h=[],d=Lp(l);let p=0;return d.forEach(function(m){const x=m.mdat,E=m.traf,D=hi(E,["tfdt"])[0],k=hi(E,["tfhd"])[0],N=hi(E,["trun"]);if(D&&(p=kp(D).baseMediaDecodeTime),N.length&&k){const W=Pp(N,p,k);let ae=0;W.forEach(function(Y){const ue="utf-8",ge=new TextDecoder(ue),ze=x.slice(ae,ae+Y.size);if(hi(ze,["vtte"])[0]){ae+=Y.size;return}hi(ze,["vttc"]).forEach(function(js){const Vs=hi(js,["payl"])[0],Hs=hi(js,["sttg"])[0],zs=Y.pts/o,zr=(Y.pts+Y.duration)/o;let Ie,Gs;if(Vs)try{Ie=ge.decode(Vs)}catch(Rt){console.error(Rt)}if(Hs)try{Gs=ge.decode(Hs)}catch(Rt){console.error(Rt)}Y.duration&&Ie&&h.push({cueText:Ie,start:zs,end:zr,settings:Gs})}),ae+=Y.size})}}),h}},ra=Cr,Uu=function(o){var l=o[1]&31;return l<<=8,l|=o[2],l},Vr=function(o){return!!(o[1]&64)},Hr=function(o){var l=0;return(o[3]&48)>>>4>1&&(l+=o[4]+1),l},Op=function(o,l){var h=Uu(o);return h===0?"pat":h===l?"pmt":l?"pes":null},Rp=function(o){var l=Vr(o),h=4+Hr(o);return l&&(h+=o[h]+1),(o[h+10]&31)<<8|o[h+11]},Np=function(o){var l={},h=Vr(o),d=4+Hr(o);if(h&&(d+=o[d]+1),!!(o[d+5]&1)){var p,m,x;p=(o[d+1]&15)<<8|o[d+2],m=3+p-4,x=(o[d+10]&15)<<8|o[d+11];for(var E=12+x;E<m;){var D=d+E;l[(o[D+1]&31)<<8|o[D+2]]=o[D],E+=((o[D+3]&15)<<8|o[D+4])+5}return l}},Mp=function(o,l){var h=Uu(o),d=l[h];switch(d){case ra.H264_STREAM_TYPE:return"video";case ra.ADTS_STREAM_TYPE:return"audio";case ra.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Bp=function(o){var l=Vr(o);if(!l)return null;var h=4+Hr(o);if(h>=o.byteLength)return null;var d=null,p;return p=o[h+7],p&192&&(d={},d.pts=(o[h+9]&14)<<27|(o[h+10]&255)<<20|(o[h+11]&254)<<12|(o[h+12]&255)<<5|(o[h+13]&254)>>>3,d.pts*=4,d.pts+=(o[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(o[h+14]&14)<<27|(o[h+15]&255)<<20|(o[h+16]&254)<<12|(o[h+17]&255)<<5|(o[h+18]&254)>>>3,d.dts*=4,d.dts+=(o[h+18]&6)>>>1)),d},na=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}},Fp=function(o){for(var l=4+Hr(o),h=o.subarray(l),d=0,p=0,m=!1,x;p<h.byteLength-3;p++)if(h[p+2]===1){d=p+5;break}for(;d<h.byteLength;)switch(h[d]){case 0:if(h[d-1]!==0){d+=2;break}else if(h[d-2]!==0){d++;break}p+3!==d-2&&(x=na(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0));do d++;while(h[d]!==1&&d<h.length);p=d-2,d+=3;break;case 1:if(h[d-1]!==0||h[d-2]!==0){d+=3;break}x=na(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0),p=d-2,d+=3;break;default:d+=3;break}return h=h.subarray(p),d-=p,p=0,h&&h.byteLength>3&&(x=na(h[p+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0)),m},Up={parseType:Op,parsePat:Rp,parsePmt:Np,parsePayloadUnitStartIndicator:Vr,parsePesType:Mp,parsePesTime:Bp,videoPacketContainsKeyFrame:Fp},qu=Cr,Wi=iu.handleRollover,Ee={};Ee.ts=Up,Ee.aac=Qn;var ki=be.ONE_SECOND_IN_TS,nt=188,qt=71,qp=function(o,l){for(var h=0,d=nt,p,m;d<o.byteLength;){if(o[h]===qt&&o[d]===qt){switch(p=o.subarray(h,d),m=Ee.ts.parseType(p,l.pid),m){case"pat":l.pid=Ee.ts.parsePat(p);break;case"pmt":var x=Ee.ts.parsePmt(p);l.table=l.table||{},Object.keys(x).forEach(function(E){l.table[E]=x[E]});break}h+=nt,d+=nt;continue}h++,d++}},$u=function(o,l,h){for(var d=0,p=nt,m,x,E,D,k,N=!1;p<=o.byteLength;){if(o[d]===qt&&(o[p]===qt||p===o.byteLength)){switch(m=o.subarray(d,p),x=Ee.ts.parseType(m,l.pid),x){case"pes":E=Ee.ts.parsePesType(m,l.table),D=Ee.ts.parsePayloadUnitStartIndicator(m),E==="audio"&&D&&(k=Ee.ts.parsePesTime(m),k&&(k.type="audio",h.audio.push(k),N=!0));break}if(N)break;d+=nt,p+=nt;continue}d++,p++}for(p=o.byteLength,d=p-nt,N=!1;d>=0;){if(o[d]===qt&&(o[p]===qt||p===o.byteLength)){switch(m=o.subarray(d,p),x=Ee.ts.parseType(m,l.pid),x){case"pes":E=Ee.ts.parsePesType(m,l.table),D=Ee.ts.parsePayloadUnitStartIndicator(m),E==="audio"&&D&&(k=Ee.ts.parsePesTime(m),k&&(k.type="audio",h.audio.push(k),N=!0));break}if(N)break;d-=nt,p-=nt;continue}d--,p--}},$p=function(o,l,h){for(var d=0,p=nt,m,x,E,D,k,N,W,ae,Y=!1,ue={data:[],size:0};p<o.byteLength;){if(o[d]===qt&&o[p]===qt){switch(m=o.subarray(d,p),x=Ee.ts.parseType(m,l.pid),x){case"pes":if(E=Ee.ts.parsePesType(m,l.table),D=Ee.ts.parsePayloadUnitStartIndicator(m),E==="video"&&(D&&!Y&&(k=Ee.ts.parsePesTime(m),k&&(k.type="video",h.video.push(k),Y=!0)),!h.firstKeyFrame)){if(D&&ue.size!==0){for(N=new Uint8Array(ue.size),W=0;ue.data.length;)ae=ue.data.shift(),N.set(ae,W),W+=ae.byteLength;if(Ee.ts.videoPacketContainsKeyFrame(N)){var ge=Ee.ts.parsePesTime(N);ge?(h.firstKeyFrame=ge,h.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}ue.size=0}ue.data.push(m),ue.size+=m.byteLength}break}if(Y&&h.firstKeyFrame)break;d+=nt,p+=nt;continue}d++,p++}for(p=o.byteLength,d=p-nt,Y=!1;d>=0;){if(o[d]===qt&&o[p]===qt){switch(m=o.subarray(d,p),x=Ee.ts.parseType(m,l.pid),x){case"pes":E=Ee.ts.parsePesType(m,l.table),D=Ee.ts.parsePayloadUnitStartIndicator(m),E==="video"&&D&&(k=Ee.ts.parsePesTime(m),k&&(k.type="video",h.video.push(k),Y=!0));break}if(Y)break;d-=nt,p-=nt;continue}d--,p--}},jp=function(o,l){if(o.audio&&o.audio.length){var h=l;(typeof h>
204"u"||isNaN(h))&&(h=o.audio[0].dts),o.audio.forEach(function(m){m.dts=Wi(m.dts,h),m.pts=Wi(m.pts,h),m.dtsTime=m.dts/ki,m.ptsTime=m.pts/ki})}if(o.video&&o.video.length){var d=l;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(m){m.dts=Wi(m.dts,d),m.pts=Wi(m.pts,d),m.dtsTime=m.dts/ki,m.ptsTime=m.pts/ki}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=Wi(p.dts,d),p.pts=Wi(p.pts,d),p.dtsTime=p.dts/ki,p.ptsTime=p.pts/ki}}},Vp=function(o){for(var l=!1,h=0,d=null,p=null,m=0,x=0,E;o.length-x>=3;){var D=Ee.aac.parseType(o,x);switch(D){case"timed-metadata":if(o.length-x<10){l=!0;break}if(m=Ee.aac.parseId3TagSize(o,x),m>o.length){l=!0;break}p===null&&(E=o.subarray(x,x+m),p=Ee.aac.parseAacTimestamp(E)),x+=m;break;case"audio":if(o.length-x<7){l=!0;break}if(m=Ee.aac.parseAdtsSize(o,x),m>o.length){l=!0;break}d===null&&(E=o.subarray(x,x+m),d=Ee.aac.parseSampleRate(E)),h++,x+=m;break;default:x++;break}if(l)return null}if(d===null||p===null)return null;var k=ki/d,N={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*k,pts:p+h*1024*k}]};return N},Hp=function(o){var l={pid:null,table:null},h={};qp(o,l);for(var d in l.table)if(l.table.hasOwnProperty(d)){var p=l.table[d];switch(p){case qu.H264_STREAM_TYPE:h.video=[],$p(o,l,h),h.video.length===0&&delete h.video;break;case qu.ADTS_STREAM_TYPE:h.audio=[],$u(o,l,h),h.audio.length===0&&delete h.audio;break}}return h},zp=function(o,l){var h=Ee.aac.isLikelyAacData(o),d;return h?d=Vp(o):d=Hp(o),!d||!d.audio&&!d.video?null:(jp(d,l),d)},Gp={inspect:zp,parseAudioPes_:$u};const Wp=function(o,l){l.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,o.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),l.on("done",function(h){o.postMessage({action:"done"})}),l.on("gopInfo",function(h){o.postMessage({action:"gopInfo",gopInfo:h})}),l.on("videoSegmentTimingInfo",function(h){const d={start:{decode:be.videoTsToSeconds(h.start.dts),presentation:be.videoTsToSeconds(h.start.pts)},end:{decode:be.videoTsToSeconds(h.end.dts),presentation:be.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:be.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=be.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),l.on("audioSegmentTimingInfo",function(h){const d={start:{decode:be.videoTsToSeconds(h.start.dts),presentation:be.videoTsToSeconds(h.start.pts)},end:{decode:be.videoTsToSeconds(h.end.dts),presentation:be.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:be.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=be.videoTsToSeconds(h.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),l.on("id3Frame",function(h){o.postMessage({action:"id3Frame",id3Frame:h})}),l.on("caption",function(h){o.postMessage({action:"caption",caption:h})}),l.on("trackinfo",function(h){o.postMessage({action:"trackinfo",trackInfo:h})}),l.on("audioTimingInfo",function(h){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:be.videoTsToSeconds(h.start),end:be.videoTsToSeconds(h.end)}})}),l.on("videoTimingInfo",function(h){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:be.videoTsToSeconds(h.start),end:be.videoTsToSeconds(h.end)}})}),l.on("log",function(h){o.postMessage({action:"log",log:h})})};class ju{constructor(l,h){this.options=h||{},this.self=l,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Vf.Transmuxer(this.options),Wp(this.self,this.transmuxer)}pushMp4Captions(l){this.captionParser||(this.captionParser=new wp,this.captionParser.init());const h=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.captionParser.parse(h,l.trackIds,l.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}initMp4WebVttParser(l){this.webVttParser||(this.webVttParser=new Fu);const h=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.webVttParser.init(h)}getMp4WebVttText(l){this.webVttParser||(this.webVttParser=new Fu);const h=new Uint8Array(l.data,l.byteOffset,l.byteLength),d=this.webVttParser.parseSegment(h);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:l,data:h}){const d=$s.startTime(l,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:l}){const h=$s.tracks(l);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:l},[l.buffer])}probeEmsgID3({data:l,offset:h}){const d=$s.getEmsgID3(l,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:l},[l.buffer])}probeTs({data:l,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*be.ONE_SECOND_IN_TS:void 0,p=Gp.inspect(l,d);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 h=new Uint8Array(l.data,l.byteOffset,l.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(l){const h=l.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(be.secondsToVideoTs(h)))}setAudioAppendStart(l){this.transmuxer.setAudioAppendStart(Math.ceil(be.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())}}
204self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new ju(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new ju(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}}));var vy=Ih(Ty);const by=(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},y={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"&&(y.videoFrameDtsTime=c),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},xy=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},Sy=(s,e)=>{e.gopInfo=s.data.gopInfo},Oh=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:u,onAudioTimingInfo:c,onVideoTimingInfo:f,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:w,onCaptions:S,onDone:O,onEndedTimeline:T,onTransmuxerLog:P,isEndOfTimeline:B,segment:M,triggerSegmentEventFn:L}=s,z={buffer:[]};let q=B;const $=G=>{e.currentTransmux===s&&(G.data.action==="data"&&by(G,z,a),G.data.action==="trackinfo"&&u(G.data.trackInfo),G.data.action==="gopInfo"&&Sy(G,z),G.data.action==="audioTimingInfo"&&c(G.data.audioTimingInfo),G.data.action==="videoTimingInfo"&&f(G.data.videoTimingInfo),G.data.action==="videoSegmentTimingInfo"&&g(G.data.videoSegmentTimingInfo),G.data.action==="audioSegmentTimingInfo"&&y(G.data.audioSegmentTimingInfo),G.data.action==="id3Frame"&&w([G.data.id3Frame],G.data.id3Frame.dispatchType),G.data.action==="caption"&&S(G.data.caption),G.data.action==="endedtimeline"&&(q=!1,T()),G.data.action==="log"&&P(G.data.log),G.data.type==="transmuxed"&&(q||(e.onmessage=null,xy({transmuxedData:z,callback:O}),Rh(e))))},R=()=>{const G={message:"Received an error message from the transmuxer worker",metadata:{errorType:F.Error.StreamingFailedToTransmuxSegment,segmentInfo:Oi({segment:M})}};O(null,G)};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 G=t instanceof ArrayBuffer?t:t.buffer,v=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:M}),e.postMessage({action:"push",data:G,byteOffset:v,byteLength:t.byteLength},[G])}B&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Rh=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():Oh(s.currentTransmux))},nc=(s,e)=>{s.postMessage({action:e}),Rh(s)},Nh=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,nc(e,s);return}e.transmuxQueue.push(nc.bind(null,e,s))},Ey=s=>{Nh("reset",s)},Cy=s=>{Nh("endTimeline",s)},Mh=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,Oh(s);return}s.transmuxer.transmuxQueue.push(s)},Ay=s=>{const e=new vy;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 Ua={reset:Ey,endTimeline:Cy,transmux:Mh,createTransmuxer:Ay};const ns=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=qe({},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)},Wt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Bh="wvtt",lo=s=>{s.forEach(e=>{e.abort()})},Dy=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),wy=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},Jo=(s,e)=>{const{requestType:t}=e,i=qi({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Wt.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Wt.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Wt.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Wt.FAILURE,xhr:e,metadata:i}:null},ac=(s,e,t,i)=>(r,n)=>{const a=n.response,u=Jo(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:Wt.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 y=0;y<e.length;y++)e[y].bytes=f;const g={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:g}),t(null,s)},ky=(s,e)=>{e===Bh&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},Iy=(s,e,t)=>{e===Bh&&ns({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},Fh=(s,e)=>{const t=bo(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Wt.FAILURE,metadata:{mediaType:r}})}ns({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>
204(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"&&ky(s,n.codec))}),e(null))})},Py=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=Jo(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,Fh(s,function(u){if(u)return u.xhr=r,u.status=r.status,e(u,s);e(null,s)})},Ly=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=Jo(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const u=t==="arraybuffer"||!n.responseText?n.response:_y(n.responseText.substring(s.lastReachedChar||0));return s.stats=Dy(n),s.key?s.encryptedBytes=new Uint8Array(u):s.bytes=new Uint8Array(u),e(null,s)},Oy=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})=>{const O=s.map&&s.map.tracks||{},T=!!(O.audio&&O.video);let P=i.bind(null,s,"audio","start");const B=i.bind(null,s,"audio","end");let M=i.bind(null,s,"video","start");const L=i.bind(null,s,"video","end"),z=()=>Mh({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=>{M&&typeof q.start<"u"&&(M(q.start),M=null),L&&typeof q.end<"u"&&L(q.end)},onVideoSegmentTimingInfo:q=>{const $={pts:{start:q.start.presentation,end:q.end.presentation},dts:{start:q.start.decode,end:q.end.decode}};S({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}};S({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:$}),n(q)},onId3:(q,$)=>{a(s,q,$)},onCaptions:q=>{u(s,[q])},isEndOfTimeline:c,onEndedTimeline:()=>{f()},onTransmuxerLog:w,onDone:(q,$)=>{y&&(q.type=q.type==="combined"?"video":q.type,S({type:"segmenttransmuxingcomplete",segment:s}),y($,s,q))},segment:s,triggerSegmentEventFn:S});ns({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),z()}})},Uh=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})=>{let O=new Uint8Array(e);if(e0(O)){s.isFmp4=!0;const{tracks:T}=s.map;if(T.text&&(!T.audio||!T.video)){g(s,{data:O,type:"text"}),Iy(s,T.text.codec,y);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 M=(L,z)=>{g(s,{data:O,type:B.hasAudio&&!B.isMuxed?"audio":"video"}),z&&z.length&&a(s,z),L&&L.length&&u(s,L),y(null,s,{})};ns({action:"probeMp4StartTime",timescales:s.map.timescales,data:O,transmuxer:s.transmuxer,callback:({data:L,startTime:z})=>{e=L.buffer,s.bytes=O=L,B.hasAudio&&!B.isMuxed&&i(s,"audio","start",z),B.hasVideo&&i(s,"video","start",z),ns({action:"probeEmsgID3",data:O,transmuxer:s.transmuxer,offset:z,callback:({emsgData:q,id3Frames:$})=>{if(e=q.buffer,s.bytes=O=q,!T.video||!q.byteLength||!s.transmuxer){M(void 0,$);return}ns({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:O,timescales:s.map.timescales,trackIds:[T.video.id],callback:R=>{e=R.data.buffer,s.bytes=O=R.data,R.logs.forEach(function(G){w(Se(G,{stream:"mp4CaptionParser"}))}),M(R.captions,$)}})}})}});return}if(!s.transmuxer){y(null,s,{});return}if(typeof s.container>"u"&&(s.container=bo(O)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),y(null,s,{});return}Oy({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})},qh=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=Oi({segment:r}),y={message:f,metadata:{error:new Error(f),errorType:F.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,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(Eh({source:s,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},Ry=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})=>{S({type:"segmentdecryptionstart"}),qh({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:y},O=>{e.bytes=O,S({type:"segmentdecryptioncomplete",segment:e}),Uh({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})})},Ny=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})=>{let O=0,T=!1;return(P,B)=>{if(!T){if(P)return T=!0,lo(s),y(P,B);if(O+=1,O===s.length){const M=function(){if(B.encryptedBytes)return Ry({decryptionWorker:e,segment:B,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S});Uh({segment:B,bytes:B.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g,doneFn:y,onTransmuxerLog:w,triggerSegmentEventFn:S})};if(B.endOfAllRequests=Date.now(),B.map&&B.map.encryptedBytes&&!B.map.bytes)return S({type:"segmentdecryptionstart",segment:B}),qh({decryptionWorker:e,id:B.requestId+"-init",encryptedBytes:B.map.encryptedBytes,key:B.map.key,segment:B,doneFn:y},L=>{B.map.bytes=L,S({type:"segmentdecryptioncomplete",segment:B}),Fh(B,z=>{if(z)return lo(s),y(z,B);M()})});M()}}}},My=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},By=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:f,dataFn:g})=>y=>{if(!y.target.aborted)return s.stats=Se(s.stats,wy(y)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(y,s)},Fy=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:S,dataFn:O,doneFn:T,onTransmuxerLog:P,triggerSegmentEventFn:B})=>{const M=[],L=Ny({activeXhrs:M,decryptionWorker:t,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:S,dataFn:O,doneFn:T,onTransmuxerLog:P,triggerSegmentEventFn:B});if(i.key&&!i.key.bytes){const G=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&G.push(i.map.
vendor: 4,710 bytes, line 204
204key);const v=Se(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=ac(i,G,L,B),U={uri:i.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:U});const H=s(v,C);M.push(H)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const H=Se(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),V=ac(i,[i.map.key],L,B),Q={uri:i.map.key.resolvedUri};B({type:"segmentkeyloadstart",segment:i,keyInfo:Q});const ie=s(H,V);M.push(ie)}const v=Se(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:oo(i.map),requestType:"segment-media-initialization"}),C=Py({segment:i,finishProcessingFn:L,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const U=s(v,C);M.push(U)}const z=Se(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:oo(i),requestType:"segment"}),q=Ly({segment:i,finishProcessingFn:L,responseType:z.responseType,triggerSegmentEventFn:B});B({type:"segmentloadstart",segment:i});const $=s(z,q);$.addEventListener("progress",By({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:y,isEndOfTimeline:w,endedTimelineFn:S,dataFn:O})),M.push($);const R={};return M.forEach(G=>{G.addEventListener("loadend",My({loadendState:R,abortFn:r}))}),()=>lo(M)},Qr=It("PlaylistSelector"),oc=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||""})},as=function(s,e){if(!s)return"";const t=A.getComputedStyle(s);return t?t[e]:""},os=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})},Zo=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||A.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||A.Number.MAX_VALUE,t-i},Uy=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||A.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let $h=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;ht.isAudioOnly(e)&&(f=u.getAudioTrackPlaylists_(),c.audioOnly=!0);let g=f.map(R=>{let G;const v=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,C=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return G=R.attributes&&R.attributes.BANDWIDTH,G=G||A.Number.MAX_VALUE,{bandwidth:G,width:v,height:C,playlist:R}});os(g,(R,G)=>R.bandwidth-G.bandwidth),g=g.filter(R=>!ht.isIncompatible(R.playlist));let y=g.filter(R=>ht.isEnabled(R.playlist));y.length||(y=g.filter(R=>!ht.isDisabled(R.playlist)));const w=y.filter(R=>R.bandwidth*Ge.BANDWIDTH_VARIANCE<t);let S=w[w.length-1];const O=w.filter(R=>R.bandwidth===S.bandwidth)[0];if(a===!1){const R=O||y[0]||g[0];if(R&&R.playlist){let G="sortedPlaylistReps";return O&&(G="bandwidthBestRep"),y[0]&&(G="enabledPlaylistReps"),Qr(`choosing ${oc(R)} using ${G} with options`,c),R.playlist}return Qr("could not choose a playlist with options",c),null}const T=w.filter(R=>R.width&&R.height);os(T,(R,G)=>R.width-G.width);const P=T.filter(R=>R.width===i&&R.height===r);S=P[P.length-1];const B=P.filter(R=>R.bandwidth===S.bandwidth)[0];let M,L,z;B||(M=T.filter(R=>n==="cover"?R.width>i&&R.height>r:R.width>i||R.height>r),L=M.filter(R=>R.width===M[0].width&&R.height===M[0].height),S=L[L.length-1],z=L.filter(R=>R.bandwidth===S.bandwidth)[0]);let q;if(u.leastPixelDiffSelector){const R=T.map(G=>(G.pixelDiff=Math.abs(G.width-i)+Math.abs(G.height-r),G));os(R,(G,v)=>G.pixelDiff===v.pixelDiff?v.bandwidth-G.bandwidth:G.pixelDiff-v.pixelDiff),q=R[0]}const $=q||z||B||O||y[0]||g[0];if($&&$.playlist){let R="sortedPlaylistReps";return q?R="leastPixelDiffRep":z?R="resolutionPlusOneRep":B?R="resolutionBestRep":O?R="bandwidthBestRep":y[0]&&(R="enabledPlaylistReps"),Qr(`choosing ${oc($)} using ${R} with options`,c),$.playlist}return Qr("could not choose a playlist with options",c),null};const uc=function(){let s=this.useDevicePixelRatio&&A.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),$h({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(as(this.tech_.el(),"width"),10)*s,playerHe
204ight:parseInt(as(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?as(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},qy=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&&A.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),$h({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(as(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(as(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?as(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},$y=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:u,syncController:c}=s,f=e.playlists.filter(O=>!ht.isIncompatible(O));let g=f.filter(ht.isEnabled);g.length||(g=f.filter(O=>!ht.isDisabled(O)));const w=g.filter(ht.hasAttribute.bind(null,"BANDWIDTH")).map(O=>{const P=c.getSyncPoint(O,r,u,t)?1:2,M=ht.estimateSegmentRequestTime(n,i,O)*P-a;return{playlist:O,rebufferingImpact:M}}),S=w.filter(O=>O.rebufferingImpact<=0);return os(S,(O,T)=>Zo(T.playlist,O.playlist)),S.length?S[0]:(os(w,(O,T)=>O.rebufferingImpact-T.rebufferingImpact),w[0]||null)},jy=function(){const s=this.playlists.main.playlists.filter(ht.isEnabled);return os(s,(t,i)=>Zo(t,i)),s.filter(t=>!!ar(this.playlists.main,t).video)[0]||null},Vy=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 jh(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const Hy=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}}},zy=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=A.WebKitDataCue||A.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))})},Gy=function(s){Object.defineProperties(s.frame,{id:{get(){return F.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return F.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return F.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},Wy=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=A.WebKitDataCue||A.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(g=>{const y=g.cueTime+t;typeof y!="number"||A.isNaN(y)||y<0||!(y<1/0)||!g.frames||!g.frames.length||g.frames.forEach(w=>{const S=new r(y,y,w.value||w.url||w.data||"");S.frame=w,S.value=w,Gy(S),n.addCue(S)})}),!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,y)=>{const w=g[y.startTime]||[];return w.push(y),g[y.startTime]=w,g},{}),f=Object.keys(c).sort((g,y)=>Number(g)-Number(y));f.forEach((g,y)=>{const w=c[g],S=isFinite(i)?i:g,O=Number(f[y+1])||S;w.forEach(T=>{T.endTime=O})})},Xy={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"}
204,Ky=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Yy=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=A.WebKitDataCue||A.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(Ky.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:Xy[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()})},lc=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,F.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},er=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)},Qy=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}},Jy=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Ri.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},Zy=(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)},eT=(s,e,t,i)=>{const r=Math.ceil((e-i)*Ri.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Ri.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},tT=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},iT=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]},Qs=1,sT=500,cc=s=>typeof s=="number"&&isFinite(s),Jr=1/60,rT=(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,nT=(s,e,t)=>{let i=e-Ge.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},Yi=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:u=[]},mediaIndex:c,partIndex:f,timeline:g}=s,y=u.length-1;let w="mediaIndex/partIndex increment";s.getMediaInfoForTime?w=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(w="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(w+=` with independent ${s.independent}`);const S=typeof f=="number",O=s.segment.uri?"segment":"pre-segment",T=S?ah({preloadSegment:i})-1:0;return`${O} [${n+c}/${n+y}]`+(S?` part [${f}/${T}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(S?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${w}] playlist [${a}]`},dc=s=>`${s}TimingInfo`,aT=({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,co=({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},oT=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)},uT=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},gi=s=>{const e=s.pendingSegment_;if(!e)return;if(co({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&oT(s.timelineChangeController_)){if(uT(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}s.timelineChangeController_.trigger("fixBadTimelineChange")}},lT=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=A.BigInt(n)-A.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+zt:!1,cT=(s,e)=>{if(e!=="hls")return null;const t=lT({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 204
204return r||n?{severity:r?"warn":"info",message:a}:null},Oi=({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 ho extends F.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=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_():gi(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(qe({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():gi(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(qe({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():gi(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():gi(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Ua.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_&&A.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_())}
204abort(){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,A.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_&&Ua.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Xe();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=bn(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=Ch(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: 205currentTime: ${this.currentTime_()} 206bufferedEnd: ${Ba(this.buffered_())} 207`,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_&&(A.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"}))}
207resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ua.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_=eT(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const u in this.inbandTextTracks_)er(e,t,this.inbandTextTracks_[u]);er(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),sT)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Oi({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=Ba(e)||0,i=Xo(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=iT(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 w=a[this.mediaIndex],S=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=w.end?w.end:t,w.parts&&w.parts[S+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=S+1):u.mediaIndex=this.mediaIndex+1}else{let w,S,O;const T=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 208For TargetTime: ${T}. 209CurrentTime: ${this.currentTime_()} 210BufferedEnd: ${t} 211Fetch At Buffer: ${this.fetchAtBuffer_} 212`,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:F.Error.StreamingFailedToSelectNextSegment,error:new Error(B)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${P.start} --> ${P.end})`),w=P.segmentIndex,S=P.partIndex,O=P.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const P=ht.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:T,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});w=P.segmentIndex,S=P.partIndex,O=P.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${T}`:`currentTime ${T}`,u.mediaIndex=w,u.startOfSegment=O,u.partIndex=S,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 w=a[u.mediaIndex-1],S=w.parts&&w.parts.length&&w.parts[w.parts.length-1];S&&S.independent&&(u.mediaIndex-=1,u.partIndex=w.parts.length-1,u.independent="previous segment")}else c.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=a.length-1&&y&&!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],y=typeof u=="number"&&g.parts[u],w={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?u:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},S=typeof c<"u"?c:this.isPendingTimestampOffset_;w.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:S});
212const O=Ba(this.sourceUpdater_.audioBuffered());return typeof O=="number"&&(w.audioAppendStart=O-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(w.gopsToAlignWith=Jy(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),w}timestampOffsetForSegment_(e){return aT(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=ht.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=w_(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const u=$y({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<=zt&&(g=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=u.playlist.attributes.BANDWIDTH*Ge.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Yi(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:Oi({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||{},tT(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_():gi(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=dc(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():gi(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}`),Hy(g,this.vhs_.tech_,a),er(u,c,g[a]),zy({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_()?!co({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||co({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_()){gi(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
212y,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[dc(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=bn(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: "+Ni(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ni(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<=Qs&&g-f<=Qs){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ni(n).join(", ")}, video buffer: ${Ni(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 w=this.currentTime_()-Qs;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${w}`),this.remove(0,w,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Qs}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=A.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Qs*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===_h){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:F.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const u=[r];let c=r.byteLength;i&&(u.unshift(i),c+=i.byteLength),n=Vy({bytes:c,segments:u})}const a={segmentInfo:Oi({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_()){gi(this),this.loadQueue_.push(()=>{const t=qe({},e,{forceTimestampOffset:!0});qe(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_
212(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 213${jh(e.uri)} 214${Yi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Fy({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_(`${Yi(e)} logged from transmuxer stream ${f} as a ${c}: ${u}`)},triggerSegmentEventFn:({type:u,segment:c,keyInfo:f,trackInfo:g,timingInfo:y})=>{const S={segmentInfo:Oi({segment:c})};f&&(S.keyInfo=f),g&&(S.trackInfo=g),y&&(S.timingInfo=y),this.trigger({type:u,metadata:S})}})}trimBackBuffer_(e){const t=nT(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<Jr){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Jr}`);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===Wt.ABORTED)return;if(this.pause(),e.code===Wt.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_=Zy(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))}
214checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=rT(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:Oi({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=cT(e,this.sourceType_);if(t&&(t.severity==="warn"?F.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Yi(e)}`);return}this.logger_(`Appended ${Yi(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"} ${Yi(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<Jr){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Jr}`);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(!cc(i)||!cc(r))return;er(i,r,this.segmentMetadataTrack_);const n=A.WebKitDataCue||A.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
214i,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 ii(){}const Vh=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},dT=["video","audio"],fo=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},hT=(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},us=(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(),us("audio",e),us("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||fo(s,e))){if(i.type!==s){if(t=hT(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,us(s,e);return}}},Hh=(s,e)=>{const t=e[`${s}Buffer`],i=Vh(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},Vt=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,_t={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(Vt(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===_h?"(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(Vt(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`];Vt(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){F.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){F.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(Vt(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){F.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=Vh(s),r=ls(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(Hh(s,e),!!Vt(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){F.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=ls(s);if(!Vt(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=F.Error.StreamingCodecsChangeError,c.error=f,f.metadata=c,t.error_=f,t.trigger("error"),F.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},yt=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),us(s,e)},fc=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=C_(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_`])}us(s,e)};class zh extends F.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>us("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_=fc("video",this),this.onAudioUpdateEnd_=fc("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())}
214triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){yt({type:"mediaSource",sourceUpdater:this,action:_t.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){yt({type:e,sourceUpdater:this,action:_t.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){F.log.error("removeSourceBuffer is not supported!");return}yt({type:"mediaSource",sourceUpdater:this,action:_t.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!F.browser.IS_FIREFOX&&A.MediaSource&&A.MediaSource.prototype&&typeof A.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return A.SourceBuffer&&A.SourceBuffer.prototype&&typeof A.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){F.log.error("changeType is not supported!");return}yt({type:e,sourceUpdater:this,action:_t.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(yt({type:r,sourceUpdater:this,action:_t.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 Vt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Xe()}videoBuffered(){return Vt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Xe()}buffered(){const e=Vt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Vt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():D_(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=ii){yt({type:"mediaSource",sourceUpdater:this,action:_t.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=ii){typeof e!="string"&&(e=void 0),yt({type:"mediaSource",sourceUpdater:this,action:_t.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=ii){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}yt({type:"audio",sourceUpdater:this,action:_t.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=ii){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}yt({type:"video",sourceUpdater:this,action:_t.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(fo("audio",this)||fo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(yt({type:"audio",sourceUpdater:this,action:_t.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(yt({type:"video",sourceUpdater:this,action:_t.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&yt({type:"audio",sourceUpdater:this,action:_t.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&yt({type:"video",sourceUpdater:this,action:_t.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),dT.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Hh(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const pc=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),fT=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},mc=new Uint8Array(` 215 216`.split("").map(s=>s.charCodeAt(0)));
216class pT extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class mT extends ho{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 Xe();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Xe([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=bn(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=mc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(mc,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){er(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===Wt.TIMEOUT&&this.handleTimeout_(),e.code===Wt.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 A.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:F.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 A.VTTCue(u.startTime,u.endTime,u.text):u)}),Qy(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 A.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 A.WebVTT!="function")throw new pT;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof A.TextDecoder=="function"?t=new A.TextDecoder("utf8"):(t=A.WebVTT.StringDecoder(),i=!0);const r=new A.WebVTT.Parser(A,A.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{F.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=pc(a)),r.parse(a)}let n=e.bytes;i&&(n=pc(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/Ri.ONE_SECOND_IN_TS-a+t.mapping;
vendor: 6,368 bytes, lines 216-219
216if(e.cues.forEach(f=>{const g=f.endTime-f.startTime,y=this.handleRollover_(f.startTime+c,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+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*Ri.ONE_SECOND_IN_TS;const r=t*Ri.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Ri.ONE_SECOND_IN_TS}}const gT=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},_T=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=gT(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 A.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 A.VTTCue(i,i+a.duration,""),r.adStartTime=i-u,r.adEndTime=r.adStartTime+c,e.addCue(r)}i+=a.duration}};class gc{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 yT{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 Gh{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=` 217`,a=i,u=t;this.start_=a,e.forEach((c,f)=>{const g=this.storage_.get(u),y=a,w=y+c.duration,S=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),O=new gc({start:y,end:w,appended:S,segmentIndex:f});c.syncInfo=O;let T=a;const P=(c.parts||[]).map((B,M)=>{const L=T,z=T+B.duration,q=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[M]&&g.partsSyncInfo[M].isAppended),$=new gc({start:L,end:z,appended:q,segmentIndex:f,partIndex:M});return T=z,n+=`Media Sequence: ${u}.${M} | Range: ${L} --> ${z} | Appended: ${q} 218`,B.syncInfo=$,$});r.set(u,new yT(O,P)),n+=`${jh(c.resolvedUri)} | Media Sequence: ${u} | Range: ${y} --> ${w} | Appended: ${S} 219`,u++,a=w}),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 _c extends Gh{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 TT=86400,qa=[{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=io(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],y=g.segment,w=s.timelineToDatetimeMappings[y.timeline];if(!w||!y.dateTimeObject)continue;let O=y.dateTimeObject.getTime()/1e3+w;if(y.parts&&typeof g.partIndex=="number")for(let P=0;P<g.partIndex;P++)O+=y.parts[P].duration;const T=Math.abs(r-O);if(a!==null&&(T===0||a<T))break;a=T,n={time:O,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=io(e);for(let c=0;c<u.length;c++){const f=e.endList||r===0?c:u.length-(c+1),g=u[f],y=g.segment,w=g.part&&g.part.start||y&&y.start;if(y.timeline===i&&typeof w<"u"){const S=Math.abs(r-w);if(a!==null&&a<S)break;(!n||a===null||a>=S)&&(a=S,n={time:w,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 y=Math.abs(r-g.time);if(a!==null&&a<y)break;(!n||a===null||a>=y)&&(a=y,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 vT extends F.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Gh,i=new _c(t),r=new _c(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 qa.find(({name:c}
219)=>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:y}=c;if(g<0)continue;const w=e.segments[g],S=y,O=S+w.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${g}. Time: [${S} -> ${O}]}`),r>=S&&r<O)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+nr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let u=0;u<qa.length;u++){const c=qa[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>TT){F.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],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-nr({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=i.end+nr({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 bT extends F.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const xT=Ph(Lh(function(){var s=function(){function T(){this.listeners={}}var P=T.prototype;return P.on=function(M,L){this.listeners[M]||(this.listeners[M]=[]),this.listeners[M].push(L)},P.off=function(M,L){if(!this.listeners[M])return!1;var z=this.listeners[M].indexOf(L);return this.listeners[M]=this.listeners[M].slice(0),this.listeners[M].splice(z,1),z>-1},P.trigger=function(M){var L=this.listeners[M];if(L)if(arguments.length===2)for(var z=L.length,q=0;q<z;++q)L[q].call(this,arguments[1]);
219else for(var $=Array.prototype.slice.call(arguments,1),R=L.length,G=0;G<R;++G)L[G].apply(this,$)},P.dispose=function(){this.listeners={}},P.pipe=function(M){this.on("data",function(L){M.push(L)})},T}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(T){return T.subarray(0,T.byteLength-T[T.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const T=[[[],[],[],[],[]],[[],[],[],[],[]]],P=T[0],B=T[1],M=P[4],L=B[4];let z,q,$;const R=[],G=[];let v,C,U,H,V,Q;for(z=0;z<256;z++)G[(R[z]=z<<1^(z>>7)*283)^z]=z;for(q=$=0;!M[q];q^=v||1,$=G[$]||1)for(H=$^$<<1^$<<2^$<<3^$<<4,H=H>>8^H&255^99,M[q]=H,L[H]=q,U=R[C=R[v=R[q]]],Q=U*16843009^C*65537^v*257^q*16843008,V=R[H]*257^H*16843008,z=0;z<4;z++)P[z][q]=V=V<<24^V>>>8,B[z][H]=Q=Q<<24^Q>>>8;for(z=0;z<5;z++)P[z]=P[z].slice(0),B[z]=B[z].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,M,L;const z=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 G=P.slice(0),v=[];for(this._key=[G,v],B=$;B<4*$+28;B++)L=G[B-1],(B%$===0||$===8&&B%$===4)&&(L=z[L>>>24]<<24^z[L>>16&255]<<16^z[L>>8&255]<<8^z[L&255],B%$===0&&(L=L<<8^L>>>24^R<<24,R=R<<1^(R>>7)*283)),G[B]=G[B-$]^L;for(M=0;B;M++,B--)L=G[M&3?B:B-4],B<=4||M<4?v[M]=L:v[M]=q[0][z[L>>>24]]^q[1][z[L>>16&255]]^q[2][z[L>>8&255]]^q[3][z[L&255]]}decrypt(P,B,M,L,z,q){const $=this._key[1];let R=P^$[0],G=L^$[1],v=M^$[2],C=B^$[3],U,H,V;const Q=$.length/4-2;let ie,re=4;const K=this._tables[1],Z=K[0],J=K[1],te=K[2],ee=K[3],fe=K[4];for(ie=0;ie<Q;ie++)U=Z[R>>>24]^J[G>>16&255]^te[v>>8&255]^ee[C&255]^$[re],H=Z[G>>>24]^J[v>>16&255]^te[C>>8&255]^ee[R&255]^$[re+1],V=Z[v>>>24]^J[C>>16&255]^te[R>>8&255]^ee[G&255]^$[re+2],C=Z[C>>>24]^J[R>>16&255]^te[G>>8&255]^ee[v&255]^$[re+3],re+=4,R=U,G=H,v=V;for(ie=0;ie<4;ie++)z[(3&-ie)+q]=fe[R>>>24]<<24^fe[G>>16&255]<<16^fe[v>>8&255]<<8^fe[C&255]^$[re++],U=R,R=G,G=v,v=C,C=U}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(P){this.jobs.push(P),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(T){return T<<24|(T&65280)<<8|(T&16711680)>>8|T>>>24},u=function(T,P,B){const M=new Int32Array(T.buffer,T.byteOffset,T.byteLength>>2),L=new r(Array.prototype.slice.call(P)),z=new Uint8Array(T.byteLength),q=new Int32Array(z.buffer);let $,R,G,v,C,U,H,V,Q;for($=B[0],R=B[1],G=B[2],v=B[3],Q=0;Q<M.length;Q+=4)C=a(M[Q]),U=a(M[Q+1]),H=a(M[Q+2]),V=a(M[Q+3]),L.decrypt(C,U,H,V,q,Q),q[Q]=a(q[Q]^$),q[Q+1]=a(q[Q+1]^R),q[Q+2]=a(q[Q+2]^G),q[Q+3]=a(q[Q+3]^v),$=C,R=U,G=H,v=V;return z};class c{constructor(P,B,M,L){const z=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+z),B,M,$)),R=z;R<q.length;R+=z)M=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+z),B,M,$));this.asyncStream_.push(function(){L(null,e($))})}static get STEP(){return 32e3}decryptChunk_(P,B,M,L){return function(){const z=u(P,B,M);L.set(z,P.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof f<"u"?g=f:typeof self<"u"?g=self:g={};var y=g,w=function(P){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(P):P&&P.buffer instanceof ArrayBuffer},S=y.BigInt||Number;S("0x1"),S("0x100"),S("0x10000"),S("0x1000000"),S("0x100000000"),S("0x10000000000"),S("0x1000000000000"),S("0x100000000000000"),S("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 O=function(T){const P={};return Object.keys(T).forEach(B=>{const M=T[B];w(M)?P[B]={bytes:M.buffer,byteOffset:M.byteOffset,byteLength:M.byteLength}:P[B]=M}),P};self.onmessage=function(T){const P=T.data,B=new Uint8Array(P.encrypted.bytes,P.encrypted.byteOffset,P.encrypted.byteLength),M=new Uint32Array(P.key.bytes,P.key.byteOffset,P.ke
219y.byteLength/4),L=new Uint32Array(P.iv.bytes,P.iv.byteOffset,P.iv.byteLength/4);new c(B,M,L,function(z,q){self.postMessage(O({source:P.source,decrypted:q}),[q.buffer])})}}));var ST=Ih(xT);const ET=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Wh=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},po=(s,e)=>{e.activePlaylistLoader=s,s.load()},CT=(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,Wh(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){u&&i.resetEverything();return}t.resyncLoader(),po(a.playlistLoader,r)}},AT=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},DT=(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,Wh(i,n),!!u)){if(u.isMainPlaylist){if(!a||!f||a.id===f.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();if(g.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),g.fastQualityChange_(y);return}if(s==="AUDIO"){if(!u.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(c===u.playlistLoader){po(u.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),po(u.playlistLoader,n)}},xn={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}F.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;F.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},yc={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",xn[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",xn[s](s,t))}},wT={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,y=_r(g.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},y&&(a[s].main.default.playlists=g.main.playlists));for(const w in a[s]){u[w]||(u[w]=[]);for(const S in a[s][w]){let O=a[s][w][S],T;if(y?(f(`AUDIO group '${w}' label '${S}' is a main playlist`),O.isMainPlaylist=!0,T=null):i==="vhs-json"&&O.playlists?T=new Zi(O.playlists[0],t,n):O.resolvedUri?T=new Zi(O.resolvedUri,t,n):O.playlists&&i==="dash"?T=new uo(O.playlists[0],t,n,g):T=null,O=Se({id:S,playlistLoader:T},O),yc[s](s,O.playlistLoader,e),u[w].push(O),typeof c[S]>"u"){const P=new F.AudioTrack({id:S,kind:ET(O),enabled:!1,language:O.language,default:O.default,label:S});c[S]=P}}}r.on("error",xn[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 y in u[s]){c[y]||(c[y]=[]);for(const w in u[s][y]){if(!i.options_.useForcedSubtitles&&u[s][y][w].forced)continue;let S=u[s][y][w],O;if(r==="hls")O=new Zi(S.resolvedUri,i,a);else if(r==="dash"){if(!S.playlists.filter(P=>P.excludeUntil!==1/0).length)return;O=new uo(S.playlists[0],i,a,g)}else r==="vhs-json"&&(O=new Zi(S.playlists?S.playlists[0]:S.resolvedUri,i,a));if(S=Se({id:w,playlistLoader:O},S),yc[s](s,S.playlistLoader,e),c[y].push(S),typeof f[w]>"u"){const T=t.addRemoteTextTrack({id:w,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:w},!1).track;f[w]=T}}}n.on("error",xn[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=Se(g,f[g.instreamId])),g.default===void 0&&delete g.default,r[a].push(Se({id:u},c)),typeof n[u]>
219"u"){const y=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[u]=y}}}}},Xh=(s,e)=>{for(let t=0;t<s.length;t++)if(Qo(e,s[t])||s[t].playlists&&Xh(s[t].playlists,e))return!0;return!1},kT=(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&&_r(e.main))for(let c=0;c<u.length;c++){const f=r[u[c]];if(Xh(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},IT={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}},PT=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},LT=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{wT[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=kT(f,s),e[f].activeTrack=IT[f](f,s),e[f].onGroupChanged=CT(f,s),e[f].onGroupChanging=AT(f,s),e[f].onTrackChanged=DT(f,s),e[f].getActiveGroup=PT(f,s)});const u=e.AUDIO.activeGroup();if(u){const f=(u.filter(y=>y.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])},OT=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:ii,activeTrack:ii,getActiveGroup:ii,onGroupChanged:ii,onTrackChanged:ii,lastTrack_:null,logger_:It(`MediaGroups[${e}]`)}}),s};class Tc{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_=dt(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 RT extends F.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new Tc,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=dt(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 219
219{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:F.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 A.URL(e),i=new A.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(A.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new A.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_=A.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){A.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 Tc}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&&(dt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const NT=(s,e)=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(null,i)},e)}},MT=10;let _i;const BT=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],FT=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},UT=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:u,log:c}){if(!i)return F.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return c(`${f} as current playlist is not set`),!0;if(i.id===s.id)return!1;const g=!!Ji(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 y=Xo(e,t),w=u?Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ge.MAX_BUFFER_LOW_WATER_LINE;if(a<w)return c(`${f} as duration < max low water line (${a} < ${w})`),!0;const S=i.attributes.BANDWIDTH,O=s.attributes.BANDWIDTH;if(S<O&&(!u||y<n)){let T=`${f} as next bandwidth < current bandwidth (${S} < ${O})`;return u&&(T+=` and forwardBuffer < bufferHighWaterLine (${y} < ${n})`),c(T),!0}if((!u||S>O)&&y>=r){let T=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return u&&(T+=` and next bandwidth > current bandwidth (${S} > ${O})`),c(T),!0}return c(`not ${f} as no switching criteria met`),!1};class qT extends F.EventTarget{constructor(e){super(),this.fastQualityChange_=NT(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:y,bufferBasedABR:w,leastPixelDiffSelector:S,captionServices:O,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),_i=a,this.bufferBasedABR=!!w,this.leastPixelDiffSelector=!!S,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_=OT(),T&&A.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new A.ManagedMediaSource,this.usingManagedMediaSource_=!0,F.log("Using ManagedMediaSource")):A.MediaSource&&(this.mediaSource=new A.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_=Xe(),this.hasPlayed_=!1,this.syncController_=new vT(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new ST,this.sourceUpdater_=new zh(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new bT,this.keyStatusMap_=new Map;const B={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:O,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uo(t,this.vhs_,Se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Zi(t,this.vhs_,Se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new ho(Se(B,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new ho(Se(B,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new mT(Se(B,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((z,q)=>{function $(){r.off("vttjserror",R),z()}function R(){r.off("vttjsloaded",$),q()}r.one("vttjsloaded",$),r.one("vttjserror",R),r.addWebVttScript_()})}),e);const M=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new RT(this.vhs_.xhr,M),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),BT.forEach(z=>{this[z+"_"]=FT.bind(this,z)}),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 L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{const z=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-z,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 219
219=>{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_=A.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.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;so(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()),LT({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;so(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(qe({},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"}),_i.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 219
219dingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return UT({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:MT}))});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",()=>
219{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(qe({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(qe({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(qe({},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=_i.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Gt;const u=a.end(a.length-1);return u-n<=Gt&&r-u<=Gt}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(Hn),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return F.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const O=this.pathwayAttribute_(e),T=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(O),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(O)},T);return}let S=!1;r.forEach(O=>{if(O===e)return;const T=O.excludeUntil;typeof T<"u"&&T!==1/0&&(S=!0,delete O.excludeUntil)}),S&&(F.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_:F.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 y=c.targetDuration/2*1e3||5*1e3,w=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=y;return this.switchMedia_(c,"exclude",a||w)}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
219h(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=Ji(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:_i.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=_i.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),g=Math.max(u,c-f);return Xe([[u,g]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=_i.Playlist.seekable(i,n,_i.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:Xe([[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 [${rh(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=_i.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=ar(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||Em),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||nl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||nl,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?tr(g,this.usingManagedMediaSource_):Ta(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;
219this.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,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${u[y].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 y=(jt(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,w=(jt(r[g]||"")[0]||{}).type;y&&w&&y.toLowerCase()!==w.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=ar(this.main,r),a=[];n.audio&&!Ta(n.audio)&&!tr(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Ta(n.video)&&!tr(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=dr(jt(e)),n=tc(r),a=r.video&&jt(r.video)[0]||null,u=r.audio&&jt(r.audio)[0]||null;
219Object.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=[],y=ar(this.mainPlaylistLoader_.main,f),w=tc(y);if(!(!y.audio&&!y.video)){if(w!==n&&g.push(`codec count "${w}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const S=y.video&&jt(y.video)[0]||null,O=y.audio&&jt(y.audio)[0]||null;S&&a&&S.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${S.type}" !== "${a.type}"`),O&&u&&O.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${O.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)),_T(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ge.GOAL_BUFFER_LENGTH,i=Ge.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ge.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ge.BUFFER_LOW_WATER_LINE,i=Ge.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ge.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ge.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ge.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){lc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),Yy({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();lc(this.inbandTextTracks_,e,this.tech_),Wy({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(qe({},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 219
219Object.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 y=!u.excludeUntil&&u.excludeUntil!==1/0;!r.has(u.id)&&f&&y&&(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 219
219g.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,F.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:fT(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 $T=(s,e,t)=>i=>{const r=s.main.playlists[e],n=Yo(r),a=Hn(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 jT{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=ar(r.main(),t),this.playlist=t,this.id=i,this.enabled=$T(e.playlists,t.id,n)}}const VT=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=_r(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!Yo(i)).map((i,r)=>new jT(s,i,i.id)):[]}},vc=["seeking","seeked","pause","playing","error"];class HT extends F.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=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(y=>{a[`${y}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(vc,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(vc,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_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=A.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=k_(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:Ni(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+Gt>=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(Xe([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,
219i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const O=t.start(0);n=O+(O===t.end(0)?0:Gt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${rh(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(),y=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-zt)*2,w=[c,f];for(let O=0;O<w.length;O++){if(!w[O])continue;if(Xo(w[O],i)<y)return!1}const S=Yr(u,i);return S.length===0?!1:(n=S.start(0)+Gt,this.logger_(`Buffered region starts (${S.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=Ji(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=Yr(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)+Gt;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=Ji(e,i-3),a=Ji(e,i),u=Ji(t,i);u.length&&!a.length&&n.length&&(r={start:n.end(0),end:u.end(0)})}else Yr(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=Yr(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)+zt);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=A_(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 zT={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},Kh=function(s,e){let t=0,i=0;const r=Se(zT,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"){F.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(),Kh(s,g)};s.on("error",u),s.on("dispose",c),s.reloadSourceOnError=f},GT=function(s){Kh(this,s)};var Yh="3.17.2",WT="7.1.0",XT="1.3.1",KT="7.2.0",YT="4.0.2";const Ne={PlaylistLoader:Zi,Playlist:ht,utils:ty,STANDARD_PLAYLIST_SELECTOR:uc,INITIAL_PLAYLIST_SELECTOR:jy,lastBandwidthSelector:uc,movingAverageBandwidthSelector:qy,comparePlaylistBandwidth:Zo,comparePlaylistResolution:Uy,xhr:Sh()};Object.keys(Ge).forEach(s=>{Object.defineProperty(Ne,s,{get(){return F.log.warn(`using Vhs.${s}
219 is UNSAFE be sure you know what you are doing`),Ge[s]},set(e){if(F.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){F.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}Ge[s]=e}})});const Qh="videojs-vhs",Jh=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"})},QT=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),Jh(s,e.playlists)};Ne.canPlaySource=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const JT=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=dr(jt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=ls(i.video),n=ls(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 Se(s,a)},ZT=(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},[]),ev=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=ZT(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},y=>{if(y){g(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(u)])},tv=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=JT(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(F.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Zh=()=>{if(!A.localStorage)return null;const s=A.localStorage.getItem(Qh);if(!s)return null;try{return JSON.parse(s)}catch{return null}},iv=s=>{if(!A.localStorage)return!1;let e=Zh();e=e?Se(e,s):s;try{A.localStorage.setItem(Qh,JSON.stringify(e))}catch{return!1}return e},sv=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)};Ne.supportsNativeHls=function(){if(!se||!se.createElement)return!1;const s=se.createElement("video");return F.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1}();Ne.supportsNativeDash=function(){return!se||!se.createElement||!F.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(se.createElement("video").canPlayType("application/dash+xml"))}();Ne.supportsTypeNatively=s=>s==="hls"?Ne.supportsNativeHls:s==="dash"?Ne.supportsNativeDash:!1;Ne.isSupported=function(){return F.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Ne.xhr.onRequest=function(s){ef(Ne.xhr,s)};Ne.xhr.onResponse=function(s){tf(Ne.xhr,s)};Ne.xhr.offRequest=function(s){sf(Ne.xhr,s)};Ne.xhr.offResponse=function(s){rf(Ne.xhr,s)};const rv=F.getComponent("Component");class nf extends rv{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=F.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(se,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=se.fullscreenElement||se.webkitFullscreenElement||se.mozFullScreenElement||se.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_=Se(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
vendor: 7,678 bytes, line 219
219!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=Zh();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=Ge.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ge.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=sv(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ne,this.options_.sourceType=Cc(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new qT(this.options_);const i=Se({liveRangeSafeTimeDelta:Gt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new HT(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=F.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?Ne.movingAverageBandwidthSelector(.55):Ne.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Ne.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=A.navigator.connection||A.navigator.mozConnection||A.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(){F.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ni(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:()=>Ni(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&&iv({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{VT(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_=A.URL.createObjectURL(this.playlistController_.mediaSource),(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),ev({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
219ys 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=tv({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=F.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{QT(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Jh(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Yh,"mux.js":WT,"mpd-parser":XT,"m3u8-parser":KT,"aes-decrypter":YT}}version(){return this.constructor.version()}canChangeType(){return zh.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_&&A.URL.revokeObjectURL&&(A.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return uy({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return wh({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(qe({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(qe({},r))})})}}const Sn={name:"videojs-http-streaming",VERSION:Yh,canHandleSource(s,e={}){const t=Se(F.options,e);return!t.vhs.experimentalUseMMS&&!tr("avc1.4d400d,mp4a.40.2",!1)?!1:Sn.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=Se(F.options,t);return e.vhs=new nf(s,e,i),e.vhs.xhr=Sh(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=Cc(s);if(!t)return"";const i=Sn.getOverrideNative(e);return!Ne.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(F.browser.IS_ANY_SAFARI||F.browser.IS_IOS),{overrideNative:i=t}=e;return i}},nv=()=>tr("avc1.4d400d,mp4a.40.2",!0);nv()&&F.getTech("Html5").registerSourceHandler(Sn,0);F.VhsHandler=nf;F.VhsSourceHandler=Sn;F.Vhs=Ne;F.use||F.registerComponent("Vhs",Ne);F.options.vhs=F.options.vhs||{};(!F.getPlugin||!F.getPlugin("reloadSourceOnError"))&&F.registerPlugin("reloadSourceOnError",GT);const uv=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{uv as a,se as d,F as v,A as w};
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.