123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import{cG as en,cE as ya,cF as ry,d as Zh,bg as ay,be as Vo,L as tp,r as ep,cd as sy,m as oy,M as Wo,a0 as Go,aA as uy,bU as np,o as ip,c as ly,h as rp,g as ap,w as cy,a as zo,x as dy,R as hy,Q as py,k as fy,az as my,_ as gy,__tla as vy}from"./index-d02d27ca.js";let sp,yy=Promise.all([(()=>{try{return vy}catch{}})()]).then(async()=>{var Ki=typeof window<"u"?window:ya!==void 0?ya:typeof self<"u"?self:{};const D=en(Ki);var Yi,Xo=ya!==void 0?ya:typeof window<"u"?window:{},op=ry;typeof document<"u"?Yi=document:(Yi=Xo["__GLOBAL_DOCUMENT_CACHE@4"])||(Yi=Xo["__GLOBAL_DOCUMENT_CACHE@4"]=op);var Ko=Yi;const H=en(Ko);function he(){return he=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},he.apply(this,arguments)}var _a={exports:{}};(function(e,i){function r(u){if(u&&typeof u=="object"){var c=u.which||u.keyCode||u.charCode;c&&(u=c)}if(typeof u=="number")return s[u];var d,m=String(u);return(d=t[m.toLowerCase()])?d:(d=n[m.toLowerCase()])||(m.length===1?m.charCodeAt(0):void 0)}r.isEventKey=function(u,c){if(u&&typeof u=="object"){var d=u.which||u.keyCode||u.charCode;if(d==null)return!1;if(typeof c=="string"){var m;if((m=t[c.toLowerCase()])||(m=n[c.toLowerCase()]))return m===d}else if(typeof c=="number")return c===d;return!1}};var t=(i=e.exports=r).code=i.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},n=i.aliases={windows:91,"\u21E7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)t[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)t[a-48]=a;for(a=1;a<13;a++)t["f"+a]=a+111;for(a=0;a<10;a++)t["numpad "+a]=a+96;var s=i.names=i.title={};for(a in t)s[t[a]]=a;for(var o in n)t[o]=n[o]})(_a,_a.exports);const et=en(_a.exports);function tt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _n(e,i){return _n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},_n(e,i)}function V(e,i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,_n(e,i)}const up=en(function(e,i){var r,t=null;try{r=JSON.parse(e,i)}catch(n){t=n}return[t,r]});var ba={exports:{}},Yo={exports:{}};(function(e){function i(){return e.exports=i=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},e.exports.__esModule=!0,e.exports.default=e.exports,i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports})(Yo);var lp=Yo.exports,cp=function(e){if(!e)return!1;var i=dp.call(e);return i==="[object Function]"||typeof e=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},dp=Object.prototype.toString,hp=Ki,pp=function(e,i){return i===void 0&&(i=!1),function(r,t,n){if(r)e(r);else if(t.statusCode>=400&&t.statusCode<=599){var a=n;if(i)if(hp.TextDecoder){var s=function(o){return o===void 0&&(o=""),o.toLowerCase().split(";").reduce(function(u,c){var d=c.split("="),m=d[0],f=d[1];return m.trim()==="charset"?f.trim():u},"utf-8")}(t.headers&&t.headers["content-type"]);try{a=new TextDecoder(s).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a})}else e(null,n)}},Qo=Ki,fp=lp,mp=cp;_e.httpHandler=pp;var gp=function(e){var i={};return e&&e.trim().split(`
- `).forEach(function(r){var t=r.indexOf(":"),n=r.slice(0,t).trim().toLowerCase(),a=r.slice(t+1).trim();i[n]===void 0?i[n]=a:Array.isArray(i[n])?i[n].push(a):i[n]=[i[n],a]}),i};function $o(e,i,r){var t=e;return mp(i)?(r=i,typeof e=="string"&&(t={uri:e})):t=fp({},i,{uri:e}),t.callback=r,t}function _e(e,i,r){return Jo(i=$o(e,i,r))}function Jo(e){if(e.callback===void 0)throw new Error("callback argument missing");var i=!1,r=function(w,k,I){i||(i=!0,e.callback(w,k,I))};function t(){var w=void 0;if(w=u.response?u.response:u.responseText||function(k){try{if(k.responseType==="document")return k.responseXML;var I=k.responseXML&&k.responseXML.documentElement.nodeName==="parsererror";if(k.responseType===""&&!I)return k.responseXML}catch{}return null}(u),y)try{w=JSON.parse(w)}catch{}return w}function n(w){return clearTimeout(c),w instanceof Error||(w=new Error(""+(w||"Unknown XMLHttpRequest Error"))),w.statusCode=0,r(w,E)}function a(){if(!o){var w;clearTimeout(c),w=e.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var k=E,I=null;return w!==0?(k={body:t(),statusCode:w,method:m,headers:{},url:d,rawRequest:u},u.getAllResponseHeaders&&(k.headers=gp(u.getAllResponseHeaders()))):I=new Error("Internal XMLHttpRequest Error"),r(I,k,k.body)}}var s,o,u=e.xhr||null;u||(u=e.cors||e.useXDR?new _e.XDomainRequest:new _e.XMLHttpRequest);var c,d=u.url=e.uri||e.url,m=u.method=e.method||"GET",f=e.body||e.data,_=u.headers=e.headers||{},b=!!e.sync,y=!1,E={body:void 0,headers:{},statusCode:0,method:m,url:d,rawRequest:u};if("json"in e&&e.json!==!1&&(y=!0,_.accept||_.Accept||(_.Accept="application/json"),m!=="GET"&&m!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),f=JSON.stringify(e.json===!0?f:e.json))),u.onreadystatechange=function(){u.readyState===4&&setTimeout(a,0)},u.onload=a,u.onerror=n,u.onprogress=function(){},u.onabort=function(){o=!0},u.ontimeout=n,u.open(m,d,!b,e.username,e.password),b||(u.withCredentials=!!e.withCredentials),!b&&e.timeout>0&&(c=setTimeout(function(){if(!o){o=!0,u.abort("timeout");var w=new Error("XMLHttpRequest timeout");w.code="ETIMEDOUT",n(w)}},e.timeout)),u.setRequestHeader)for(s in _)_.hasOwnProperty(s)&&u.setRequestHeader(s,_[s]);else if(e.headers&&!function(w){for(var k in w)if(w.hasOwnProperty(k))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(u),u.send(f||null),u}ba.exports=_e,ba.exports.default=_e,_e.XMLHttpRequest=Qo.XMLHttpRequest||function(){},_e.XDomainRequest="withCredentials"in new _e.XMLHttpRequest?_e.XMLHttpRequest:Qo.XDomainRequest,function(e,i){for(var r=0;r<e.length;r++)i(e[r])}(["get","put","post","patch","head","delete"],function(e){_e[e==="delete"?"del":e]=function(i,r,t){return(r=$o(i,r,t)).method=e.toUpperCase(),Jo(r)}});const Zo=en(ba.exports);var tu={exports:{}},eu=Ko,Ta=Object.create||function(){function e(){}return function(i){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=i,new e}}();function ie(e,i){this.name="ParsingError",this.code=e.code,this.message=i||e.message}function Sa(e){function i(t,n,a,s){return 3600*(0|t)+60*(0|n)+(0|a)+(0|s)/1e3}var r=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return r?r[3]?i(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?i(r[1],r[2],0,r[4]):i(0,r[1],r[2],r[4]):null}function ri(){this.values=Ta(null)}function ai(e,i,r,t){var n=t?e.split(t):[e];for(var a in n)if(typeof n[a]=="string"){var s=n[a].split(r);s.length===2&&i(s[0].trim(),s[1].trim())}}function vp(e,i,r){var t=e;function n(){var s=Sa(e);if(s===null)throw new ie(ie.Errors.BadTimeStamp,"Malformed timestamp: "+t);return e=e.replace(/^[^\sa-zA-Z-]+/,""),s}function a(){e=e.replace(/^\s+/,"")}if(a(),i.startTime=n(),a(),e.substr(0,3)!=="-->")throw new ie(ie.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+t);e=e.substr(3),a(),i.endTime=n(),a(),function(s,o){var u=new ri;ai(s,function(c,d){switch(c){case"region":for(var m=r.length-1;m>=0;m--)if(r[m].id===d){u.set(c,r[m].region);break}break;case"vertical":u.alt(c,d,["rl","lr"]);break;case"line":var f=d.split(","),_=f[0];u.integer(c,_),u.percent(c,_)&&u.set("snapToLines",!1),u.alt(c,_,["auto"]),f.length===2&&u.alt("lineAlign",f[1],["start","center","end"]);break;case"position":f=d.split(","),u.percent(c,f[0]),f.length===2&&u.alt("positionAlign",f[1],["start","center","end"]);break;case"size":u.percent(c,d);break;case"align":u.alt(c,d,["start","center","end","left","right"])}},/:/,/\s/),o.region=u.get("region",null),o.vertical=u.get("vertical","");try{o.line=u.get("line","auto")}catch{}o.lineAlign=u.get("lineAlign","start"),o.snapToLines=u.get("snapToLines",!0),o.size=u.get("size",100);try{o.align=u.get("align","center")}catch{o.align=u.get("align","middle")}try{o.position=u.get("position","auto")}catch{o.position=u.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},o.align)}o.positionAlign=u.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},o.align)}(e,i)}ie.prototype=Ta(Error.prototype),ie.prototype.constructor=ie,ie.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},ri.prototype={set:function(e,i){this.get(e)||i===""||(this.values[e]=i)},get:function(e,i,r){return r?this.has(e)?this.values[e]:i[r]:this.has(e)?this.values[e]:i},has:function(e){return e in this.values},alt:function(e,i,r){for(var t=0;t<r.length;++t)if(i===r[t]){this.set(e,i);break}},integer:function(e,i){/^-?\d+$/.test(i)&&this.set(e,parseInt(i,10))},percent:function(e,i){return!!(i.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(i=parseFloat(i))>=0&&i<=100)&&(this.set(e,i),!0)}};var Ea=eu.createElement&&eu.createElement("textarea"),yp={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},nu={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},_p={v:"title",lang:"lang"},iu={rt:"ruby"};function ru(e,i){function r(){if(!i)return null;var b,y=i.match(/^([^<]*)(<[^>]*>?)?/);return b=y[1]?y[1]:y[2],i=i.substr(b.length),b}function t(b,y){return!iu[y.localName]||iu[y.localName]===b.localName}function n(b,y){var E=yp[b];if(!E)return null;var w=e.document.createElement(E),k=_p[b];return k&&y&&(w[k]=y.trim()),w}for(var a,s,o=e.document.createElement("div"),u=o,c=[];(a=r())!==null;)if(a[0]!=="<")u.appendChild(e.document.createTextNode((s=a,Ea.innerHTML=s,s=Ea.textContent,Ea.textContent="",s)));else{if(a[1]==="/"){c.length&&c[c.length-1]===a.substr(2).replace(">","")&&(c.pop(),u=u.parentNode);continue}var d,m=Sa(a.substr(1,a.length-2));if(m){d=e.document.createProcessingInstruction("timestamp",m),u.appendChild(d);continue}var f=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f||!(d=n(f[1],f[3]))||!t(u,d))continue;if(f[2]){var _=f[2].split(".");_.forEach(function(b){var y=/^bg_/.test(b),E=y?b.slice(3):b;if(nu.hasOwnProperty(E)){var w=y?"background-color":"color",k=nu[E];d.style[w]=k}}),d.className=_.join(" ")}c.push(f[1]),u.appendChild(d),u=d}return o}var au=[[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 bp(e){for(var i=0;i<au.length;i++){var r=au[i];if(e>=r[0]&&e<=r[1])return!0}return!1}function Tp(e){var i=[],r="";if(!e||!e.childNodes)return"ltr";function t(s,o){for(var u=o.childNodes.length-1;u>=0;u--)s.push(o.childNodes[u])}function n(s){if(!s||!s.length)return null;var o=s.pop(),u=o.textContent||o.innerText;if(u){var c=u.match(/^.*(\n|\r)/);return c?(s.length=0,c[0]):u}return o.tagName==="ruby"?n(s):o.childNodes?(t(s,o),n(s)):void 0}for(t(i,e);r=n(i);)for(var a=0;a<r.length;a++)if(bp(r.charCodeAt(a)))return"rtl";return"ltr"}function Qi(){}function $i(e,i,r){Qi.call(this),this.cue=i,this.cueDiv=ru(e,i.text);var t={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:i.vertical===""?"horizontal-tb":i.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(t,this.cueDiv),this.div=e.document.createElement("div"),t={direction:Tp(this.cueDiv),writingMode:i.vertical===""?"horizontal-tb":i.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:i.align==="middle"?"center":i.align,font:r.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(t),this.div.appendChild(this.cueDiv);var n=0;switch(i.positionAlign){case"start":case"line-left":n=i.position;break;case"center":n=i.position-i.size/2;break;case"end":case"line-right":n=i.position-i.size}i.vertical===""?this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(i.size,"%")}):this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(i.size,"%")}),this.move=function(a){this.applyStyles({top:this.formatStyle(a.top,"px"),bottom:this.formatStyle(a.bottom,"px"),left:this.formatStyle(a.left,"px"),right:this.formatStyle(a.right,"px"),height:this.formatStyle(a.height,"px"),width:this.formatStyle(a.width,"px")})}}function qt(e){var i,r,t,n;if(e.div){r=e.div.offsetHeight,t=e.div.offsetWidth,n=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),i=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||r,this.bottom=e.bottom||n+(e.height||r),this.width=e.width||t,this.lineHeight=i!==void 0?i:e.lineHeight}function Sp(e,i,r,t){var n=new qt(i),a=i.cue,s=function(y){if(typeof y.line=="number"&&(y.snapToLines||y.line>=0&&y.line<=100))return y.line;if(!y.track||!y.track.textTrackList||!y.track.textTrackList.mediaElement)return-1;for(var E=y.track,w=E.textTrackList,k=0,I=0;I<w.length&&w[I]!==E;I++)w[I].mode==="showing"&&k++;return-1*++k}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var c=n.lineHeight,d=c*Math.round(s),m=r[u]+c,f=o[0];Math.abs(d)>m&&(d=d<0?-1:1,d*=Math.ceil(m/c)*c),s<0&&(d+=a.vertical===""?r.height:r.width,o=o.reverse()),n.move(f,d)}else{var _=n.lineHeight/r.height*100;switch(a.lineAlign){case"center":s-=_/2;break;case"end":s-=_}switch(a.vertical){case"":i.applyStyles({top:i.formatStyle(s,"%")});break;case"rl":i.applyStyles({left:i.formatStyle(s,"%")});break;case"lr":i.applyStyles({right:i.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],n=new qt(i)}var b=function(y,E){for(var w,k=new qt(y),I=1,P=0;P<E.length;P++){for(;y.overlapsOppositeAxis(r,E[P])||y.within(r)&&y.overlapsAny(t);)y.move(E[P]);if(y.within(r))return y;var N=y.intersectPercentage(r);I>N&&(w=new qt(y),I=N),y=new qt(k)}return w||k}(n,o);i.move(b.toCSSCompatValues(r))}function bn(){}Qi.prototype.applyStyles=function(e,i){for(var r in i=i||this.div,e)e.hasOwnProperty(r)&&(i.style[r]=e[r])},Qi.prototype.formatStyle=function(e,i){return e===0?0:e+i},$i.prototype=Ta(Qi.prototype),$i.prototype.constructor=$i,qt.prototype.move=function(e,i){switch(i=i!==void 0?i:this.lineHeight,e){case"+x":this.left+=i,this.right+=i;break;case"-x":this.left-=i,this.right-=i;break;case"+y":this.top+=i,this.bottom+=i;break;case"-y":this.top-=i,this.bottom-=i}},qt.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},qt.prototype.overlapsAny=function(e){for(var i=0;i<e.length;i++)if(this.overlaps(e[i]))return!0;return!1},qt.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},qt.prototype.overlapsOppositeAxis=function(e,i){switch(i){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},qt.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},qt.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},qt.getSimpleBoxPosition=function(e){var i=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,r=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,t=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||t,height:e.height||i,bottom:e.bottom||t+(e.height||i),width:e.width||r}},bn.StringDecoder=function(){return{decode:function(e){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},bn.convertCueToDOMTree=function(e,i){return e&&i?ru(e,i):null},bn.processCues=function(e,i,r){if(!e||!i||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var t=e.document.createElement("div");if(t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",r.appendChild(t),function(u){for(var c=0;c<u.length;c++)if(u[c].hasBeenReset||!u[c].displayState)return!0;return!1}(i)){var n=[],a=qt.getSimpleBoxPosition(t),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};(function(){for(var u,c,d=0;d<i.length;d++)c=i[d],u=new $i(e,c,s),t.appendChild(u.div),Sp(0,u,a,n),c.displayState=u.div,n.push(qt.getSimpleBoxPosition(u))})()}else for(var o=0;o<i.length;o++)t.appendChild(i[o].displayState)},bn.Parser=function(e,i,r){r||(r=i,i={}),i||(i={}),this.window=e,this.vttjs=i,this.state="INITIAL",this.buffer="",this.decoder=r||new TextDecoder("utf8"),this.regionList=[]},bn.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof ie))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var i=this;function r(){for(var u=i.buffer,c=0;c<u.length&&u[c]!=="\r"&&u[c]!==`
- `;)++c;var d=u.substr(0,c);return u[c]==="\r"&&++c,u[c]===`
- `&&++c,i.buffer=u.substr(c),d}function t(u){u.match(/X-TIMESTAMP-MAP/)?ai(u,function(c,d){c==="X-TIMESTAMP-MAP"&&function(m){var f=new ri;ai(m,function(_,b){switch(_){case"MPEGT":f.integer(_+"S",b);break;case"LOCA":f.set(_+"L",Sa(b))}},/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:f.get("MPEGTS"),LOCAL:f.get("LOCAL")})}(d)},/=/):ai(u,function(c,d){c==="Region"&&function(m){var f=new ri;if(ai(m,function(b,y){switch(b){case"id":f.set(b,y);break;case"width":f.percent(b,y);break;case"lines":f.integer(b,y);break;case"regionanchor":case"viewportanchor":var E=y.split(",");if(E.length!==2)break;var w=new ri;if(w.percent("x",E[0]),w.percent("y",E[1]),!w.has("x")||!w.has("y"))break;f.set(b+"X",w.get("x")),f.set(b+"Y",w.get("y"));break;case"scroll":f.alt(b,y,["up"])}},/=/,/\s/),f.has("id")){var _=new(i.vttjs.VTTRegion||i.window.VTTRegion);_.width=f.get("width",100),_.lines=f.get("lines",3),_.regionAnchorX=f.get("regionanchorX",0),_.regionAnchorY=f.get("regionanchorY",100),_.viewportAnchorX=f.get("viewportanchorX",0),_.viewportAnchorY=f.get("viewportanchorY",100),_.scroll=f.get("scroll",""),i.onregion&&i.onregion(_),i.regionList.push({id:f.get("id"),region:_})}}(d)},/:/)}e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));try{var n;if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;var a=(n=r()).match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new ie(ie.Errors.BadSignature);i.state="HEADER"}for(var s=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(s?s=!1:n=r(),i.state){case"HEADER":/:/.test(n)?t(n):n||(i.state="ID");continue;case"NOTE":n||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){i.state="NOTE";break}if(!n)continue;i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");try{i.cue.align="center"}catch{i.cue.align="middle"}if(i.state="CUE",n.indexOf("-->")===-1){i.cue.id=n;continue}case"CUE":try{vp(n,i.cue,i.regionList)}catch(u){i.reportOrThrowError(u),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=n.indexOf("-->")!==-1;if(!n||o&&(s=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=`
- `),i.cue.text+=n.replace(/\u2028/g,`
- `).replace(/u2029/g,`
- `);continue;case"BADCUE":n||(i.state="ID");continue}}}catch(u){i.reportOrThrowError(u),i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||e.state==="HEADER")&&(e.buffer+=`
- `,e.parse()),e.state==="INITIAL")throw new ie(ie.Errors.BadSignature)}catch(i){e.reportOrThrowError(i)}return e.onflush&&e.onflush(),this}};var Ep=bn,wp={"":1,lr:1,rl:1},kp={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function wa(e){return typeof e=="string"&&!!kp[e.toLowerCase()]&&e.toLowerCase()}function su(e,i,r){this.hasBeenReset=!1;var t="",n=!1,a=e,s=i,o=r,u=null,c="",d=!0,m="auto",f="start",_="auto",b="auto",y=100,E="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return t},set:function(w){t=""+w}},pauseOnExit:{enumerable:!0,get:function(){return n},set:function(w){n=!!w}},startTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");a=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");s=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(w){u=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(w){var k=function(I){return typeof I=="string"&&!!wp[I.toLowerCase()]&&I.toLowerCase()}(w);if(k===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");c=k,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(w){d=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(w){if(typeof w!="number"&&w!=="auto")throw new SyntaxError("Line: an invalid number or illegal string was specified.");m=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(w){var k=wa(w);k?(f=k,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return _},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");_=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(w){var k=wa(w);k?(b=k,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");y=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return E},set:function(w){var k=wa(w);if(!k)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");E=k,this.hasBeenReset=!0}}}),this.displayState=void 0}su.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Cp=su,xp={"":!0,up:!0};function si(e){return typeof e=="number"&&e>=0&&e<=100}var Dp=function(){var e=100,i=3,r=0,t=100,n=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(o){if(!si(o))throw new Error("Width must be between 0 and 100.");e=o}},lines:{enumerable:!0,get:function(){return i},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");i=o}},regionAnchorY:{enumerable:!0,get:function(){return t},set:function(o){if(!si(o))throw new Error("RegionAnchorX must be between 0 and 100.");t=o}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!si(o))throw new Error("RegionAnchorY must be between 0 and 100.");r=o}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(o){if(!si(o))throw new Error("ViewportAnchorY must be between 0 and 100.");a=o}},viewportAnchorX:{enumerable:!0,get:function(){return n},set:function(o){if(!si(o))throw new Error("ViewportAnchorX must be between 0 and 100.");n=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=function(c){return typeof c=="string"&&!!xp[c.toLowerCase()]&&c.toLowerCase()}(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})},Ie=Ki,nn=tu.exports={WebVTT:Ep,VTTCue:Cp,VTTRegion:Dp};Ie.vttjs=nn,Ie.WebVTT=nn.WebVTT;var Ip=nn.VTTCue,Ap=nn.VTTRegion,Pp=Ie.VTTCue,Lp=Ie.VTTRegion;nn.shim=function(){Ie.VTTCue=Ip,Ie.VTTRegion=Ap},nn.restore=function(){Ie.VTTCue=Pp,Ie.VTTRegion=Lp},Ie.VTTCue||nn.shim();const ou=en(tu.exports);function uu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uu=function(){return!!e})()}function lu(e,i,r){if(uu())return Reflect.construct.apply(null,arguments);var t=[null];t.push.apply(t,i);var n=new(e.bind.apply(e,t));return r&&_n(n,r.prototype),n}var cu,du={exports:{}};cu=du,function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,t=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(s,o,u){if(u=u||{},s=s.trim(),!(o=o.trim())){if(!u.alwaysNormalize)return s;var c=a.parseURL(s);if(!c)throw new Error("Error trying to parse base URL.");return c.path=a.normalizePath(c.path),a.buildURLFromParts(c)}var d=a.parseURL(o);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return u.alwaysNormalize?(d.path=a.normalizePath(d.path),a.buildURLFromParts(d)):o;var m=a.parseURL(s);if(!m)throw new Error("Error trying to parse base URL.");if(!m.netLoc&&m.path&&m.path[0]!=="/"){var f=r.exec(m.path);m.netLoc=f[1],m.path=f[2]}m.netLoc&&!m.path&&(m.path="/");var _={scheme:m.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(_.netLoc=m.netLoc,d.path[0]!=="/"))if(d.path){var b=m.path,y=b.substring(0,b.lastIndexOf("/")+1)+d.path;_.path=a.normalizePath(y)}else _.path=m.path,d.params||(_.params=m.params,d.query||(_.query=m.query));return _.path===null&&(_.path=u.alwaysNormalize?a.normalizePath(d.path):d.path),a.buildURLFromParts(_)},parseURL:function(s){var o=i.exec(s);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(s){for(s=s.split("").reverse().join("").replace(t,"");s.length!==(s=s.replace(n,"")).length;);return s.split("").reverse().join("")},buildURLFromParts:function(s){return s.scheme+s.netLoc+s.path+s.params+s.query+s.fragment}};cu.exports=a}();const hu=en(du.exports);var Op="http://example.com",Ji=function(e,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(e)&&(e=D.location&&D.location.href||"");var r=typeof D.URL=="function",t=/^\/\//.test(e),n=!D.location&&!/\/\//i.test(e);if(r?e=new D.URL(e,D.location||Op):/\/\//i.test(e)||(e=hu.buildAbsoluteURL(D.location&&D.location.href||"",e)),r){var a=new URL(i,e);return n?a.href.slice(18):t?a.href.slice(a.protocol.length):a.href}return hu.buildAbsoluteURL(e,i)},ka=function(){function e(){this.listeners={}}var i=e.prototype;return i.on=function(r,t){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(t)},i.off=function(r,t){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(t);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},i.trigger=function(r){var t=this.listeners[r];if(t)if(arguments.length===2)for(var n=t.length,a=0;a<n;++a)t[a].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),o=t.length,u=0;u<o;++u)t[u].apply(this,s)},i.dispose=function(){this.listeners={}},i.pipe=function(r){this.on("data",function(t){r.push(t)})},e}();function pu(e){for(var i,r=(i=e,D.atob?D.atob(i):Buffer.from(i,"base64").toString("binary")),t=new Uint8Array(r.length),n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}var Rp=function(e){function i(){var r;return(r=e.call(this)||this).buffer="",r}return V(i,e),i.prototype.push=function(r){var t;for(this.buffer+=r,t=this.buffer.indexOf(`
- `);t>-1;t=this.buffer.indexOf(`
- `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},i}(ka),Np=String.fromCharCode(9),Ca=function(e){var i=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),r={};return i[1]&&(r.length=parseInt(i[1],10)),i[2]&&(r.offset=parseInt(i[2],10)),r},pe=function(e){for(var i,r=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),t={},n=r.length;n--;)r[n]!==""&&((i=/([^=]*)=(.*)/.exec(r[n]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),t[i[0]]=i[1]);return t},Mp=function(e){function i(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}V(i,e);var r=i.prototype;return r.push=function(t){var n,a,s=this;(t=t.trim()).length!==0&&(t[0]==="#"?this.tagMappers.reduce(function(o,u){var c=u(t);return c===t?o:o.concat([c])},[t]).forEach(function(o){for(var u=0;u<s.customParsers.length;u++)if(s.customParsers[u].call(s,o))return;if(o.indexOf("#EXT")===0)if(o=o.replace("\r",""),n=/^#EXTM3U/.exec(o))s.trigger("data",{type:"tag",tagType:"m3u"});else{if(n=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(o))return a={type:"tag",tagType:"inf"},n[1]&&(a.duration=parseFloat(n[1])),n[2]&&(a.title=n[2]),void s.trigger("data",a);if(n=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"targetduration"},n[1]&&(a.duration=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"version"},n[1]&&(a.version=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"media-sequence"},n[1]&&(a.number=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"discontinuity-sequence"},n[1]&&(a.number=parseInt(n[1],10)),void s.trigger("data",a);if(n=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(o))return a={type:"tag",tagType:"playlist-type"},n[1]&&(a.playlistType=n[1]),void s.trigger("data",a);if(n=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(o))return a=he(Ca(n[1]),{type:"tag",tagType:"byterange"}),void s.trigger("data",a);if(n=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(o))return a={type:"tag",tagType:"allow-cache"},n[1]&&(a.allowed=!/NO/.test(n[1])),void s.trigger("data",a);if(n=/^#EXT-X-MAP:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"map"},n[1]){var c=pe(n[1]);c.URI&&(a.uri=c.URI),c.BYTERANGE&&(a.byterange=Ca(c.BYTERANGE))}s.trigger("data",a)}else if(n=/^#EXT-X-STREAM-INF:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"stream-inf"},n[1]){if(a.attributes=pe(n[1]),a.attributes.RESOLUTION){var d=a.attributes.RESOLUTION.split("x"),m={};d[0]&&(m.width=parseInt(d[0],10)),d[1]&&(m.height=parseInt(d[1],10)),a.attributes.RESOLUTION=m}a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["FRAME-RATE"]&&(a.attributes["FRAME-RATE"]=parseFloat(a.attributes["FRAME-RATE"])),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))}s.trigger("data",a)}else{if(n=/^#EXT-X-MEDIA:?(.*)$/.exec(o))return a={type:"tag",tagType:"media"},n[1]&&(a.attributes=pe(n[1])),void s.trigger("data",a);if(n=/^#EXT-X-ENDLIST/.exec(o))s.trigger("data",{type:"tag",tagType:"endlist"});else if(n=/^#EXT-X-DISCONTINUITY/.exec(o))s.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(n=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(o))return a={type:"tag",tagType:"program-date-time"},n[1]&&(a.dateTimeString=n[1],a.dateTimeObject=new Date(n[1])),void s.trigger("data",a);if(n=/^#EXT-X-KEY:?(.*)$/.exec(o))return a={type:"tag",tagType:"key"},n[1]&&(a.attributes=pe(n[1]),a.attributes.IV&&(a.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void s.trigger("data",a);if(n=/^#EXT-X-START:?(.*)$/.exec(o))return a={type:"tag",tagType:"start"},n[1]&&(a.attributes=pe(n[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void s.trigger("data",a);if(n=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-out-cont"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a);if(n=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-out"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a);if(n=/^#EXT-X-CUE-IN:?(.*)?$/.exec(o))return a={type:"tag",tagType:"cue-in"},n[1]?a.data=n[1]:a.data="",void s.trigger("data",a);if((n=/^#EXT-X-SKIP:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"skip"}).attributes=pe(n[1]),a.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(a.attributes["SKIPPED-SEGMENTS"]=parseInt(a.attributes["SKIPPED-SEGMENTS"],10)),a.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(a.attributes["RECENTLY-REMOVED-DATERANGES"]=a.attributes["RECENTLY-REMOVED-DATERANGES"].split(Np)),void s.trigger("data",a);if((n=/^#EXT-X-PART:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"part"}).attributes=pe(n[1]),["DURATION"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=parseFloat(a.attributes[f]))}),["INDEPENDENT","GAP"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=/YES/.test(a.attributes[f]))}),a.attributes.hasOwnProperty("BYTERANGE")&&(a.attributes.byterange=Ca(a.attributes.BYTERANGE)),void s.trigger("data",a);if((n=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"server-control"}).attributes=pe(n[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=parseFloat(a.attributes[f]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=/YES/.test(a.attributes[f]))}),void s.trigger("data",a);if((n=/^#EXT-X-PART-INF:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"part-inf"}).attributes=pe(n[1]),["PART-TARGET"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=parseFloat(a.attributes[f]))}),void s.trigger("data",a);if((n=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"preload-hint"}).attributes=pe(n[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(f){if(a.attributes.hasOwnProperty(f)){a.attributes[f]=parseInt(a.attributes[f],10);var _=f==="BYTERANGE-LENGTH"?"length":"offset";a.attributes.byterange=a.attributes.byterange||{},a.attributes.byterange[_]=a.attributes[f],delete a.attributes[f]}}),void s.trigger("data",a);if((n=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(o))&&n[1])return(a={type:"tag",tagType:"rendition-report"}).attributes=pe(n[1]),["LAST-MSN","LAST-PART"].forEach(function(f){a.attributes.hasOwnProperty(f)&&(a.attributes[f]=parseInt(a.attributes[f],10))}),void s.trigger("data",a);s.trigger("data",{type:"tag",data:o.slice(4)})}}}else s.trigger("data",{type:"comment",text:o.slice(1)})}):this.trigger("data",{type:"uri",uri:t}))},r.addParser=function(t){var n=this,a=t.expression,s=t.customType,o=t.dataParser,u=t.segment;typeof o!="function"&&(o=function(c){return c}),this.customParsers.push(function(c){if(a.exec(c))return n.trigger("data",{type:"custom",data:o(c),customType:s,segment:u}),!0})},r.addTagMapper=function(t){var n=t.expression,a=t.map;this.tagMappers.push(function(s){return n.test(s)?a(s):s})},i}(ka),Tn=function(e){var i={};return Object.keys(e).forEach(function(r){var t;i[t=r,t.toLowerCase().replace(/-(\w)/g,function(n){return n[1].toUpperCase()})]=e[r]}),i},xa=function(e){var i=e.serverControl,r=e.targetDuration,t=e.partTargetDuration;if(i){var n="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=r&&3*r,u=t&&2*t;r&&!i.hasOwnProperty(a)&&(i[a]=o,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&i[a]<o&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+i[a]+") to targetDuration * 3 ("+o+")"}),i[a]=o),t&&!i.hasOwnProperty(s)&&(i[s]=3*t,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+i[s]+")."})),t&&i[s]<u&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+i[s]+") to partTargetDuration * 2 ("+u+")."}),i[s]=u)}},Up=function(e){function i(){var t;(t=e.call(this)||this).lineStream=new Rp,t.parseStream=new Mp,t.lineStream.pipe(t.parseStream);var n,a,s=tt(t),o=[],u={},c=!1,d=function(){},m={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var _=0,b=0;return t.on("end",function(){u.uri||!u.parts&&!u.preloadHints||(!u.map&&n&&(u.map=n),!u.key&&a&&(u.key=a),u.timeline||typeof f!="number"||(u.timeline=f),t.manifest.preloadSegment=u)}),t.parseStream.on("data",function(y){var E,w;({tag:function(){({version:function(){y.version&&(this.manifest.version=y.version)},"allow-cache":function(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var k={};"length"in y&&(u.byterange=k,k.length=y.length,"offset"in y||(y.offset=_)),"offset"in y&&(u.byterange=k,k.offset=y.offset),_=k.offset+k.length},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),y.duration>0&&(u.duration=y.duration),y.duration===0&&(u.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(y.attributes)if(y.attributes.METHOD!=="NONE")if(y.attributes.URI){if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes});if(y.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI});if(y.attributes.KEYFORMAT==="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):y.attributes.KEYID&&y.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:pu(y.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},y.attributes.IV!==void 0&&(a.iv=y.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else a=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(y.number)?this.manifest.mediaSequence=y.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number})},"discontinuity-sequence":function(){isFinite(y.number)?(this.manifest.discontinuitySequence=y.number,f=y.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number})},"playlist-type":function(){/VOD|EVENT/.test(y.playlistType)?this.manifest.playlistType=y.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist})},map:function(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||m,y.attributes?(u.attributes||(u.attributes={}),he(u.attributes,y.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||m,y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME){var k=this.manifest.mediaGroups[y.attributes.TYPE];k[y.attributes["GROUP-ID"]]=k[y.attributes["GROUP-ID"]]||{},E=k[y.attributes["GROUP-ID"]],(w={default:/yes/i.test(y.attributes.DEFAULT)}).default?w.autoselect=!0:w.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(w.language=y.attributes.LANGUAGE),y.attributes.URI&&(w.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(w.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(w.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(w.forced=/yes/i.test(y.attributes.FORCED)),E[y.attributes.NAME]=w}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){f+=1,u.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),u.dateTimeString=y.dateTimeString,u.dateTimeObject=y.dateTimeObject},targetduration:function(){!isFinite(y.duration)||y.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration}):(this.manifest.targetDuration=y.duration,xa.call(this,this.manifest))},start:function(){y.attributes&&!isNaN(y.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){u.cueOut=y.data},"cue-out-cont":function(){u.cueOutCont=y.data},"cue-in":function(){u.cueIn=y.data},skip:function(){this.manifest.skip=Tn(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part:function(){var k=this;c=!0;var I=this.manifest.segments.length,P=Tn(y.attributes);u.parts=u.parts||[],u.parts.push(P),P.byterange&&(P.byterange.hasOwnProperty("offset")||(P.byterange.offset=b),b=P.byterange.offset+P.byterange.length);var N=u.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+N+" for segment #"+I,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(A,U){A.hasOwnProperty("lastPart")||k.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+U+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var k=this.manifest.serverControl=Tn(y.attributes);k.hasOwnProperty("canBlockReload")||(k.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),xa.call(this,this.manifest),k.canSkipDateranges&&!k.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var k=this.manifest.segments.length,I=Tn(y.attributes),P=I.type&&I.type==="PART";u.preloadHints=u.preloadHints||[],u.preloadHints.push(I),I.byterange&&(I.byterange.hasOwnProperty("offset")||(I.byterange.offset=P?b:0,P&&(b=I.byterange.offset+I.byterange.length)));var N=u.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+N+" for segment #"+k,y.attributes,["TYPE","URI"]),I.type)for(var A=0;A<u.preloadHints.length-1;A++){var U=u.preloadHints[A];U.type&&U.type===I.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+N+" for segment #"+k+" has the same TYPE "+I.type+" as preload hint #"+A})}},"rendition-report":function(){var k=Tn(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(k);var I=this.manifest.renditionReports.length-1,P=["LAST-MSN","URI"];c&&P.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+I,y.attributes,P)},"part-inf":function(){this.manifest.partInf=Tn(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),xa.call(this,this.manifest)}}[y.tagType]||d).call(s)},uri:function(){u.uri=y.uri,o.push(u),this.manifest.targetDuration&&!("duration"in u)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),u.duration=this.manifest.targetDuration),a&&(u.key=a),u.timeline=f,n&&(u.map=n),b=0,u={}},comment:function(){},custom:function(){y.segment?(u.custom=u.custom||{},u.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(s)}),t}V(i,e);var r=i.prototype;return r.warnOnMissingAttributes_=function(t,n,a){var s=[];a.forEach(function(o){n.hasOwnProperty(o)||s.push(o)}),s.length&&this.trigger("warn",{message:t+" lacks required attribute(s): "+s.join(", ")})},r.push=function(t){this.lineStream.push(t)},r.end=function(){this.lineStream.push(`
- `),this.trigger("end")},r.addParser=function(t){this.parseStream.addParser(t)},r.addTagMapper=function(t){this.parseStream.addTagMapper(t)},i}(ka),rn={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^/},Bp=["video","audio","text"],fu=["Video","Audio","Text"],mu=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(i,r,t){return"avc1."+("00"+Number(r).toString(16)).slice(-2)+"00"+("00"+Number(t).toString(16)).slice(-2)})},be=function(e){e===void 0&&(e="");var i=e.split(","),r=[];return i.forEach(function(t){var n;t=t.trim(),Bp.forEach(function(a){var s=rn[a].exec(t.toLowerCase());if(s&&!(s.length<=1)){n=a;var o=t.substring(0,s[1].length),u=t.replace(o,"");r.push({type:o,details:u,mediaType:a})}}),n||r.push({type:t,details:"",mediaType:"unknown"})}),r},gu=function(e){return e===void 0&&(e=""),rn.audio.test(e.trim().toLowerCase())},oi=function(e){if(e&&typeof e=="string"){var i,r=e.toLowerCase().split(",").map(function(a){return mu(a.trim())}),t="video";r.length===1&&gu(r[0])?t="audio":r.length===1&&((i=r[0])===void 0&&(i=""),rn.text.test(i.trim().toLowerCase()))&&(t="application");var n="mp4";return r.every(function(a){return rn.mp4.test(a)})?n="mp4":r.every(function(a){return rn.webm.test(a)})?n="webm":r.every(function(a){return rn.ogg.test(a)})&&(n="ogg"),t+"/"+n+';codecs="'+e+'"'}},Zi=function(e){return e===void 0&&(e=""),D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(oi(e))||!1},Da=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(i){i=i.trim();for(var r=0;r<fu.length;r++)if(rn["muxer"+fu[r]].test(i))return!0;return!1})},vu="mp4a.40.2",Fp=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,jp=/^application\/dash\+xml/i,yu=function(e){return Fp.test(e)?"hls":jp.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},_u=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},Z=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||_u(e)||e instanceof ArrayBuffer||(e=typeof e!="number"||typeof e=="number"&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Rt=D.BigInt||Number,Ia=[Rt("0x1"),Rt("0x100"),Rt("0x10000"),Rt("0x1000000"),Rt("0x100000000"),Rt("0x10000000000"),Rt("0x1000000000000"),Rt("0x100000000000000"),Rt("0x10000000000000000")];(function(){var e=new Uint16Array([65484]),i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);i[0]===255||i[0]})();var qp=function(e,i){var r=i===void 0?{}:i,t=r.signed,n=t!==void 0&&t,a=r.le,s=a!==void 0&&a;e=Z(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,function(d,m,f){var _=s?f:Math.abs(f+1-e.length);return d+Rt(m)*Ia[_]},Rt(0));if(n){var c=Ia[e.length]/Rt(2)-Rt(1);(u=Rt(u))>c&&(u-=c,u-=c,u-=Rt(2))}return Number(u)},Hp=function(e,i){var r=(i===void 0?{}:i).le,t=r!==void 0&&r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!=e)&&(e=0),e=Rt(e);for(var n,a=(n=e,Math.ceil(function(c){return c.toString(2).length}(n)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var u=t?o:Math.abs(o+1-s.length);s[u]=Number(e/Ia[o]&Rt(255)),e<0&&(s[u]=Math.abs(~s[u]),s[u]-=o===0?1:2)}return s},bu=function(e,i){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;i||(e=unescape(encodeURIComponent(e)));for(var r=new Uint8Array(e.length),t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return r},bt=function(e,i,r){var t=r===void 0?{}:r,n=t.offset,a=n===void 0?0:n,s=t.mask,o=s===void 0?[]:s;e=Z(e);var u=(i=Z(i)).every?i.every:Array.prototype.every;return i.length&&e.length-a>=i.length&&u.call(i,function(c,d){return c===(o[d]?o[d]&e[a+d]:e[a+d])})},Ye={},Ae={};function Aa(e,i){return i===void 0&&(i=Object),i&&typeof i.freeze=="function"?i.freeze(e):e}var Tu=Aa({HTML:"text/html",isHTML:function(e){return e===Tu.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Su=Aa({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Su.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Ae.assign=function(e,i){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},Ae.find=function(e,i,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,i);for(var t=0;t<e.length;t++)if(Object.prototype.hasOwnProperty.call(e,t)){var n=e[t];if(i.call(void 0,n,t,e))return n}},Ae.freeze=Aa,Ae.MIME_TYPE=Tu,Ae.NAMESPACE=Su;var Eu=Ae,Te=Eu.find,ui=Eu.NAMESPACE;function Vp(e){return e!==""}function Wp(e,i){return e.hasOwnProperty(i)||(e[i]=!0),e}function wu(e){if(!e)return[];var i=function(r){return r?r.split(/[\t\n\f\r ]+/).filter(Vp):[]}(e);return Object.keys(i.reduce(Wp,{}))}function li(e,i){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r])}function $t(e,i){var r=e.prototype;if(!(r instanceof i)){let t=function(){};t.prototype=i.prototype,li(r,t=new t),e.prototype=r=t}r.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),r.constructor=e)}var Jt={},fe=Jt.ELEMENT_NODE=1,Sn=Jt.ATTRIBUTE_NODE=2,tr=Jt.TEXT_NODE=3,ku=Jt.CDATA_SECTION_NODE=4,Cu=Jt.ENTITY_REFERENCE_NODE=5,Gp=Jt.ENTITY_NODE=6,xu=Jt.PROCESSING_INSTRUCTION_NODE=7,Du=Jt.COMMENT_NODE=8,Iu=Jt.DOCUMENT_NODE=9,Au=Jt.DOCUMENT_TYPE_NODE=10,Pe=Jt.DOCUMENT_FRAGMENT_NODE=11,zp=Jt.NOTATION_NODE=12,Ut={},At={};Ut.INDEX_SIZE_ERR=(At[1]="Index size error",1),Ut.DOMSTRING_SIZE_ERR=(At[2]="DOMString size error",2);var Zt=Ut.HIERARCHY_REQUEST_ERR=(At[3]="Hierarchy request error",3);Ut.WRONG_DOCUMENT_ERR=(At[4]="Wrong document",4),Ut.INVALID_CHARACTER_ERR=(At[5]="Invalid character",5),Ut.NO_DATA_ALLOWED_ERR=(At[6]="No data allowed",6),Ut.NO_MODIFICATION_ALLOWED_ERR=(At[7]="No modification allowed",7);var Pu=Ut.NOT_FOUND_ERR=(At[8]="Not found",8);Ut.NOT_SUPPORTED_ERR=(At[9]="Not supported",9);var Lu=Ut.INUSE_ATTRIBUTE_ERR=(At[10]="Attribute in use",10);function St(e,i){if(i instanceof Error)var r=i;else r=this,Error.call(this,At[e]),this.message=At[e],Error.captureStackTrace&&Error.captureStackTrace(this,St);return r.code=e,i&&(this.message=this.message+": "+i),r}function Le(){}function En(e,i){this._node=e,this._refresh=i,Pa(this)}function Pa(e){var i=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==i){var r=e._refresh(e._node);if(Yu(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var t=r.length;t in e;t++)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];li(r,e),e._inc=i}}function er(){}function Ou(e,i){for(var r=e.length;r--;)if(e[r]===i)return r}function Ru(e,i,r,t){if(t?i[Ou(i,t)]=r:i[i.length++]=r,e){r.ownerElement=e;var n=e.ownerDocument;n&&(t&&Bu(n,e,t),function(a,s,o){a&&a._inc++;var u=o.namespaceURI;u===ui.XMLNS&&(s._nsMap[o.prefix?o.localName:""]=o.value)}(n,e,r))}}function Nu(e,i,r){var t=Ou(i,r);if(!(t>=0))throw new St(Pu,new Error(e.tagName+"@"+r));for(var n=i.length-1;t<n;)i[t]=i[++t];if(i.length=n,e){var a=e.ownerDocument;a&&(Bu(a,e,r),r.ownerElement=null)}}function Mu(){}function dt(){}function Uu(e){return(e=="<"?"<":e==">"&&">")||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}function ci(e,i){if(i(e))return!0;if(e=e.firstChild)do if(ci(e,i))return!0;while(e=e.nextSibling)}function di(){this.ownerDocument=this}function Bu(e,i,r,t){e&&e._inc++,r.namespaceURI===ui.XMLNS&&delete i._nsMap[r.prefix?r.localName:""]}function La(e,i,r){if(e&&e._inc){e._inc++;var t=i.childNodes;if(r)t[t.length++]=r;else{for(var n=i.firstChild,a=0;n;)t[a++]=n,n=n.nextSibling;t.length=a,delete t[t.length]}}}function Fu(e,i){var r=i.previousSibling,t=i.nextSibling;return r?r.nextSibling=t:e.firstChild=t,t?t.previousSibling=r:e.lastChild=r,i.parentNode=null,i.previousSibling=null,i.nextSibling=null,La(e.ownerDocument,e),i}function Oe(e){return e&&e.nodeType===dt.DOCUMENT_TYPE_NODE}function Se(e){return e&&e.nodeType===dt.ELEMENT_NODE}function Oa(e){return e&&e.nodeType===dt.TEXT_NODE}function ju(e,i){var r=e.childNodes||[];if(Te(r,Se)||Oe(i))return!1;var t=Te(r,Oe);return!(i&&t&&r.indexOf(t)>r.indexOf(i))}function qu(e,i){var r=e.childNodes||[];if(Te(r,function(n){return Se(n)&&n!==i}))return!1;var t=Te(r,Oe);return!(i&&t&&r.indexOf(t)>r.indexOf(i))}function Xp(e,i,r){if(!function(t){return t&&(t.nodeType===dt.DOCUMENT_NODE||t.nodeType===dt.DOCUMENT_FRAGMENT_NODE||t.nodeType===dt.ELEMENT_NODE)}(e))throw new St(Zt,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new St(Pu,"child not in parent");if(!function(t){return t&&(Se(t)||Oa(t)||Oe(t)||t.nodeType===dt.DOCUMENT_FRAGMENT_NODE||t.nodeType===dt.COMMENT_NODE||t.nodeType===dt.PROCESSING_INSTRUCTION_NODE)}(i)||Oe(i)&&e.nodeType!==dt.DOCUMENT_NODE)throw new St(Zt,"Unexpected node type "+i.nodeType+" for parent node type "+e.nodeType)}function Kp(e,i,r){var t=e.childNodes||[],n=i.childNodes||[];if(i.nodeType===dt.DOCUMENT_FRAGMENT_NODE){var a=n.filter(Se);if(a.length>1||Te(n,Oa))throw new St(Zt,"More than one element or text in fragment");if(a.length===1&&!ju(e,r))throw new St(Zt,"Element in fragment can not be inserted before doctype")}if(Se(i)&&!ju(e,r))throw new St(Zt,"Only one element can be added and only after doctype");if(Oe(i)){if(Te(t,Oe))throw new St(Zt,"Only one doctype is allowed");var s=Te(t,Se);if(r&&t.indexOf(s)<t.indexOf(r))throw new St(Zt,"Doctype can only be inserted before an element");if(!r&&s)throw new St(Zt,"Doctype can not be appended since element is present")}}function Hu(e,i,r){var t=e.childNodes||[],n=i.childNodes||[];if(i.nodeType===dt.DOCUMENT_FRAGMENT_NODE){var a=n.filter(Se);if(a.length>1||Te(n,Oa))throw new St(Zt,"More than one element or text in fragment");if(a.length===1&&!qu(e,r))throw new St(Zt,"Element in fragment can not be inserted before doctype")}if(Se(i)&&!qu(e,r))throw new St(Zt,"Only one element can be added and only after doctype");if(Oe(i)){if(Te(t,function(u){return Oe(u)&&u!==r}))throw new St(Zt,"Only one doctype is allowed");var s=Te(t,Se);if(r&&t.indexOf(s)<t.indexOf(r))throw new St(Zt,"Doctype can only be inserted before an element")}}function nr(e,i,r,t){Xp(e,i,r),e.nodeType===dt.DOCUMENT_NODE&&(t||Kp)(e,i,r);var n=i.parentNode;if(n&&n.removeChild(i),i.nodeType===Pe){var a=i.firstChild;if(a==null)return i;var s=i.lastChild}else a=s=i;var o=r?r.previousSibling:e.lastChild;a.previousSibling=o,s.nextSibling=r,o?o.nextSibling=a:e.firstChild=a,r==null?e.lastChild=s:r.previousSibling=s;do a.parentNode=e;while(a!==s&&(a=a.nextSibling));return La(e.ownerDocument||e,e),i.nodeType==Pe&&(i.firstChild=i.lastChild=null),i}function an(){this._nsMap={}}function ir(){}function hi(){}function Ra(){}function Na(){}function Ma(){}function rr(){}function Vu(){}function Wu(){}function Ua(){}function ar(){}function Ba(){}function Gu(){}function zu(e,i){var r=[],t=this.nodeType==9&&this.documentElement||this,n=t.prefix,a=t.namespaceURI;if(a&&n==null&&(n=t.lookupPrefix(a))==null)var s=[{namespace:a,prefix:null}];return wn(this,r,e,i,s),r.join("")}function Xu(e,i,r){var t=e.prefix||"",n=e.namespaceURI;if(!n||t==="xml"&&n===ui.XML||n===ui.XMLNS)return!1;for(var a=r.length;a--;){var s=r[a];if(s.prefix===t)return s.namespace!==n}return!0}function Fa(e,i,r){e.push(" ",i,'="',r.replace(/[<>&"\t\n\r]/g,Uu),'"')}function wn(e,i,r,t,n){if(n||(n=[]),t){if(!(e=t(e)))return;if(typeof e=="string")return void i.push(e)}switch(e.nodeType){case fe:var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName,c=u;if(!(r=ui.isHTML(e.namespaceURI)||r)&&!e.prefix&&e.namespaceURI){for(var d,m=0;m<a.length;m++)if(a.item(m).name==="xmlns"){d=a.item(m).value;break}if(!d){for(var f=n.length-1;f>=0;f--)if((_=n[f]).prefix===""&&_.namespace===e.namespaceURI){d=_.namespace;break}}if(d!==e.namespaceURI)for(f=n.length-1;f>=0;f--){var _;if((_=n[f]).namespace===e.namespaceURI){_.prefix&&(c=_.prefix+":"+u);break}}}i.push("<",c);for(var b=0;b<s;b++)(y=a.item(b)).prefix=="xmlns"?n.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&n.push({prefix:"",namespace:y.value});for(b=0;b<s;b++){var y,E,w;Xu(y=a.item(b),0,n)&&(Fa(i,(E=y.prefix||"")?"xmlns:"+E:"xmlns",w=y.namespaceURI),n.push({prefix:E,namespace:w})),wn(y,i,r,t,n)}if(u===c&&Xu(e,0,n)&&(Fa(i,(E=e.prefix||"")?"xmlns:"+E:"xmlns",w=e.namespaceURI),n.push({prefix:E,namespace:w})),o||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(i.push(">"),r&&/^script$/i.test(u))for(;o;)o.data?i.push(o.data):wn(o,i,r,t,n.slice()),o=o.nextSibling;else for(;o;)wn(o,i,r,t,n.slice()),o=o.nextSibling;i.push("</",c,">")}else i.push("/>");return;case Iu:case Pe:for(o=e.firstChild;o;)wn(o,i,r,t,n.slice()),o=o.nextSibling;return;case Sn:return Fa(i,e.name,e.value);case tr:return i.push(e.data.replace(/[<&>]/g,Uu));case ku:return i.push("<![CDATA[",e.data,"]]>");case Du:return i.push("<!--",e.data,"-->");case Au:var k=e.publicId,I=e.systemId;if(i.push("<!DOCTYPE ",e.name),k)i.push(" PUBLIC ",k),I&&I!="."&&i.push(" ",I),i.push(">");else if(I&&I!=".")i.push(" SYSTEM ",I,">");else{var P=e.internalSubset;P&&i.push(" [",P,"]"),i.push(">")}return;case xu:return i.push("<?",e.target," ",e.data,"?>");case Cu:return i.push("&",e.nodeName,";");default:i.push("??",e.nodeName)}}function Ku(e,i,r){var t;switch(i.nodeType){case fe:(t=i.cloneNode(!1)).ownerDocument=e;case Pe:break;case Sn:r=!0}if(t||(t=i.cloneNode(!1)),t.ownerDocument=e,t.parentNode=null,r)for(var n=i.firstChild;n;)t.appendChild(Ku(e,n,r)),n=n.nextSibling;return t}function ja(e,i,r){var t=new i.constructor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=i[n];typeof a!="object"&&a!=t[n]&&(t[n]=a)}switch(i.childNodes&&(t.childNodes=new Le),t.ownerDocument=e,t.nodeType){case fe:var s=i.attributes,o=t.attributes=new er,u=s.length;o._ownerElement=t;for(var c=0;c<u;c++)t.setAttributeNode(ja(e,s.item(c),!0));break;case Sn:r=!0}if(r)for(var d=i.firstChild;d;)t.appendChild(ja(e,d,r)),d=d.nextSibling;return t}function Yu(e,i,r){e[i]=r}Ut.INVALID_STATE_ERR=(At[11]="Invalid state",11),Ut.SYNTAX_ERR=(At[12]="Syntax error",12),Ut.INVALID_MODIFICATION_ERR=(At[13]="Invalid modification",13),Ut.NAMESPACE_ERR=(At[14]="Invalid namespace",14),Ut.INVALID_ACCESS_ERR=(At[15]="Invalid access",15),St.prototype=Error.prototype,li(Ut,St),Le.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,i){for(var r=[],t=0;t<this.length;t++)wn(this[t],r,e,i);return r.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},En.prototype.item=function(e){return Pa(this),this[e]||null},$t(En,Le),er.prototype={length:0,item:Le.prototype.item,getNamedItem:function(e){for(var i=this.length;i--;){var r=this[i];if(r.nodeName==e)return r}},setNamedItem:function(e){var i=e.ownerElement;if(i&&i!=this._ownerElement)throw new St(Lu);var r=this.getNamedItem(e.nodeName);return Ru(this._ownerElement,this,e,r),r},setNamedItemNS:function(e){var i,r=e.ownerElement;if(r&&r!=this._ownerElement)throw new St(Lu);return i=this.getNamedItemNS(e.namespaceURI,e.localName),Ru(this._ownerElement,this,e,i),i},removeNamedItem:function(e){var i=this.getNamedItem(e);return Nu(this._ownerElement,this,i),i},removeNamedItemNS:function(e,i){var r=this.getNamedItemNS(e,i);return Nu(this._ownerElement,this,r),r},getNamedItemNS:function(e,i){for(var r=this.length;r--;){var t=this[r];if(t.localName==i&&t.namespaceURI==e)return t}return null}},Mu.prototype={hasFeature:function(e,i){return!0},createDocument:function(e,i,r){var t=new di;if(t.implementation=this,t.childNodes=new Le,t.doctype=r||null,r&&t.appendChild(r),i){var n=t.createElementNS(e,i);t.appendChild(n)}return t},createDocumentType:function(e,i,r){var t=new rr;return t.name=e,t.nodeName=e,t.publicId=i||"",t.systemId=r||"",t}},dt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,i){return nr(this,e,i)},replaceChild:function(e,i){nr(this,e,i,Hu),i&&this.removeChild(i)},removeChild:function(e){return Fu(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return ja(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var i=e.nextSibling;i&&i.nodeType==tr&&e.nodeType==tr?(this.removeChild(i),e.appendData(i.data)):(e.normalize(),e=i)}},isSupported:function(e,i){return this.ownerDocument.implementation.hasFeature(e,i)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var i=this;i;){var r=i._nsMap;if(r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&r[t]===e)return t}i=i.nodeType==Sn?i.ownerDocument:i.parentNode}return null},lookupNamespaceURI:function(e){for(var i=this;i;){var r=i._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];i=i.nodeType==Sn?i.ownerDocument:i.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null}},li(Jt,dt),li(Jt,dt.prototype),di.prototype={nodeName:"#document",nodeType:Iu,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,i){if(e.nodeType==Pe){for(var r=e.firstChild;r;){var t=r.nextSibling;this.insertBefore(r,i),r=t}return e}return nr(this,e,i),e.ownerDocument=this,this.documentElement===null&&e.nodeType===fe&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Fu(this,e)},replaceChild:function(e,i){nr(this,e,i,Hu),e.ownerDocument=this,i&&this.removeChild(i),Se(e)&&(this.documentElement=e)},importNode:function(e,i){return Ku(this,e,i)},getElementById:function(e){var i=null;return ci(this.documentElement,function(r){if(r.nodeType==fe&&r.getAttribute("id")==e)return i=r,!0}),i},getElementsByClassName:function(e){var i=wu(e);return new En(this,function(r){var t=[];return i.length>0&&ci(r.documentElement,function(n){if(n!==r&&n.nodeType===fe){var a=n.getAttribute("class");if(a){var s=e===a;if(!s){var o=wu(a);s=i.every((u=o,function(c){return u&&u.indexOf(c)!==-1}))}s&&t.push(n)}}var u}),t})},createElement:function(e){var i=new an;return i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.localName=e,i.childNodes=new Le,(i.attributes=new er)._ownerElement=i,i},createDocumentFragment:function(){var e=new ar;return e.ownerDocument=this,e.childNodes=new Le,e},createTextNode:function(e){var i=new Ra;return i.ownerDocument=this,i.appendData(e),i},createComment:function(e){var i=new Na;return i.ownerDocument=this,i.appendData(e),i},createCDATASection:function(e){var i=new Ma;return i.ownerDocument=this,i.appendData(e),i},createProcessingInstruction:function(e,i){var r=new Ba;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=e,r.nodeValue=r.data=i,r},createAttribute:function(e){var i=new ir;return i.ownerDocument=this,i.name=e,i.nodeName=e,i.localName=e,i.specified=!0,i},createEntityReference:function(e){var i=new Ua;return i.ownerDocument=this,i.nodeName=e,i},createElementNS:function(e,i){var r=new an,t=i.split(":"),n=r.attributes=new er;return r.childNodes=new Le,r.ownerDocument=this,r.nodeName=i,r.tagName=i,r.namespaceURI=e,t.length==2?(r.prefix=t[0],r.localName=t[1]):r.localName=i,n._ownerElement=r,r},createAttributeNS:function(e,i){var r=new ir,t=i.split(":");return r.ownerDocument=this,r.nodeName=i,r.name=i,r.namespaceURI=e,r.specified=!0,t.length==2?(r.prefix=t[0],r.localName=t[1]):r.localName=i,r}},$t(di,dt),an.prototype={nodeType:fe,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var i=this.getAttributeNode(e);return i&&i.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,i){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+i,this.setAttributeNode(r)},removeAttribute:function(e){var i=this.getAttributeNode(e);i&&this.removeAttributeNode(i)},appendChild:function(e){return e.nodeType===Pe?this.insertBefore(e,null):function(i,r){return r.parentNode&&r.parentNode.removeChild(r),r.parentNode=i,r.previousSibling=i.lastChild,r.nextSibling=null,r.previousSibling?r.previousSibling.nextSibling=r:i.firstChild=r,i.lastChild=r,La(i.ownerDocument,i,r),r}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,i){var r=this.getAttributeNodeNS(e,i);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,i){return this.getAttributeNodeNS(e,i)!=null},getAttributeNS:function(e,i){var r=this.getAttributeNodeNS(e,i);return r&&r.value||""},setAttributeNS:function(e,i,r){var t=this.ownerDocument.createAttributeNS(e,i);t.value=t.nodeValue=""+r,this.setAttributeNode(t)},getAttributeNodeNS:function(e,i){return this.attributes.getNamedItemNS(e,i)},getElementsByTagName:function(e){return new En(this,function(i){var r=[];return ci(i,function(t){t===i||t.nodeType!=fe||e!=="*"&&t.tagName!=e||r.push(t)}),r})},getElementsByTagNameNS:function(e,i){return new En(this,function(r){var t=[];return ci(r,function(n){n===r||n.nodeType!==fe||e!=="*"&&n.namespaceURI!==e||i!=="*"&&n.localName!=i||t.push(n)}),t})}},di.prototype.getElementsByTagName=an.prototype.getElementsByTagName,di.prototype.getElementsByTagNameNS=an.prototype.getElementsByTagNameNS,$t(an,dt),ir.prototype.nodeType=Sn,$t(ir,dt),hi.prototype={data:"",substringData:function(e,i){return this.data.substring(e,e+i)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,i){this.replaceData(e,0,i)},appendChild:function(e){throw new Error(At[Zt])},deleteData:function(e,i){this.replaceData(e,i,"")},replaceData:function(e,i,r){r=this.data.substring(0,e)+r+this.data.substring(e+i),this.nodeValue=this.data=r,this.length=r.length}},$t(hi,dt),Ra.prototype={nodeName:"#text",nodeType:tr,splitText:function(e){var i=this.data,r=i.substring(e);i=i.substring(0,e),this.data=this.nodeValue=i,this.length=i.length;var t=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling),t}},$t(Ra,hi),Na.prototype={nodeName:"#comment",nodeType:Du},$t(Na,hi),Ma.prototype={nodeName:"#cdata-section",nodeType:ku},$t(Ma,hi),rr.prototype.nodeType=Au,$t(rr,dt),Vu.prototype.nodeType=zp,$t(Vu,dt),Wu.prototype.nodeType=Gp,$t(Wu,dt),Ua.prototype.nodeType=Cu,$t(Ua,dt),ar.prototype.nodeName="#document-fragment",ar.prototype.nodeType=Pe,$t(ar,dt),Ba.prototype.nodeType=xu,$t(Ba,dt),Gu.prototype.serializeToString=function(e,i,r){return zu.call(e,i,r)},dt.prototype.toString=zu;try{if(Object.defineProperty){let e=function(i){switch(i.nodeType){case fe:case Pe:var r=[];for(i=i.firstChild;i;)i.nodeType!==7&&i.nodeType!==8&&r.push(e(i)),i=i.nextSibling;return r.join("");default:return i.nodeValue}};Object.defineProperty(En.prototype,"length",{get:function(){return Pa(this),this.$$length}}),Object.defineProperty(dt.prototype,"textContent",{get:function(){return e(this)},set:function(i){switch(this.nodeType){case fe:case Pe:for(;this.firstChild;)this.removeChild(this.firstChild);(i||String(i))&&this.appendChild(this.ownerDocument.createTextNode(i));break;default:this.data=i,this.value=i,this.nodeValue=i}}}),Yu=function(i,r,t){i["$$"+r]=t}}}catch{}Ye.DocumentType=rr,Ye.DOMException=St,Ye.DOMImplementation=Mu,Ye.Element=an,Ye.Node=dt,Ye.NodeList=Le,Ye.XMLSerializer=Gu;var sr={},Qu={};(function(e){var i=Ae.freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=i({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
- `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}),e.entityMap=e.HTML_ENTITIES})(Qu);var qa={},pi=Ae.NAMESPACE,Ha=/[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]/,$u=new RegExp("[\\-\\.0-9"+Ha.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ju=new RegExp("^"+Ha.source+$u.source+"*(?::"+Ha.source+$u.source+"*)?$"),fi=0,Qe=1,kn=2,mi=3,Cn=4,xn=5,gi=6,or=7;function Dn(e,i){this.message=e,this.locator=i,Error.captureStackTrace&&Error.captureStackTrace(this,Dn)}function Zu(){}function tl(e,i){return i.lineNumber=e.lineNumber,i.columnNumber=e.columnNumber,i}function Yp(e,i,r,t,n,a){function s(f,_,b){r.attributeNames.hasOwnProperty(f)&&a.fatalError("Attribute "+f+" redefined"),r.addValue(f,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),b)}for(var o,u=++i,c=fi;;){var d=e.charAt(u);switch(d){case"=":if(c===Qe)o=e.slice(i,u),c=mi;else{if(c!==kn)throw new Error("attribute equal must after attrName");c=mi}break;case"'":case'"':if(c===mi||c===Qe){if(c===Qe&&(a.warning('attribute value must after "="'),o=e.slice(i,u)),i=u+1,!((u=e.indexOf(d,i))>0))throw new Error("attribute value no end '"+d+"' match");s(o,m=e.slice(i,u),i-1),c=xn}else{if(c!=Cn)throw new Error('attribute value must after "="');s(o,m=e.slice(i,u),i),a.warning('attribute "'+o+'" missed start quot('+d+")!!"),i=u+1,c=xn}break;case"/":switch(c){case fi:r.setTagName(e.slice(i,u));case xn:case gi:case or:c=or,r.closed=!0;case Cn:case Qe:break;case kn:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),c==fi&&r.setTagName(e.slice(i,u)),u;case">":switch(c){case fi:r.setTagName(e.slice(i,u));case xn:case gi:case or:break;case Cn:case Qe:(m=e.slice(i,u)).slice(-1)==="/"&&(r.closed=!0,m=m.slice(0,-1));case kn:c===kn&&(m=o),c==Cn?(a.warning('attribute "'+m+'" missed quot(")!'),s(o,m,i)):(pi.isHTML(t[""])&&m.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+m+'" missed value!! "'+m+'" instead!!'),s(m,m,i));break;case mi:throw new Error("attribute value missed!!")}return u;case"\x80":d=" ";default:if(d<=" ")switch(c){case fi:r.setTagName(e.slice(i,u)),c=gi;break;case Qe:o=e.slice(i,u),c=kn;break;case Cn:var m=e.slice(i,u);a.warning('attribute "'+m+'" missed quot(")!!'),s(o,m,i);case xn:c=gi}else switch(c){case kn:r.tagName,pi.isHTML(t[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,i),i=u,c=Qe;break;case xn:a.warning('attribute space is required"'+o+'"!!');case gi:c=Qe,i=u;break;case mi:c=Cn,i=u;break;case or:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function el(e,i,r){for(var t=e.tagName,n=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((f=o.indexOf(":"))>0)var c=s.prefix=o.slice(0,f),d=o.slice(f+1),m=c==="xmlns"&&d;else d=o,c=null,m=o==="xmlns"&&"";s.localName=d,m!==!1&&(n==null&&(n={},nl(r,r={})),r[m]=n[m]=u,s.uri=pi.XMLNS,i.startPrefixMapping(m,u))}for(a=e.length;a--;)(c=(s=e[a]).prefix)&&(c==="xml"&&(s.uri=pi.XML),c!=="xmlns"&&(s.uri=r[c||""]));var f;(f=t.indexOf(":"))>0?(c=e.prefix=t.slice(0,f),d=e.localName=t.slice(f+1)):(c=null,d=e.localName=t);var _=e.uri=r[c||""];if(i.startElement(_,d,t,e),!e.closed)return e.currentNSMap=r,e.localNSMap=n,!0;if(i.endElement(_,d,t),n)for(c in n)Object.prototype.hasOwnProperty.call(n,c)&&i.endPrefixMapping(c)}function Qp(e,i,r,t,n){if(/^(?:script|textarea)$/i.test(r)){var a=e.indexOf("</"+r+">",i),s=e.substring(i+1,a);if(/[&<]/.test(s))return/^script$/i.test(r)?(n.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,t),n.characters(s,0,s.length),a)}return i+1}function $p(e,i,r,t){var n=t[r];return n==null&&((n=e.lastIndexOf("</"+r+">"))<i&&(n=e.lastIndexOf("</"+r)),t[r]=n),n<i}function nl(e,i){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r])}function Jp(e,i,r,t){if(e.charAt(i+2)==="-")return e.charAt(i+3)==="-"?(n=e.indexOf("-->",i+4))>i?(r.comment(e,i+4,n-i-4),n+3):(t.error("Unclosed comment"),-1):-1;if(e.substr(i+3,6)=="CDATA["){var n=e.indexOf("]]>",i+9);return r.startCDATA(),r.characters(e,i+9,n-i-9),r.endCDATA(),n+3}var a=function(m,f){var _,b=[],y=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(y.lastIndex=f,y.exec(m);_=y.exec(m);)if(b.push(_),_[1])return b}(e,i),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,c=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],c=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(c=a[3][0]));var d=a[s-1];return r.startDTD(o,u,c),r.endDTD(),d.index+d[0].length}return-1}function Zp(e,i,r){var t=e.indexOf("?>",i);if(t){var n=e.substring(i,t).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return n?(n[0].length,r.processingInstruction(n[1],n[2]),t+2):-1}return-1}function il(){this.attributeNames={}}Dn.prototype=new Error,Dn.prototype.name=Dn.name,Zu.prototype={parse:function(e,i,r){var t=this.domBuilder;t.startDocument(),nl(i,i={}),function(n,a,s,o,u){function c(J){if(J>65535){var rt=55296+((J-=65536)>>10),se=56320+(1023&J);return String.fromCharCode(rt,se)}return String.fromCharCode(J)}function d(J){var rt=J.slice(1,-1);return Object.hasOwnProperty.call(s,rt)?s[rt]:rt.charAt(0)==="#"?c(parseInt(rt.substr(1).replace("x","0x"))):(u.error("entity not found:"+J),J)}function m(J){if(J>I){var rt=n.substring(I,J).replace(/&#?\w+;/g,d);E&&f(I),o.characters(rt,0,J-I),I=J}}function f(J,rt){for(;J>=b&&(rt=y.exec(n));)_=rt.index,b=_+rt[0].length,E.lineNumber++;E.columnNumber=J-_+1}for(var _=0,b=0,y=/.*(?:\r\n?|\n)|.*$/g,E=o.locator,w=[{currentNSMap:a}],k={},I=0;;){try{var P=n.indexOf("<",I);if(P<0){if(!n.substr(I).match(/^\s*$/)){var N=o.doc,A=N.createTextNode(n.substr(I));N.appendChild(A),o.currentElement=A}return}switch(P>I&&m(P),n.charAt(P+1)){case"/":var U=n.indexOf(">",P+3),B=n.substring(P+2,U).replace(/[ \t\n\r]+$/g,""),R=w.pop();U<0?(B=n.substring(P+2).replace(/[\s<].*/,""),u.error("end tag name: "+B+" is not complete:"+R.tagName),U=P+1+B.length):B.match(/\s</)&&(B=B.replace(/[\s<].*/,""),u.error("end tag name: "+B+" maybe not complete"),U=P+1+B.length);var q=R.localNSMap,$=R.tagName==B;if($||R.tagName&&R.tagName.toLowerCase()==B.toLowerCase()){if(o.endElement(R.uri,R.localName,B),q)for(var Y in q)Object.prototype.hasOwnProperty.call(q,Y)&&o.endPrefixMapping(Y);$||u.fatalError("end tag name: "+B+" is not match the current start tagName:"+R.tagName)}else w.push(R);U++;break;case"?":E&&f(P),U=Zp(n,P,o);break;case"!":E&&f(P),U=Jp(n,P,o,u);break;default:E&&f(P);var K=new il,Q=w[w.length-1].currentNSMap,X=(U=Yp(n,P,K,Q,d,u),K.length);if(!K.closed&&$p(n,U,K.tagName,k)&&(K.closed=!0,s.nbsp||u.warning("unclosed xml attribute")),E&&X){for(var nt=tl(E,{}),at=0;at<X;at++){var ht=K[at];f(ht.offset),ht.locator=tl(E,{})}o.locator=nt,el(K,o,Q)&&w.push(K),o.locator=E}else el(K,o,Q)&&w.push(K);pi.isHTML(K.uri)&&!K.closed?U=Qp(n,U,K.tagName,d,o):U++}}catch(J){if(J instanceof Dn)throw J;u.error("element parse error: "+J),U=-1}U>I?I=U:m(Math.max(P,I)+1)}}(e,i,r,t,this.errorHandler),t.endDocument()}},il.prototype={setTagName:function(e){if(!Ju.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,i,r){if(!Ju.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:i,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},qa.XMLReader=Zu,qa.ParseError=Dn;var tf=Ae,rl=Qu,al=qa,ef=Ye.DOMImplementation,sl=tf.NAMESPACE,nf=al.ParseError,rf=al.XMLReader;function ol(e){return e.replace(/\r[\n\u0085]/g,`
- `).replace(/[\r\u0085\u2028]/g,`
- `)}function ul(e){this.options=e||{locator:{}}}function vi(){this.cdata=!1}function In(e,i){i.lineNumber=e.lineNumber,i.columnNumber=e.columnNumber}function Va(e){if(e)return`
- @`+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function ll(e,i,r){return typeof e=="string"?e.substr(i,r):e.length>=i+r||i?new java.lang.String(e,i,r)+"":e}function ur(e,i){e.currentElement?e.currentElement.appendChild(i):e.doc.appendChild(i)}ul.prototype.parseFromString=function(e,i){var r=this.options,t=new rf,n=r.domBuilder||new vi,a=r.errorHandler,s=r.locator,o=r.xmlns||{},u=/\/x?html?$/.test(i),c=u?rl.HTML_ENTITIES:rl.XML_ENTITIES;s&&n.setDocumentLocator(s),t.errorHandler=function(m,f,_){if(!m){if(f instanceof vi)return f;m=f}var b={},y=m instanceof Function;function E(w){var k=m[w];!k&&y&&(k=m.length==2?function(I){m(w,I)}:m),b[w]=k&&function(I){k("[xmldom "+w+"] "+I+Va(_))}||function(){}}return _=_||{},E("warning"),E("error"),E("fatalError"),b}(a,n,s),t.domBuilder=r.domBuilder||n,u&&(o[""]=sl.HTML),o.xml=o.xml||sl.XML;var d=r.normalizeLineEndings||ol;return e&&typeof e=="string"?t.parse(d(e),o,c):t.errorHandler.error("invalid doc source"),n.doc},vi.prototype={startDocument:function(){this.doc=new ef().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,i,r,t){var n=this.doc,a=n.createElementNS(e,r||i),s=t.length;ur(this,a),this.currentElement=a,this.locator&&In(this.locator,a);for(var o=0;o<s;o++){e=t.getURI(o);var u=t.getValue(o),c=(r=t.getQName(o),n.createAttributeNS(e,r));this.locator&&In(t.getLocator(o),c),c.value=c.nodeValue=u,a.setAttributeNode(c)}},endElement:function(e,i,r){var t=this.currentElement;t.tagName,this.currentElement=t.parentNode},startPrefixMapping:function(e,i){},endPrefixMapping:function(e){},processingInstruction:function(e,i){var r=this.doc.createProcessingInstruction(e,i);this.locator&&In(this.locator,r),ur(this,r)},ignorableWhitespace:function(e,i,r){},characters:function(e,i,r){if(e=ll.apply(this,arguments)){if(this.cdata)var t=this.doc.createCDATASection(e);else t=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(t):/^\s*$/.test(e)&&this.doc.appendChild(t),this.locator&&In(this.locator,t)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,i,r){e=ll.apply(this,arguments);var t=this.doc.createComment(e);this.locator&&In(this.locator,t),ur(this,t)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,i,r){var t=this.doc.implementation;if(t&&t.createDocumentType){var n=t.createDocumentType(e,i,r);this.locator&&In(this.locator,n),ur(this,n),this.doc.doctype=n}},warning:function(e){console.warn("[xmldom warning] "+e,Va(this.locator))},error:function(e){console.error("[xmldom error] "+e,Va(this.locator))},fatalError:function(e){throw new nf(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){vi.prototype[e]=function(){return null}}),sr.__DOMHandler=vi,sr.normalizeLineEndings=ol,sr.DOMParser=ul;var af=sr.DOMParser,cl=function(e){return!!e&&typeof e=="object"},Ht=function e(){for(var i=arguments.length,r=new Array(i),t=0;t<i;t++)r[t]=arguments[t];return r.reduce(function(n,a){return typeof a!="object"||Object.keys(a).forEach(function(s){Array.isArray(n[s])&&Array.isArray(a[s])?n[s]=n[s].concat(a[s]):cl(n[s])&&cl(a[s])?n[s]=e(n[s],a[s]):n[s]=a[s]}),n},{})},dl=function(e){return Object.keys(e).map(function(i){return e[i]})},lr=function(e){return e.reduce(function(i,r){return i.concat(r)},[])},hl=function(e){if(!e.length)return[];for(var i=[],r=0;r<e.length;r++)i.push(e[r]);return i},Wa=function(e,i){for(var r=0;r<e.length;r++)if(i(e[r]))return r;return-1},sf="INVALID_NUMBER_OF_PERIOD",of="DASH_EMPTY_MANIFEST",uf="DASH_INVALID_XML",lf="NO_BASE_URL",cf="SEGMENT_TIME_UNSPECIFIED",df="UNSUPPORTED_UTC_TIMING_SCHEME",yi=function(e){var i=e.baseUrl,r=i===void 0?"":i,t=e.source,n=t===void 0?"":t,a=e.range,s=a===void 0?"":a,o=e.indexRange,u=o===void 0?"":o,c={uri:n,resolvedUri:Ji(r||"",n)};if(s||u){var d,m=(s||u).split("-"),f=D.BigInt?D.BigInt(m[0]):parseInt(m[0],10),_=D.BigInt?D.BigInt(m[1]):parseInt(m[1],10);f<Number.MAX_SAFE_INTEGER&&typeof f=="bigint"&&(f=Number(f)),_<Number.MAX_SAFE_INTEGER&&typeof _=="bigint"&&(_=Number(_)),typeof(d=typeof _=="bigint"||typeof f=="bigint"?D.BigInt(_)-D.BigInt(f)+D.BigInt(1):_-f+1)=="bigint"&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),c.byterange={length:d,offset:f}}return c},pl=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},hf={static:function(e){var i=e.duration,r=e.timescale,t=r===void 0?1:r,n=e.sourceDuration,a=e.periodDuration,s=pl(e.endNumber),o=i/t;return typeof s=="number"?{start:0,end:s}:typeof a=="number"?{start:0,end:a/o}:{start:0,end:n/o}},dynamic:function(e){var i=e.NOW,r=e.clientOffset,t=e.availabilityStartTime,n=e.timescale,a=n===void 0?1:n,s=e.duration,o=e.periodStart,u=o===void 0?0:o,c=e.minimumUpdatePeriod,d=c===void 0?0:c,m=e.timeShiftBufferDepth,f=m===void 0?1/0:m,_=pl(e.endNumber),b=(i+r)/1e3,y=t+u,E=b+d-y,w=Math.ceil(E*a/s),k=Math.floor((b-y-f)*a/s),I=Math.floor((b-y)*a/s);return{start:Math.max(0,k),end:typeof _=="number"?_:Math.min(w,I)}}},Ga=function(e){var i=e.type,r=e.duration,t=e.timescale,n=t===void 0?1:t,a=e.periodDuration,s=e.sourceDuration,o=hf[i](e),u=function(m,f){for(var _=[],b=m;b<f;b++)_.push(b);return _}(o.start,o.end).map(function(m){return function(f){var _=m.duration,b=m.timescale,y=b===void 0?1:b,E=m.periodStart,w=m.startNumber;return{number:(w===void 0?1:w)+f,duration:_/y,timeline:E,time:f*_}}}(e));if(i==="static"){var c=u.length-1,d=typeof a=="number"?a:s;u[c].duration=d-r/n*c}return u},fl=function(e){var i=e.baseUrl,r=e.initialization,t=r===void 0?{}:r,n=e.sourceDuration,a=e.indexRange,s=a===void 0?"":a,o=e.periodStart,u=e.presentationTime,c=e.number,d=c===void 0?0:c,m=e.duration;if(!i)throw new Error(lf);var f=yi({baseUrl:i,source:t.sourceURL,range:t.range}),_=yi({baseUrl:i,source:i,indexRange:s});if(_.map=f,m){var b=Ga(e);b.length&&(_.duration=b[0].duration,_.timeline=b[0].timeline)}else n&&(_.duration=n,_.timeline=o);return _.presentationTime=u||o,_.number=d,[_]},za=function(e,i,r){var t,n=e.sidx.map?e.sidx.map:null,a=e.sidx.duration,s=e.timeline||0,o=e.sidx.byterange,u=o.offset+o.length,c=i.timescale,d=i.references.filter(function(A){return A.referenceType!==1}),m=[],f=e.endList?"static":"dynamic",_=e.sidx.timeline,b=_,y=e.mediaSequence||0;t=typeof i.firstOffset=="bigint"?D.BigInt(u)+i.firstOffset:u+i.firstOffset;for(var E=0;E<d.length;E++){var w=i.references[E],k=w.referencedSize,I=w.subsegmentDuration,P=void 0;P=typeof t=="bigint"?t+D.BigInt(k)-D.BigInt(1):t+k-1;var N=fl({baseUrl:r,timescale:c,timeline:s,periodStart:_,presentationTime:b,number:y,duration:I,sourceDuration:a,indexRange:t+"-"+P,type:f})[0];n&&(N.map=n),m.push(N),t+=typeof t=="bigint"?D.BigInt(k):k,b+=I/c,y++}return e.segments=m,e},pf=["AUDIO","SUBTITLES"],ml=function(e){return(i=e,r=function(t){return t.timeline},dl(i.reduce(function(t,n){return n.forEach(function(a){t[r(a)]=a}),t},{}))).sort(function(t,n){return t.timeline>n.timeline?1:-1});var i,r},gl=function(e){var i,r,t=[];return i=e,r=function(n,a,s,o){t=t.concat(n.playlists||[])},pf.forEach(function(n){for(var a in i.mediaGroups[n])for(var s in i.mediaGroups[n][a]){var o=i.mediaGroups[n][a][s];r(o,n,a,s)}}),t},vl=function(e){var i=e.playlist,r=e.mediaSequence;i.mediaSequence=r,i.segments.forEach(function(t,n){t.number=i.mediaSequence+n})},ff=function(e){var i=e.oldManifest,r=e.newManifest,t=i.playlists.concat(gl(i)),n=r.playlists.concat(gl(r));return r.timelineStarts=ml([i.timelineStarts,r.timelineStarts]),function(a){var s=a.oldPlaylists,o=a.newPlaylists,u=a.timelineStarts;o.forEach(function(c){c.discontinuitySequence=Wa(u,function(_){return _.timeline===c.timeline});var d=function(_,b){for(var y=0;y<_.length;y++)if(_[y].attributes.NAME===b)return _[y];return null}(s,c.attributes.NAME);if(d&&!c.sidx){var m=c.segments[0],f=Wa(d.segments,function(_){return Math.abs(_.presentationTime-m.presentationTime)<.016666666666666666});if(f===-1)return vl({playlist:c,mediaSequence:d.mediaSequence+d.segments.length}),c.segments[0].discontinuity=!0,c.discontinuityStarts.unshift(0),void((!d.segments.length&&c.timeline>d.timeline||d.segments.length&&c.timeline>d.segments[d.segments.length-1].timeline)&&c.discontinuitySequence--);d.segments[f].discontinuity&&!m.discontinuity&&(m.discontinuity=!0,c.discontinuityStarts.unshift(0),c.discontinuitySequence--),vl({playlist:c,mediaSequence:d.segments[f].number})}})}({oldPlaylists:t,newPlaylists:n,timelineStarts:r.timelineStarts}),r},cr=function(e){return e&&e.uri+"-"+(i=e.byterange,r=typeof i.offset=="bigint"||typeof i.length=="bigint"?D.BigInt(i.offset)+D.BigInt(i.length)-D.BigInt(1):i.offset+i.length-1,i.offset+"-"+r);var i,r},Xa=function(e){return dl(e.reduce(function(i,r){var t=r.attributes.id+(r.attributes.lang||"");if(i[t]){var n;r.segments&&(r.segments[0]&&(r.segments[0].discontinuity=!0),(n=i[t].segments).push.apply(n,r.segments)),r.attributes.contentProtection&&(i[t].attributes.contentProtection=r.attributes.contentProtection)}else i[t]=r,i[t].attributes.timelineStarts=[];return i[t].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{})).map(function(i){var r,t;return i.discontinuityStarts=(r=i.segments||[],t="discontinuity",r.reduce(function(n,a,s){return a[t]&&n.push(s),n},[])),i})},Ka=function(e,i){var r=cr(e.sidx),t=r&&i[r]&&i[r].sidx;return t&&za(e,t,e.sidx.resolvedUri),e},mf=function(e,i){if(i===void 0&&(i={}),!Object.keys(i).length)return e;for(var r in e)e[r]=Ka(e[r],i);return e},gf=function(e){var i,r=e.attributes,t=e.segments,n=e.sidx,a=e.discontinuityStarts,s={attributes:(i={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:t};return r.frameRate&&(s.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(s.contentProtection=r.contentProtection),n&&(s.sidx=n),s},vf=function(e){var i=e.attributes;return i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video"},yf=function(e){var i=e.attributes;return i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio"},_f=function(e){var i=e.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"},yl=function(e){return e?Object.keys(e).reduce(function(i,r){var t=e[r];return i.concat(t.playlists)},[]):[]},bf=function(e){var i,r=e.dashPlaylists,t=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,s=e.previousManifest;if(!r.length)return{};var o=r[0].attributes,u=o.sourceDuration,c=o.type,d=o.suggestedPresentationDelay,m=o.minimumUpdatePeriod,f=Xa(r.filter(vf)).map(gf),_=Xa(r.filter(yf)),b=Xa(r.filter(_f)),y=r.map(function(B){return B.attributes.captionServices}).filter(Boolean),E={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:u,playlists:mf(f,a)};m>=0&&(E.minimumUpdatePeriod=1e3*m),t&&(E.locations=t),c==="dynamic"&&(E.suggestedPresentationDelay=d);var w,k,I=E.playlists.length===0,P=_.length?function(B,R,q){var $;R===void 0&&(R={}),q===void 0&&(q=!1);var Y=B.reduce(function(K,Q){var X=Q.attributes.role&&Q.attributes.role.value||"",nt=Q.attributes.lang||"",at=Q.attributes.label||"main";if(nt&&!Q.attributes.label){var ht=X?" ("+X+")":"";at=""+Q.attributes.lang+ht}K[at]||(K[at]={language:nt,autoselect:!0,default:X==="main",playlists:[],uri:""});var J=Ka(function(rt,se){var le,Kt=rt.attributes,ji=rt.segments,Dt=rt.sidx,na=rt.mediaSequence,qi=rt.discontinuitySequence,ia=rt.discontinuityStarts,Ge={attributes:(le={NAME:Kt.id,BANDWIDTH:Kt.bandwidth,CODECS:Kt.codecs},le["PROGRAM-ID"]=1,le),uri:"",endList:Kt.type==="static",timeline:Kt.periodStart,resolvedUri:"",targetDuration:Kt.duration,discontinuitySequence:qi,discontinuityStarts:ia,timelineStarts:Kt.timelineStarts,mediaSequence:na,segments:ji};return Kt.contentProtection&&(Ge.contentProtection=Kt.contentProtection),Dt&&(Ge.sidx=Dt),se&&(Ge.attributes.AUDIO="audio",Ge.attributes.SUBTITLES="subs"),Ge}(Q,q),R);return K[at].playlists.push(J),$===void 0&&X==="main"&&(($=Q).default=!0),K},{});return $||(Y[Object.keys(Y)[0]].default=!0),Y}(_,a,I):null,N=b.length?function(B,R){return R===void 0&&(R={}),B.reduce(function(q,$){var Y=$.attributes.lang||"text";return q[Y]||(q[Y]={language:Y,default:!1,autoselect:!1,playlists:[],uri:""}),q[Y].playlists.push(Ka(function(K){var Q,X=K.attributes,nt=K.segments,at=K.mediaSequence,ht=K.discontinuityStarts,J=K.discontinuitySequence;nt===void 0&&(nt=[{uri:X.baseUrl,timeline:X.periodStart,resolvedUri:X.baseUrl||"",duration:X.sourceDuration,number:0}],X.duration=X.sourceDuration);var rt=((Q={NAME:X.id,BANDWIDTH:X.bandwidth})["PROGRAM-ID"]=1,Q);return X.codecs&&(rt.CODECS=X.codecs),{attributes:rt,uri:"",endList:X.type==="static",timeline:X.periodStart,resolvedUri:X.baseUrl||"",targetDuration:X.duration,timelineStarts:X.timelineStarts,discontinuityStarts:ht,discontinuitySequence:J,mediaSequence:at,segments:nt}}($),R)),q},{})}(b,a):null,A=f.concat(yl(P),yl(N)),U=A.map(function(B){return B.timelineStarts});return E.timelineStarts=ml(U),w=A,k=E.timelineStarts,w.forEach(function(B){B.mediaSequence=0,B.discontinuitySequence=Wa(k,function(R){return R.timeline===B.timeline}),B.segments&&B.segments.forEach(function(R,q){R.number=q})}),P&&(E.mediaGroups.AUDIO.audio=P),N&&(E.mediaGroups.SUBTITLES.subs=N),y.length&&(E.mediaGroups["CLOSED-CAPTIONS"].cc=y.reduce(function(B,R){return R&&R.forEach(function(q){var $=q.channel,Y=q.language;B[Y]={autoselect:!1,default:!1,instreamId:$,language:Y},q.hasOwnProperty("aspectRatio")&&(B[Y].aspectRatio=q.aspectRatio),q.hasOwnProperty("easyReader")&&(B[Y].easyReader=q.easyReader),q.hasOwnProperty("3D")&&(B[Y]["3D"]=q["3D"])}),B},{})),s?ff({oldManifest:s,newManifest:E}):E},Tf=function(e,i,r){var t=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=s===void 0?1:s,u=e.periodStart,c=u===void 0?0:u,d=e.minimumUpdatePeriod,m=(t+n)/1e3+(d===void 0?0:d)-(a+c);return Math.ceil((m*o-i)/r)},_l=function(e,i){for(var r=e.type,t=e.minimumUpdatePeriod,n=t===void 0?0:t,a=e.media,s=a===void 0?"":a,o=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,d=e.startNumber,m=d===void 0?1:d,f=e.periodStart,_=[],b=-1,y=0;y<i.length;y++){var E=i[y],w=E.d,k=E.r||0,I=E.t||0;b<0&&(b=I),I&&I>b&&(b=I);var P=void 0;if(k<0){var N=y+1;P=N===i.length?r==="dynamic"&&n>0&&s.indexOf("$Number$")>0?Tf(e,b,w):(o*c-b)/w:(i[N].t-b)/w}else P=k+1;for(var A=m+_.length+P,U=m+_.length;U<A;)_.push({number:U,duration:w/c,time:b,timeline:f}),b+=w,U++}return _},Sf=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,bl=function(e,i){return e.replace(Sf,function(r){return function(t,n,a,s){if(t==="$$")return"$";if(r[n]===void 0)return t;var o=""+r[n];return n==="RepresentationID"?o:(s=a?parseInt(s,10):1,o.length>=s?o:""+new Array(s-o.length+1).join("0")+o)}}(i))},Ef=function(e,i){var r={RepresentationID:e.id,Bandwidth:e.bandwidth||0},t=e.initialization,n=t===void 0?{sourceURL:"",range:""}:t,a=yi({baseUrl:e.baseUrl,source:bl(n.sourceURL,r),range:n.range}),s=function(o,u){return o.duration||u?o.duration?Ga(o):_l(o,u):[{number:o.startNumber||1,duration:o.sourceDuration,time:0,timeline:o.periodStart}]}(e,i);return s.map(function(o){r.Number=o.number,r.Time=o.time;var u=bl(e.media||"",r),c=e.timescale||1,d=e.presentationTimeOffset||0,m=e.periodStart+(o.time-d)/c;return{uri:u,timeline:o.timeline,duration:o.duration,resolvedUri:Ji(e.baseUrl||"",u),map:a,number:o.number,presentationTime:m}})},wf=function(e,i){var r=e.duration,t=e.segmentUrls,n=t===void 0?[]:t,a=e.periodStart;if(!r&&!i||r&&i)throw new Error(cf);var s,o=n.map(function(u){return function(c,d){var m=c.baseUrl,f=c.initialization,_=f===void 0?{}:f,b=yi({baseUrl:m,source:_.sourceURL,range:_.range}),y=yi({baseUrl:m,source:d.media,range:d.mediaRange});return y.map=b,y}(e,u)});return r&&(s=Ga(e)),i&&(s=_l(e,i)),s.map(function(u,c){if(o[c]){var d=o[c],m=e.timescale||1,f=e.presentationTimeOffset||0;return d.timeline=u.timeline,d.duration=u.duration,d.number=u.number,d.presentationTime=a+(u.time-f)/m,d}}).filter(function(u){return u})},kf=function(e){var i,r,t=e.attributes,n=e.segmentInfo;n.template?(r=Ef,i=Ht(t,n.template)):n.base?(r=fl,i=Ht(t,n.base)):n.list&&(r=wf,i=Ht(t,n.list));var a={attributes:t};if(!r)return a;var s=r(i,n.segmentTimeline);if(i.duration){var o=i,u=o.duration,c=o.timescale,d=c===void 0?1:c;i.duration=u/d}else s.length?i.duration=s.reduce(function(m,f){return Math.max(m,Math.ceil(f.duration))},0):i.duration=0;return a.attributes=i,a.segments=s,n.base&&i.indexRange&&(a.sidx=s[0],a.segments=[]),a},Et=function(e,i){return hl(e.childNodes).filter(function(r){return r.tagName===i})},Ya=function(e){return e.textContent.trim()},An=function(e){var i=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!i)return 0;var r=i.slice(1),t=r[0],n=r[1],a=r[2],s=r[3],o=r[4],u=r[5];return 31536e3*parseFloat(t||0)+2592e3*parseFloat(n||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},Tl={mediaPresentationDuration:function(e){return An(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i=e)&&(i+="Z"),Date.parse(i)/1e3;var i},minimumUpdatePeriod:function(e){return An(e)},suggestedPresentationDelay:function(e){return An(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return An(e)},start:function(e){return An(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return function(i){return parseFloat(i.split("/").reduce(function(r,t){return r/t}))}(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var i=parseInt(e,10);return isNaN(i)?An(e):i},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Bt=function(e){return e&&e.attributes?hl(e.attributes).reduce(function(i,r){var t=Tl[r.name]||Tl.DEFAULT;return i[r.name]=t(r.value),i},{}):{}},Cf={"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"},dr=function(e,i){return i.length?lr(e.map(function(r){return i.map(function(t){return Ji(r,Ya(t))})})):e},Qa=function(e){var i=Et(e,"SegmentTemplate")[0],r=Et(e,"SegmentList")[0],t=r&&Et(r,"SegmentURL").map(function(m){return Ht({tag:"SegmentURL"},Bt(m))}),n=Et(e,"SegmentBase")[0],a=r||i,s=a&&Et(a,"SegmentTimeline")[0],o=r||n||i,u=o&&Et(o,"Initialization")[0],c=i&&Bt(i);c&&u?c.initialization=u&&Bt(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var d={template:c,segmentTimeline:s&&Et(s,"S").map(function(m){return Bt(m)}),list:r&&Ht(Bt(r),{segmentUrls:t,initialization:Bt(u)}),base:n&&Ht(Bt(n),{initialization:Bt(u)})};return Object.keys(d).forEach(function(m){d[m]||delete d[m]}),d},xf=function(e,i,r){return function(t){var n,a=Bt(t),s=dr(i,Et(t,"BaseURL")),o=Et(t,"Role")[0],u={role:Bt(o)},c=Ht(e,a,u),d=Et(t,"Accessibility")[0],m=(n=Bt(d)).schemeIdUri==="urn:scte:dash:cc:cea-608:2015"?(typeof n.value!="string"?[]:n.value.split(";")).map(function(k){var I,P;if(P=k,/^CC\d=/.test(k)){var N=k.split("=");I=N[0],P=N[1]}else/^CC\d$/.test(k)&&(I=k);return{channel:I,language:P}}):n.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"?(typeof n.value!="string"?[]:n.value.split(";")).map(function(k){var I={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(k)){var P=k.split("="),N=P[0],A=P[1],U=A===void 0?"":A;I.channel=N,I.language=k,U.split(",").forEach(function(B){var R=B.split(":"),q=R[0],$=R[1];q==="lang"?I.language=$:q==="er"?I.easyReader=Number($):q==="war"?I.aspectRatio=Number($):q==="3D"&&(I["3D"]=Number($))})}else I.language=k;return I.channel&&(I.channel="SERVICE"+I.channel),I}):void 0;m&&(c=Ht(c,{captionServices:m}));var f=Et(t,"Label")[0];if(f&&f.childNodes.length){var _=f.childNodes[0].nodeValue.trim();c=Ht(c,{label:_})}var b=Et(t,"ContentProtection").reduce(function(k,I){var P=Bt(I);P.schemeIdUri&&(P.schemeIdUri=P.schemeIdUri.toLowerCase());var N=Cf[P.schemeIdUri];if(N){k[N]={attributes:P};var A=Et(I,"cenc:pssh")[0];if(A){var U=Ya(A);k[N].pssh=U&&pu(U)}}return k},{});Object.keys(b).length&&(c=Ht(c,{contentProtection:b}));var y=Qa(t),E=Et(t,"Representation"),w=Ht(r,y);return lr(E.map(function(k,I,P){return function(N){var A=Et(N,"BaseURL"),U=dr(I,A),B=Ht(k,Bt(N)),R=Qa(N);return U.map(function(q){return{segmentInfo:Ht(P,R),attributes:Ht(B,{baseUrl:q})}})}}(c,s,w)))}},Df=function(e,i){return function(r,t){var n=dr(i,Et(r.node,"BaseURL")),a=Ht(e,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var s=Et(r.node,"AdaptationSet"),o=Qa(r.node);return lr(s.map(xf(a,n,o)))}},Sl=function(e){if(e==="")throw new Error(of);var i,r,t=new af;try{r=(i=t.parseFromString(e,"application/xml"))&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(uf);return r},If=function(e,i){i===void 0&&(i={});var r=function(n,a){a===void 0&&(a={});var s=a,o=s.manifestUri,u=o===void 0?"":o,c=s.NOW,d=c===void 0?Date.now():c,m=s.clientOffset,f=m===void 0?0:m,_=Et(n,"Period");if(!_.length)throw new Error(sf);var b=Et(n,"Location"),y=Bt(n),E=dr([u],Et(n,"BaseURL"));y.type=y.type||"static",y.sourceDuration=y.mediaPresentationDuration||0,y.NOW=d,y.clientOffset=f,b.length&&(y.locations=b.map(Ya));var w=[];return _.forEach(function(k,I){var P=Bt(k),N=w[I-1];P.start=function(A){var U=A.attributes,B=A.priorPeriodAttributes,R=A.mpdType;return typeof U.start=="number"?U.start:B&&typeof B.start=="number"&&typeof B.duration=="number"?B.start+B.duration:B||R!=="static"?null:0}({attributes:P,priorPeriodAttributes:N?N.attributes:null,mpdType:y.type}),w.push({node:k,attributes:P})}),{locations:y.locations,representationInfo:lr(w.map(Df(y,E)))}}(Sl(e),i),t=r.representationInfo.map(kf);return bf({dashPlaylists:t,locations:r.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest})},Af=function(e){return function(i){var r=Et(i,"UTCTiming")[0];if(!r)return null;var t=Bt(r);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;default:throw new Error(df)}return t}(Sl(e))},Pf=Math.pow(2,32),El=function(e){var i,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(i=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(i):i:r.getUint32(0)*Pf+r.getUint32(4)},Lf=function(e){var i=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},t=12;r.version===0?(r.earliestPresentationTime=i.getUint32(t),r.firstOffset=i.getUint32(t+4),t+=8):(r.earliestPresentationTime=El(e.subarray(t)),r.firstOffset=El(e.subarray(t+8)),t+=16),t+=2;var n=i.getUint16(t);for(t+=2;n>0;t+=12,n--)r.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return r};const Of=en(Lf);var Rf=Z([73,68,51]),_i=function e(i,r){return r===void 0&&(r=0),(i=Z(i)).length-r<10||!bt(i,Rf,{offset:r})?r:(r+=function(t,n){n===void 0&&(n=0);var a=(t=Z(t))[n+5],s=t[n+6]<<21|t[n+7]<<14|t[n+8]<<7|t[n+9];return(16&a)>>4?s+20:s+10}(i,r),e(i,r))},wl=function(e){return typeof e=="string"?bu(e):e},Nf=function e(i,r,t){t===void 0&&(t=!1),r=function(d){return Array.isArray(d)?d.map(function(m){return wl(m)}):[wl(d)]}(r),i=Z(i);var n=[];if(!r.length)return n;for(var a=0;a<i.length;){var s=(i[a]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3])>>>0,o=i.subarray(a+4,a+8);if(s===0)break;var u=a+s;if(u>i.length){if(t)break;u=i.length}var c=i.subarray(a+8,u);bt(o,r[0])&&(r.length===1?n.push(c):n.push.apply(n,e(c,r.slice(1),t))),a=u}return n},hr={EBML:Z([26,69,223,163]),DocType:Z([66,130]),Segment:Z([24,83,128,103]),SegmentInfo:Z([21,73,169,102]),Tracks:Z([22,84,174,107]),Track:Z([174]),TrackNumber:Z([215]),DefaultDuration:Z([35,227,131]),TrackEntry:Z([174]),TrackType:Z([131]),FlagDefault:Z([136]),CodecID:Z([134]),CodecPrivate:Z([99,162]),VideoTrack:Z([224]),AudioTrack:Z([225]),Cluster:Z([31,67,182,117]),Timestamp:Z([231]),TimestampScale:Z([42,215,177]),BlockGroup:Z([160]),BlockDuration:Z([155]),Block:Z([161]),SimpleBlock:Z([163])},$a=[128,64,32,16,8,4,2,1],pr=function(e,i,r,t){r===void 0&&(r=!0),t===void 0&&(t=!1);var n=function(s){for(var o=1,u=0;u<$a.length&&!(s&$a[u]);u++)o++;return o}(e[i]),a=e.subarray(i,i+n);return r&&((a=Array.prototype.slice.call(e,i,i+n))[0]^=$a[n-1]),{length:n,value:qp(a,{signed:t}),bytes:a}},kl=function e(i){return typeof i=="string"?i.match(/.{1,2}/g).map(function(r){return e(r)}):typeof i=="number"?Hp(i):i},Mf=function e(i,r,t){if(t>=r.length)return r.length;var n=pr(r,t,!1);if(bt(i.bytes,n.bytes))return t;var a=pr(r,t+n.length);return e(i,r,t+a.length+a.value+n.length)},Cl=function e(i,r){r=function(d){return Array.isArray(d)?d.map(function(m){return kl(m)}):[kl(d)]}(r),i=Z(i);var t=[];if(!r.length)return t;for(var n=0;n<i.length;){var a=pr(i,n,!1),s=pr(i,n+a.length),o=n+a.length+s.length;s.value===127&&(s.value=Mf(a,i,o),s.value!==i.length&&(s.value-=o));var u=o+s.value>i.length?i.length:o+s.value,c=i.subarray(o,u);bt(r[0],a.bytes)&&(r.length===1?t.push(c):t=t.concat(e(c,r.slice(1)))),n+=a.length+s.length+c.length}return t},Uf=Z([0,0,0,1]),Bf=Z([0,0,1]),Ff=Z([0,0,3]),jf=function(e){for(var i=[],r=1;r<e.length-2;)bt(e.subarray(r,r+3),Ff)&&(i.push(r+2),r++),r++;if(i.length===0)return e;var t=e.length-i.length,n=new Uint8Array(t),a=0;for(r=0;r<t;a++,r++)a===i[0]&&(a++,i.shift()),n[r]=e[a];return n},xl=function(e,i,r,t){t===void 0&&(t=1/0),e=Z(e),r=[].concat(r);for(var n,a=0,s=0;a<e.length&&(s<t||n);){var o=void 0;if(bt(e.subarray(a),Uf)?o=4:bt(e.subarray(a),Bf)&&(o=3),o){if(s++,n)return jf(e.subarray(n,a));var u=void 0;i==="h264"?u=31&e[a+o]:i==="h265"&&(u=e[a+o]>>1&63),r.indexOf(u)!==-1&&(n=a+o),a+=o+(i==="h264"?1:2)}else a++}return e.subarray(0,0)},Vt={webm:Z([119,101,98,109]),matroska:Z([109,97,116,114,111,115,107,97]),flac:Z([102,76,97,67]),ogg:Z([79,103,103,83]),ac3:Z([11,119]),riff:Z([82,73,70,70]),avi:Z([65,86,73]),wav:Z([87,65,86,69]),"3gp":Z([102,116,121,112,51,103]),mp4:Z([102,116,121,112]),fmp4:Z([115,116,121,112]),mov:Z([102,116,121,112,113,116]),moov:Z([109,111,111,118]),moof:Z([109,111,111,102])},Pn={aac:function(e){var i=_i(e);return bt(e,[255,16],{offset:i,mask:[255,22]})},mp3:function(e){var i=_i(e);return bt(e,[255,2],{offset:i,mask:[255,6]})},webm:function(e){var i=Cl(e,[hr.EBML,hr.DocType])[0];return bt(i,Vt.webm)},mkv:function(e){var i=Cl(e,[hr.EBML,hr.DocType])[0];return bt(i,Vt.matroska)},mp4:function(e){return!Pn["3gp"](e)&&!Pn.mov(e)&&(!(!bt(e,Vt.mp4,{offset:4})&&!bt(e,Vt.fmp4,{offset:4}))||!(!bt(e,Vt.moof,{offset:4})&&!bt(e,Vt.moov,{offset:4}))||void 0)},mov:function(e){return bt(e,Vt.mov,{offset:4})},"3gp":function(e){return bt(e,Vt["3gp"],{offset:4})},ac3:function(e){var i=_i(e);return bt(e,Vt.ac3,{offset:i})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var i=0;i+188<e.length&&i<188;){if(e[i]===71&&e[i+188]===71)return!0;i+=1}return!1},flac:function(e){var i=_i(e);return bt(e,Vt.flac,{offset:i})},ogg:function(e){return bt(e,Vt.ogg)},avi:function(e){return bt(e,Vt.riff)&&bt(e,Vt.avi,{offset:8})},wav:function(e){return bt(e,Vt.riff)&&bt(e,Vt.wav,{offset:8})},h264:function(e){return function(i,r,t){return xl(i,"h264",r,t)}(e,7,3).length},h265:function(e){return function(i,r,t){return xl(i,"h265",r,t)}(e,[32,33],3).length}},Ja=Object.keys(Pn).filter(function(e){return e!=="ts"&&e!=="h264"&&e!=="h265"}).concat(["ts","h264","h265"]);Ja.forEach(function(e){var i=Pn[e];Pn[e]=function(r){return i(Z(r))}});var qf,Hf,Vf,Wf,Gf=Pn,Za=function(e){e=Z(e);for(var i=0;i<Ja.length;i++){var r=Ja[i];if(Gf[r](e))return r}return""},ts=9e4,fr=ts;qf=function(e){return e*ts},Hf=function(e,i){return e*i},Vf=function(e){return e/ts},Wf=function(e,i){return e/i};function es(e){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},es(e)}function ns(e){var i=typeof Map=="function"?new Map:void 0;return ns=function(r){if(r===null||!function(n){try{return Function.toString.call(n).indexOf("[native code]")!==-1}catch{return typeof n=="function"}}(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(i!==void 0){if(i.has(r))return i.get(r);i.set(r,t)}function t(){return lu(r,arguments,es(this).constructor)}return t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),_n(t,r)},ns(e)}for(var bi,Dl="7.21.5",Re={},$e=function(e,i){return Re[e]=Re[e]||[],i&&(Re[e]=Re[e].concat(i)),Re[e]},Il=function(e,i){var r=$e(e).indexOf(i);return!(r<=-1)&&(Re[e]=Re[e].slice(),Re[e].splice(r,1),!0)},mr={prefixed:!0},gr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],Al=gr[0],vr=0;vr<gr.length;vr++)if(gr[vr][1]in H){bi=gr[vr];break}if(bi){for(var yr=0;yr<bi.length;yr++)mr[Al[yr]]=bi[yr];mr.prefixed=bi[0]!==Al[0]}var te=[],it=function e(i){var r,t="info",n=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];r("log",t,s)};return r=function(a,s){return function(o,u,c){var d=s.levels[u],m=new RegExp("^("+d+")$");if(o!=="log"&&c.unshift(o.toUpperCase()+":"),c.unshift(a+":"),te){te.push([].concat(c));var f=te.length-1e3;te.splice(0,f>0?f:0)}if(D.console){var _=D.console[o];_||o!=="debug"||(_=D.console.info||D.console.log),_&&d&&m.test(o)&&_[Array.isArray(c)?"apply":"call"](D.console,c)}}}(i,n),n.createLogger=function(a){return e(i+": "+a)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(a){if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error('"'+a+'" in not a valid log level');t=a}return t},(n.history=function(){return te?[].concat(te):[]}).filter=function(a){return(te||[]).filter(function(s){return new RegExp(".*"+a+".*").test(s[0])})},n.history.clear=function(){te&&(te.length=0)},n.history.disable=function(){te!==null&&(te.length=0,te=null)},n.history.enable=function(){te===null&&(te=[])},n.error=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return r("error",t,s)},n.warn=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return r("warn",t,s)},n.debug=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return r("debug",t,s)},n}("VIDEOJS"),Pl=it.createLogger,zf=Object.prototype.toString,Ll=function(e){return Ne(e)?Object.keys(e):[]};function Ln(e,i){Ll(e).forEach(function(r){return i(e[r],r)})}function wt(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];return Object.assign?he.apply(void 0,[e].concat(r)):(r.forEach(function(n){n&&Ln(n,function(a,s){e[s]=a})}),e)}function Ne(e){return!!e&&typeof e=="object"}function Ti(e){return Ne(e)&&zf.call(e)==="[object Object]"&&e.constructor===Object}function Si(e,i){if(!e||!i)return"";if(typeof D.getComputedStyle=="function"){var r;try{r=D.getComputedStyle(e)}catch{return""}return r?r.getPropertyValue(i)||r[i]:""}return""}var is,Pt=D.navigator&&D.navigator.userAgent||"",Ol=/AppleWebKit\/([\d.]+)/i.exec(Pt),Xf=Ol?parseFloat(Ol.pop()):null,Rl=/iPod/i.test(Pt),Kf=(is=Pt.match(/OS (\d+)_/i))&&is[1]?is[1]:null,Me=/Android/i.test(Pt),rs=function(){var e=Pt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var i=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return i&&r?parseFloat(e[1]+"."+e[2]):i||null}(),Nl=Me&&rs<5&&Xf<537,Ml=/Firefox/i.test(Pt),Ei=/Edg/i.test(Pt),Ue=!Ei&&(/Chrome/i.test(Pt)||/CriOS/i.test(Pt)),Ul=function(){var e=Pt.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),wi=function(){var e=/MSIE\s(\d+)\.\d/.exec(Pt),i=e&&parseFloat(e[1]);return!i&&/Trident\/7.0/i.test(Pt)&&/rv:11.0/.test(Pt)&&(i=11),i}(),as=/Safari/i.test(Pt)&&!Ue&&!Me&&!Ei,Bl=/Windows/i.test(Pt),On=!!(Rn()&&("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),ss=/iPad/i.test(Pt)||as&&On&&!/iPhone/i.test(Pt),os=/iPhone/i.test(Pt)&&!ss,Wt=os||ss||Rl,_r=(as||Wt)&&!Ue,Yf=Object.freeze({__proto__:null,IS_IPOD:Rl,IOS_VERSION:Kf,IS_ANDROID:Me,ANDROID_VERSION:rs,IS_NATIVE_ANDROID:Nl,IS_FIREFOX:Ml,IS_EDGE:Ei,IS_CHROME:Ue,CHROME_VERSION:Ul,IE_VERSION:wi,IS_SAFARI:as,IS_WINDOWS:Bl,TOUCH_ENABLED:On,IS_IPAD:ss,IS_IPHONE:os,IS_IOS:Wt,IS_ANY_SAFARI:_r});function Fl(e){return typeof e=="string"&&!!e.trim()}function jl(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Rn(){return H===D.document}function Nn(e){return Ne(e)&&e.nodeType===1}function ql(){try{return D.parent!==D.self}catch{return!0}}function Hl(e){return function(i,r){if(!Fl(i))return H[e](null);Fl(r)&&(r=H.querySelector(r));var t=Nn(r)?r:H;return t[e]&&t[e](i)}}function ot(e,i,r,t){e===void 0&&(e="div"),i===void 0&&(i={}),r===void 0&&(r={});var n=H.createElement(e);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(it.warn(`Setting attributes in the second argument of createEl()
- has been deprecated. Use the third argument instead.
- createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),n.setAttribute(a,s)):a==="textContent"?sn(n,s):n[a]===s&&a!=="tabIndex"||(n[a]=s)}),Object.getOwnPropertyNames(r).forEach(function(a){n.setAttribute(a,r[a])}),t&&cs(n,t),n}function sn(e,i){return e.textContent===void 0?e.innerText=i:e.textContent=i,e}function us(e,i){i.firstChild?i.insertBefore(e,i.firstChild):i.appendChild(e)}function on(e,i){return jl(i),e.classList?e.classList.contains(i):(r=i,new RegExp("(^|\\s)"+r+"($|\\s)")).test(e.className);var r}function Be(e,i){return e.classList?e.classList.add(i):on(e,i)||(e.className=(e.className+" "+i).trim()),e}function ki(e,i){return e?(e.classList?e.classList.remove(i):(jl(i),e.className=e.className.split(/\s+/).filter(function(r){return r!==i}).join(" ")),e):(it.warn("removeClass was called with an element that doesn't exist"),null)}function Vl(e,i,r){var t=on(e,i);if(typeof r=="function"&&(r=r(e,i)),typeof r!="boolean"&&(r=!t),r!==t)return r?Be(e,i):ki(e,i),e}function Wl(e,i){Object.getOwnPropertyNames(i).forEach(function(r){var t=i[r];t==null||t===!1?e.removeAttribute(r):e.setAttribute(r,t===!0?"":t)})}function Fe(e){var i={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var t=e.attributes,n=t.length-1;n>=0;n--){var a=t[n].name,s=t[n].value;typeof e[a]!="boolean"&&r.indexOf(","+a+",")===-1||(s=s!==null),i[a]=s}return i}function Gl(e,i){return e.getAttribute(i)}function Mn(e,i,r){e.setAttribute(i,r)}function br(e,i){e.removeAttribute(i)}function zl(){H.body.focus(),H.onselectstart=function(){return!1}}function Xl(){H.onselectstart=function(){return!0}}function Un(e){if(e&&e.getBoundingClientRect&&e.parentNode){var i=e.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(t){i[t]!==void 0&&(r[t]=i[t])}),r.height||(r.height=parseFloat(Si(e,"height"))),r.width||(r.width=parseFloat(Si(e,"width"))),r}}function Ci(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var i=e.offsetWidth,r=e.offsetHeight,t=0,n=0;e.offsetParent&&e!==H[mr.fullscreenElement];)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n,width:i,height:r}}function Tr(e,i){var r={x:0,y:0};if(Wt)for(var t=e;t&&t.nodeName.toLowerCase()!=="html";){var n=Si(t,"transform");if(/^matrix/.test(n)){var a=n.slice(7,-1).split(/,\s/).map(Number);r.x+=a[4],r.y+=a[5]}else if(/^matrix3d/.test(n)){var s=n.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}t=t.parentNode}var o={},u=Ci(i.target),c=Ci(e),d=c.width,m=c.height,f=i.offsetY-(c.top-u.top),_=i.offsetX-(c.left-u.left);return i.changedTouches&&(_=i.changedTouches[0].pageX-c.left,f=i.changedTouches[0].pageY+c.top,Wt&&(_-=r.x,f-=r.y)),o.y=1-Math.max(0,Math.min(1,f/m)),o.x=Math.max(0,Math.min(1,_/d)),o}function Kl(e){return Ne(e)&&e.nodeType===3}function ls(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Yl(e){return typeof e=="function"&&(e=e()),(Array.isArray(e)?e:[e]).map(function(i){return typeof i=="function"&&(i=i()),Nn(i)||Kl(i)?i:typeof i=="string"&&/\S/.test(i)?H.createTextNode(i):void 0}).filter(function(i){return i})}function cs(e,i){return Yl(i).forEach(function(r){return e.appendChild(r)}),e}function Ql(e,i){return cs(ls(e),i)}function xi(e){return e.button===void 0&&e.buttons===void 0||e.button===0&&e.buttons===void 0||e.type==="mouseup"&&e.button===0&&e.buttons===0||e.button===0&&e.buttons===1}var ds,Je=Hl("querySelector"),$l=Hl("querySelectorAll"),Jl=Object.freeze({__proto__:null,isReal:Rn,isEl:Nn,isInFrame:ql,createEl:ot,textContent:sn,prependTo:us,hasClass:on,addClass:Be,removeClass:ki,toggleClass:Vl,setAttributes:Wl,getAttributes:Fe,getAttribute:Gl,setAttribute:Mn,removeAttribute:br,blockTextSelection:zl,unblockTextSelection:Xl,getBoundingClientRect:Un,findPosition:Ci,getPointerPosition:Tr,isTextNode:Kl,emptyEl:ls,normalizeContent:Yl,appendContent:cs,insertContent:Ql,isSingleLeftClick:xi,$:Je,$$:$l}),Zl=!1,Qf=function(){if(ds.options.autoSetup!==!1){var e=Array.prototype.slice.call(H.getElementsByTagName("video")),i=Array.prototype.slice.call(H.getElementsByTagName("audio")),r=Array.prototype.slice.call(H.getElementsByTagName("video-js")),t=e.concat(i,r);if(t&&t.length>0)for(var n=0,a=t.length;n<a;n++){var s=t[n];if(!s||!s.getAttribute){hs(1);break}s.player===void 0&&s.getAttribute("data-setup")!==null&&ds(s)}else Zl||hs(1)}};function hs(e,i){Rn()&&(i&&(ds=i),D.setTimeout(Qf,e))}function ps(){Zl=!0,D.removeEventListener("load",ps)}Rn()&&(H.readyState==="complete"?ps():D.addEventListener("load",ps));var tc,ec=function(e){var i=H.createElement("style");return i.className=e,i},nc=function(e,i){e.styleSheet?e.styleSheet.cssText=i:e.textContent=i},$f=3;function je(){return $f++}D.WeakMap||(tc=function(){function e(){this.vdata="vdata"+Math.floor(D.performance&&D.performance.now()||Date.now()),this.data={}}var i=e.prototype;return i.set=function(r,t){var n=r[this.vdata]||je();return r[this.vdata]||(r[this.vdata]=n),this.data[n]=t,this},i.get=function(r){var t=r[this.vdata];if(t)return this.data[t];it("We have no data for this element",r)},i.has=function(r){return r[this.vdata]in this.data},i.delete=function(r){var t=r[this.vdata];t&&(delete this.data[t],delete r[this.vdata])},e}());var Sr,Gt=D.WeakMap?new WeakMap:new tc;function ic(e,i){if(Gt.has(e)){var r=Gt.get(e);r.handlers[i].length===0&&(delete r.handlers[i],e.removeEventListener?e.removeEventListener(i,r.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+i,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),Object.getOwnPropertyNames(r).length===0&&Gt.delete(e)}}function fs(e,i,r,t){r.forEach(function(n){e(i,n,t)})}function Er(e){if(e.fixed_)return e;function i(){return!0}function r(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var t=e||D.event;for(var n in e={},t)n!=="layerX"&&n!=="layerY"&&n!=="keyLocation"&&n!=="webkitMovementX"&&n!=="webkitMovementY"&&n!=="path"&&(n==="returnValue"&&t.preventDefault||(e[n]=t[n]));if(e.target||(e.target=e.srcElement||H),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){t.preventDefault&&t.preventDefault(),e.returnValue=!1,t.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){t.stopPropagation&&t.stopPropagation(),e.cancelBubble=!0,t.cancelBubble=!0,e.isPropagationStopped=i},e.isPropagationStopped=r,e.stopImmediatePropagation=function(){t.stopImmediatePropagation&&t.stopImmediatePropagation(),e.isImmediatePropagationStopped=i,e.stopPropagation()},e.isImmediatePropagationStopped=r,e.clientX!==null&&e.clientX!==void 0){var a=H.documentElement,s=H.body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,e.button!==null&&e.button!==void 0&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var Jf=function(){if(typeof Sr!="boolean"){Sr=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Sr=!0}});D.addEventListener("test",null,e),D.removeEventListener("test",null,e)}catch{}}return Sr},Zf=["touchstart","touchmove"];function re(e,i,r){if(Array.isArray(i))return fs(re,e,i,r);Gt.has(e)||Gt.set(e,{});var t=Gt.get(e);if(t.handlers||(t.handlers={}),t.handlers[i]||(t.handlers[i]=[]),r.guid||(r.guid=je()),t.handlers[i].push(r),t.dispatcher||(t.disabled=!1,t.dispatcher=function(a,s){if(!t.disabled){a=Er(a);var o=t.handlers[a.type];if(o)for(var u=o.slice(0),c=0,d=u.length;c<d&&!a.isImmediatePropagationStopped();c++)try{u[c].call(e,a,s)}catch(m){it.error(m)}}}),t.handlers[i].length===1)if(e.addEventListener){var n=!1;Jf()&&Zf.indexOf(i)>-1&&(n={passive:!0}),e.addEventListener(i,t.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+i,t.dispatcher)}function Ft(e,i,r){if(Gt.has(e)){var t=Gt.get(e);if(t.handlers){if(Array.isArray(i))return fs(Ft,e,i,r);var n=function(u,c){t.handlers[c]=[],ic(u,c)};if(i!==void 0){var a=t.handlers[i];if(a)if(r){if(r.guid)for(var s=0;s<a.length;s++)a[s].guid===r.guid&&a.splice(s--,1);ic(e,i)}else n(e,i)}else for(var o in t.handlers)Object.prototype.hasOwnProperty.call(t.handlers||{},o)&&n(e,o)}}}function Bn(e,i,r){var t=Gt.has(e)?Gt.get(e):{},n=e.parentNode||e.ownerDocument;if(typeof i=="string"?i={type:i,target:e}:i.target||(i.target=e),i=Er(i),t.dispatcher&&t.dispatcher.call(e,i,r),n&&!i.isPropagationStopped()&&i.bubbles===!0)Bn.call(null,n,i,r);else if(!n&&!i.defaultPrevented&&i.target&&i.target[i.type]){Gt.has(i.target)||Gt.set(i.target,{});var a=Gt.get(i.target);i.target[i.type]&&(a.disabled=!0,typeof i.target[i.type]=="function"&&i.target[i.type](),a.disabled=!1)}return!i.defaultPrevented}function wr(e,i,r){if(Array.isArray(i))return fs(wr,e,i,r);var t=function n(){Ft(e,i,n),r.apply(this,arguments)};t.guid=r.guid=r.guid||je(),re(e,i,t)}function rc(e,i,r){var t=function n(){Ft(e,i,n),r.apply(this,arguments)};t.guid=r.guid=r.guid||je(),re(e,i,t)}var Di,tm=Object.freeze({__proto__:null,fixEvent:Er,on:re,off:Ft,trigger:Bn,one:wr,any:rc}),me=30,yt=function(e,i,r){i.guid||(i.guid=je());var t=i.bind(e);return t.guid=r?r+"_"+i.guid:i.guid,t},qe=function(e,i){var r=D.performance.now();return function(){var t=D.performance.now();t-r>=i&&(e.apply(void 0,arguments),r=t)}},Lt=function(){};Lt.prototype.allowedEvents_={},Lt.prototype.on=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},re(this,e,i),this.addEventListener=r},Lt.prototype.addEventListener=Lt.prototype.on,Lt.prototype.off=function(e,i){Ft(this,e,i)},Lt.prototype.removeEventListener=Lt.prototype.off,Lt.prototype.one=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},wr(this,e,i),this.addEventListener=r},Lt.prototype.any=function(e,i){var r=this.addEventListener;this.addEventListener=function(){},rc(this,e,i),this.addEventListener=r},Lt.prototype.trigger=function(e){var i=e.type||e;typeof e=="string"&&(e={type:i}),e=Er(e),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](e),Bn(this,e)},Lt.prototype.dispatchEvent=Lt.prototype.trigger,Lt.prototype.queueTrigger=function(e){var i=this;Di||(Di=new Map);var r=e.type||e,t=Di.get(this);t||(t=new Map,Di.set(this,t));var n=t.get(r);t.delete(r),D.clearTimeout(n);var a=D.setTimeout(function(){t.delete(r),t.size===0&&(t=null,Di.delete(i)),i.trigger(e)},0);t.set(r,a)};var kr=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},He=function(e){return e instanceof Lt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof e[i]=="function"})},ms=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Cr=function(e,i,r){if(!e||!e.nodeName&&!He(e))throw new Error("Invalid target for "+kr(i)+"#"+r+"; must be a DOM node or evented object.")},ac=function(e,i,r){if(!ms(e))throw new Error("Invalid event type for "+kr(i)+"#"+r+"; must be a non-empty string or array.")},sc=function(e,i,r){if(typeof e!="function")throw new Error("Invalid listener for "+kr(i)+"#"+r+"; must be a function.")},gs=function(e,i,r){var t,n,a,s=i.length<3||i[0]===e||i[0]===e.eventBusEl_;return s?(t=e.eventBusEl_,i.length>=3&&i.shift(),n=i[0],a=i[1]):(t=i[0],n=i[1],a=i[2]),Cr(t,e,r),ac(n,e,r),sc(a,e,r),{isTargetingSelf:s,target:t,type:n,listener:a=yt(e,a)}},un=function(e,i,r,t){Cr(e,e,i),e.nodeName?tm[i](e,r,t):e[i](r,t)},em={on:function(){for(var e=this,i=arguments.length,r=new Array(i),t=0;t<i;t++)r[t]=arguments[t];var n=gs(this,r,"on"),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(un(s,"on",o,u),!a){var c=function(){return e.off(s,o,u)};c.guid=u.guid;var d=function(){return e.off("dispose",c)};d.guid=u.guid,un(this,"on","dispose",c),un(s,"on","dispose",d)}},one:function(){for(var e=this,i=arguments.length,r=new Array(i),t=0;t<i;t++)r[t]=arguments[t];var n=gs(this,r,"one"),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(a)un(s,"one",o,u);else{var c=function d(){e.off(s,o,d);for(var m=arguments.length,f=new Array(m),_=0;_<m;_++)f[_]=arguments[_];u.apply(null,f)};c.guid=u.guid,un(s,"one",o,c)}},any:function(){for(var e=this,i=arguments.length,r=new Array(i),t=0;t<i;t++)r[t]=arguments[t];var n=gs(this,r,"any"),a=n.isTargetingSelf,s=n.target,o=n.type,u=n.listener;if(a)un(s,"any",o,u);else{var c=function d(){e.off(s,o,d);for(var m=arguments.length,f=new Array(m),_=0;_<m;_++)f[_]=arguments[_];u.apply(null,f)};c.guid=u.guid,un(s,"any",o,c)}},off:function(e,i,r){if(!e||ms(e))Ft(this.eventBusEl_,e,i);else{var t=e,n=i;Cr(t,this,"off"),ac(n,this,"off"),sc(r,this,"off"),r=yt(this,r),this.off("dispose",r),t.nodeName?(Ft(t,n,r),Ft(t,"dispose",r)):He(t)&&(t.off(n,r),t.off("dispose",r))}},trigger:function(e,i){Cr(this.eventBusEl_,this,"trigger");var r=e&&typeof e!="string"?e.type:e;if(!ms(r)){var t="Invalid event type for "+kr(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(t);(this.log||it).error(t)}return Bn(this.eventBusEl_,e,i)}};function vs(e,i){i===void 0&&(i={});var r=i.eventBusKey;if(r){if(!e[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');e.eventBusEl_=e[r]}else e.eventBusEl_=ot("span",{className:"vjs-event-bus"});return wt(e,em),e.eventedCallbacks&&e.eventedCallbacks.forEach(function(t){t()}),e.on("dispose",function(){e.off(),[e,e.el_,e.eventBusEl_].forEach(function(t){t&&Gt.has(t)&&Gt.delete(t)}),D.setTimeout(function(){e.eventBusEl_=null},0)}),e}var nm={state:{},setState:function(e){var i,r=this;return typeof e=="function"&&(e=e()),Ln(e,function(t,n){r.state[n]!==t&&((i=i||{})[n]={from:r.state[n],to:t}),r.state[n]=t}),i&&He(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function oc(e,i){return wt(e,nm),e.state=wt({},e.state,i),typeof e.handleStateChanged=="function"&&He(e)&&e.on("statechanged",e.handleStateChanged),e}var xr=function(e){return typeof e!="string"?e:e.replace(/./,function(i){return i.toLowerCase()})},kt=function(e){return typeof e!="string"?e:e.replace(/./,function(i){return i.toUpperCase()})};function _t(){for(var e={},i=arguments.length,r=new Array(i),t=0;t<i;t++)r[t]=arguments[t];return r.forEach(function(n){n&&Ln(n,function(a,s){Ti(a)?(Ti(e[s])||(e[s]={}),e[s]=_t(e[s],a)):e[s]=a})}),e}var im=function(){function e(){this.map_={}}var i=e.prototype;return i.has=function(r){return r in this.map_},i.delete=function(r){var t=this.has(r);return delete this.map_[r],t},i.set=function(r,t){return this.map_[r]=t,this},i.forEach=function(r,t){for(var n in this.map_)r.call(t,this.map_[n],n,this)},e}(),rm=D.Map?D.Map:im,am=function(){function e(){this.set_={}}var i=e.prototype;return i.has=function(r){return r in this.set_},i.delete=function(r){var t=this.has(r);return delete this.set_[r],t},i.add=function(r){return this.set_[r]=1,this},i.forEach=function(r,t){for(var n in this.set_)r.call(t,n,n,this)},e}(),ys=D.Set?D.Set:am,F=function(){function e(r,t,n){var a=this;if(!r&&this.play?this.player_=r=this:this.player_=r,this.isDisposed_=!1,this.parentComponent_=null,this.options_=_t({},this.options_),t=this.options_=_t(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var s=r&&r.id&&r.id()||"no_player";this.id_=s+"_component_"+je()}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(function(o){return a.addClass(o)}),t.evented!==!1&&(vs(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),oc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new ys,this.setIntervalIds_=new ys,this.rafIds_=new ys,this.namedRafs_=new rm,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(n),t.reportTouchActivity!==!1&&this.enableTouchActivity()}var i=e.prototype;return i.dispose=function(r){if(r===void 0&&(r={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var 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&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},i.isDisposed=function(){return!!this.isDisposed_},i.player=function(){return this.player_},i.options=function(r){return r?(this.options_=_t(this.options_,r),this.options_):this.options_},i.el=function(){return this.el_},i.createEl=function(r,t,n){return ot(r,t,n)},i.localize=function(r,t,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[a],u=a&&a.split("-")[0],c=s&&s[u],d=n;return o&&o[r]?d=o[r]:c&&c[r]&&(d=c[r]),t&&(d=d.replace(/\{(\d+)\}/g,function(m,f){var _=t[f-1],b=_;return _===void 0&&(b=m),b})),d},i.handleLanguagechange=function(){},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(r){return this.childIndex_[r]},i.getChild=function(r){if(r)return this.childNameIndex_[r]},i.getDescendant=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];t=t.reduce(function(o,u){return o.concat(u)},[]);for(var a=this,s=0;s<t.length;s++)if(!(a=a.getChild(t[s]))||!a.getChild)return;return a},i.addChild=function(r,t,n){var a,s;if(t===void 0&&(t={}),n===void 0&&(n=this.children_.length),typeof r=="string"){s=kt(r);var o=t.componentClass||s;t.name=s;var u=e.getComponent(o);if(!u)throw new Error("Component "+o+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,t)}else a=r;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),(s=s||a.name&&kt(a.name()))&&(this.childNameIndex_[s]=a,this.childNameIndex_[xr(s)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[n+1]&&(this.children_[n+1].el_?c=this.children_[n+1].el_:Nn(this.children_[n+1])&&(c=this.children_[n+1])),this.contentEl().insertBefore(a.el(),c)}return a},i.removeChild=function(r){if(typeof r=="string"&&(r=this.getChild(r)),r&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===r){t=!0,this.children_.splice(n,1);break}if(t){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[kt(r.name())]=null,this.childNameIndex_[xr(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},i.initChildren=function(){var r=this,t=this.options_.children;if(t){var n,a=this.options_,s=e.getComponent("Tech");(n=Array.isArray(t)?t:Object.keys(t)).concat(Object.keys(this.options_).filter(function(o){return!n.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(function(o){var u,c;return typeof o=="string"?c=t[u=o]||r.options_[u]||{}:(u=o.name,c=o),{name:u,opts:c}}).filter(function(o){var u=e.getComponent(o.opts.componentClass||kt(o.name));return u&&!s.isTech(u)}).forEach(function(o){var u=o.name,c=o.opts;if(a[u]!==void 0&&(c=a[u]),c!==!1){c===!0&&(c={}),c.playerOptions=r.options_.playerOptions;var d=r.addChild(u,c);d&&(r[u]=d)}})}},i.buildCSSClass=function(){return""},i.ready=function(r,t){if(t===void 0&&(t=!1),r)return this.isReady_?void(t?r.call(this):this.setTimeout(r,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r))},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)},i.$=function(r,t){return Je(r,t||this.contentEl())},i.$$=function(r,t){return $l(r,t||this.contentEl())},i.hasClass=function(r){return on(this.el_,r)},i.addClass=function(r){Be(this.el_,r)},i.removeClass=function(r){ki(this.el_,r)},i.toggleClass=function(r,t){Vl(this.el_,r,t)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(r){return Gl(this.el_,r)},i.setAttribute=function(r,t){Mn(this.el_,r,t)},i.removeAttribute=function(r){br(this.el_,r)},i.width=function(r,t){return this.dimension("width",r,t)},i.height=function(r,t){return this.dimension("height",r,t)},i.dimensions=function(r,t){this.width(r,!0),this.height(t)},i.dimension=function(r,t,n){if(t!==void 0)return t!==null&&t==t||(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[r]=t:this.el_.style[r]=t==="auto"?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],s=a.indexOf("px");return parseInt(s!==-1?a.slice(0,s):this.el_["offset"+kt(r)],10)},i.currentDimension=function(r){var t=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Si(this.el_,r),(t=parseFloat(t))===0||isNaN(t)){var n="offset"+kt(r);t=this.el_[n]}return t},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(r){this.player_&&(et.isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},i.handleKeyPress=function(r){this.handleKeyDown(r)},i.emitTapEvents=function(){var r,t=0,n=null;this.on("touchstart",function(s){s.touches.length===1&&(n={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},t=D.performance.now(),r=!0)}),this.on("touchmove",function(s){if(s.touches.length>1)r=!1;else if(n){var o=s.touches[0].pageX-n.pageX,u=s.touches[0].pageY-n.pageY;Math.sqrt(o*o+u*u)>10&&(r=!1)}});var a=function(){r=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(s){n=null,r===!0&&D.performance.now()-t<200&&(s.preventDefault(),this.trigger("tap"))})},i.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var r,t=yt(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(r),r=this.setInterval(t,250)});var n=function(a){t(),this.clearInterval(r)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},i.setTimeout=function(r,t){var n,a=this;return r=yt(this,r),this.clearTimersOnDispose_(),n=D.setTimeout(function(){a.setTimeoutIds_.has(n)&&a.setTimeoutIds_.delete(n),r()},t),this.setTimeoutIds_.add(n),n},i.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),D.clearTimeout(r)),r},i.setInterval=function(r,t){r=yt(this,r),this.clearTimersOnDispose_();var n=D.setInterval(r,t);return this.setIntervalIds_.add(n),n},i.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),D.clearInterval(r)),r},i.requestAnimationFrame=function(r){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),r=yt(this,r),t=D.requestAnimationFrame(function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),r()}),this.rafIds_.add(t),t):this.setTimeout(r,1e3/60)},i.requestNamedAnimationFrame=function(r,t){var n=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),t=yt(this,t);var a=this.requestAnimationFrame(function(){t(),n.namedRafs_.has(r)&&n.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},i.cancelNamedAnimationFrame=function(r){this.namedRafs_.has(r)&&(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},i.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),D.cancelAnimationFrame(r)),r):this.clearTimeout(r)},i.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var n=t[0],a=t[1];r[n].forEach(function(s,o){return r[a](o)})}),r.clearingTimersOnDispose_=!1}))},e.registerComponent=function(r,t){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var n,a=e.getComponent("Tech"),s=a&&a.isTech(t),o=e===t||e.prototype.isPrototypeOf(t.prototype);if(s||!o)throw n=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+r+'"; '+n+".");r=kt(r),e.components_||(e.components_={});var u=e.getComponent("Player");if(r==="Player"&&u&&u.players){var c=u.players,d=Object.keys(c);if(c&&d.length>0&&d.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[r]=t,e.components_[xr(r)]=t,t},e.getComponent=function(r){if(r&&e.components_)return e.components_[r]},e}();function uc(e,i,r,t){return function(n,a,s){if(typeof a!="number"||a<0||a>s)throw new Error("Failed to execute '"+n+"' on 'TimeRanges': The index provided ("+a+") is non-numeric or out of bounds (0-"+s+").")}(e,t,r.length-1),r[t][i]}function _s(e){var i;return i=e===void 0||e.length===0?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:uc.bind(null,"start",0,e),end:uc.bind(null,"end",1,e)},D.Symbol&&D.Symbol.iterator&&(i[D.Symbol.iterator]=function(){return(e||[]).values()}),i}function ln(e,i){return Array.isArray(e)?_s(e):e===void 0||i===void 0?_s():_s([[e,i]])}function lc(e,i){var r,t,n=0;if(!i)return 0;e&&e.length||(e=ln(0,0));for(var a=0;a<e.length;a++)r=e.start(a),(t=e.end(a))>i&&(t=i),n+=t-r;return n/i}function zt(e){if(e instanceof zt)return e;typeof e=="number"?this.code=e:typeof e=="string"?this.message=e:Ne(e)&&(typeof e.code=="number"&&(this.code=e.code),wt(this,e)),this.message||(this.message=zt.defaultMessages[this.code]||"")}F.prototype.supportsRaf_=typeof D.requestAnimationFrame=="function"&&typeof D.cancelAnimationFrame=="function",F.registerComponent("Component",F),zt.prototype.code=0,zt.prototype.message="",zt.prototype.status=null,zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Fn=0;Fn<zt.errorTypes.length;Fn++)zt[zt.errorTypes[Fn]]=Fn,zt.prototype[zt.errorTypes[Fn]]=Fn;function Ii(e){return e!=null&&typeof e.then=="function"}function Ee(e){Ii(e)&&e.then(null,function(i){})}var cc=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(i,r,t){return e[r]&&(i[r]=e[r]),i},{cues:e.cues&&Array.prototype.map.call(e.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})})},sm=function(e){var i=e.$$("track"),r=Array.prototype.map.call(i,function(t){return t.track});return Array.prototype.map.call(i,function(t){var n=cc(t.track);return t.src&&(n.src=t.src),n}).concat(Array.prototype.filter.call(e.textTracks(),function(t){return r.indexOf(t)===-1}).map(cc))},om=function(e,i){return e.forEach(function(r){var t=i.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(n){return t.addCue(n)})}),i.textTracks()},bs="vjs-modal-dialog",jn=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).handleKeyDown_=function(s){return a.handleKeyDown(s)},a.close_=function(s){return a.close(s)},a.opened_=a.hasBeenOpened_=a.hasBeenFilled_=!1,a.closeable(!a.options_.uncloseable),a.content(a.options_.content),a.contentEl_=ot("div",{className:bs+"-content"},{role:"document"}),a.descEl_=ot("p",{className:bs+"-description vjs-control-text",id:a.el().getAttribute("aria-describedby")}),sn(a.descEl_,a.description()),a.el_.appendChild(a.descEl_),a.el_.appendChild(a.contentEl_),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},r.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},r.buildCSSClass=function(){return bs+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},r.label=function(){return this.localize(this.options_.label||"Modal Window")},r.description=function(){var t=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t},r.open=function(){if(!this.opened_){var t=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},r.opened=function(t){return typeof t=="boolean"&&this[t?"open":"close"](),this.opened_},r.close=function(){if(this.opened_){var t=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},r.closeable=function(t){if(typeof t=="boolean"){var n=this.closeable_=!!t,a=this.getChild("closeButton");if(n&&!a){var s=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},r.fill=function(){this.fillWith(this.content())},r.fillWith=function(t){var n=this.contentEl(),a=n.parentNode,s=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),Ql(n,t),this.trigger("modalfill"),s?a.insertBefore(n,s):a.appendChild(n);var o=this.getChild("closeButton");o&&a.appendChild(o.el_)},r.empty=function(){this.trigger("beforemodalempty"),ls(this.contentEl()),this.trigger("modalempty")},r.content=function(t){return t!==void 0&&(this.content_=t),this.content_},r.conditionalFocus_=function(){var t=H.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(t)||n===t)&&(this.previouslyActiveEl_=t,this.focus())},r.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},r.handleKeyDown=function(t){if(t.stopPropagation(),et.isEventKey(t,"Escape")&&this.closeable())return t.preventDefault(),void this.close();if(et.isEventKey(t,"Tab")){for(var n,a=this.focusableEls_(),s=this.el_.querySelector(":focus"),o=0;o<a.length;o++)if(s===a[o]){n=o;break}H.activeElement===this.el_&&(n=0),t.shiftKey&&n===0?(a[a.length-1].focus(),t.preventDefault()):t.shiftKey||n!==a.length-1||(a[0].focus(),t.preventDefault())}},r.focusableEls_=function(){var t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,function(n){return(n instanceof D.HTMLAnchorElement||n instanceof D.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof D.HTMLInputElement||n instanceof D.HTMLSelectElement||n instanceof D.HTMLTextAreaElement||n instanceof D.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof D.HTMLIFrameElement||n instanceof D.HTMLObjectElement||n instanceof D.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},i}(F);jn.prototype.options_={pauseOnOpen:!0,temporary:!0},F.registerComponent("ModalDialog",jn);var qn=function(e){function i(t){var n;t===void 0&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(tt(n),"length",{get:function(){return this.tracks_.length}});for(var a=0;a<t.length;a++)n.addTrack(t[a]);return n}V(i,e);var r=i.prototype;return r.addTrack=function(t){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(t)===-1&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack",target:this})),t.labelchange_=function(){n.trigger({track:t,type:"labelchange",target:n})},He(t)&&t.addEventListener("labelchange",t.labelchange_)},r.removeTrack=function(t){for(var n,a=0,s=this.length;a<s;a++)if(this[a]===t){(n=this[a]).off&&n.off(),this.tracks_.splice(a,1);break}n&&this.trigger({track:n,type:"removetrack",target:this})},r.getTrackById=function(t){for(var n=null,a=0,s=this.length;a<s;a++){var o=this[a];if(o.id===t){n=o;break}}return n},i}(Lt);for(var um in qn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},qn.prototype.allowedEvents_)qn.prototype["on"+um]=null;var Ts=function(e,i){for(var r=0;r<e.length;r++)Object.keys(e[r]).length&&i.id!==e[r].id&&(e[r].enabled=!1)},lm=function(e){function i(t){var n;t===void 0&&(t=[]);for(var a=t.length-1;a>=0;a--)if(t[a].enabled){Ts(t,t[a]);break}return(n=e.call(this,t)||this).changing_=!1,n}V(i,e);var r=i.prototype;return r.addTrack=function(t){var n=this;t.enabled&&Ts(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Ts(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},i}(qn),Ss=function(e,i){for(var r=0;r<e.length;r++)Object.keys(e[r]).length&&i.id!==e[r].id&&(e[r].selected=!1)},cm=function(e){function i(t){var n;t===void 0&&(t=[]);for(var a=t.length-1;a>=0;a--)if(t[a].selected){Ss(t,t[a]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(tt(n),"selectedIndex",{get:function(){for(var s=0;s<this.length;s++)if(this[s].selected)return s;return-1},set:function(){}}),n}V(i,e);var r=i.prototype;return r.addTrack=function(t){var n=this;t.selected&&Ss(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,Ss(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},i}(qn),dc=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.addTrack=function(t){var n=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(t.kind)===-1&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},i}(qn),dm=function(){function e(r){r===void 0&&(r=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=r.length;t<n;t++)this.addTrackElement_(r[t])}var i=e.prototype;return i.addTrackElement_=function(r){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),this.trackElements_.indexOf(r)===-1&&this.trackElements_.push(r)},i.getTrackElementByTrack_=function(r){for(var t,n=0,a=this.trackElements_.length;n<a;n++)if(r===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},i.removeTrackElement_=function(r){for(var t=0,n=this.trackElements_.length;t<n;t++)if(r===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}},e}(),hc=function(){function e(r){e.prototype.setCues_.call(this,r),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var i=e.prototype;return i.setCues_=function(r){var t=this.length||0,n=0,a=r.length;this.cues_=r,this.length_=r.length;var s=function(o){""+o in this||Object.defineProperty(this,""+o,{get:function(){return this.cues_[o]}})};if(t<a)for(n=t;n<a;n++)s.call(this,n)},i.getCueById=function(r){for(var t=null,n=0,a=this.length;n<a;n++){var s=this[n];if(s.id===r){t=s;break}}return t},e}(),hm={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},pm={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},fm={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},pc={disabled:"disabled",hidden:"hidden",showing:"showing"},Es=function(e){function i(r){var t;r===void 0&&(r={}),t=e.call(this)||this;var n={id:r.id||"vjs_track_"+je(),kind:r.kind||"",language:r.language||""},a=r.label||"",s=function(u){Object.defineProperty(tt(t),u,{get:function(){return n[u]},set:function(){}})};for(var o in n)s(o);return Object.defineProperty(tt(t),"label",{get:function(){return a},set:function(u){u!==a&&(a=u,this.trigger("labelchange"))}}),t}return V(i,e),i}(Lt),ws=function(e){var i=["protocol","hostname","port","pathname","search","hash","host"],r=H.createElement("a");r.href=e;for(var t={},n=0;n<i.length;n++)t[i[n]]=r[i[n]];return t.protocol==="http:"&&(t.host=t.host.replace(/:80$/,"")),t.protocol==="https:"&&(t.host=t.host.replace(/:443$/,"")),t.protocol||(t.protocol=D.location.protocol),t.host||(t.host=D.location.host),t},fc=function(e){if(!e.match(/^https?:\/\//)){var i=H.createElement("a");i.href=e,e=i.href}return e},ks=function(e){if(typeof e=="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(i)return i.pop().toLowerCase()}return""},Dr=function(e,i){i===void 0&&(i=D.location);var r=ws(e);return(r.protocol===":"?i.protocol:r.protocol)+r.host!==i.protocol+i.host},mm=Object.freeze({__proto__:null,parseUrl:ws,getAbsoluteURL:fc,getFileExtension:ks,isCrossOrigin:Dr}),mc=function(e,i){var r=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),t=[];r.oncue=function(n){i.addCue(n)},r.onparsingerror=function(n){t.push(n)},r.onflush=function(){i.trigger({type:"loadeddata",target:i})},r.parse(e),t.length>0&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed("Text Track parsing errors for "+i.src),t.forEach(function(n){return it.error(n)}),D.console&&D.console.groupEnd&&D.console.groupEnd()),r.flush()},gc=function(e,i){var r={uri:e},t=Dr(e);t&&(r.cors=t);var n=i.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),Zo(r,yt(this,function(a,s,o){if(a)return it.error(a,s);i.loaded_=!0,typeof D.WebVTT!="function"?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type!=="vttjserror")return mc(o,i);it.error("vttjs failed to load, stopping trying to process "+i.src)}):mc(o,i)}))},Ai=function(e){function i(t){var n;if(t===void 0&&(t={}),!t.tech)throw new Error("A tech was not provided.");var a=_t(t,{kind:fm[t.kind]||"subtitles",language:t.language||t.srclang||""}),s=pc[a.mode]||"disabled",o=a.default;a.kind!=="metadata"&&a.kind!=="chapters"||(s="hidden"),(n=e.call(this,a)||this).tech_=a.tech,n.cues_=[],n.activeCues_=[],n.preload_=n.tech_.preloadTextTracks!==!1;var u=new hc(n.cues_),c=new hc(n.activeCues_),d=!1;return n.timeupdateHandler=yt(tt(n),function(m){m===void 0&&(m={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),n.tech_.one("dispose",function(){n.stopTracking()}),s!=="disabled"&&n.startTracking(),Object.defineProperties(tt(n),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(m){pc[m]&&s!==m&&(s=m,this.preload_||s==="disabled"||this.cues.length!==0||gc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return c;for(var m=this.tech_.currentTime(),f=[],_=0,b=this.cues.length;_<b;_++){var y=this.cues[_];(y.startTime<=m&&y.endTime>=m||y.startTime===y.endTime&&y.startTime<=m&&y.startTime+.5>=m)&&f.push(y)}if(d=!1,f.length!==this.activeCues_.length)d=!0;else for(var E=0;E<f.length;E++)this.activeCues_.indexOf(f[E])===-1&&(d=!0);return this.activeCues_=f,c.setCues_(this.activeCues_),c},set:function(){}}}),a.src?(n.src=a.src,n.preload_||(n.loaded_=!0),(n.preload_||a.kind!=="subtitles"&&a.kind!=="captions")&&gc(n.src,tt(n))):n.loaded_=!0,n}V(i,e);var r=i.prototype;return r.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},r.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},r.addCue=function(t){var n=t;if(n.constructor&&n.constructor.name!=="VTTCue"){for(var a in n=new D.vttjs.VTTCue(t.startTime,t.endTime,t.text),t)a in n||(n[a]=t[a]);n.id=t.id,n.originalCue_=t}for(var s=this.tech_.textTracks(),o=0;o<s.length;o++)s[o]!==this&&s[o].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},r.removeCue=function(t){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===t||a.originalCue_&&a.originalCue_===t){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},i}(Es);Ai.prototype.allowedEvents_={cuechange:"cuechange"};var vc=function(e){function i(r){var t;r===void 0&&(r={});var n=_t(r,{kind:pm[r.kind]||""});t=e.call(this,n)||this;var a=!1;return Object.defineProperty(tt(t),"enabled",{get:function(){return a},set:function(s){typeof s=="boolean"&&s!==a&&(a=s,this.trigger("enabledchange"))}}),n.enabled&&(t.enabled=n.enabled),t.loaded_=!0,t}return V(i,e),i}(Es),yc=function(e){function i(r){var t;r===void 0&&(r={});var n=_t(r,{kind:hm[r.kind]||""});t=e.call(this,n)||this;var a=!1;return Object.defineProperty(tt(t),"selected",{get:function(){return a},set:function(s){typeof s=="boolean"&&s!==a&&(a=s,this.trigger("selectedchange"))}}),n.selected&&(t.selected=n.selected),t}return V(i,e),i}(Es),Hn=function(e){function i(r){var t,n;r===void 0&&(r={}),t=e.call(this)||this;var a=new Ai(r);return t.kind=a.kind,t.src=a.src,t.srclang=a.language,t.label=a.label,t.default=a.default,Object.defineProperties(tt(t),{readyState:{get:function(){return n}},track:{get:function(){return a}}}),n=0,a.addEventListener("loadeddata",function(){n=2,t.trigger({type:"load",target:tt(t)})}),t}return V(i,e),i}(Lt);Hn.prototype.allowedEvents_={load:"load"},Hn.NONE=0,Hn.LOADING=1,Hn.LOADED=2,Hn.ERROR=3;var ue={audio:{ListClass:lm,TrackClass:vc,capitalName:"Audio"},video:{ListClass:cm,TrackClass:yc,capitalName:"Video"},text:{ListClass:dc,TrackClass:Ai,capitalName:"Text"}};Object.keys(ue).forEach(function(e){ue[e].getterName=e+"Tracks",ue[e].privateName=e+"Tracks_"});var Vn={remoteText:{ListClass:dc,TrackClass:Ai,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:dm,TrackClass:Hn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Xt=he({},ue,Vn);Vn.names=Object.keys(Vn),ue.names=Object.keys(ue),Xt.names=[].concat(Vn.names).concat(ue.names);var mt=function(e){function i(t,n){var a;return t===void 0&&(t={}),n===void 0&&(n=function(){}),t.reportTouchActivity=!1,(a=e.call(this,null,t,n)||this).onDurationChange_=function(s){return a.onDurationChange(s)},a.trackProgress_=function(s){return a.trackProgress(s)},a.trackCurrentTime_=function(s){return a.trackCurrentTime(s)},a.stopTrackingCurrentTime_=function(s){return a.stopTrackingCurrentTime(s)},a.disposeSourceHandler_=function(s){return a.disposeSourceHandler(s)},a.queuedHanders_=new Set,a.hasStarted_=!1,a.on("playing",function(){this.hasStarted_=!0}),a.on("loadstart",function(){this.hasStarted_=!1}),Xt.names.forEach(function(s){var o=Xt[s];t&&t[o.getterName]&&(a[o.privateName]=t[o.getterName])}),a.featuresProgressEvents||a.manualProgressOn(),a.featuresTimeupdateEvents||a.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){t["native"+s+"Tracks"]===!1&&(a["featuresNative"+s+"Tracks"]=!1)}),t.nativeCaptions===!1||t.nativeTextTracks===!1?a.featuresNativeTextTracks=!1:t.nativeCaptions!==!0&&t.nativeTextTracks!==!0||(a.featuresNativeTextTracks=!0),a.featuresNativeTextTracks||a.emulateTextTracks(),a.preloadTextTracks=t.preloadTextTracks!==!1,a.autoRemoteTextTracks_=new Xt.text.ListClass,a.initTrackListeners(),t.nativeControlsForTouch||a.emitTapEvents(),a.constructor&&(a.name_=a.constructor.name||"Unknown Tech"),a}V(i,e);var r=i.prototype;return r.triggerSourceset=function(t){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},r.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},r.trackProgress=function(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(yt(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},r.onDurationChange=function(t){this.duration_=this.duration()},r.buffered=function(){return ln(0,0)},r.bufferedPercent=function(){return lc(this.buffered(),this.duration_)},r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},r.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.dispose=function(){this.clearTracks(ue.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},r.clearTracks=function(t){var n=this;(t=[].concat(t)).forEach(function(a){for(var s=n[a+"Tracks"]()||[],o=s.length;o--;){var u=s[o];a==="text"&&n.removeRemoteTextTrack(u),s.removeTrack(u)}})},r.cleanupAutoTextTracks=function(){for(var t=this.autoRemoteTextTracks_||[],n=t.length;n--;){var a=t[n];this.removeRemoteTextTrack(a)}},r.reset=function(){},r.crossOrigin=function(){},r.setCrossOrigin=function(){},r.error=function(t){return t!==void 0&&(this.error_=new zt(t),this.trigger("error")),this.error_},r.played=function(){return this.hasStarted_?ln(0,0):ln()},r.play=function(){},r.setScrubbing=function(){},r.scrubbing=function(){},r.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.initTrackListeners=function(){var t=this;ue.names.forEach(function(n){var a=ue[n],s=function(){t.trigger(n+"trackchange")},o=t[a.getterName]();o.addEventListener("removetrack",s),o.addEventListener("addtrack",s),t.on("dispose",function(){o.removeEventListener("removetrack",s),o.removeEventListener("addtrack",s)})})},r.addWebVttScript_=function(){var t=this;if(!D.WebVTT)if(H.body.contains(this.el())){if(!this.options_["vtt.js"]&&Ti(ou)&&Object.keys(ou).length>0)return void this.trigger("vttjsloaded");var n=H.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){t.trigger("vttjsloaded")},n.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),D.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var t=this,n=this.textTracks(),a=this.remoteTextTracks(),s=function(d){return n.addTrack(d.track)},o=function(d){return n.removeTrack(d.track)};a.on("addtrack",s),a.on("removetrack",o),this.addWebVttScript_();var u=function(){return t.trigger("texttrackchange")},c=function(){u();for(var d=0;d<n.length;d++){var m=n[d];m.removeEventListener("cuechange",u),m.mode==="showing"&&m.addEventListener("cuechange",u)}};c(),n.addEventListener("change",c),n.addEventListener("addtrack",c),n.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",s),a.off("removetrack",o),n.removeEventListener("change",c),n.removeEventListener("addtrack",c),n.removeEventListener("removetrack",c);for(var d=0;d<n.length;d++)n[d].removeEventListener("cuechange",u)})},r.addTextTrack=function(t,n,a){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(s,o,u,c,d){d===void 0&&(d={});var m=s.textTracks();d.kind=o,u&&(d.label=u),c&&(d.language=c),d.tech=s;var f=new Xt.text.TrackClass(d);return m.addTrack(f),f}(this,t,n,a)},r.createRemoteTextTrack=function(t){var n=_t(t,{tech:this});return new Vn.remoteTextEl.TrackClass(n)},r.addRemoteTextTrack=function(t,n){var a=this;t===void 0&&(t={});var s=this.createRemoteTextTrack(t);return n!==!0&&n!==!1&&(it.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(s.track)}),s},r.removeRemoteTextTrack=function(t){var n=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(t),this.autoRemoteTextTracks_.removeTrack(t)},r.getVideoPlaybackQuality=function(){return{}},r.requestPictureInPicture=function(){var t=this.options_.Promise||D.Promise;if(t)return t.reject()},r.disablePictureInPicture=function(){return!0},r.setDisablePictureInPicture=function(){},r.requestVideoFrameCallback=function(t){var n=this,a=je();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),t())})):this.requestNamedAnimationFrame(a,t),a},r.cancelVideoFrameCallback=function(t){this.queuedHanders_.has(t)?this.queuedHanders_.delete(t):this.cancelNamedAnimationFrame(t)},r.setPoster=function(){},r.playsinline=function(){},r.setPlaysinline=function(){},r.overrideNativeAudioTracks=function(){},r.overrideNativeVideoTracks=function(){},r.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(t,n){return i.canPlayType(t.type)},i.isTech=function(t){return t.prototype instanceof i||t instanceof i||t===i},i.registerTech=function(t,n){if(i.techs_||(i.techs_={}),!i.isTech(n))throw new Error("Tech "+t+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=kt(t),i.techs_[t]=n,i.techs_[xr(t)]=n,t!=="Tech"&&i.defaultTechOrder_.push(t),n},i.getTech=function(t){if(t)return i.techs_&&i.techs_[t]?i.techs_[t]:(t=kt(t),D&&D.videojs&&D.videojs[t]?(it.warn("The "+t+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),D.videojs[t]):void 0)},i}(F);Xt.names.forEach(function(e){var i=Xt[e];mt.prototype[i.getterName]=function(){return this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName]}}),mt.prototype.featuresVolumeControl=!0,mt.prototype.featuresMuteControl=!0,mt.prototype.featuresFullscreenResize=!1,mt.prototype.featuresPlaybackRate=!1,mt.prototype.featuresProgressEvents=!1,mt.prototype.featuresSourceset=!1,mt.prototype.featuresTimeupdateEvents=!1,mt.prototype.featuresNativeTextTracks=!1,mt.prototype.featuresVideoFrameCallback=!1,mt.withSourceHandlers=function(e){e.registerSourceHandler=function(i,r){var t=e.sourceHandlers;t||(t=e.sourceHandlers=[]),r===void 0&&(r=t.length),t.splice(r,0,i)},e.canPlayType=function(i){for(var r,t=e.sourceHandlers||[],n=0;n<t.length;n++)if(r=t[n].canPlayType(i))return r;return""},e.selectSourceHandler=function(i,r){for(var t=e.sourceHandlers||[],n=0;n<t.length;n++)if(t[n].canHandleSource(i,r))return t[n];return null},e.canPlaySource=function(i,r){var t=e.selectSourceHandler(i,r);return t?t.canHandleSource(i,r):""},["seekable","seeking","duration"].forEach(function(i){var r=this[i];typeof r=="function"&&(this[i]=function(){return this.sourceHandler_&&this.sourceHandler_[i]?this.sourceHandler_[i].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(i){var r=e.selectSourceHandler(i,this.options_);r||(e.nativeSourceHandler?r=e.nativeSourceHandler:it.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==e.nativeSourceHandler&&(this.currentSource_=i),this.sourceHandler_=r.handleSource(i,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},F.registerComponent("Tech",mt),mt.registerTech("Tech",mt),mt.defaultTechOrder_=[];var cn={},Cs={},Ir={};function gm(e,i,r){e.setTimeout(function(){return dn(i,cn[i.type],r,e)},1)}function _c(e,i,r,t){t===void 0&&(t=null);var n="call"+kt(r),a=e.reduce(xs(n),t),s=a===Ir,o=s?null:i[r](a);return function(u,c,d,m){for(var f=u.length-1;f>=0;f--){var _=u[f];_[c]&&_[c](m,d)}}(e,r,o,s),o}var vm={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ym={setCurrentTime:1,setMuted:1,setVolume:1},bc={play:1,pause:1};function xs(e){return function(i,r){return i===Ir?Ir:r[e]?r[e](i):i}}function dn(e,i,r,t,n,a){e===void 0&&(e={}),i===void 0&&(i=[]),n===void 0&&(n=[]),a===void 0&&(a=!1);var s=i,o=s[0],u=s.slice(1);if(typeof o=="string")dn(e,cn[o],r,t,n,a);else if(o){var c=function(d,m){var f=Cs[d.id()],_=null;if(f==null)return _=m(d),Cs[d.id()]=[[m,_]],_;for(var b=0;b<f.length;b++){var y=f[b],E=y[0],w=y[1];E===m&&(_=w)}return _===null&&(_=m(d),f.push([m,_])),_}(t,o);if(!c.setSource)return n.push(c),dn(e,u,r,t,n,a);c.setSource(wt({},e),function(d,m){if(d)return dn(e,u,r,t,n,a);n.push(c),dn(m,e.type===m.type?u:cn[m.type],r,t,n,a)})}else u.length?dn(e,u,r,t,n,a):a?r(e,n):dn(e,cn["*"],r,t,n,!0)}var _m={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"},Ar=function(e){e===void 0&&(e="");var i=ks(e);return _m[i.toLowerCase()]||""},bm=function e(i){if(Array.isArray(i)){var r=[];i.forEach(function(t){t=e(t),Array.isArray(t)?r=r.concat(t):Ne(t)&&r.push(t)}),i=r}else i=typeof i=="string"&&i.trim()?[Tc({src:i})]:Ne(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?[Tc(i)]:[];return i};function Tc(e){if(!e.type){var i=Ar(e.src);i&&(e.type=i)}return e}var Tm=function(e){function i(r,t,n){var a,s=_t({createEl:!1},t);if(a=e.call(this,r,s,n)||this,t.playerOptions.sources&&t.playerOptions.sources.length!==0)r.src(t.playerOptions.sources);else for(var o=0,u=t.playerOptions.techOrder;o<u.length;o++){var c=kt(u[o]),d=mt.getTech(c);if(c||(d=F.getComponent(c)),d&&d.isSupported()){r.loadTech_(c);break}}return a}return V(i,e),i}(F);F.registerComponent("MediaLoader",Tm);var Pr=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).options_.controlText&&a.controlText(a.options_.controlText),a.handleMouseOver_=function(s){return a.handleMouseOver(s)},a.handleMouseOut_=function(s){return a.handleMouseOut(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.emitTapEvents(),a.enable(),a}V(i,e);var r=i.prototype;return r.createEl=function(t,n,a){t===void 0&&(t="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=wt({className:this.buildCSSClass(),tabIndex:0},n),t==="button"&&it.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),a=wt({role:"button"},a),this.tabIndex_=n.tabIndex;var s=ot(t,n,a);return s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s},r.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},r.createControlTextEl=function(t){return this.controlTextEl_=ot("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_},r.controlText=function(t,n){if(n===void 0&&(n=this.el()),t===void 0)return this.controlText_||"Need Text";var a=this.localize(t);this.controlText_=t,sn(this.controlTextEl_,a),this.nonIconControl||this.player_.options_.noUITitleAttributes||n.setAttribute("title",a)},r.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},r.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),this.tabIndex_!==void 0&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},r.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),this.tabIndex_!==void 0&&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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(t){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(t){et.isEventKey(t,"Space")||et.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},i}(F);F.registerComponent("ClickableComponent",Pr);var Sm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update(),a.update_=function(s){return a.update(s)},t.on("posterchange",a.update_),a}V(i,e);var r=i.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},r.createEl=function(){return ot("div",{className:"vjs-poster",tabIndex:-1})},r.update=function(t){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},r.setSrc=function(t){var n="";t&&(n='url("'+t+'")'),this.el_.style.backgroundImage=n},r.handleClick=function(t){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(wi||Ei)&&n||this.player_.tech(!0).focus(),this.player_.paused()?Ee(this.player_.play()):this.player_.pause()}},i}(Pr);F.registerComponent("PosterImage",Sm);var Lr="#222",Em={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ds(e,i){var r;if(e.length===4)r=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(e.length!==7)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");r=e.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+i+")"}function Is(e,i,r){try{e.style[i]=r}catch{return}}var wm=function(e){function i(t,n,a){var s;s=e.call(this,t,n,a)||this;var o=function(u){return s.updateDisplay(u)};return t.on("loadstart",function(u){return s.toggleDisplay(u)}),t.on("texttrackchange",o),t.on("loadedmetadata",function(u){return s.preselectTrack(u)}),t.ready(yt(tt(s),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",o),t.on("playerresize",o),D.addEventListener("orientationchange",o),t.on("dispose",function(){return D.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],c=0;c<u.length;c++)this.player_.addRemoteTextTrack(u[c],!0);this.preselectTrack()}})),s}V(i,e);var r=i.prototype;return r.preselectTrack=function(){for(var t,n,a,s={captions:1,subtitles:1},o=this.player_.textTracks(),u=this.player_.cache_.selectedLanguage,c=0;c<o.length;c++){var d=o[c];u&&u.enabled&&u.language&&u.language===d.language&&d.kind in s?d.kind===u.kind?a=d:a||(a=d):u&&!u.enabled?(a=null,t=null,n=null):d.default&&(d.kind!=="descriptions"||t?d.kind in s&&!n&&(n=d):t=d)}a?a.mode="showing":n?n.mode="showing":t&&(t.mode="showing")},r.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},r.clearDisplay=function(){typeof D.WebVTT=="function"&&D.WebVTT.processCues(D,[],this.el_)},r.updateDisplay=function(){var t=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],s=0;s<t.length;++s){var o=t[s];o.mode==="showing"&&a.push(o)}this.updateForTrack(a)}else{for(var u=null,c=null,d=t.length;d--;){var m=t[d];m.mode==="showing"&&(m.kind==="descriptions"?u=m:c=m)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))}},r.updateDisplayState=function(t){for(var n=this.player_.textTrackSettings.getValues(),a=t.activeCues,s=a.length;s--;){var o=a[s];if(o){var u=o.displayState;if(n.color&&(u.firstChild.style.color=n.color),n.textOpacity&&Is(u.firstChild,"color",Ds(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Is(u.firstChild,"backgroundColor",Ds(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Is(u,"backgroundColor",Ds(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Lr:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Lr:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Lr:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Lr)),n.fontPercent&&n.fontPercent!==1){var c=D.parseFloat(u.style.fontSize);u.style.fontSize=c*n.fontPercent+"px",u.style.height="auto",u.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=Em[n.fontFamily])}}},r.updateForTrack=function(t){if(Array.isArray(t)||(t=[t]),typeof D.WebVTT=="function"&&!t.every(function(f){return!f.activeCues})){for(var n=[],a=0;a<t.length;++a)for(var s=t[a],o=0;o<s.activeCues.length;++o)n.push(s.activeCues[o]);D.WebVTT.processCues(D,n,this.el_);for(var u=0;u<t.length;++u){for(var c=t[u],d=0;d<c.activeCues.length;++d){var m=c.activeCues[d].displayState;Be(m,"vjs-text-track-cue"),Be(m,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&Mn(m,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},i}(F);F.registerComponent("TextTrackDisplay",wm);var km=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){var r=this.player_.isAudio(),t=this.localize(r?"Audio Player":"Video Player"),n=ot("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),a=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return a.appendChild(n),a},i}(F);F.registerComponent("LoadingSpinner",km);var ge=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.createEl=function(t,n,a){n===void 0&&(n={}),a===void 0&&(a={});var s=ot("button",n=wt({className:this.buildCSSClass()},n),a=wt({type:"button"},a));return s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s},r.addChild=function(t,n){n===void 0&&(n={});var a=this.constructor.name;return it.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),F.prototype.addChild.call(this,t,n)},r.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(t){et.isEventKey(t,"Space")||et.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},i}(Pr);F.registerComponent("Button",ge);var Sc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).mouseused_=!1,a.on("mousedown",function(s){return a.handleMouseDown(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(t){var n=this.player_.play();if(this.mouseused_&&t.clientX&&t.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Ee(n),void(!this.player_.tech(!0)||(wi||Ei)&&a||this.player_.tech(!0).focus())}var s=this.player_.getChild("controlBar"),o=s&&s.getChild("playToggle");if(o){var u=function(){return o.focus()};Ii(n)?n.then(u,function(){}):this.setTimeout(u,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},r.handleMouseDown=function(t){this.mouseused_=!0},i}(ge);Sc.prototype.controlText_="Play Video",F.registerComponent("BigPlayButton",Sc);var Cm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).controlText(n&&n.controlText||a.localize("Close")),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(t){et.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},i}(ge);F.registerComponent("CloseButton",Cm);var Ec=function(e){function i(t,n){var a;return n===void 0&&(n={}),a=e.call(this,t,n)||this,n.replay=n.replay===void 0||n.replay,a.on(t,"play",function(s){return a.handlePlay(s)}),a.on(t,"pause",function(s){return a.handlePause(s)}),n.replay&&a.on(t,"ended",function(s){return a.handleEnded(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){this.player_.paused()?Ee(this.player_.play()):this.player_.pause()},r.handleSeeked=function(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):this.handlePlay(t)},r.handlePlay=function(t){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(t){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(t){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},i}(ge);Ec.prototype.controlText_="Play",F.registerComponent("PlayToggle",Ec);var wc=function(e,i){e=e<0?0:e;var r=Math.floor(e%60),t=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(i/60%60),s=Math.floor(i/3600);return(isNaN(e)||e===1/0)&&(n=t=r="-"),(n=n>0||s>0?n+":":"")+(t=((n||a>=10)&&t<10?"0"+t:t)+":")+(r=r<10?"0"+r:r)},As=wc;function Wn(e,i){return i===void 0&&(i=e),As(e,i)}var Gn=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,["timeupdate","ended"],function(s){return a.updateContent(s)}),a.updateTextNode_(),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),a=ot("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xA0"},{role:"presentation"});return n.appendChild(a),this.contentEl_=ot("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},r.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},r.updateTextNode_=function(t){var n=this;t===void 0&&(t=0),t=Wn(t),this.formattedTime_!==t&&(this.formattedTime_=t,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,it.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=H.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},r.updateContent=function(t){},i}(F);Gn.prototype.labelText_="Time",Gn.prototype.controlText_="Time",F.registerComponent("TimeDisplay",Gn);var Ps=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(t){var n;n=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},i}(Gn);Ps.prototype.labelText_="Current Time",Ps.prototype.controlText_="Current Time",F.registerComponent("CurrentTimeDisplay",Ps);var Ls=function(e){function i(t,n){var a,s=function(o){return a.updateContent(o)};return(a=e.call(this,t,n)||this).on(t,"durationchange",s),a.on(t,"loadstart",s),a.on(t,"loadedmetadata",s),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(t){var n=this.player_.duration();this.updateTextNode_(n)},i}(Gn);Ls.prototype.labelText_="Duration",Ls.prototype.controlText_="Duration",F.registerComponent("DurationDisplay",Ls);var xm=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){var r=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return t.appendChild(n),r.appendChild(t),r},i}(F);F.registerComponent("TimeDivider",xm);var Os=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"durationchange",function(s){return a.updateContent(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var t=e.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&t.insertBefore(ot("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},r.updateContent=function(t){var n;typeof this.player_.duration()=="number"&&(n=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(n))},i}(Gn);Os.prototype.labelText_="Remaining Time",Os.prototype.controlText_="Remaining Time",F.registerComponent("RemainingTimeDisplay",Os);var Dm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).updateShowing(),a.on(a.player(),"durationchange",function(s){return a.updateShowing(s)}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ot("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ot("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xA0"})),this.contentEl_.appendChild(H.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},r.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},r.updateShowing=function(t){this.player().duration()===1/0?this.show():this.hide()},i}(F);F.registerComponent("LiveDisplay",Dm);var kc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).updateLiveEdgeStatus(),a.player_.liveTracker&&(a.updateLiveEdgeStatusHandler_=function(s){return a.updateLiveEdgeStatus(s)},a.on(a.player_.liveTracker,"liveedgechange",a.updateLiveEdgeStatusHandler_)),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ot("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},i}(ge);kc.prototype.controlText_="Seek to live, currently playing live",F.registerComponent("SeekToLive",kc);var Or=function(e,i,r){return e=Number(e),Math.min(r,Math.max(i,isNaN(e)?i:e))},Rs=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).handleMouseDown_=function(s){return a.handleMouseDown(s)},a.handleMouseUp_=function(s){return a.handleMouseUp(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleMouseMove_=function(s){return a.handleMouseMove(s)},a.update_=function(s){return a.update(s)},a.bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}V(i,e);var r=i.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var t=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(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(t,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=wt({tabIndex:0},n),a=wt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),e.prototype.createEl.call(this,t,n,a)},r.handleMouseDown=function(t){var n=this.bar.el_.ownerDocument;t.type==="mousedown"&&t.preventDefault(),t.type!=="touchstart"||Ue||t.preventDefault(),zl(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(t,!0)},r.handleMouseMove=function(t){},r.handleMouseUp=function(){var t=this.bar.el_.ownerDocument;Xl(),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()},r.update=function(){var t=this;if(this.el_&&this.bar){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=t.vertical()?"height":"width";t.bar.el().style[a]=(100*n).toFixed(2)+"%"})),n}},r.getProgress=function(){return Number(Or(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(t){var n=Tr(this.el_,t);return this.vertical()?n.y:n.x},r.handleKeyDown=function(t){et.isEventKey(t,"Left")||et.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):et.isEventKey(t,"Right")||et.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},r.handleClick=function(t){t.stopPropagation(),t.preventDefault()},r.vertical=function(t){if(t===void 0)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},i}(F);F.registerComponent("Slider",Rs);var Ns=function(e,i){return Or(e/i*100,0,100).toFixed(2)+"%"},Im=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).partEls_=[],a.on(t,"progress",function(s){return a.update(s)}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=ot("span",{className:"vjs-control-text"}),a=ot("span",{textContent:this.localize("Loaded")}),s=H.createTextNode(": ");return this.percentageEl_=ot("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(a),n.appendChild(s),n.appendChild(this.percentageEl_),t},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},r.update=function(t){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,s=n.player_.buffered(),o=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,d=Ns(u,o);n.percent_!==d&&(n.el_.style.width=d,sn(n.percentageEl_,d),n.percent_=d);for(var m=0;m<s.length;m++){var f=s.start(m),_=s.end(m),b=c[m];b||(b=n.el_.appendChild(ot()),c[m]=b),b.dataset.start===f&&b.dataset.end===_||(b.dataset.start=f,b.dataset.end=_,b.style.left=Ns(f,u),b.style.width=Ns(_-f,u))}for(var y=c.length;y>s.length;y--)n.el_.removeChild(c[y-1]);c.length=s.length})},i}(F);F.registerComponent("LoadProgressBar",Im);var Am=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(t,n,a){var s=Ci(this.el_),o=Un(this.player_.el()),u=t.width*n;if(o&&s){var c=t.left-o.left+u,d=t.width-u+(o.right-t.right),m=s.width/2;c<m?m+=m-c:d<m&&(m=d),m<0?m=0:m>s.width&&(m=s.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(a)}},r.write=function(t){sn(this.el_,t)},r.updateTime=function(t,n,a,s){var o=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=o.player_.duration();if(o.player_.liveTracker&&o.player_.liveTracker.isLive()){var d=o.player_.liveTracker.liveWindow(),m=d-n*d;u=(m<1?"":"-")+Wn(m,d)}else u=Wn(a,c);o.update(t,n,u),s&&s()})},i}(F);F.registerComponent("TimeTooltip",Am);var Ms=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(t,n){var a=this.getChild("timeTooltip");if(a){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(t,n,s)}},i}(F);Ms.prototype.options_={children:[]},Wt||Me||Ms.prototype.options_.children.push("timeTooltip"),F.registerComponent("PlayProgressBar",Ms);var Cc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,n){var a=this,s=n*this.player_.duration();this.getChild("timeTooltip").updateTime(t,n,s,function(){a.el_.style.left=t.width*n+"px"})},i}(F);Cc.prototype.options_={children:["timeTooltip"]},F.registerComponent("MouseTimeDisplay",Cc);var Us=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).setEventHandlers_(),a}V(i,e);var r=i.prototype;return r.setEventHandlers_=function(){var t=this;this.update_=yt(this,this.update),this.update=qe(this.update_,me),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return t.enableInterval_(n)},this.disableIntervalHandler_=function(n){return t.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in H&&"visibilityState"in H&&this.on(H,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(t){H.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(t)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,me))},r.disableInterval_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&t.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(t){var n=this;if(H.visibilityState!=="hidden"){var a=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var s=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),o=n.player_.liveTracker,u=n.player_.duration();o&&o.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),n.percent_=a),n.currentTime_===s&&n.duration_===u||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Wn(s,u),Wn(u,u)],"{1} of {2}")),n.currentTime_=s,n.duration_=u),n.bar&&n.bar.update(Un(n.el()),n.getProgress())}),a}},r.userSeek_=function(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(t)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var t,n=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(t=(n-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(t=1)):t=n/this.player_.duration(),t},r.handleMouseDown=function(t){xi(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},r.handleMouseMove=function(t,n){if(n===void 0&&(n=!1),xi(t)){var a;n||this.player_.scrubbing()||this.player_.scrubbing(!0);var s=this.calculateDistance(t),o=this.player_.liveTracker;if(o&&o.isLive()){if(s>=.99)return void o.seekToLiveEdge();var u=o.seekableStart(),c=o.liveCurrentTime();if((a=u+s*o.liveWindow())>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}else(a=s*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userSeek_(a)}},r.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},r.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},r.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Ee(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},r.handleAction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(t){var n=this.player_.liveTracker;if(et.isEventKey(t,"Space")||et.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(et.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(et.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(et(t))){t.preventDefault(),t.stopPropagation();var a=10*(et.codes[et(t)]-et.codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else et.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):et.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in H&&"visibilityState"in H&&this.off(H,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},i}(Rs);Us.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Wt||Me||Us.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),F.registerComponent("SeekBar",Us);var xc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).handleMouseMove=qe(yt(tt(a),a.handleMouseMove),me),a.throttledHandleMouseSeek=qe(yt(tt(a),a.handleMouseSeek),me),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.handleMouseDownHandler_=function(s){return a.handleMouseDown(s)},a.enable(),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(t){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),s=n.getChild("mouseTimeDisplay");if(a||s){var o=n.el(),u=Ci(o),c=Tr(o,t).x;c=Or(c,0,1),s&&s.update(u,c),a&&a.update(u,n.getProgress())}}},r.handleMouseSeek=function(t){var n=this.getChild("seekBar");n&&n.handleMouseMove(t)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var t=this.getChild("seekBar");this.player_.scrubbing(!1),t.videoWasPlaying&&Ee(this.player_.play())}},r.enable=function(){this.children().forEach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(t){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(t),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var n=this.getChild("seekBar");n&&n.handleMouseUp(t),this.removeListenersAddedOnMousedownAndTouchstart()},i}(F);xc.prototype.options_={children:["seekBar"]},F.registerComponent("ProgressControl",xc);var Dc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(s){return a.handlePictureInPictureChange(s)}),a.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(s){return a.handlePictureInPictureEnabledChange(s)}),a.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){t.currentType().substring(0,5)==="audio"||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),a.hide()):a.show()}),a.disable(),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){H.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(t){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(t){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(ge);Dc.prototype.controlText_="Picture-in-Picture",F.registerComponent("PictureInPictureToggle",Dc);var Ic=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"fullscreenchange",function(s){return a.handleFullscreenChange(s)}),H[t.fsApi_.fullscreenEnabled]===!1&&a.disable(),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(t){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(ge);Ic.prototype.controlText_="Fullscreen",F.registerComponent("FullscreenToggle",Ic);var Pm=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){var r=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},i}(F);F.registerComponent("VolumeLevel",Pm);var Lm=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(t,n,a,s){if(!a){var o=Un(this.el_),u=Un(this.player_.el()),c=t.width*n;if(!u||!o)return;var d=t.left-u.left+c,m=t.width-c+(u.right-t.right),f=o.width/2;d<f?f+=f-d:m<f&&(f=m),f<0?f=0:f>o.width&&(f=o.width),this.el_.style.right="-"+f+"px"}this.write(s+"%")},r.write=function(t){sn(this.el_,t)},r.updateVolume=function(t,n,a,s,o){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(t,n,a,s.toFixed(0)),o&&o()})},i}(F);F.registerComponent("VolumeLevelTooltip",Lm);var Ac=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).update=qe(yt(tt(a),a.update),me),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(t,n,a){var s=this,o=100*n;this.getChild("volumeLevelTooltip").updateVolume(t,n,a,o,function(){a?s.el_.style.bottom=t.height*n+"px":s.el_.style.left=t.width*n+"px"})},i}(F);Ac.prototype.options_={children:["volumeLevelTooltip"]},F.registerComponent("MouseVolumeLevelDisplay",Ac);var Rr=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on("slideractive",function(s){return a.updateLastVolume_(s)}),a.on(t,"volumechange",function(s){return a.updateARIAAttributes(s)}),t.ready(function(){return a.updateARIAAttributes()}),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(t){xi(t)&&e.prototype.handleMouseDown.call(this,t)},r.handleMouseMove=function(t){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),s=Un(a),o=this.vertical(),u=Tr(a,t);u=o?u.y:u.x,u=Or(u,0,1),n.update(s,u,o)}xi(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(t){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var t=this,n=this.player_.volume();this.one("sliderinactive",function(){t.player_.volume()===0&&t.player_.lastVolume_(n)})},i}(Rs);Rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Wt||Me||Rr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Rr.prototype.playerEvent="volumechange",F.registerComponent("VolumeBar",Rr);var Pc=function(e){function i(t,n){var a;return n===void 0&&(n={}),n.vertical=n.vertical||!1,(n.volumeBar===void 0||Ti(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),function(s,o){o.tech_&&!o.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(tt(a=e.call(this,t,n)||this),t),a.throttledHandleMouseMove=qe(yt(tt(a),a.handleMouseMove),me),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.on("mousedown",function(s){return a.handleMouseDown(s)}),a.on("touchstart",function(s){return a.handleMouseDown(s)}),a.on("mousemove",function(s){return a.handleMouseMove(s)}),a.on(a.volumeBar,["focus","slideractive"],function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")}),a.on(a.volumeBar,["blur","sliderinactive"],function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},r.handleMouseDown=function(t){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(t){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(t){this.volumeBar.handleMouseMove(t)},i}(F);Pc.prototype.options_={children:["volumeBar"]},F.registerComponent("VolumeControl",Pc);var Lc=function(e){function i(t,n){var a;return function(s,o){o.tech_&&!o.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(o,"loadstart",function(){o.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})}(tt(a=e.call(this,t,n)||this),t),a.on(t,["loadstart","volumechange"],function(s){return a.update(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},r.handleClick=function(t){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var s=a<.1?.1:a;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(t){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var t=this.player_.volume(),n=3;Wt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),t===0||this.player_.muted()?n=0:t<.33?n=1:t<.67&&(n=2);for(var a=0;a<4;a++)ki(this.el_,"vjs-vol-"+a);Be(this.el_,"vjs-vol-"+n)},r.updateControlText_=function(){var t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},i}(ge);Lc.prototype.controlText_="Mute",F.registerComponent("MuteToggle",Lc);var Oc=function(e){function i(t,n){var a;return n===void 0&&(n={}),n.inline!==void 0?n.inline=n.inline:n.inline=!0,(n.volumeControl===void 0||Ti(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(a=e.call(this,t,n)||this).handleKeyPressHandler_=function(s){return a.handleKeyPress(s)},a.on(t,["loadstart"],function(s){return a.volumePanelState_(s)}),a.on(a.muteToggle,"keyup",function(s){return a.handleKeyPress(s)}),a.on(a.volumeControl,"keyup",function(s){return a.handleVolumeControlKeyUp(s)}),a.on("keydown",function(s){return a.handleKeyPress(s)}),a.on("mouseover",function(s){return a.handleMouseOver(s)}),a.on("mouseout",function(s){return a.handleMouseOut(s)}),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}V(i,e);var r=i.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},r.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(t){et.isEventKey(t,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(t){this.addClass("vjs-hover"),re(H,"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(t){this.removeClass("vjs-hover"),Ft(H,"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(t){et.isEventKey(t,"Esc")&&this.handleMouseOut()},i}(F);Oc.prototype.options_={children:["muteToggle","volumeControl"]},F.registerComponent("VolumePanel",Oc);var Rc=function(e){function i(t,n){var a;return a=e.call(this,t,n)||this,n&&(a.menuButton_=n.menuButton),a.focusedChild_=-1,a.on("keydown",function(s){return a.handleKeyDown(s)}),a.boundHandleBlur_=function(s){return a.handleBlur(s)},a.boundHandleTapClick_=function(s){return a.handleTapClick(s)},a}V(i,e);var r=i.prototype;return r.addEventListenerForItem=function(t){t instanceof F&&(this.on(t,"blur",this.boundHandleBlur_),this.on(t,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(t){t instanceof F&&(this.off(t,"blur",this.boundHandleBlur_),this.off(t,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(t){typeof t=="string"&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},r.addItem=function(t){var n=this.addChild(t);n&&this.addEventListenerForItem(n)},r.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=ot(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),re(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},r.handleBlur=function(t){var n=t.relatedTarget||H.activeElement;if(!this.children().some(function(s){return s.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},r.handleTapClick=function(t){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(s){return s.el()===t.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(t){et.isEventKey(t,"Left")||et.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):(et.isEventKey(t,"Right")||et.isEventKey(t,"Up"))&&(t.preventDefault(),t.stopPropagation(),this.stepBack())},r.stepForward=function(){var t=0;this.focusedChild_!==void 0&&(t=this.focusedChild_+1),this.focus(t)},r.stepBack=function(){var t=0;this.focusedChild_!==void 0&&(t=this.focusedChild_-1),this.focus(t)},r.focus=function(t){t===void 0&&(t=0);var n=this.children().slice();n.length&&n[0].hasClass("vjs-menu-title")&&n.shift(),n.length>0&&(t<0?t=0:t>=n.length&&(t=n.length-1),this.focusedChild_=t,n[t].el_.focus())},i}(F);F.registerComponent("Menu",Rc);var Bs=function(e){function i(t,n){var a;n===void 0&&(n={}),(a=e.call(this,t,n)||this).menuButton_=new ge(t,n),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ge.prototype.buildCSSClass();a.menuButton_.el_.className=a.buildCSSClass()+" "+s,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0;var o=function(u){return a.handleClick(u)};return a.handleMenuKeyUp_=function(u){return a.handleMenuKeyUp(u)},a.on(a.menuButton_,"tap",o),a.on(a.menuButton_,"click",o),a.on(a.menuButton_,"keydown",function(u){return a.handleKeyDown(u)}),a.on(a.menuButton_,"mouseenter",function(){a.addClass("vjs-hover"),a.menu.show(),re(H,"keyup",a.handleMenuKeyUp_)}),a.on("mouseleave",function(u){return a.handleMouseLeave(u)}),a.on("keydown",function(u){return a.handleSubmenuKeyDown(u)}),a}V(i,e);var r=i.prototype;return r.update=function(){var t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var t=new Rc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=ot("li",{className:"vjs-menu-title",textContent:kt(this.options_.title),tabIndex:-1}),a=new F(this.player_,{el:n});t.addItem(a)}if(this.items=this.createItems(),this.items)for(var s=0;s<this.items.length;s++)t.addItem(this.items[s]);return t},r.createItems=function(){},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var t="vjs-menu-button";return this.options_.inline===!0?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+ge.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var t="vjs-menu-button";return this.options_.inline===!0?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},r.controlText=function(t,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(t,n)},r.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},r.handleClick=function(t){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(t){this.removeClass("vjs-hover"),Ft(H,"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(t){et.isEventKey(t,"Esc")||et.isEventKey(t,"Tab")?(this.buttonPressed_&&this.unpressButton(),et.isEventKey(t,"Tab")||(t.preventDefault(),this.menuButton_.focus())):(et.isEventKey(t,"Up")||et.isEventKey(t,"Down"))&&(this.buttonPressed_||(t.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(t){(et.isEventKey(t,"Esc")||et.isEventKey(t,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(t){this.handleSubmenuKeyDown(t)},r.handleSubmenuKeyDown=function(t){(et.isEventKey(t,"Esc")||et.isEventKey(t,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),et.isEventKey(t,"Tab")||(t.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Wt&&ql())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},i}(F);F.registerComponent("MenuButton",Bs);var Fs=function(e){function i(r,t){var n,a=t.tracks;if((n=e.call(this,r,t)||this).items.length<=1&&n.hide(),!a)return tt(n);var s=yt(tt(n),n.update);return a.addEventListener("removetrack",s),a.addEventListener("addtrack",s),a.addEventListener("labelchange",s),n.player_.on("ready",s),n.player_.on("dispose",function(){a.removeEventListener("removetrack",s),a.removeEventListener("addtrack",s),a.removeEventListener("labelchange",s)}),n}return V(i,e),i}(Bs);F.registerComponent("TrackButton",Fs);var Om=["Tab","Esc","Up","Down","Right","Left"],Pi=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).selectable=n.selectable,a.isSelected_=n.selected||!1,a.multiSelectable=n.multiSelectable,a.selected(a.isSelected_),a.selectable?a.multiSelectable?a.el_.setAttribute("role","menuitemcheckbox"):a.el_.setAttribute("role","menuitemradio"):a.el_.setAttribute("role","menuitem"),a}V(i,e);var r=i.prototype;return r.createEl=function(t,n,a){this.nonIconControl=!0;var s=e.prototype.createEl.call(this,"li",wt({className:"vjs-menu-item",tabIndex:-1},n),a);return s.replaceChild(ot("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),s.querySelector(".vjs-icon-placeholder")),s},r.handleKeyDown=function(t){Om.some(function(n){return et.isEventKey(t,n)})||e.prototype.handleKeyDown.call(this,t)},r.handleClick=function(t){this.selected(!0)},r.selected=function(t){this.selectable&&(t?(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))},i}(Pr);F.registerComponent("MenuItem",Pi);var Li=function(e){function i(t,n){var a,s=n.track,o=t.textTracks();n.label=s.label||s.language||"Unknown",n.selected=s.mode==="showing",(a=e.call(this,t,n)||this).track=s,a.kinds=(n.kinds||[n.kind||a.track.kind]).filter(Boolean);var u,c=function(){for(var m=arguments.length,f=new Array(m),_=0;_<m;_++)f[_]=arguments[_];a.handleTracksChange.apply(tt(a),f)},d=function(){for(var m=arguments.length,f=new Array(m),_=0;_<m;_++)f[_]=arguments[_];a.handleSelectedLanguageChange.apply(tt(a),f)};return t.on(["loadstart","texttrackchange"],c),o.addEventListener("change",c),o.addEventListener("selectedlanguagechange",d),a.on("dispose",function(){t.off(["loadstart","texttrackchange"],c),o.removeEventListener("change",c),o.removeEventListener("selectedlanguagechange",d)}),o.onchange===void 0&&a.on(["tap","click"],function(){if(typeof D.Event!="object")try{u=new D.Event("change")}catch{}u||(u=H.createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(u)}),a.handleTracksChange(),a}V(i,e);var r=i.prototype;return r.handleClick=function(t){var n=this.track,a=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),a)for(var s=0;s<a.length;s++){var o=a[s];this.kinds.indexOf(o.kind)!==-1&&(o===n?o.mode!=="showing"&&(o.mode="showing"):o.mode!=="disabled"&&(o.mode="disabled"))}},r.handleTracksChange=function(t){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},r.handleSelectedLanguageChange=function(t){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},r.dispose=function(){this.track=null,e.prototype.dispose.call(this)},i}(Pi);F.registerComponent("TextTrackMenuItem",Li);var Nc=function(e){function i(t,n){return n.track={player:t,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,e.call(this,t,n)||this}V(i,e);var r=i.prototype;return r.handleTracksChange=function(t){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s<o;s++){var u=n[s];if(this.options_.kinds.indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},r.handleSelectedLanguageChange=function(t){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s<o;s++){var u=n[s];if(["captions","descriptions","subtitles"].indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(Li);F.registerComponent("OffTextTrackMenuItem",Nc);var zn=function(e){function i(r,t){return t===void 0&&(t={}),t.tracks=r.textTracks(),e.call(this,r,t)||this}return V(i,e),i.prototype.createItems=function(r,t){var n;r===void 0&&(r=[]),t===void 0&&(t=Li),this.label_&&(n=this.label_+" off"),r.push(new Nc(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var s=0;s<a.length;s++){var o=a[s];if(this.kinds_.indexOf(o.kind)>-1){var u=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass("vjs-"+o.kind+"-menu-item"),r.push(u)}}return r},i}(Fs);F.registerComponent("TextTrackButton",zn);var Mc=function(e){function i(r,t){var n,a=t.track,s=t.cue,o=r.currentTime();return t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=o&&o<s.endTime,(n=e.call(this,r,t)||this).track=a,n.cue=s,n}return V(i,e),i.prototype.handleClick=function(r){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},i}(Pi);F.registerComponent("ChaptersTrackMenuItem",Mc);var js=function(e){function i(t,n,a){var s;return(s=e.call(this,t,n,a)||this).selectCurrentItem_=function(){s.items.forEach(function(o){o.selected(s.track_.activeCues[0]===o.cue)})},s}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},r.update=function(t){if(!t||!t.track||t.track.kind==="chapters"){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),e.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&e.prototype.update.call(this)}},r.setTrack=function(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},r.findChaptersTrack=function(){for(var t=this.player_.textTracks()||[],n=t.length-1;n>=0;n--){var a=t[n];if(a.kind===this.kind_)return a}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(kt(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},r.createItems=function(){var t=[];if(!this.track_)return t;var n=this.track_.cues;if(!n)return t;for(var a=0,s=n.length;a<s;a++){var o=n[a],u=new Mc(this.player_,{track:this.track_,cue:o});t.push(u)}return t},i}(zn);js.prototype.kind_="chapters",js.prototype.controlText_="Chapters",F.registerComponent("ChaptersButton",js);var qs=function(e){function i(t,n,a){var s;s=e.call(this,t,n,a)||this;var o=t.textTracks(),u=yt(tt(s),s.handleTracksChange);return o.addEventListener("change",u),s.on("dispose",function(){o.removeEventListener("change",u)}),s}V(i,e);var r=i.prototype;return r.handleTracksChange=function(t){for(var n=this.player().textTracks(),a=!1,s=0,o=n.length;s<o;s++){var u=n[s];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},i}(zn);qs.prototype.kind_="descriptions",qs.prototype.controlText_="Descriptions",F.registerComponent("DescriptionsButton",qs);var Hs=function(e){function i(t,n,a){return e.call(this,t,n,a)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},i}(zn);Hs.prototype.kind_="subtitles",Hs.prototype.controlText_="Subtitles",F.registerComponent("SubtitlesButton",Hs);var Vs=function(e){function i(r,t){var n;return t.track={player:r,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",(n=e.call(this,r,t)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+t.kind+" settings dialog"),n}return V(i,e),i.prototype.handleClick=function(r){this.player().getChild("textTrackSettings").open()},i}(Li);F.registerComponent("CaptionSettingsMenuItem",Vs);var Ws=function(e){function i(t,n,a){return e.call(this,t,n,a)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Vs(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},i}(zn);Ws.prototype.kind_="captions",Ws.prototype.controlText_="Captions",F.registerComponent("CaptionsButton",Ws);var Uc=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(r,t,n){var a=e.prototype.createEl.call(this,r,t,n),s=a.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ot("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),a},i}(Li);F.registerComponent("SubsCapsMenuItem",Uc);var Gs=function(e){function i(t,n){var a;return n===void 0&&(n={}),(a=e.call(this,t,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(a.player_.language_)>-1&&(a.label_="captions"),a.menuButton_.controlText(kt(a.label_)),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new Vs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Uc)},i}(zn);Gs.prototype.kinds_=["captions","subtitles"],Gs.prototype.controlText_="Subtitles",F.registerComponent("SubsCapsButton",Gs);var Bc=function(e){function i(t,n){var a,s=n.track,o=t.audioTracks();n.label=s.label||s.language||"Unknown",n.selected=s.enabled,(a=e.call(this,t,n)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,d=new Array(c),m=0;m<c;m++)d[m]=arguments[m];a.handleTracksChange.apply(tt(a),d)};return o.addEventListener("change",u),a.on("dispose",function(){o.removeEventListener("change",u)}),a}V(i,e);var r=i.prototype;return r.createEl=function(t,n,a){var s=e.prototype.createEl.call(this,t,n,a),o=s.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(o.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),o.appendChild(ot("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s},r.handleClick=function(t){if(e.prototype.handleClick.call(this,t),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var s=n[a];s!==this.track&&(s.enabled=s===this.track)}},r.handleTracksChange=function(t){this.selected(this.track.enabled)},i}(Pi);F.registerComponent("AudioTrackMenuItem",Bc);var Fc=function(e){function i(t,n){return n===void 0&&(n={}),n.tracks=t.audioTracks(),e.call(this,t,n)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(t){t===void 0&&(t=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var s=n[a];t.push(new Bc(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return t},i}(Fs);Fc.prototype.controlText_="Audio Track",F.registerComponent("AudioTrackButton",Fc);var zs=function(e){function i(t,n){var a,s=n.rate,o=parseFloat(s,10);return n.label=s,n.selected=o===t.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(a=e.call(this,t,n)||this).label=s,a.rate=o,a.on(t,"ratechange",function(u){return a.update(u)}),a}V(i,e);var r=i.prototype;return r.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(t){this.selected(this.player().playbackRate()===this.rate)},i}(Pi);zs.prototype.contentElType="button",F.registerComponent("PlaybackRateMenuItem",zs);var jc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).menuButton_.el_.setAttribute("aria-describedby",a.labelElId_),a.updateVisibility(),a.updateLabel(),a.on(t,"loadstart",function(s){return a.updateVisibility(s)}),a.on(t,"ratechange",function(s){return a.updateLabel(s)}),a.on(t,"playbackrateschange",function(s){return a.handlePlaybackRateschange(s)}),a}V(i,e);var r=i.prototype;return r.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ot("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),t},r.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){for(var t=this.playbackRates(),n=[],a=t.length-1;a>=0;a--)n.push(new zs(this.player(),{rate:t[a]+"x"}));return n},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(t){var n=this.player().playbackRate(),a=this.playbackRates(),s=(a.indexOf(n)+1)%a.length;this.player().playbackRate(a[s])},r.handlePlaybackRateschange=function(t){this.update()},r.playbackRates=function(){var t=this.player();return t.playbackRates&&t.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(t){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(t){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},i}(Bs);jc.prototype.controlText_="Playback Rate",F.registerComponent("PlaybackRateMenuButton",jc);var qc=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(t,n,a){return t===void 0&&(t="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,a)},i}(F);F.registerComponent("Spacer",qc);var Rm=function(e){function i(){return e.apply(this,arguments)||this}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},r.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xA0"})},i}(qc);F.registerComponent("CustomControlSpacer",Rm);var Nr=function(e){function i(){return e.apply(this,arguments)||this}return V(i,e),i.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(F);Nr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in H&&Nr.prototype.options_.children.splice(Nr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),F.registerComponent("ControlBar",Nr);var Hc=function(e){function i(t,n){var a;return(a=e.call(this,t,n)||this).on(t,"error",function(s){return a.open(s)}),a}V(i,e);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},r.content=function(){var t=this.player().error();return t?this.localize(t.message):""},i}(jn);Hc.prototype.options_=he({},jn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),F.registerComponent("ErrorDisplay",Hc);var Xs="vjs-text-track-settings",Vc=["#000","Black"],Wc=["#00F","Blue"],Gc=["#0FF","Cyan"],zc=["#0F0","Green"],Xc=["#F0F","Magenta"],Kc=["#F00","Red"],Yc=["#FFF","White"],Qc=["#FF0","Yellow"],Ks=["1","Opaque"],Ys=["0.5","Semi-Transparent"],$c=["0","Transparent"],hn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vc,Yc,Kc,zc,Wc,Qc,Xc,Gc]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ks,Ys,$c]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Yc,Vc,Kc,zc,Wc,Qc,Xc,Gc]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ks,Ys]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[$c,Ys,Ks]}};function Jc(e,i){if(i&&(e=i(e)),e&&e!=="none")return e}hn.windowColor.options=hn.backgroundColor.options;var Nm=function(e){function i(t,n){var a;return n.temporary=!1,(a=e.call(this,t,n)||this).updateDisplay=a.updateDisplay.bind(tt(a)),a.fill(),a.hasBeenOpened_=a.hasBeenFilled_=!0,a.endDialog=ot("p",{className:"vjs-control-text",textContent:a.localize("End of dialog window.")}),a.el().appendChild(a.endDialog),a.setDefaults(),n.persistTextTrackSettings===void 0&&(a.options_.persistTextTrackSettings=a.options_.playerOptions.persistTextTrackSettings),a.on(a.$(".vjs-done-button"),"click",function(){a.saveSettings(),a.close()}),a.on(a.$(".vjs-default-button"),"click",function(){a.setDefaults(),a.updateDisplay()}),Ln(hn,function(s){a.on(a.$(s.selector),"change",a.updateDisplay)}),a.options_.persistTextTrackSettings&&a.restoreSettings(),a}V(i,e);var r=i.prototype;return r.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},r.createElSelect_=function(t,n,a){var s=this;n===void 0&&(n=""),a===void 0&&(a="label");var o=hn[t],u=o.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(o.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(o.options.map(function(d){var m=u+"-"+d[1].replace(/\W+/g,"");return['<option id="'+m+'" value="'+d[0]+'" ','aria-labelledby="'+c+" "+m+'">',s.localize(d[1]),"</option>"].join("")})).concat("</select>").join("")},r.createElFgColor_=function(){var t="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",t),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",t),"</span>","</fieldset>"].join("")},r.createElBgColor_=function(){var t="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",t),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",t),"</span>","</fieldset>"].join("")},r.createElWinColor_=function(){var t="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+t+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",t),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",t),"</span>","</fieldset>"].join("")},r.createElColors_=function(){return ot("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return ot("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},r.createElControls_=function(){var t=this.localize("restore all settings to the default values");return ot("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+t+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+t+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var t,n,a,s=this;return n=function(o,u,c){var d,m,f=(d=s.$(u.selector),m=u.parser,Jc(d.options[d.options.selectedIndex].value,m));return f!==void 0&&(o[c]=f),o},(a={})===void 0&&(a=0),Ll(t=hn).reduce(function(o,u){return n(o,t[u],u)},a)},r.setValues=function(t){var n=this;Ln(hn,function(a,s){(function(o,u,c){if(u){for(var d=0;d<o.options.length;d++)if(Jc(o.options[d].value,c)===u){o.selectedIndex=d;break}}})(n.$(a.selector),t[s],a.parser)})},r.setDefaults=function(){var t=this;Ln(hn,function(n){var a=n.hasOwnProperty("default")?n.default:0;t.$(n.selector).selectedIndex=a})},r.restoreSettings=function(){var t;try{t=JSON.parse(D.localStorage.getItem(Xs))}catch(n){it.warn(n)}t&&this.setValues(t)},r.saveSettings=function(){if(this.options_.persistTextTrackSettings){var t=this.getValues();try{Object.keys(t).length?D.localStorage.setItem(Xs,JSON.stringify(t)):D.localStorage.removeItem(Xs)}catch(n){it.warn(n)}}},r.updateDisplay=function(){var t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var t=this.player_.controlBar,n=t&&t.subsCapsButton,a=t&&t.captionsButton;n?n.focus():a&&a.focus()},i}(jn);F.registerComponent("TextTrackSettings",Nm);var Mm=function(e){function i(t,n){var a,s=n.ResizeObserver||D.ResizeObserver;n.ResizeObserver===null&&(s=!1);var o=_t({createEl:!s,reportTouchActivity:!1},n);return(a=e.call(this,t,o)||this).ResizeObserver=n.ResizeObserver||D.ResizeObserver,a.loadListener_=null,a.resizeObserver_=null,a.debouncedHandler_=function(u,c,d,m){var f;m===void 0&&(m=D);var _=function(){var b=this,y=arguments,E=function(){f=null,E=null,d||u.apply(b,y)};!f&&d&&u.apply(b,y),m.clearTimeout(f),f=m.setTimeout(E,c)};return _.cancel=function(){m.clearTimeout(f),f=null},_}(function(){a.resizeHandler()},100,!1,tt(a)),s?(a.resizeObserver_=new a.ResizeObserver(a.debouncedHandler_),a.resizeObserver_.observe(t.el())):(a.loadListener_=function(){if(a.el_&&a.el_.contentWindow){var u=a.debouncedHandler_,c=a.unloadListener_=function(){Ft(this,"resize",u),Ft(this,"unload",c),c=null};re(a.el_.contentWindow,"unload",c),re(a.el_.contentWindow,"resize",u)}},a.one("load",a.loadListener_)),a}V(i,e);var r=i.prototype;return r.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},r.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},i}(F);F.registerComponent("ResizeManager",Mm);var Um={trackingThreshold:20,liveTolerance:15},Bm=function(e){function i(t,n){var a,s=_t(Um,n,{createEl:!1});return(a=e.call(this,t,s)||this).handleVisibilityChange_=function(o){return a.handleVisibilityChange(o)},a.trackLiveHandler_=function(){return a.trackLive_()},a.handlePlay_=function(o){return a.handlePlay(o)},a.handleFirstTimeupdate_=function(o){return a.handleFirstTimeupdate(o)},a.handleSeeked_=function(o){return a.handleSeeked(o)},a.seekToLiveEdge_=function(o){return a.seekToLiveEdge(o)},a.reset_(),a.on(a.player_,"durationchange",function(o){return a.handleDurationchange(o)}),a.on(a.player_,"canplay",function(){return a.toggleTracking()}),wi&&"hidden"in H&&"visibilityState"in H&&a.on(H,"visibilitychange",a.handleVisibilityChange_),a}V(i,e);var r=i.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(H.hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var t=this.player_.seekable();if(t&&t.length){var n=Number(D.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var s=this.liveCurrentTime(),o=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-o)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,me),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var t=this.player_.seekable(),n=[],a=t?t.length:0;a--;)n.push(t.end(a));return n.length?n.sort()[n.length-1]:1/0},r.seekableStart=function(){for(var t=this.player_.seekable(),n=[],a=t?t.length:0;a--;)n.push(t.start(a));return n.length?n.sort()[0]:0},r.liveWindow=function(){var t=this.liveCurrentTime();return t===1/0?0:t-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var t=this.seekableEnd();return this.lastSeekEnd_!==-1&&t!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=t,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(H,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},i}(F);F.registerComponent("LiveTracker",Bm);var Mr,Qs=function(e){var i=e.el();if(i.hasAttribute("src"))return e.triggerSourceset(i.src),!0;var r=e.$$("source"),t=[],n="";if(!r.length)return!1;for(var a=0;a<r.length;a++){var s=r[a].src;s&&t.indexOf(s)===-1&&t.push(s)}return!!t.length&&(t.length===1&&(n=t[0]),e.triggerSourceset(n),!0)},Fm=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var i=H.createElement(this.nodeName.toLowerCase());i.innerHTML=e;for(var r=H.createDocumentFragment();i.childNodes.length;)r.appendChild(i.childNodes[0]);return this.innerText="",D.Element.prototype.appendChild.call(this,r),this.innerHTML}}),Zc=function(e,i){for(var r={},t=0;t<e.length&&!((r=Object.getOwnPropertyDescriptor(e[t],i))&&r.set&&r.get);t++);return r.enumerable=!0,r.configurable=!0,r},td=function(e){var i=e.el();if(!i.resetSourceWatch_){var r={},t=function(a){return Zc([a.el(),D.HTMLMediaElement.prototype,D.Element.prototype,Fm],"innerHTML")}(e),n=function(a){return function(){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];var c=a.apply(i,o);return Qs(e),c}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){i[a]&&(r[a]=i[a],i[a]=n(r[a]))}),Object.defineProperty(i,"innerHTML",_t(t,{set:n(t.set)})),i.resetSourceWatch_=function(){i.resetSourceWatch_=null,Object.keys(r).forEach(function(a){i[a]=r[a]}),Object.defineProperty(i,"innerHTML",t)},e.one("sourceset",i.resetSourceWatch_)}},jm=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?fc(D.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return D.Element.prototype.setAttribute.call(this,"src",e),e}}),qm=function(e){if(e.featuresSourceset){var i=e.el();if(!i.resetSourceset_){var r=function(a){return Zc([a.el(),D.HTMLMediaElement.prototype,jm],"src")}(e),t=i.setAttribute,n=i.load;Object.defineProperty(i,"src",_t(r,{set:function(a){var s=r.set.call(i,a);return e.triggerSourceset(i.src),s}})),i.setAttribute=function(a,s){var o=t.call(i,a,s);return/src/i.test(a)&&e.triggerSourceset(i.src),o},i.load=function(){var a=n.call(i);return Qs(e)||(e.triggerSourceset(""),td(e)),a},i.currentSrc?e.triggerSourceset(i.currentSrc):Qs(e)||td(e),i.resetSourceset_=function(){i.resetSourceset_=null,i.load=n,i.setAttribute=t,Object.defineProperty(i,"src",r),i.resetSourceWatch_&&i.resetSourceWatch_()}}}},$s=function(e,i,r,t){t===void 0&&(t=!0);var n=function(s){return Object.defineProperty(e,i,{value:s,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var s=r();return n(s),s}};return t&&(a.set=n),Object.defineProperty(e,i,a)},G=function(e){function i(t,n){var a;a=e.call(this,t,n)||this;var s=t.source,o=!1;if(a.featuresVideoFrameCallback=a.featuresVideoFrameCallback&&a.el_.tagName==="VIDEO",s&&(a.el_.currentSrc!==s.src||t.tag&&t.tag.initNetworkState_===3)?a.setSource(s):a.handleLateInit_(a.el_),t.enableSourceset&&a.setupSourcesetHandling_(),a.isScrubbing_=!1,a.el_.hasChildNodes()){for(var u=a.el_.childNodes,c=u.length,d=[];c--;){var m=u[c];m.nodeName.toLowerCase()==="track"&&(a.featuresNativeTextTracks?(a.remoteTextTrackEls().addTrackElement_(m),a.remoteTextTracks().addTrack(m.track),a.textTracks().addTrack(m.track),o||a.el_.hasAttribute("crossorigin")||!Dr(m.src)||(o=!0)):d.push(m))}for(var f=0;f<d.length;f++)a.el_.removeChild(d[f])}return a.proxyNativeTracks_(),a.featuresNativeTextTracks&&o&&it.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
- This may prevent text tracks from loading.`),a.restoreMetadataTracksInIOSNativePlayer_(),(On||os||Nl)&&t.nativeControlsForTouch===!0&&a.setControls(!0),a.proxyWebkitFullscreen_(),a.triggerReady(),a}V(i,e);var r=i.prototype;return r.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},r.setupSourcesetHandling_=function(){qm(this)},r.restoreMetadataTracksInIOSNativePlayer_=function(){var t,n=this.textTracks(),a=function(){t=[];for(var o=0;o<n.length;o++){var u=n[o];u.kind==="metadata"&&t.push({track:u,storedMode:u.mode})}};a(),n.addEventListener("change",a),this.on("dispose",function(){return n.removeEventListener("change",a)});var s=function o(){for(var u=0;u<t.length;u++){var c=t[u];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}n.removeEventListener("change",o)};this.on("webkitbeginfullscreen",function(){n.removeEventListener("change",a),n.removeEventListener("change",s),n.addEventListener("change",s)}),this.on("webkitendfullscreen",function(){n.removeEventListener("change",a),n.addEventListener("change",a),n.removeEventListener("change",s)})},r.overrideNative_=function(t,n){var a=this;if(n===this["featuresNative"+t+"Tracks"]){var s=t.toLowerCase();this[s+"TracksListeners_"]&&Object.keys(this[s+"TracksListeners_"]).forEach(function(o){a.el()[s+"Tracks"].removeEventListener(o,a[s+"TracksListeners_"][o])}),this["featuresNative"+t+"Tracks"]=!n,this[s+"TracksListeners_"]=null,this.proxyNativeTracksForType_(s)}},r.overrideNativeAudioTracks=function(t){this.overrideNative_("Audio",t)},r.overrideNativeVideoTracks=function(t){this.overrideNative_("Video",t)},r.proxyNativeTracksForType_=function(t){var n=this,a=ue[t],s=this.el()[a.getterName],o=this[a.getterName]();if(this["featuresNative"+a.capitalName+"Tracks"]&&s&&s.addEventListener){var u={change:function(d){var m={type:"change",target:o,currentTarget:o,srcElement:o};o.trigger(m),t==="text"&&n[Vn.remoteText.getterName]().trigger(m)},addtrack:function(d){o.addTrack(d.track)},removetrack:function(d){o.removeTrack(d.track)}},c=function(){for(var d=[],m=0;m<o.length;m++){for(var f=!1,_=0;_<s.length;_++)if(s[_]===o[m]){f=!0;break}f||d.push(o[m])}for(;d.length;)o.removeTrack(d.shift())};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(d){var m=u[d];s.addEventListener(d,m),n.on("dispose",function(f){return s.removeEventListener(d,m)})}),this.on("loadstart",c),this.on("dispose",function(d){return n.off("loadstart",c)})}},r.proxyNativeTracks_=function(){var t=this;ue.names.forEach(function(n){t.proxyNativeTracksForType_(n)})},r.createEl=function(){var t=this.options_.tag;if(!t||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(t){var n=t.cloneNode(!0);t.parentNode&&t.parentNode.insertBefore(n,t),i.disposeMediaElement(t),t=n}else{t=H.createElement("video");var a=_t({},this.options_.tag&&Fe(this.options_.tag));On&&this.options_.nativeControlsForTouch===!0||delete a.controls,Wl(t,wt(a,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}this.options_.preload!==void 0&&Mn(t,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);for(var s=["loop","muted","playsinline","autoplay"],o=0;o<s.length;o++){var u=s[o],c=this.options_[u];c!==void 0&&(c?Mn(t,u,u):br(t,u),t[u]=c)}return t},r.handleLateInit_=function(t){if(t.networkState!==0&&t.networkState!==3){if(t.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var s=function(){n||this.trigger("loadstart")};return this.on("loadedmetadata",s),void this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",s),n||this.trigger("loadstart")})}var o=["loadstart"];o.push("loadedmetadata"),t.readyState>=2&&o.push("loadeddata"),t.readyState>=3&&o.push("canplay"),t.readyState>=4&&o.push("canplaythrough"),this.ready(function(){o.forEach(function(u){this.trigger(u)},this)})}},r.setScrubbing=function(t){this.isScrubbing_=t},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(t){try{this.isScrubbing_&&this.el_.fastSeek&&_r?this.el_.fastSeek(t):this.el_.currentTime=t}catch(n){it(n,"Video is not ready. (Video.js)")}},r.duration=function(){var t=this;return this.el_.duration===1/0&&Me&&Ue&&this.el_.currentTime===0?(this.on("timeupdate",function n(){t.el_.currentTime>0&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",n))}),NaN):this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var t=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){t.off("webkitbeginfullscreen",a),t.off("webkitendfullscreen",n)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var t=D.navigator&&D.navigator.userAgent||"";if(/Android/.test(t)||!/Chrome|Mac OS X 10.5/.test(t))return!0}return!1},r.enterFullScreen=function(){var t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA)Ee(this.el_.play()),this.setTimeout(function(){t.pause();try{t.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{t.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},r.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},r.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},r.src=function(t){if(t===void 0)return this.el_.src;this.setSrc(t)},r.reset=function(){i.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(t){this.el_.controls=!!t},r.addTextTrack=function(t,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,a):e.prototype.addTextTrack.call(this,t,n,a)},r.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=H.createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},r.addRemoteTextTrack=function(t,n){var a=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},r.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)t!==n[a]&&t!==n[a].track||this.el().removeChild(n[a])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var t={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),D.performance&&typeof D.performance.now=="function"?t.creationTime=D.performance.now():D.performance&&D.performance.timing&&typeof D.performance.timing.navigationStart=="number"&&(t.creationTime=D.Date.now()-D.performance.timing.navigationStart),t},i}(mt);$s(G,"TEST_VID",function(){if(Rn()){var e=H.createElement("video"),i=H.createElement("track");return i.kind="captions",i.srclang="en",i.label="English",e.appendChild(i),e}}),G.isSupported=function(){try{G.TEST_VID.volume=.5}catch{return!1}return!(!G.TEST_VID||!G.TEST_VID.canPlayType)},G.canPlayType=function(e){return G.TEST_VID.canPlayType(e)},G.canPlaySource=function(e,i){return G.canPlayType(e.type)},G.canControlVolume=function(){try{var e=G.TEST_VID.volume;G.TEST_VID.volume=e/2+.1;var i=e!==G.TEST_VID.volume;return i&&Wt?(D.setTimeout(function(){G&&G.prototype&&(G.prototype.featuresVolumeControl=e!==G.TEST_VID.volume)}),!1):i}catch{return!1}},G.canMuteVolume=function(){try{var e=G.TEST_VID.muted;return G.TEST_VID.muted=!e,G.TEST_VID.muted?Mn(G.TEST_VID,"muted","muted"):br(G.TEST_VID,"muted"),e!==G.TEST_VID.muted}catch{return!1}},G.canControlPlaybackRate=function(){if(Me&&Ue&&Ul<58)return!1;try{var e=G.TEST_VID.playbackRate;return G.TEST_VID.playbackRate=e/2+.1,e!==G.TEST_VID.playbackRate}catch{return!1}},G.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(H.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(H.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(H.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(H.createElement("audio"),"innerHTML",{get:e,set:e})}catch{return!1}return!0},G.supportsNativeTextTracks=function(){return _r||Wt&&Ue},G.supportsNativeVideoTracks=function(){return!(!G.TEST_VID||!G.TEST_VID.videoTracks)},G.supportsNativeAudioTracks=function(){return!(!G.TEST_VID||!G.TEST_VID.audioTracks)},G.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var i=e[0],r=e[1];$s(G.prototype,i,function(){return G[r]()},!0)}),G.prototype.featuresVolumeControl=G.canControlVolume(),G.prototype.movingMediaElementInDOM=!Wt,G.prototype.featuresFullscreenResize=!0,G.prototype.featuresProgressEvents=!0,G.prototype.featuresTimeupdateEvents=!0,G.prototype.featuresVideoFrameCallback=!(!G.TEST_VID||!G.TEST_VID.requestVideoFrameCallback),G.patchCanPlayType=function(){rs>=4&&!Ml&&!Ue&&(Mr=G.TEST_VID&&G.TEST_VID.constructor.prototype.canPlayType,G.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Mr.call(this,e)})},G.unpatchCanPlayType=function(){var e=G.TEST_VID.constructor.prototype.canPlayType;return Mr&&(G.TEST_VID.constructor.prototype.canPlayType=Mr),e},G.patchCanPlayType(),G.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}},G.resetMediaElement=function(e){if(e){for(var i=e.querySelectorAll("source"),r=i.length;r--;)e.removeChild(i[r]);e.removeAttribute("src"),typeof e.load=="function"&&function(){try{e.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){G.prototype["set"+kt(e)]=function(i){this.el_[e]=i,i?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){G.prototype["set"+kt(e)]=function(i){this.el_[e]=i}}),["pause","load","play"].forEach(function(e){G.prototype[e]=function(){return this.el_[e]()}}),mt.withSourceHandlers(G),G.nativeSourceHandler={},G.nativeSourceHandler.canPlayType=function(e){try{return G.TEST_VID.canPlayType(e)}catch{return""}},G.nativeSourceHandler.canHandleSource=function(e,i){if(e.type)return G.nativeSourceHandler.canPlayType(e.type);if(e.src){var r=ks(e.src);return G.nativeSourceHandler.canPlayType("video/"+r)}return""},G.nativeSourceHandler.handleSource=function(e,i,r){i.setSrc(e.src)},G.nativeSourceHandler.dispose=function(){},G.registerSourceHandler(G.nativeSourceHandler),mt.registerTech("Html5",G);var ed=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Js={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Zs=["tiny","xsmall","small","medium","large","xlarge","huge"],Ur={};Zs.forEach(function(e){var i=e.charAt(0)==="x"?"x-"+e.substring(1):e;Ur[e]="vjs-layout-"+i});var Hm={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},xt=function(e){function i(t,n,a){var s;if(t.id=t.id||n.id||"vjs_video_"+je(),(n=wt(i.getTagSettings(t),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if(typeof t.closest=="function"){var o=t.closest("[lang]");o&&o.getAttribute&&(n.language=o.getAttribute("lang"))}else for(var u=t;u&&u.nodeType===1;){if(Fe(u).hasOwnProperty("lang")){n.language=u.getAttribute("lang");break}u=u.parentNode}if((s=e.call(this,null,n,a)||this).boundDocumentFullscreenChange_=function(f){return s.documentFullscreenChange_(f)},s.boundFullWindowOnEscKey_=function(f){return s.fullWindowOnEscKey(f)},s.boundUpdateStyleEl_=function(f){return s.updateStyleEl_(f)},s.boundApplyInitTime_=function(f){return s.applyInitTime_(f)},s.boundUpdateCurrentBreakpoint_=function(f){return s.updateCurrentBreakpoint_(f)},s.boundHandleTechClick_=function(f){return s.handleTechClick_(f)},s.boundHandleTechDoubleClick_=function(f){return s.handleTechDoubleClick_(f)},s.boundHandleTechTouchStart_=function(f){return s.handleTechTouchStart_(f)},s.boundHandleTechTouchMove_=function(f){return s.handleTechTouchMove_(f)},s.boundHandleTechTouchEnd_=function(f){return s.handleTechTouchEnd_(f)},s.boundHandleTechTap_=function(f){return s.handleTechTap_(f)},s.isFullscreen_=!1,s.log=Pl(s.id_),s.fsApi_=mr,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=t,s.tagAttributes=t&&Fe(t),s.language(s.options_.language),n.languages){var c={};Object.getOwnPropertyNames(n.languages).forEach(function(f){c[f.toLowerCase()]=n.languages[f]}),s.languages_=c}else s.languages_=i.prototype.options_.languages;s.resetCache_(),s.poster_=n.poster||"",s.controls_=!!n.controls,t.controls=!1,t.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],t.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(f){if(typeof s[f]!="function")throw new Error('plugin "'+f+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),vs(tt(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(re(H,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var d=_t(s.options_);n.plugins&&Object.keys(n.plugins).forEach(function(f){s[f](n.plugins[f])}),n.debug&&s.debug(!0),s.options_.playerOptions=d,s.middleware_=[],s.playbackRates(n.playbackRates),s.initChildren(),s.isAudio(t.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),On&&s.addClass("vjs-touch-enabled"),Wt||s.addClass("vjs-workinghover"),i.players[s.id_]=tt(s);var m=Dl.split(".")[0];return s.addClass("vjs-v"+m),s.userActive(!0),s.reportUserActivity(),s.one("play",function(f){return s.listenForUserActivity_(f)}),s.on("stageclick",function(f){return s.handleStageClick_(f)}),s.on("keydown",function(f){return s.handleKeyDown(f)}),s.on("languagechange",function(f){return s.handleLanguagechange(f)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}V(i,e);var r=i.prototype;return r.dispose=function(){var t=this;this.trigger("dispose"),this.off("dispose"),Ft(H,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ft(H,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Cs[this.id()]=null,Xt.names.forEach(function(n){var a=Xt[n],s=t[a.getterName]();s&&s.off&&s.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var t,n=this.tag,a=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";a?t=this.el_=n.parentNode:s||(t=this.el_=e.prototype.createEl.call(this,"div"));var o=Fe(n);if(s){for(t=this.el_=n,n=this.tag=H.createElement("video");t.children.length;)n.appendChild(t.firstChild);on(t,"video-js")||Be(t,"video-js"),t.appendChild(n),a=this.playerElIngest_=t,Object.keys(t).forEach(function(_){try{n[_]=t[_]}catch{}})}if(n.setAttribute("tabindex","-1"),o.tabindex="-1",(wi||Ue&&Bl)&&(n.setAttribute("role","application"),o.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(_){s&&_==="class"||t.setAttribute(_,o[_]),s&&n.setAttribute(_,o[_])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ec("vjs-styles-dimensions");var u=Je(".vjs-styles-defaults"),c=Je("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var d=n.getElementsByTagName("a"),m=0;m<d.length;m++){var f=d.item(m);Be(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!a&&n.parentNode.insertBefore(t,n),us(n,t),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t},r.crossOrigin=function(t){if(!t)return this.techGet_("crossOrigin");t==="anonymous"||t==="use-credentials"?this.techCall_("setCrossOrigin",t):it.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+t+'"')},r.width=function(t){return this.dimension("width",t)},r.height=function(t){return this.dimension("height",t)},r.dimension=function(t,n){var a=t+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto")return this[a]=void 0,void this.updateStyleEl_();var s=parseFloat(n);isNaN(s)?it.error('Improper value "'+n+'" supplied for for '+t):(this[a]=s,this.updateStyleEl_())},r.fluid=function(t){var n,a,s=this;if(t===void 0)return!!this.fluid_;this.fluid_=!!t,He(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),t?(this.addClass("vjs-fluid"),this.fill(!1),a=function(){s.on(["playerreset","resize"],s.boundUpdateStyleEl_)},He(n=this)?a():(n.eventedCallbacks||(n.eventedCallbacks=[]),n.eventedCallbacks.push(a))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},r.fill=function(t){if(t===void 0)return!!this.fill_;this.fill_=!!t,t?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},r.aspectRatio=function(t){if(t===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(t))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=t,this.fluid(!0),this.updateStyleEl_()},r.updateStyleEl_=function(){if(D.VIDEOJS_NO_DYNAMIC_STYLE!==!0){var t,n,a,s=(this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];t=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/o:this.videoWidth()||300,n=this.height_!==void 0?this.height_:t*o,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),nc(this.styleEl_,`
- .`+a+` {
- width: `+t+`px;
- height: `+n+`px;
- }
- .`+a+`.vjs-fluid:not(.vjs-audio-only-mode) {
- padding-top: `+100*o+`%;
- }
- `)}else{var u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(u>=0&&(d.width=u),c>=0&&(d.height=c))}},r.loadTech_=function(t,n){var a=this;this.tech_&&this.unloadTech_();var s=kt(t),o=t.charAt(0).toLowerCase()+t.slice(1);s!=="Html5"&&this.tag&&(mt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Xt.names.forEach(function(m){var f=Xt[m];c[f.getterName]=a[f.privateName]}),wt(c,this.options_[s]),wt(c,this.options_[o]),wt(c,this.options_[t.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var d=mt.getTech(t);if(!d)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new d(c),this.tech_.ready(yt(this,this.handleTechReady_),!0),om(this.textTracksJson_||[],this.tech_),ed.forEach(function(m){a.on(a.tech_,m,function(f){return a["handleTech"+kt(m)+"_"](f)})}),Object.keys(Js).forEach(function(m){a.on(a.tech_,m,function(f){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+Js[m]+"_"].bind(a),event:f}):a["handleTech"+Js[m]+"_"](f)})}),this.on(this.tech_,"loadstart",function(m){return a.handleTechLoadStart_(m)}),this.on(this.tech_,"sourceset",function(m){return a.handleTechSourceset_(m)}),this.on(this.tech_,"waiting",function(m){return a.handleTechWaiting_(m)}),this.on(this.tech_,"ended",function(m){return a.handleTechEnded_(m)}),this.on(this.tech_,"seeking",function(m){return a.handleTechSeeking_(m)}),this.on(this.tech_,"play",function(m){return a.handleTechPlay_(m)}),this.on(this.tech_,"firstplay",function(m){return a.handleTechFirstPlay_(m)}),this.on(this.tech_,"pause",function(m){return a.handleTechPause_(m)}),this.on(this.tech_,"durationchange",function(m){return a.handleTechDurationChange_(m)}),this.on(this.tech_,"fullscreenchange",function(m,f){return a.handleTechFullscreenChange_(m,f)}),this.on(this.tech_,"fullscreenerror",function(m,f){return a.handleTechFullscreenError_(m,f)}),this.on(this.tech_,"enterpictureinpicture",function(m){return a.handleTechEnterPictureInPicture_(m)}),this.on(this.tech_,"leavepictureinpicture",function(m){return a.handleTechLeavePictureInPicture_(m)}),this.on(this.tech_,"error",function(m){return a.handleTechError_(m)}),this.on(this.tech_,"posterchange",function(m){return a.handleTechPosterChange_(m)}),this.on(this.tech_,"textdata",function(m){return a.handleTechTextData_(m)}),this.on(this.tech_,"ratechange",function(m){return a.handleTechRateChange_(m)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||s==="Html5"&&this.tag||us(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var t=this;Xt.names.forEach(function(n){var a=Xt[n];t[a.privateName]=t[a.getterName]()}),this.textTracksJson_=sm(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(t){return t===void 0&&it.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
- See https://github.com/videojs/video.js/issues/2617 for more info.
- `),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(t){var n=this;if(this.tech_&&typeof t=="string"){var a,s=function(){var o=n.muted();n.muted(!0);var u=function(){n.muted(o)};n.playTerminatedQueue_.push(u);var c=n.play();if(Ii(c))return c.catch(function(d){throw u(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(d||""))})};if(t!=="any"||this.muted()?a=t!=="muted"||this.muted()?this.play():s():Ii(a=this.play())&&(a=a.catch(s)),Ii(a))return a.then(function(){n.trigger({type:"autoplay-success",autoplay:t})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:t})})}},r.updateSourceCaches_=function(t){t===void 0&&(t="");var n=t,a="";typeof n!="string"&&(n=t.src,a=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=function(f,_){if(!_)return"";if(f.cache_.source.src===_&&f.cache_.source.type)return f.cache_.source.type;var b=f.cache_.sources.filter(function(k){return k.src===_});if(b.length)return b[0].type;for(var y=f.$$("source"),E=0;E<y.length;E++){var w=y[E];if(w.type&&w.src&&w.src===_)return w.type}return Ar(_)}(this,n)),this.cache_.source=_t({},t,{src:n,type:a});for(var s=this.cache_.sources.filter(function(f){return f.src&&f.src===n}),o=[],u=this.$$("source"),c=[],d=0;d<u.length;d++){var m=Fe(u[d]);o.push(m),m.src&&m.src===n&&c.push(m.src)}c.length&&!s.length?this.cache_.sources=o:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},r.handleTechSourceset_=function(t){var n=this;if(!this.changingSrc_){var a=function(u){return n.updateSourceCaches_(u)},s=this.currentSource().src,o=t.src;s&&!/^blob:/.test(s)&&/^blob:/.test(o)&&(!this.lastSource_||this.lastSource_.tech!==o&&this.lastSource_.player!==s)&&(a=function(){}),a(o),t.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=n.techGet("currentSrc");n.lastSource_.tech=c,n.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:t.src},this.trigger({src:t.src,type:"sourceset"})},r.hasStarted=function(t){if(t===void 0)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},r.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},r.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(t){return t.callback(t.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime();this.on("timeupdate",function a(){n!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",a))})},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(it.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(t){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,t):this.paused()?Ee(this.play()):this.pause()))},r.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(n){return n.contains(t.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,t):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(t){t.cancelable&&t.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(t){var n=t.target.player;if(!n||n===this){var a=this.el(),s=H[this.fsApi_.fullscreenElement]===a;!s&&a.matches?s=a.matches(":"+this.fsApi_.fullscreen):!s&&a.msMatchesSelector&&(s=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}},r.handleTechFullscreenChange_=function(t,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},r.handleTechFullscreenError_=function(t,n){this.trigger("fullscreenerror",n)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(t){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(t){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var t=this.tech_.error();this.error(t)},r.handleTechTextData_=function(){var t=null;arguments.length>1&&(t=arguments[1]),this.trigger("textdata",t)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(t,n){this.ready(function(){if(t in ym)return function(a,s,o,u){return s[o](a.reduce(xs(o),u))}(this.middleware_,this.tech_,t,n);if(t in bc)return _c(this.middleware_,this.tech_,t,n);try{this.tech_&&this.tech_[t](n)}catch(a){throw it(a),a}},!0)},r.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in vm)return function(n,a,s){return n.reduceRight(xs(s),a[s]())}(this.middleware_,this.tech_,t);if(t in bc)return _c(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(n){throw this.tech_[t]===void 0?(it("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(it("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(it(n),n)}}},r.play=function(){var t=this,n=this.options_.Promise||D.Promise;return n?new n(function(a){t.play_(a)}):this.play_()},r.play_=function(t){var n=this;t===void 0&&(t=Ee),this.playCallbacks_.push(t);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(_r||Wt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(u){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&s&&this.load());var o=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),o===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},r.runPlayTerminatedQueue_=function(){var t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],t.forEach(function(n){n()})},r.runPlayCallbacks_=function(t){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(t)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||ln(0,0)},r.scrubbing=function(t){if(t===void 0)return this.scrubbing_;this.scrubbing_=!!t,this.techCall_("setScrubbing",this.scrubbing_),t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(t){return t!==void 0?(t<0&&(t=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",t),void(this.cache_.initTime=0)):(this.cache_.initTime=t,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(t){if(t===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(t)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var t=this.techGet_("buffered");return t&&t.length||(t=ln(0,0)),t},r.bufferedPercent=function(){return lc(this.buffered(),this.duration())},r.bufferedEnd=function(){var t=this.buffered(),n=this.duration(),a=t.end(t.length-1);return a>n&&(a=n),a},r.volume=function(t){var n;return t!==void 0?(n=Math.max(0,Math.min(1,parseFloat(t))),this.cache_.volume=n,this.techCall_("setVolume",n),void(n>0&&this.lastVolume_(n))):(n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n)},r.muted=function(t){if(t===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)},r.defaultMuted=function(t){return t!==void 0?this.techCall_("setDefaultMuted",t):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(t){if(t===void 0||t===0)return this.cache_.lastVolume;this.cache_.lastVolume=t},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(t){if(t!==void 0){var n=this.isFullscreen_;return this.isFullscreen_=!!t,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},r.requestFullscreen=function(t){var n=this.options_.Promise||D.Promise;if(n){var a=this;return new n(function(s,o){function u(){a.off("fullscreenerror",d),a.off("fullscreenchange",c)}function c(){u(),s()}function d(f,_){u(),o(_)}a.one("fullscreenchange",c),a.one("fullscreenerror",d);var m=a.requestFullscreenHelper_(t);m&&(m.then(u,u),m.then(s,o))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(t){var n,a=this;if(this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},t!==void 0&&(n=t)),this.fsApi_.requestFullscreen){var s=this.el_[this.fsApi_.requestFullscreen](n);return s&&s.then(function(){return a.isFullscreen(!0)},function(){return a.isFullscreen(!1)}),s}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var t=this.options_.Promise||D.Promise;if(t){var n=this;return new t(function(a,s){function o(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){o(),a()}function c(m,f){o(),s(f)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var d=n.exitFullscreenHelper_();d&&(d.then(o,o),d.then(a,s))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var t=this;if(this.fsApi_.requestFullscreen){var n=H[this.fsApi_.exitFullscreen]();return n&&Ee(n.then(function(){return t.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=H.documentElement.style.overflow,re(H,"keydown",this.boundFullWindowOnEscKey_),H.documentElement.style.overflow="hidden",Be(H.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(t){et.isEventKey(t,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ft(H,"keydown",this.boundFullWindowOnEscKey_),H.documentElement.style.overflow=this.docOrigOverflow,ki(H.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(t){if(t===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(t){return t!==void 0?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in H&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in H)return H.exitPictureInPicture()},r.handleKeyDown=function(t){var n=this.options_.userActions;n&&n.hotkeys&&(function(a){var s=a.tagName.toLowerCase();return a.isContentEditable?!0:s==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(a.type)===-1:["textarea"].indexOf(s)!==-1}(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,t):this.handleHotkeys(t)))},r.handleHotkeys=function(t){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,s=a===void 0?function(f){return et.isEventKey(f,"f")}:a,o=n.muteKey,u=o===void 0?function(f){return et.isEventKey(f,"m")}:o,c=n.playPauseKey,d=c===void 0?function(f){return et.isEventKey(f,"k")||et.isEventKey(f,"Space")}:c;if(s.call(this,t)){t.preventDefault(),t.stopPropagation();var m=F.getComponent("FullscreenToggle");H[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,t)}else u.call(this,t)?(t.preventDefault(),t.stopPropagation(),F.getComponent("MuteToggle").prototype.handleClick.call(this,t)):d.call(this,t)&&(t.preventDefault(),t.stopPropagation(),F.getComponent("PlayToggle").prototype.handleClick.call(this,t))},r.canPlayType=function(t){for(var n,a=0,s=this.options_.techOrder;a<s.length;a++){var o=s[a],u=mt.getTech(o);if(u||(u=F.getComponent(o)),u){if(u.isSupported()&&(n=u.canPlayType(t)))return n}else it.error('The "'+o+'" tech is undefined. Skipped browser support check for that tech.')}return""},r.selectSource=function(t){var n,a,s=this,o=this.options_.techOrder.map(function(d){return[d,mt.getTech(d)]}).filter(function(d){var m=d[0],f=d[1];return f?f.isSupported():(it.error('The "'+m+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),u=function(d,m,f){var _;return d.some(function(b){return m.some(function(y){if(_=f(b,y))return!0})}),_},c=function(d,m){var f=d[0];if(d[1].canPlaySource(m,s.options_[f.toLowerCase()]))return{source:m,tech:f}};return n=this.options_.sourceOrder?u(t,o,(a=c,function(d,m){return a(m,d)})):u(o,t,c),n||!1},r.handleSrc_=function(t,n){var a=this;if(t===void 0)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var s=bm(t);if(s.length){if(this.changingSrc_=!0,n||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),gm(this,s[0],function(c,d){var m,f;if(a.middleware_=d,n||(a.cache_.sources=s),a.updateSourceCaches_(c),a.src_(c))return s.length>1?a.handleSrc_(s.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void a.triggerReady());m=d,f=a.tech_,m.forEach(function(_){return _.setTech&&_.setTech(f)})}),this.options_.retryOnError&&s.length>1){var o=function(){a.error(null),a.handleSrc_(s.slice(1),!0)},u=function(){a.off("error",o)};this.one("error",o),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",o),a.off("playing",u)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)},r.src=function(t){return this.handleSrc_(t,!1)},r.src_=function(t){var n,a,s=this,o=this.selectSource([t]);return!o||(n=o.tech,a=this.techName_,kt(n)!==kt(a)?(this.changingSrc_=!0,this.loadTech_(o.tech,o.source),this.tech_.ready(function(){s.changingSrc_=!1}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1},!0),!1))},r.load=function(){this.techCall_("load")},r.reset=function(){var t=this,n=this.options_.Promise||D.Promise;this.paused()||!n?this.doReset_():Ee(this.play().then(function(){return t.doReset_()}))},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),He(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var t=this.controlBar||{},n=t.durationDisplay,a=t.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var t=this.currentSource(),n=[];return Object.keys(t).length!==0&&n.push(t),this.cache_.sources||n},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(t){return t!==void 0?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")},r.autoplay=function(t){if(t===void 0)return this.options_.autoplay||!1;var n;typeof t=="string"&&/(any|play|muted)/.test(t)||t===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=t,this.manualAutoplay_(typeof t=="string"?t:"play"),n=!1):this.options_.autoplay=!!t,n=n===void 0?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},r.playsinline=function(t){return t!==void 0?(this.techCall_("setPlaysinline",t),this.options_.playsinline=t,this):this.techGet_("playsinline")},r.loop=function(t){return t!==void 0?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")},r.poster=function(t){if(t===void 0)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(t){if(t===void 0)return!!this.controls_;t=!!t,this.controls_!==t&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(t){if(t===void 0)return!!this.usingNativeControls_;t=!!t,this.usingNativeControls_!==t&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(t){var n=this;if(t===void 0)return this.error_||null;if($e("beforeerror").forEach(function(s){var o=s(n,t);Ne(o)&&!Array.isArray(o)||typeof o=="string"||typeof o=="number"||o===null?t=o:n.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&t&&t.code===4){var a=function(){this.error(t)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(t===null)return this.error_=t,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new zt(t),this.addClass("vjs-error"),it.error("(CODE:"+this.error_.code+" "+zt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),$e("error").forEach(function(s){return s(n,n.error_)})},r.reportUserActivity=function(t){this.userActivity_=!0},r.userActive=function(t){if(t===void 0)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var t,n,a,s=yt(this,this.reportUserActivity),o=function(d){s(),this.clearInterval(t)};this.on("mousedown",function(){s(),this.clearInterval(t),t=this.setInterval(s,250)}),this.on("mousemove",function(d){d.screenX===n&&d.screenY===a||(n=d.screenX,a=d.screenY,s())}),this.on("mouseup",o),this.on("mouseleave",o);var u,c=this.getChild("controlBar");!c||Wt||Me||(c.on("mouseenter",function(d){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(d){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);var d=this.options_.inactivityTimeout;d<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},d))}},250)},r.playbackRate=function(t){if(t===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)},r.defaultPlaybackRate=function(t){return t!==void 0?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(t){if(t===void 0)return!!this.isAudio_;this.isAudio_=!!t},r.enableAudioOnlyUI_=function(){var t=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),s=a&&a.currentHeight();n.forEach(function(o){o!==a&&o.el_&&!o.hasClass("vjs-hidden")&&(o.hide(),t.audioOnlyCache_.hiddenChildren.push(o))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(t){return t.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(t){var n=this;if(typeof t!="boolean"||t===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=t;var a=this.options_.Promise||D.Promise;if(a){if(t){var s=[];return this.isInPictureInPicture()&&s.push(this.exitPictureInPicture()),this.isFullscreen()&&s.push(this.exitFullscreen()),this.audioPosterMode()&&s.push(this.audioPosterMode(!1)),a.all(s).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}t?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(t){var n=this;if(typeof t!="boolean"||t===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=t;var a=this.options_.Promise||D.Promise;return a?t?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.disablePosterModeUI_()}):t?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},r.addTextTrack=function(t,n,a){if(this.tech_)return this.tech_.addTextTrack(t,n,a)},r.addRemoteTextTrack=function(t,n){if(this.tech_)return this.tech_.addRemoteTextTrack(t,n)},r.removeRemoteTextTrack=function(t){t===void 0&&(t={});var n=t.track;if(n||(n=t),this.tech_)return this.tech_.removeRemoteTextTrack(n)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(t){if(t===void 0)return this.language_;this.language_!==String(t).toLowerCase()&&(this.language_=String(t).toLowerCase(),He(this)&&this.trigger("languagechange"))},r.languages=function(){return _t(i.prototype.options_.languages,this.languages_)},r.toJSON=function(){var t=_t(this.options_),n=t.tracks;t.tracks=[];for(var a=0;a<n.length;a++){var s=n[a];(s=_t(s)).player=void 0,t.tracks[a]=s}return t},r.createModal=function(t,n){var a=this;(n=n||{}).content=t||"";var s=new jn(this,n);return this.addChild(s),s.on("dispose",function(){a.removeChild(s)}),s.open(),s},r.updateCurrentBreakpoint_=function(){if(this.responsive())for(var t=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<Zs.length;a++){var s=Zs[a];if(n<=this.breakpoints_[s]){if(t===s)return;t&&this.removeClass(Ur[t]),this.addClass(Ur[s]),this.breakpoint_=s;break}}},r.removeCurrentBreakpoint_=function(){var t=this.currentBreakpointClass();this.breakpoint_="",t&&this.removeClass(t)},r.breakpoints=function(t){return t===void 0||(this.breakpoint_="",this.breakpoints_=wt({},Hm,t),this.updateCurrentBreakpoint_()),wt(this.breakpoints_)},r.responsive=function(t){return t===void 0?this.responsive_:(t=!!t)!==this.responsive_?(this.responsive_=t,t?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),t):void 0},r.currentBreakpoint=function(){return this.breakpoint_},r.currentBreakpointClass=function(){return Ur[this.breakpoint_]||""},r.loadMedia=function(t,n){var a=this;if(t&&typeof t=="object"){this.reset(),this.cache_.media=_t(t);var s=this.cache_.media,o=s.artwork,u=s.poster,c=s.src,d=s.textTracks;!o&&u&&(this.cache_.media.artwork=[{src:u,type:Ar(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(d)&&d.forEach(function(m){return a.addRemoteTextTrack(m,!1)}),this.ready(n)}},r.getMedia=function(){if(!this.cache_.media){var t=this.poster(),n={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(a){return{kind:a.kind,label:a.label,language:a.language,src:a.src}})};return t&&(n.poster=t,n.artwork=[{src:n.poster,type:Ar(n.poster)}]),n}return _t(this.cache_.media)},i.getTagSettings=function(t){var n={sources:[],tracks:[]},a=Fe(t),s=a["data-setup"];if(on(t,"vjs-fill")&&(a.fill=!0),on(t,"vjs-fluid")&&(a.fluid=!0),s!==null){var o=up(s||"{}"),u=o[0],c=o[1];u&&it.error(u),wt(a,c)}if(wt(n,a),t.hasChildNodes())for(var d=t.childNodes,m=0,f=d.length;m<f;m++){var _=d[m],b=_.nodeName.toLowerCase();b==="source"?n.sources.push(Fe(_)):b==="track"&&n.tracks.push(Fe(_))}return n},r.flexNotSupported_=function(){var t=H.createElement("i");return!("flexBasis"in t.style||"webkitFlexBasis"in t.style||"mozFlexBasis"in t.style||"msFlexBasis"in t.style||"msFlexOrder"in t.style)},r.debug=function(t){if(t===void 0)return this.debugEnabled_;t?(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)},r.playbackRates=function(t){if(t===void 0)return this.cache_.playbackRates;Array.isArray(t)&&t.every(function(n){return typeof n=="number"})&&(this.cache_.playbackRates=t,this.trigger("playbackrateschange"))},i}(F);Xt.names.forEach(function(e){var i=Xt[e];xt.prototype[i.getterName]=function(){return this.tech_?this.tech_[i.getterName]():(this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName])}}),xt.prototype.crossorigin=xt.prototype.crossOrigin,xt.players={};var Oi=D.navigator;xt.prototype.options_={techOrder:mt.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Oi&&(Oi.languages&&Oi.languages[0]||Oi.userLanguage||Oi.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},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){xt.prototype[e]=function(){return this.techGet_(e)}}),ed.forEach(function(e){xt.prototype["handleTech"+kt(e)+"_"]=function(){return this.trigger(e)}}),F.registerComponent("Player",xt);var Br="plugin",Xn="activePlugins_",Kn={},Fr=function(e){return Kn.hasOwnProperty(e)},jr=function(e){return Fr(e)?Kn[e]:void 0},nd=function(e,i){e[Xn]=e[Xn]||{},e[Xn][i]=!0},qr=function(e,i,r){var t=(r?"before":"")+"pluginsetup";e.trigger(t,i),e.trigger(t+":"+i.name,i)},id=function(e,i){return i.prototype.name=e,function(){qr(this,{name:e,plugin:i,instance:null},!0);for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];var a=lu(i,[this].concat(t));return this[e]=function(){return a},qr(this,a.getEventHash()),a}},we=function(){function e(r){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=r,this.log||(this.log=this.player.log.createLogger(this.name)),vs(this),delete this.trigger,oc(this,this.constructor.defaultState),nd(r,this.name),this.dispose=this.dispose.bind(this),r.on("dispose",this.dispose)}var i=e.prototype;return i.version=function(){return this.constructor.VERSION},i.getEventHash=function(r){return r===void 0&&(r={}),r.name=this.name,r.plugin=this.constructor,r.instance=this,r},i.trigger=function(r,t){return t===void 0&&(t={}),Bn(this.eventBusEl_,r,this.getEventHash(t))},i.handleStateChanged=function(r){},i.dispose=function(){var r=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Xn][r]=!1,this.player=this.state=null,t[r]=id(r,Kn[r])},e.isBasic=function(r){var t=typeof r=="string"?jr(r):r;return typeof t=="function"&&!e.prototype.isPrototypeOf(t.prototype)},e.registerPlugin=function(r,t){if(typeof r!="string")throw new Error('Illegal plugin name, "'+r+'", must be a string, was '+typeof r+".");if(Fr(r))it.warn('A plugin named "'+r+'" already exists. You may want to avoid re-registering plugins!');else if(xt.prototype.hasOwnProperty(r))throw new Error('Illegal plugin name, "'+r+'", cannot share a name with an existing player method!');if(typeof t!="function")throw new Error('Illegal plugin for "'+r+'", must be a function, was '+typeof t+".");return Kn[r]=t,r!==Br&&(e.isBasic(t)?xt.prototype[r]=function(n,a){var s=function(){qr(this,{name:n,plugin:a,instance:null},!0);var o=a.apply(this,arguments);return nd(this,n),qr(this,{name:n,plugin:a,instance:o}),o};return Object.keys(a).forEach(function(o){s[o]=a[o]}),s}(r,t):xt.prototype[r]=id(r,t)),t},e.deregisterPlugin=function(r){if(r===Br)throw new Error("Cannot de-register base plugin.");Fr(r)&&(delete Kn[r],delete xt.prototype[r])},e.getPlugins=function(r){var t;return r===void 0&&(r=Object.keys(Kn)),r.forEach(function(n){var a=jr(n);a&&((t=t||{})[n]=a)}),t},e.getPluginVersion=function(r){var t=jr(r);return t&&t.VERSION||""},e}();we.getPlugin=jr,we.BASE_PLUGIN_NAME=Br,we.registerPlugin(Br,we),xt.prototype.usingPlugin=function(e){return!!this[Xn]&&this[Xn][e]===!0},xt.prototype.hasPlugin=function(e){return!!Fr(e)};var rd=!1,ad=function(e){return e.indexOf("#")===0?e.slice(1):e};function O(e,i,r){var t=O.getPlayer(e);if(t)return i&&it.warn('Player "'+e+'" is already initialised. Options will not be applied.'),r&&t.ready(r),t;var n=typeof e=="string"?Je("#"+ad(e)):e;if(!Nn(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");n.ownerDocument.defaultView&&n.ownerDocument.body.contains(n)||it.warn("The element supplied is not included in the DOM"),(i=i||{}).restoreEl===!0&&(i.restoreEl=(n.parentNode&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),$e("beforesetup").forEach(function(s){var o=s(n,_t(i));Ne(o)&&!Array.isArray(o)?i=_t(i,o):it.error("please return an object in beforesetup hooks")});var a=F.getComponent("Player");return t=new a(n,i,r),$e("setup").forEach(function(s){return s(t)}),t}if(O.hooks_=Re,O.hooks=$e,O.hook=function(e,i){$e(e,i)},O.hookOnce=function(e,i){$e(e,[].concat(i).map(function(r){return function t(){return Il(e,t),r.apply(void 0,arguments)}}))},O.removeHook=Il,D.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Rn()){var Hr=Je(".vjs-styles-defaults");if(!Hr){Hr=ec("vjs-styles-defaults");var to=Je("head");to&&to.insertBefore(Hr,to.firstChild),nc(Hr,`
- .video-js {
- width: 300px;
- height: 150px;
- }
- .vjs-fluid:not(.vjs-audio-only-mode) {
- padding-top: 56.25%
- }
- `)}}hs(1,O),O.VERSION=Dl,O.options=xt.prototype.options_,O.getPlayers=function(){return xt.players},O.getPlayer=function(e){var i,r=xt.players;if(typeof e=="string"){var t=ad(e),n=r[t];if(n)return n;i=Je("#"+t)}else i=e;if(Nn(i)){var a=i,s=a.player,o=a.playerId;if(s||r[o])return s||r[o]}},O.getAllPlayers=function(){return Object.keys(xt.players).map(function(e){return xt.players[e]}).filter(Boolean)},O.players=xt.players,O.getComponent=F.getComponent,O.registerComponent=function(e,i){mt.isTech(i)&&it.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),F.registerComponent.call(F,e,i)},O.getTech=mt.getTech,O.registerTech=mt.registerTech,O.use=function(e,i){cn[e]=cn[e]||[],cn[e].push(i)},Object.defineProperty(O,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(O.middleware,"TERMINATOR",{value:Ir,writeable:!1,enumerable:!0}),O.browser=Yf,O.TOUCH_ENABLED=On,O.extend=function(e,i){i===void 0&&(i={}),rd||(it.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),rd=!0);var r=function(){e.apply(this,arguments)},t={};for(var n in typeof i=="object"?(i.constructor!==Object.prototype.constructor&&(r=i.constructor),t=i):typeof i=="function"&&(r=i),function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&_n(a,s)}(r,e),e&&(r.super_=e),t)t.hasOwnProperty(n)&&(r.prototype[n]=t[n]);return r},O.mergeOptions=_t,O.bind=yt,O.registerPlugin=we.registerPlugin,O.deregisterPlugin=we.deregisterPlugin,O.plugin=function(e,i){return it.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),we.registerPlugin(e,i)},O.getPlugins=we.getPlugins,O.getPlugin=we.getPlugin,O.getPluginVersion=we.getPluginVersion,O.addLanguage=function(e,i){var r;return e=(""+e).toLowerCase(),O.options.languages=_t(O.options.languages,((r={})[e]=i,r)),O.options.languages[e]},O.log=it,O.createLogger=Pl,O.createTimeRange=O.createTimeRanges=ln,O.formatTime=Wn,O.setFormatTime=function(e){As=e},O.resetFormatTime=function(){As=wc},O.parseUrl=ws,O.isCrossOrigin=Dr,O.EventTarget=Lt,O.on=re,O.one=wr,O.off=Ft,O.trigger=Bn,O.xhr=Zo,O.TextTrack=Ai,O.AudioTrack=vc,O.VideoTrack=yc,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){O[e]=function(){return it.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Jl[e].apply(null,arguments)}}),O.computedStyle=Si,O.dom=Jl,O.url=mm,O.defineLazyProperty=$s,O.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var ve=Ji,Vr=function(e,i,r){return e&&r&&r.responseURL&&i!==r.responseURL?r.responseURL:i},ye=function(e){return O.log.debug?O.log.debug.bind(O,"VHS:",e+" >"):function(){}},pn=1/30,ke=.1,sd=function(e,i){var r,t=[];if(e&&e.length)for(r=0;r<e.length;r++)i(e.start(r),e.end(r))&&t.push([e.start(r),e.end(r)]);return O.createTimeRanges(t)},Yn=function(e,i){return sd(e,function(r,t){return r-ke<=i&&t+ke>=i})},Wr=function(e,i){return sd(e,function(r){return r-pn>=i})},od=function(e){var i=[];if(!e||!e.length)return"";for(var r=0;r<e.length;r++)i.push(e.start(r)+" => "+e.end(r));return i.join(", ")},fn=function(e){for(var i=[],r=0;r<e.length;r++)i.push({start:e.start(r),end:e.end(r)});return i},ud=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},eo=function(e,i){var r=0;if(!e||!e.length)return r;for(var t=0;t<e.length;t++){var n=e.start(t),a=e.end(t);i>a||(r+=i>n&&i<=a?a-i:a-n)}return r},ld=O.createTimeRange,no=function(e,i){if(!i.preload)return i.duration;var r=0;return(i.parts||[]).forEach(function(t){r+=t.duration}),(i.preloadHints||[]).forEach(function(t){t.type==="PART"&&(r+=e.partTargetDuration)}),r},io=function(e){return(e.segments||[]).reduce(function(i,r,t){return r.parts?r.parts.forEach(function(n,a){i.push({duration:n.duration,segmentIndex:t,partIndex:a,part:n,segment:r})}):i.push({duration:r.duration,segmentIndex:t,partIndex:null,segment:r,part:null}),i},[])},cd=function(e){var i=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return i&&i.parts||[]},dd=function(e){var i=e.preloadSegment;if(i){var r=i.parts,t=(i.preloadHints||[]).reduce(function(n,a){return n+(a.type==="PART"?1:0)},0);return t+=r&&r.length?r.length:0}},hd=function(e,i){if(i.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var r=cd(i).length>0;return r&&i.serverControl&&i.serverControl.partHoldBack?i.serverControl.partHoldBack:r&&i.partTargetDuration?3*i.partTargetDuration:i.serverControl&&i.serverControl.holdBack?i.serverControl.holdBack:i.targetDuration?3*i.targetDuration:0},pd=function(e,i,r){if(i===void 0&&(i=e.mediaSequence+e.segments.length),i<e.mediaSequence)return 0;var t=function(a,s){var o=0,u=s-a.mediaSequence,c=a.segments[u];if(c){if(c.start!==void 0)return{result:c.start,precise:!0};if(c.end!==void 0)return{result:c.end-c.duration,precise:!0}}for(;u--;){if((c=a.segments[u]).end!==void 0)return{result:o+c.end,precise:!0};if(o+=no(a,c),c.start!==void 0)return{result:o+c.start,precise:!0}}return{result:o,precise:!1}}(e,i);if(t.precise)return t.result;var n=function(a,s){for(var o,u=0,c=s-a.mediaSequence;c<a.segments.length;c++){if((o=a.segments[c]).start!==void 0)return{result:o.start-u,precise:!0};if(u+=no(a,o),o.end!==void 0)return{result:o.end-u,precise:!0}}return{result:-1,precise:!1}}(e,i);return n.precise?n.result:t.result+r},fd=function(e,i,r){if(!e)return 0;if(typeof r!="number"&&(r=0),i===void 0){if(e.totalDuration)return e.totalDuration;if(!e.endList)return D.Infinity}return pd(e,i,r)},Ri=function(e){var i=e.defaultDuration,r=e.durationList,t=e.startIndex,n=e.endIndex,a=0;if(t>n){var s=[n,t];t=s[0],n=s[1]}if(t<0){for(var o=t;o<Math.min(0,n);o++)a+=i;t=0}for(var u=t;u<n;u++)a+=r[u].duration;return a},md=function(e,i,r,t){if(!e||!e.segments)return null;if(e.endList)return fd(e);if(i===null)return null;i=i||0;var n=pd(e,e.mediaSequence+e.segments.length,i);return r&&(n-=t=typeof t=="number"?t:hd(null,e)),Math.max(0,n)},gd=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ro=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Gr=function(e){var i=gd(e);return!e.disabled&&!i},vd=function(e,i){return i.attributes&&i.attributes[e]},ao=function(e,i){if(e.playlists.length===1)return!0;var r=i.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(t){return!!Gr(t)&&(t.attributes.BANDWIDTH||0)<r}).length===0},so=function(e,i){return!(!e&&!i||!e&&i||e&&!i)&&(e===i||!(!e.id||!i.id||e.id!==i.id)||!(!e.resolvedUri||!i.resolvedUri||e.resolvedUri!==i.resolvedUri)||!(!e.uri||!i.uri||e.uri!==i.uri))},yd=function(e,i){var r=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},t=!1;for(var n in r){for(var a in r[n])if(t=i(r[n][a]))break;if(t)break}return!!t},Ni=function(e){if(!e||!e.playlists||!e.playlists.length)return yd(e,function(n){return n.playlists&&n.playlists.length||n.uri});for(var i=function(n){var a=e.playlists[n],s=a.attributes&&a.attributes.CODECS;return s&&s.split(",").every(function(o){return gu(o)})||yd(e,function(o){return so(a,o)})?"continue":{v:!1}},r=0;r<e.playlists.length;r++){var t=i(r);if(t!=="continue"&&typeof t=="object")return t.v}return!0},ee={liveEdgeDelay:hd,duration:fd,seekable:function(e,i,r){var t=i||0,n=md(e,i,!0,r);return n===null?ld():ld(t,n)},getMediaInfoForTime:function(e){for(var i=e.playlist,r=e.currentTime,t=e.startingSegmentIndex,n=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=r-a,u=io(i),c=0,d=0;d<u.length;d++){var m=u[d];if(t===m.segmentIndex&&(typeof n!="number"||typeof m.partIndex!="number"||n===m.partIndex)){c=d;break}}if(o<0){if(c>0)for(var f=c-1;f>=0;f--){var _=u[f];if(o+=_.duration,s){if(o<0)continue}else if(o+pn<=0)continue;return{partIndex:_.partIndex,segmentIndex:_.segmentIndex,startTime:a-Ri({defaultDuration:i.targetDuration,durationList:u,startIndex:c,endIndex:f})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r}}if(c<0){for(var b=c;b<0;b++)if((o-=i.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:r};c=0}for(var y=c;y<u.length;y++){var E=u[y];if(o-=E.duration,s){if(o>0)continue}else if(o-pn>=0)continue;return{partIndex:E.partIndex,segmentIndex:E.segmentIndex,startTime:a+Ri({defaultDuration:i.targetDuration,durationList:u,startIndex:c,endIndex:y})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:r}},isEnabled:Gr,isDisabled:function(e){return e.disabled},isBlacklisted:gd,isIncompatible:ro,playlistEnd:md,isAes:function(e){for(var i=0;i<e.segments.length;i++)if(e.segments[i].key)return!0;return!1},hasAttribute:vd,estimateSegmentRequestTime:function(e,i,r,t){return t===void 0&&(t=0),vd("BANDWIDTH",r)?(e*r.attributes.BANDWIDTH-8*t)/i:NaN},isLowestEnabledRendition:ao,isAudioOnly:Ni,playlistMatch:so,segmentDurationWithParts:no},_d=O.log,oo=function(e,i){return e+"-"+i},Vm=function(e,i,r){return"placeholder-uri-"+e+"-"+i+"-"+r},Qn=function(e,i){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(r){if(e.mediaGroups[r])for(var t in e.mediaGroups[r])for(var n in e.mediaGroups[r][t]){var a=e.mediaGroups[r][t][n];i(a,r,t,n)}})},bd=function(e){var i=e.playlist,r=e.uri,t=e.id;i.id=t,i.playlistErrors_=0,r&&(i.uri=r),i.attributes=i.attributes||{}},Td=function(e,i,r){r===void 0&&(r=Vm),e.uri=i;for(var t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){var n="placeholder-uri-"+t;e.playlists[t].uri=n}var a=Ni(e);Qn(e,function(s,o,u,c){if(!s.playlists||!s.playlists.length){if(a&&o==="AUDIO"&&!s.uri)for(var d=0;d<e.playlists.length;d++){var m=e.playlists[d];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===u)return}s.playlists=[he({},s)]}s.playlists.forEach(function(f,_){var b=r(o,u,c,f),y=oo(_,b);f.uri?f.resolvedUri=f.resolvedUri||ve(e.uri,f.uri):(f.uri=_===0?b:y,f.resolvedUri=f.uri),f.id=f.id||y,f.attributes=f.attributes||{},e.playlists[f.id]=f,e.playlists[f.uri]=f})}),function(s){for(var o=s.playlists.length;o--;){var u=s.playlists[o];bd({playlist:u,id:oo(o,u.uri)}),u.resolvedUri=ve(s.uri,u.uri),s.playlists[u.id]=u,s.playlists[u.uri]=u,u.attributes.BANDWIDTH||_d.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(s){Qn(s,function(o){o.uri&&(o.resolvedUri=ve(s.uri,o.uri))})}(e)},zr=O.mergeOptions,Wm=O.EventTarget,Gm=function(e,i){if(!e)return i;var r=zr(e,i);if(e.preloadHints&&!i.preloadHints&&delete r.preloadHints,e.parts&&!i.parts)delete r.parts;else if(e.parts&&i.parts)for(var t=0;t<i.parts.length;t++)e.parts&&e.parts[t]&&(r.parts[t]=zr(e.parts[t],i.parts[t]));return!e.skipped&&i.skipped&&(r.skipped=!1),e.preload&&!i.preload&&(r.preload=!1),r},Sd=function(e,i){!e.resolvedUri&&e.uri&&(e.resolvedUri=ve(i,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=ve(i,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=ve(i,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=ve(i,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(r){r.resolvedUri||(r.resolvedUri=ve(i,r.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(r){r.resolvedUri||(r.resolvedUri=ve(i,r.uri))})},Ed=function(e){var i=e.segments||[],r=e.preloadSegment;if(r&&r.parts&&r.parts.length){if(r.preloadHints){for(var t=0;t<r.preloadHints.length;t++)if(r.preloadHints[t].type==="MAP")return i}r.duration=e.targetDuration,r.preload=!0,i.push(r)}return i},wd=function(e,i){return e===i||e.segments&&i.segments&&e.segments.length===i.segments.length&&e.endList===i.endList&&e.mediaSequence===i.mediaSequence&&e.preloadSegment===i.preloadSegment},uo=function(e,i,r){r===void 0&&(r=wd);var t=zr(e,{}),n=t.playlists[i.id];if(!n||r(n,i))return null;i.segments=Ed(i);var a=zr(n,i);if(a.preloadSegment&&!i.preloadSegment&&delete a.preloadSegment,n.segments){if(i.skip){i.segments=i.segments||[];for(var s=0;s<i.skip.skippedSegments;s++)i.segments.unshift({skipped:!0})}a.segments=function(u,c,d){var m=u.slice(),f=c.slice();d=d||0;for(var _,b=[],y=0;y<f.length;y++){var E=m[y+d],w=f[y];E?(_=E.map||_,b.push(Gm(E,w))):(_&&!w.map&&(w.map=_),b.push(w))}return b}(n.segments,i.segments,i.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){Sd(u,a.resolvedUri)});for(var o=0;o<t.playlists.length;o++)t.playlists[o].id===i.id&&(t.playlists[o]=a);return t.playlists[i.id]=a,t.playlists[i.uri]=a,Qn(e,function(u,c,d,m){if(u.playlists)for(var f=0;f<u.playlists.length;f++)i.id===u.playlists[f].id&&(u.playlists[f]=a)}),t},lo=function(e,i){var r=e.segments||[],t=r[r.length-1],n=t&&t.parts&&t.parts[t.parts.length-1],a=n&&n.duration||t&&t.duration;return i&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},$n=function(e){function i(t,n,a){var s;if(a===void 0&&(a={}),s=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");s.logger_=ye("PlaylistLoader");var o=a,u=o.withCredentials,c=u!==void 0&&u,d=o.handleManifestRedirects,m=d!==void 0&&d;s.src=t,s.vhs_=n,s.withCredentials=c,s.handleManifestRedirects=m;var f=n.options_;return s.customTagParsers=f&&f.customTagParsers||[],s.customTagMappers=f&&f.customTagMappers||[],s.experimentalLLHLS=f&&f.experimentalLLHLS||!1,O.browser.IE_VERSION&&(s.experimentalLLHLS=!1),s.state="HAVE_NOTHING",s.handleMediaupdatetimeout_=s.handleMediaupdatetimeout_.bind(tt(s)),s.on("mediaupdatetimeout",s.handleMediaupdatetimeout_),s}V(i,e);var r=i.prototype;return r.handleMediaupdatetimeout_=function(){var t=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=ve(this.master.uri,n.uri);this.experimentalLLHLS&&(a=function(s,o){if(o.endList||!o.serverControl)return s;var u={};if(o.serverControl.canBlockReload){var c=o.preloadSegment,d=o.mediaSequence+o.segments.length;if(c){var m=c.parts||[],f=dd(o)-1;f>-1&&f!==m.length-1&&(u._HLS_part=f),(f>-1||m.length)&&d--}u._HLS_msn=d}if(o.serverControl&&o.serverControl.canSkipUntil&&(u._HLS_skip=o.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(u).length){var _=new D.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(b){u.hasOwnProperty(b)&&_.searchParams.set(b,u[b])}),s=_.toString()}return s}(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(s,o){if(t.request)return s?t.playlistRequestError(t.request,t.media(),"HAVE_METADATA"):void t.haveMetadata({playlistString:t.request.responseText,url:t.media().uri,id:t.media().id})})}},r.playlistRequestError=function(t,n,a){var s=n.uri,o=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[o],status:t.status,message:"HLS playlist request error at URL: "+s+".",responseText:t.responseText,code:t.status>=500?4:2},this.trigger("error")},r.parseManifest_=function(t){var n=this,a=t.url;return function(s){var o=s.onwarn,u=s.oninfo,c=s.manifestString,d=s.customTagParsers,m=d===void 0?[]:d,f=s.customTagMappers,_=f===void 0?[]:f,b=s.experimentalLLHLS,y=new Up;o&&y.on("warn",o),u&&y.on("info",u),m.forEach(function(P){return y.addParser(P)}),_.forEach(function(P){return y.addTagMapper(P)}),y.push(c),y.end();var E=y.manifest;if(b||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(P){E.hasOwnProperty(P)&&delete E[P]}),E.segments&&E.segments.forEach(function(P){["parts","preloadHints"].forEach(function(N){P.hasOwnProperty(N)&&delete P[N]})})),!E.targetDuration){var w=10;E.segments&&E.segments.length&&(w=E.segments.reduce(function(P,N){return Math.max(P,N.duration)},0)),o&&o("manifest has no targetDuration defaulting to "+w),E.targetDuration=w}var k=cd(E);if(k.length&&!E.partTargetDuration){var I=k.reduce(function(P,N){return Math.max(P,N.duration)},0);o&&(o("manifest has no partTargetDuration defaulting to "+I),_d.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.")),E.partTargetDuration=I}return E}({onwarn:function(s){var o=s.message;return n.logger_("m3u8-parser warn for "+a+": "+o)},oninfo:function(s){var o=s.message;return n.logger_("m3u8-parser info for "+a+": "+o)},manifestString:t.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(t){var n=t.playlistString,a=t.playlistObject,s=t.url,o=t.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:s,manifestString:n});u.lastRequest=Date.now(),bd({playlist:u,uri:s,id:o});var c=uo(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(lo(this.media(),!!c)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),D.clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},r.media=function(t,n){var a=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof t=="string"){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(D.clearTimeout(this.finalRenditionTimeout),n){var s=(t.partTargetDuration||t.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,t,!1),s)}else{var o=this.state,u=!this.media_||t.id!==this.media_.id,c=this.master.playlists[t.id];if(c&&c.endList||t.endList&&t.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(u&&(this.trigger("mediachanging"),o==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(lo(t,!0)),u){if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=t,this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials},function(d,m){if(a.request){if(t.lastRequest=Date.now(),t.resolvedUri=Vr(a.handleManifestRedirects,t.resolvedUri,m),d)return a.playlistRequestError(a.request,t,o);a.haveMetadata({playlistString:m.responseText,url:t.uri,id:t.id}),o==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}}},r.pause=function(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(t){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(t){var s=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},s)}else this.started?a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},r.updateMediaUpdateTimeout_=function(t){var n=this;this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=D.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(t)},t))},r.start=function(){var t=this;if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){t.setupInitialPlaylist(t.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(t.request){if(t.request=null,n)return t.error={status:a.status,message:"HLS playlist request error at URL: "+t.src+".",responseText:a.responseText,code:2},t.state==="HAVE_NOTHING"&&(t.started=!1),t.trigger("error");t.src=Vr(t.handleManifestRedirects,t.src,a);var s=t.parseManifest_({manifestString:a.responseText,url:t.src});t.setupInitialPlaylist(s)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(t){if(this.state="HAVE_MASTER",t.playlists)return this.master=t,Td(this.master,this.srcUri()),t.playlists.forEach(function(a){a.segments=Ed(a),a.segments.forEach(function(s){Sd(s,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var n=this.srcUri()||D.location.href;this.master=function(a,s){var o=oo(0,s),u={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:s,id:o,resolvedUri:s,attributes:{}}]};return u.playlists[o]=u.playlists[0],u.playlists[s]=u.playlists[0],u}(0,n),this.haveMetadata({playlistObject:t,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},i}(Wm),zm=O.xhr,Xm=O.mergeOptions,co=function(e,i,r,t){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!i&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),r.headers&&(e.responseHeaders=r.headers),i&&i.code==="ETIMEDOUT"&&(e.timedout=!0),i||e.aborted||r.statusCode===200||r.statusCode===206||r.statusCode===0||(i=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),t(i,e)},kd=function(){var e=function i(r,t){r=Xm({timeout:45e3},r);var n=i.beforeRequest||O.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var s=(O.Vhs.xhr.original===!0?zm:O.Vhs.xhr)(r,function(u,c){return co(s,u,c,t)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=r.uri,s.requestTime=Date.now(),s};return e.original=!0,e},ho=function(e){var i,r={};return e.byterange&&(r.Range="bytes="+(i=e.byterange).offset+"-"+(typeof i.offset=="bigint"||typeof i.length=="bigint"?D.BigInt(i.offset)+D.BigInt(i.length)-D.BigInt(1):i.offset+i.length-1)),r},Km=function(e,i){return e.start(i)+"-"+e.end(i)},Ym=function(e,i){var r=e.toString(16);return"00".substring(0,2-r.length)+r+(i%2?" ":"")},Qm=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Cd=function(e){var i={};return Object.keys(e).forEach(function(r){var t=e[r];_u(t)?i[r]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:i[r]=t}),i},Xr=function(e){var i=e.byterange||{length:1/0,offset:0};return[i.length,i.offset,e.resolvedUri].join(",")},xd=function(e){return e.resolvedUri},Dd=function(e){for(var i=Array.prototype.slice.call(e),r=16,t="",n=0;n<i.length/r;n++)t+=i.slice(n*r,n*r+r).map(Ym).join("")+" "+i.slice(n*r,n*r+r).map(Qm).join("")+`
- `;return t},$m=Object.freeze({__proto__:null,createTransferableMessage:Cd,initSegmentId:Xr,segmentKeyId:xd,hexDump:Dd,tagDump:function(e){var i=e.bytes;return Dd(i)},textRanges:function(e){var i,r="";for(i=0;i<e.length;i++)r+=Km(e,i)+" ";return r}}),Jm=function(e){var i=e.playlist,r=e.time,t=r===void 0?void 0:r,n=e.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!i||t===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=function(u,c){if(!c||!c.segments||c.segments.length===0)return null;for(var d,m=0,f=0;f<c.segments.length&&!(u<=(m=(d=c.segments[f]).videoTimingInfo?d.videoTimingInfo.transmuxedPresentationEnd:m+d.duration));f++);var _=c.segments[c.segments.length-1];if(_.videoTimingInfo&&_.videoTimingInfo.transmuxedPresentationEnd<u)return null;if(u>m){if(u>m+.25*_.duration)return null;d=_}return{segment:d,estimatedStart:d.videoTimingInfo?d.videoTimingInfo.transmuxedPresentationStart:m-d.duration,type:d.videoTimingInfo?"accurate":"estimate"}}(t,i);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:t},o=function(u,c){if(!c.dateTimeObject)return null;var d=c.videoTimingInfo.transmuxerPrependedSeconds,m=u-(c.videoTimingInfo.transmuxedPresentationStart+d);return new Date(c.dateTimeObject.getTime()+1e3*m)}(t,a.segment);return o&&(s.programDateTime=o.toISOString()),n(null,s)},Zm=function e(i){var r=i.programTime,t=i.playlist,n=i.retryCount,a=n===void 0?2:n,s=i.seekTo,o=i.pauseAfterSeek,u=o===void 0||o,c=i.tech,d=i.callback;if(!d)throw new Error("seekToProgramTime: callback must be provided");if(r===void 0||!t||!s)return d({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!c.hasStarted_)return d({message:"player must be playing a live stream to start buffering"});if(!function(y){if(!y.segments||y.segments.length===0)return!1;for(var E=0;E<y.segments.length;E++)if(!y.segments[E].dateTimeObject)return!1;return!0}(t))return d({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});var m=function(y,E){var w;try{w=new Date(y)}catch{return null}if(!E||!E.segments||E.segments.length===0)return null;var k=E.segments[0];if(w<k.dateTimeObject)return null;for(var I=0;I<E.segments.length-1&&(k=E.segments[I],!(w<E.segments[I+1].dateTimeObject));I++);var P,N=E.segments[E.segments.length-1],A=N.dateTimeObject,U=N.videoTimingInfo?(P=N.videoTimingInfo).transmuxedPresentationEnd-P.transmuxedPresentationStart-P.transmuxerPrependedSeconds:N.duration+.25*N.duration;return w>new Date(A.getTime()+1e3*U)?null:(w>A&&(k=N),{segment:k,estimatedStart:k.videoTimingInfo?k.videoTimingInfo.transmuxedPresentationStart:ee.duration(E,E.mediaSequence+E.segments.indexOf(k)),type:k.videoTimingInfo?"accurate":"estimate"})}(r,t);if(!m)return d({message:r+" was not found in the stream"});var f=m.segment,_=function(y,E){var w,k;try{w=new Date(y),k=new Date(E)}catch{}var I=w.getTime();return(k.getTime()-I)/1e3}(f.dateTimeObject,r);if(m.type==="estimate")return a===0?d({message:r+" is not buffered yet. Try again"}):(s(m.estimatedStart+_),void c.one("seeked",function(){e({programTime:r,playlist:t,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:c,callback:d})}));var b=f.start+_;c.one("seeked",function(){return d(null,c.currentTime())}),u&&c.pause(),s(b)},Id=function(e,i){if(e.readyState===4)return i()},tg=function(e,i,r){var t,n=[],a=!1,s=function(d,m,f,_){return m.abort(),a=!0,r(d,m,f,_)},o=function(d,m){if(!a){if(d)return s(d,m,"",n);var f=m.responseText.substring(n&&n.byteLength||0,m.responseText.length);if(n=function(){for(var b=arguments.length,y=new Array(b),E=0;E<b;E++)y[E]=arguments[E];if(y=y.filter(function(P){return P&&(P.byteLength||P.length)&&typeof P!="string"}),y.length<=1)return Z(y[0]);var w=y.reduce(function(P,N,A){return P+(N.byteLength||N.length)},0),k=new Uint8Array(w),I=0;return y.forEach(function(P){P=Z(P),k.set(P,I),I+=P.byteLength}),k}(n,bu(f,!0)),t=t||_i(n),n.length<10||t&&n.length<t+2)return Id(m,function(){return s(d,m,"",n)});var _=Za(n);return _==="ts"&&n.length<188||!_&&n.length<376?Id(m,function(){return s(d,m,"",n)}):s(null,m,_,n)}},u={uri:e,beforeSend:function(d){d.overrideMimeType("text/plain; charset=x-user-defined"),d.addEventListener("progress",function(m){return m.total,m.loaded,co(d,null,{statusCode:d.status},o)})}},c=i(u,function(d,m){return co(c,d,m,o)});return c},eg=O.EventTarget,Ad=O.mergeOptions,Pd=function(e,i){if(!wd(e,i)||e.sidx&&i.sidx&&(e.sidx.offset!==i.sidx.offset||e.sidx.length!==i.sidx.length)||!e.sidx&&i.sidx||e.sidx&&!i.sidx||e.segments&&!i.segments||!e.segments&&i.segments)return!1;if(!e.segments&&!i.segments)return!0;for(var r=0;r<e.segments.length;r++){var t=e.segments[r],n=i.segments[r];if(t.uri!==n.uri)return!1;if(t.byterange||n.byterange){var a=t.byterange,s=n.byterange;if(a&&!s||!a&&s||a.offset!==s.offset||a.length!==s.length)return!1}}return!0},ng=function(e,i,r,t){return"placeholder-uri-"+e+"-"+i+"-"+(t.attributes.NAME||r)},ig=function(e,i,r){for(var t=!0,n=Ad(e,{duration:i.duration,minimumUpdatePeriod:i.minimumUpdatePeriod,timelineStarts:i.timelineStarts}),a=0;a<i.playlists.length;a++){var s=i.playlists[a];if(s.sidx){var o=cr(s.sidx);r&&r[o]&&r[o].sidx&&za(s,r[o].sidx,s.sidx.resolvedUri)}var u=uo(n,s,Pd);u&&(n=u,t=!1)}return Qn(i,function(c,d,m,f){if(c.playlists&&c.playlists.length){var _=c.playlists[0].id,b=uo(n,c.playlists[0],Pd);b&&(f in(n=b).mediaGroups[d][m]||(n.mediaGroups[d][m][f]=c),n.mediaGroups[d][m][f].playlists[0]=n.playlists[_],t=!1)}}),function(c,d){Qn(c,function(m,f,_,b){b in d.mediaGroups[f][_]||delete c.mediaGroups[f][_][b]})}(n,i),i.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(t=!1),t?null:n},rg=function(e,i){return(!e.map&&!i.map||!!(e.map&&i.map&&e.map.byterange.offset===i.map.byterange.offset&&e.map.byterange.length===i.map.byterange.length))&&e.uri===i.uri&&e.byterange.offset===i.byterange.offset&&e.byterange.length===i.byterange.length},Ld=function(e,i){var r={};for(var t in e){var n=e[t].sidx;if(n){var a=cr(n);if(!i[a])break;var s=i[a].sidxInfo;rg(s,n)&&(r[a]=i[a])}}return r},po=function(e){function i(t,n,a,s){var o;a===void 0&&(a={}),(o=e.call(this)||this).masterPlaylistLoader_=s||tt(o),s||(o.isMaster_=!0);var u=a,c=u.withCredentials,d=c!==void 0&&c,m=u.handleManifestRedirects,f=m!==void 0&&m;if(o.vhs_=n,o.withCredentials=d,o.handleManifestRedirects=f,!t)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=ye("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=t,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=t,o}V(i,e);var r=i.prototype;return r.requestErrored_=function(t,n,a){return!this.request||(this.request=null,t?(this.error=typeof t!="object"||t instanceof Error?{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2}:t,a&&(this.state=a),this.trigger("error"),!0):void 0)},r.addSidxSegments_=function(t,n,a){var s=this,o=t.sidx&&cr(t.sidx);if(t.sidx&&o&&!this.masterPlaylistLoader_.sidxMapping_[o]){var u=Vr(this.handleManifestRedirects,t.sidx.resolvedUri),c=function(d,m){if(!s.requestErrored_(d,m,n)){var f,_=s.masterPlaylistLoader_.sidxMapping_;try{f=Of(Z(m.response).subarray(8))}catch(b){return void s.requestErrored_(b,m,n)}return _[o]={sidxInfo:t.sidx,sidx:f},za(t,f,t.sidx.resolvedUri),a(!0)}};this.request=tg(u,this.vhs_.xhr,function(d,m,f,_){if(d)return c(d,m);if(!f||f!=="mp4")return c({status:m.status,message:"Unsupported "+(f||"unknown")+" container type for sidx segment at URL: "+u,response:"",playlist:t,internal:!0,blacklistDuration:1/0,code:2},m);var b=t.sidx.byterange,y=b.offset,E=b.length;if(_.length>=E+y)return c(d,{response:_.subarray(y,y+E),status:m.status,uri:m.uri});s.request=s.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:ho({byterange:t.sidx.byterange})},c)})}else this.mediaRequest_=D.setTimeout(function(){return a(!1)},0)},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},D.clearTimeout(this.minimumUpdatePeriodTimeout_),D.clearTimeout(this.mediaRequest_),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}},r.media=function(t){var n=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof t=="string"){if(!this.masterPlaylistLoader_.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.masterPlaylistLoader_.master.playlists[t]}var s=!this.media_||t.id!==this.media_.id;if(s&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList)return this.state="HAVE_METADATA",this.media_=t,void(s&&(this.trigger("mediachanging"),this.trigger("mediachange")));s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(t,a,function(o){n.haveMetadata({startingState:a,playlist:t})}))},r.haveMetadata=function(t){var n=t.startingState,a=t.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},r.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(D.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(t){var n=this;D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(t){var s=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=D.setTimeout(function(){return n.load()},s)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},r.start=function(){var t=this;this.started=!0,this.isMaster_?this.requestMaster_(function(n,a){t.haveMaster_(),t.hasPendingRequest()||t.media_||t.media(t.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=D.setTimeout(function(){return t.haveMaster_()},0)},r.requestMaster_=function(t){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,s){if(!n.requestErrored_(a,s)){var o=s.responseText!==n.masterPlaylistLoader_.masterXml_;return n.masterPlaylistLoader_.masterXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?n.masterLoaded_=Date.parse(s.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=Vr(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,s),o?(n.handleMaster_(),void n.syncClientServerClock_(function(){return t(s,o)})):t(s,o)}n.state==="HAVE_NOTHING"&&(n.started=!1)})},r.syncClientServerClock_=function(t){var n=this,a=Af(this.masterPlaylistLoader_.masterXml_);return a===null?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),t()):a.method==="DIRECT"?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),t()):void(this.request=this.vhs_.xhr({uri:ve(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(s,o){if(n.request){if(s)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),t();var u;u=a.method==="HEAD"?o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):n.masterLoaded_:Date.parse(o.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),t()}}))},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var t,n,a,s,o,u,c,d=this.masterPlaylistLoader_.master,m=(t={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:d},n=t.masterXml,a=t.srcUrl,s=t.clientOffset,o=t.sidxMapping,u=t.previousManifest,c=If(n,{manifestUri:a,clientOffset:s,sidxMapping:o,previousManifest:u}),Td(c,a,ng),c);d&&(m=ig(d,m,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=m||d;var f=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return f&&f!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=f),(!d||m&&m.minimumUpdatePeriod!==d.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!m},r.updateMinimumUpdatePeriodTimeout_=function(){var t=this.masterPlaylistLoader_;t.createMupOnMedia_&&(t.off("loadedmetadata",t.createMupOnMedia_),t.createMupOnMedia_=null),t.minimumUpdatePeriodTimeout_&&(D.clearTimeout(t.minimumUpdatePeriodTimeout_),t.minimumUpdatePeriodTimeout_=null);var n=t.master&&t.master.minimumUpdatePeriod;n===0&&(t.media()?n=1e3*t.media().targetDuration:(t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_,t.one("loadedmetadata",t.createMupOnMedia_))),typeof n!="number"||n<=0?n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout"):this.createMUPTimeout_(n)},r.createMUPTimeout_=function(t){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=D.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(t)},t)},r.refreshXml_=function(){var t=this;this.requestMaster_(function(n,a){var s,o,u;a&&(t.media_&&(t.media_=t.masterPlaylistLoader_.master.playlists[t.media_.id]),t.masterPlaylistLoader_.sidxMapping_=(s=t.masterPlaylistLoader_.master,o=t.masterPlaylistLoader_.sidxMapping_,u=Ld(s.playlists,o),Qn(s,function(c,d,m,f){if(c.playlists&&c.playlists.length){var _=c.playlists;u=Ad(u,Ld(_,o))}}),u),t.addSidxSegments_(t.media(),t.state,function(c){t.refreshMedia_(t.media().id)}))})},r.refreshMedia_=function(t){var n=this;if(!t)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,s=!this.media_||this.media_!==a[t];s?this.media_=a[t]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout&&function o(){n.media().endList||(n.mediaUpdateTimeout=D.setTimeout(function(){n.trigger("mediaupdatetimeout"),o()},lo(n.media(),!!s)))}(),this.trigger("loadedplaylist")},i}(eg),Ot={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},Od=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Rd=function(e){return function(){var i=function(n){try{return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))}catch{var a=new BlobBuilder;return a.append(n),URL.createObjectURL(a.getBlob())}}(e),r=Od(new Worker(i));r.objURL=i;var t=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(i),t.call(this)},r}},Nd=function(e){return"var browserWorkerPolyFill = "+Od.toString()+`;
- browserWorkerPolyFill(self);
- `+e},Md=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},ag=Nd(Md(function(){var e=function(){this.init=function(){var l={};this.on=function(h,g){l[h]||(l[h]=[]),l[h]=l[h].concat(g)},this.off=function(h,g){var p;return!!l[h]&&(p=l[h].indexOf(g),l[h]=l[h].slice(),l[h].splice(p,1),p>-1)},this.trigger=function(h){var g,p,v,T;if(g=l[h])if(arguments.length===2)for(v=g.length,p=0;p<v;++p)g[p].call(this,arguments[1]);else{for(T=[],p=arguments.length,p=1;p<arguments.length;++p)T.push(arguments[p]);for(v=g.length,p=0;p<v;++p)g[p].apply(this,T)}},this.dispose=function(){l={}}}};e.prototype.pipe=function(l){return this.on("data",function(h){l.push(h)}),this.on("done",function(h){l.flush(h)}),this.on("partialdone",function(h){l.partialFlush(h)}),this.on("endedtimeline",function(h){l.endTimeline(h)}),this.on("reset",function(h){l.reset(h)}),l},e.prototype.push=function(l){this.trigger("data",l)},e.prototype.flush=function(l){this.trigger("done",l)},e.prototype.partialFlush=function(l){this.trigger("partialdone",l)},e.prototype.endTimeline=function(l){this.trigger("endedtimeline",l)},e.prototype.reset=function(l){this.trigger("reset",l)};var i,r,t,n,a,s,o,u,c,d,m,f,_,b,y,E,w,k,I,P,N,A,U,B,R,q,$,Y,K,Q,X,nt,at,ht,J,rt,se,le,Kt,ji,Dt=e,na=Math.pow(2,32),qi={getUint64:function(l){var h,g=new DataView(l.buffer,l.byteOffset,l.byteLength);return g.getBigUint64?(h=g.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(h):h:g.getUint32(0)*na+g.getUint32(4)},MAX_UINT32:na},ia=qi.MAX_UINT32;(function(){var l;if(A={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(l in A)A.hasOwnProperty(l)&&(A[l]=[l.charCodeAt(0),l.charCodeAt(1),l.charCodeAt(2),l.charCodeAt(3)]);U=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),R=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),B=new Uint8Array([0,0,0,1]),q=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]),$=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]),Y={video:q,audio:$},X=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Q=new Uint8Array([0,0,0,0,0,0,0,0]),nt=new Uint8Array([0,0,0,0,0,0,0,0]),at=nt,ht=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),J=nt,K=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),i=function(l){var h,g,p=[],v=0;for(h=1;h<arguments.length;h++)p.push(arguments[h]);for(h=p.length;h--;)v+=p[h].byteLength;for(g=new Uint8Array(v+8),new DataView(g.buffer,g.byteOffset,g.byteLength).setUint32(0,g.byteLength),g.set(l,4),h=0,v=8;h<p.length;h++)g.set(p[h],v),v+=p[h].byteLength;return g},r=function(){return i(A.dinf,i(A.dref,X))},t=function(l){return i(A.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,l.audioobjecttype<<3|l.samplingfrequencyindex>>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},y=function(l){return i(A.hdlr,Y[l])},b=function(l){var h=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,255&l.duration,85,196,0,0]);return l.samplerate&&(h[12]=l.samplerate>>>24&255,h[13]=l.samplerate>>>16&255,h[14]=l.samplerate>>>8&255,h[15]=255&l.samplerate),i(A.mdhd,h)},_=function(l){return i(A.mdia,b(l),y(l.type),s(l))},a=function(l){return i(A.mfhd,new Uint8Array([0,0,0,0,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l]))},s=function(l){return i(A.minf,l.type==="video"?i(A.vmhd,K):i(A.smhd,Q),r(),w(l))},o=function(l,h){for(var g=[],p=h.length;p--;)g[p]=I(h[p]);return i.apply(null,[A.moof,a(l)].concat(g))},u=function(l){for(var h=l.length,g=[];h--;)g[h]=m(l[h]);return i.apply(null,[A.moov,d(4294967295)].concat(g).concat(c(l)))},c=function(l){for(var h=l.length,g=[];h--;)g[h]=P(l[h]);return i.apply(null,[A.mvex].concat(g))},d=function(l){var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(A.mvhd,h)},E=function(l){var h,g,p=l.samples||[],v=new Uint8Array(4+p.length);for(g=0;g<p.length;g++)h=p[g].flags,v[g+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return i(A.sdtp,v)},w=function(l){return i(A.stbl,k(l),i(A.stts,J),i(A.stsc,at),i(A.stsz,ht),i(A.stco,nt))},k=function(l){return i(A.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),l.type==="video"?rt(l):se(l))},rt=function(l){var h,g,p=l.sps||[],v=l.pps||[],T=[],S=[];for(h=0;h<p.length;h++)T.push((65280&p[h].byteLength)>>>8),T.push(255&p[h].byteLength),T=T.concat(Array.prototype.slice.call(p[h]));for(h=0;h<v.length;h++)S.push((65280&v[h].byteLength)>>>8),S.push(255&v[h].byteLength),S=S.concat(Array.prototype.slice.call(v[h]));if(g=[A.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&l.width)>>8,255&l.width,(65280&l.height)>>8,255&l.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(A.avcC,new Uint8Array([1,l.profileIdc,l.profileCompatibility,l.levelIdc,255].concat([p.length],T,[v.length],S))),i(A.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],l.sarRatio){var C=l.sarRatio[0],x=l.sarRatio[1];g.push(i(A.pasp,new Uint8Array([(4278190080&C)>>24,(16711680&C)>>16,(65280&C)>>8,255&C,(4278190080&x)>>24,(16711680&x)>>16,(65280&x)>>8,255&x])))}return i.apply(null,g)},se=function(l){return i(A.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&l.channelcount)>>8,255&l.channelcount,(65280&l.samplesize)>>8,255&l.samplesize,0,0,0,0,(65280&l.samplerate)>>8,255&l.samplerate,0,0]),t(l))},f=function(l){var h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,0,(4278190080&l.duration)>>24,(16711680&l.duration)>>16,(65280&l.duration)>>8,255&l.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&l.width)>>8,255&l.width,0,0,(65280&l.height)>>8,255&l.height,0,0]);return i(A.tkhd,h)},I=function(l){var h,g,p,v,T,S;return h=i(A.tfhd,new Uint8Array([0,0,0,58,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),T=Math.floor(l.baseMediaDecodeTime/ia),S=Math.floor(l.baseMediaDecodeTime%ia),g=i(A.tfdt,new Uint8Array([1,0,0,0,T>>>24&255,T>>>16&255,T>>>8&255,255&T,S>>>24&255,S>>>16&255,S>>>8&255,255&S])),l.type==="audio"?(p=N(l,92),i(A.traf,h,g,p)):(v=E(l),p=N(l,v.length+92),i(A.traf,h,g,p,v))},m=function(l){return l.duration=l.duration||4294967295,i(A.trak,f(l),_(l))},P=function(l){var h=new Uint8Array([0,0,0,0,(4278190080&l.id)>>24,(16711680&l.id)>>16,(65280&l.id)>>8,255&l.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(h[h.length-1]=0),i(A.trex,h)},ji=function(l,h){var g=0,p=0,v=0,T=0;return l.length&&(l[0].duration!==void 0&&(g=1),l[0].size!==void 0&&(p=2),l[0].flags!==void 0&&(v=4),l[0].compositionTimeOffset!==void 0&&(T=8)),[0,0,g|p|v|T,1,(4278190080&l.length)>>>24,(16711680&l.length)>>>16,(65280&l.length)>>>8,255&l.length,(4278190080&h)>>>24,(16711680&h)>>>16,(65280&h)>>>8,255&h]},Kt=function(l,h){var g,p,v,T,S,C;for(h+=20+16*(T=l.samples||[]).length,v=ji(T,h),(p=new Uint8Array(v.length+16*T.length)).set(v),g=v.length,C=0;C<T.length;C++)S=T[C],p[g++]=(4278190080&S.duration)>>>24,p[g++]=(16711680&S.duration)>>>16,p[g++]=(65280&S.duration)>>>8,p[g++]=255&S.duration,p[g++]=(4278190080&S.size)>>>24,p[g++]=(16711680&S.size)>>>16,p[g++]=(65280&S.size)>>>8,p[g++]=255&S.size,p[g++]=S.flags.isLeading<<2|S.flags.dependsOn,p[g++]=S.flags.isDependedOn<<6|S.flags.hasRedundancy<<4|S.flags.paddingValue<<1|S.flags.isNonSyncSample,p[g++]=61440&S.flags.degradationPriority,p[g++]=15&S.flags.degradationPriority,p[g++]=(4278190080&S.compositionTimeOffset)>>>24,p[g++]=(16711680&S.compositionTimeOffset)>>>16,p[g++]=(65280&S.compositionTimeOffset)>>>8,p[g++]=255&S.compositionTimeOffset;return i(A.trun,p)},le=function(l,h){var g,p,v,T,S,C;for(h+=20+8*(T=l.samples||[]).length,v=ji(T,h),(g=new Uint8Array(v.length+8*T.length)).set(v),p=v.length,C=0;C<T.length;C++)S=T[C],g[p++]=(4278190080&S.duration)>>>24,g[p++]=(16711680&S.duration)>>>16,g[p++]=(65280&S.duration)>>>8,g[p++]=255&S.duration,g[p++]=(4278190080&S.size)>>>24,g[p++]=(16711680&S.size)>>>16,g[p++]=(65280&S.size)>>>8,g[p++]=255&S.size;return i(A.trun,g)},N=function(l,h){return l.type==="audio"?le(l,h):Kt(l,h)},n=function(){return i(A.ftyp,U,B,U,R)};var Ge,Th,Sh,Do,Eh,wh,kh,Ch,xh=function(l){return i(A.mdat,l)},Dh=o,nv=function(l){var h,g=n(),p=u(l);return(h=new Uint8Array(g.byteLength+p.byteLength)).set(g),h.set(p,g.byteLength),h},iv=function(l,h){var g={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return g.dataOffset=h,g.compositionTimeOffset=l.pts-l.dts,g.duration=l.duration,g.size=4*l.length,g.size+=l.byteLength,l.keyFrame&&(g.flags.dependsOn=2,g.flags.isNonSyncSample=0),g},rv=function(l){var h,g,p=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,p.byteLength=0,h=0;h<l.length;h++)(g=l[h]).nalUnitType==="access_unit_delimiter_rbsp"?(p.length&&(p.duration=g.dts-p.dts,v.byteLength+=p.byteLength,v.nalCount+=p.length,v.duration+=p.duration,v.push(p)),(p=[g]).byteLength=g.data.byteLength,p.pts=g.pts,p.dts=g.dts):(g.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(p.keyFrame=!0),p.duration=g.dts-p.dts,p.byteLength+=g.data.byteLength,p.push(g));return v.length&&(!p.duration||p.duration<=0)&&(p.duration=v[v.length-1].duration),v.byteLength+=p.byteLength,v.nalCount+=p.length,v.duration+=p.duration,v.push(p),v},av=function(l){var h,g,p=[],v=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=l[0].pts,p.dts=l[0].dts,v.byteLength=0,v.nalCount=0,v.duration=0,v.pts=l[0].pts,v.dts=l[0].dts,h=0;h<l.length;h++)(g=l[h]).keyFrame?(p.length&&(v.push(p),v.byteLength+=p.byteLength,v.nalCount+=p.nalCount,v.duration+=p.duration),(p=[g]).nalCount=g.length,p.byteLength=g.byteLength,p.pts=g.pts,p.dts=g.dts,p.duration=g.duration):(p.duration+=g.duration,p.nalCount+=g.length,p.byteLength+=g.byteLength,p.push(g));return v.length&&p.duration<=0&&(p.duration=v[v.length-1].duration),v.byteLength+=p.byteLength,v.nalCount+=p.nalCount,v.duration+=p.duration,v.push(p),v},sv=function(l){var h;return!l[0][0].keyFrame&&l.length>1&&(h=l.shift(),l.byteLength-=h.byteLength,l.nalCount-=h.nalCount,l[0][0].dts=h.dts,l[0][0].pts=h.pts,l[0][0].duration+=h.duration),l},ov=function(l,h){var g,p,v,T,S,C=h||0,x=[];for(g=0;g<l.length;g++)for(T=l[g],p=0;p<T.length;p++)S=T[p],C+=(v=iv(S,C)).size,x.push(v);return x},uv=function(l){var h,g,p,v,T,S,C=0,x=l.byteLength,L=l.nalCount,M=new Uint8Array(x+4*L),j=new DataView(M.buffer);for(h=0;h<l.length;h++)for(v=l[h],g=0;g<v.length;g++)for(T=v[g],p=0;p<T.length;p++)S=T[p],j.setUint32(C,S.data.byteLength),C+=4,M.set(S.data,C),C+=S.data.byteLength;return M},Ze=[33,16,5,32,164,27],Io=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],pt=function(l){for(var h=[];l--;)h.push(0);return h},lv=function(){if(!Ge){var l={96e3:[Ze,[227,64],pt(154),[56]],88200:[Ze,[231],pt(170),[56]],64e3:[Ze,[248,192],pt(240),[56]],48e3:[Ze,[255,192],pt(268),[55,148,128],pt(54),[112]],44100:[Ze,[255,192],pt(268),[55,163,128],pt(84),[112]],32e3:[Ze,[255,192],pt(268),[55,234],pt(226),[112]],24e3:[Ze,[255,192],pt(268),[55,255,128],pt(268),[111,112],pt(126),[224]],16e3:[Ze,[255,192],pt(268),[55,255,128],pt(268),[111,255],pt(269),[223,108],pt(195),[1,192]],12e3:[Io,pt(268),[3,127,248],pt(268),[6,255,240],pt(268),[13,255,224],pt(268),[27,253,128],pt(259),[56]],11025:[Io,pt(268),[3,127,248],pt(268),[6,255,240],pt(268),[13,255,224],pt(268),[27,255,192],pt(268),[55,175,128],pt(108),[112]],8e3:[Io,pt(268),[3,121,16],pt(47),[7]]};h=l,Ge=Object.keys(h).reduce(function(g,p){return g[p]=new Uint8Array(h[p].reduce(function(v,T){return v.concat(T)},[])),g},{})}var h;return Ge},Ao=9e4;wh=function(l,h){return Th(Eh(l,h))},kh=function(l,h){return Sh(Do(l),h)},Ch=function(l,h,g){return Do(g?l:l-h)};var mn=Ao,Ih=Th=function(l){return l*Ao},jt=(Sh=function(l,h){return l*h},Do=function(l){return l/Ao}),Ah=(Eh=function(l,h){return l/h},wh),cv=kh,Po=Ch,dv=function(l,h,g,p){var v,T,S,C,x,L=0,M=0,j=0;if(h.length&&(v=Ah(l.baseMediaDecodeTime,l.samplerate),T=Math.ceil(mn/(l.samplerate/1024)),g&&p&&(L=v-Math.max(g,p),j=(M=Math.floor(L/T))*T),!(M<1||j>mn/2))){for((S=lv()[l.samplerate])||(S=h[0].data),C=0;C<M;C++)x=h[0],h.splice(0,0,{data:S,dts:x.dts-T,pts:x.pts-T});return l.baseMediaDecodeTime-=Math.floor(cv(j,l.samplerate)),j}},hv=function(l,h,g){return h.minSegmentDts>=g?l:(h.minSegmentDts=1/0,l.filter(function(p){return p.dts>=g&&(h.minSegmentDts=Math.min(h.minSegmentDts,p.dts),h.minSegmentPts=h.minSegmentDts,!0)}))},pv=function(l){var h,g,p=[];for(h=0;h<l.length;h++)g=l[h],p.push({size:g.data.byteLength,duration:1024});return p},fv=function(l){var h,g,p=0,v=new Uint8Array(function(T){var S,C=0;for(S=0;S<T.length;S++)C+=T[S].data.byteLength;return C}(l));for(h=0;h<l.length;h++)g=l[h],v.set(g.data,p),p+=g.data.byteLength;return v},mv=mn,ti=function(l){delete l.minSegmentDts,delete l.maxSegmentDts,delete l.minSegmentPts,delete l.maxSegmentPts},Ph=function(l,h){var g,p=l.minSegmentDts;return h||(p-=l.timelineStartInfo.dts),g=l.timelineStartInfo.baseMediaDecodeTime,g+=p,g=Math.max(0,g),l.type==="audio"&&(g*=l.samplerate/mv,g=Math.floor(g)),g},Lo=function(l,h){typeof h.pts=="number"&&(l.timelineStartInfo.pts===void 0&&(l.timelineStartInfo.pts=h.pts),l.minSegmentPts===void 0?l.minSegmentPts=h.pts:l.minSegmentPts=Math.min(l.minSegmentPts,h.pts),l.maxSegmentPts===void 0?l.maxSegmentPts=h.pts:l.maxSegmentPts=Math.max(l.maxSegmentPts,h.pts)),typeof h.dts=="number"&&(l.timelineStartInfo.dts===void 0&&(l.timelineStartInfo.dts=h.dts),l.minSegmentDts===void 0?l.minSegmentDts=h.dts:l.minSegmentDts=Math.min(l.minSegmentDts,h.dts),l.maxSegmentDts===void 0?l.maxSegmentDts=h.dts:l.maxSegmentDts=Math.max(l.maxSegmentDts,h.dts))},gv=function(l){for(var h=0,g={payloadType:-1,payloadSize:0},p=0,v=0;h<l.byteLength&&l[h]!==128;){for(;l[h]===255;)p+=255,h++;for(p+=l[h++];l[h]===255;)v+=255,h++;if(v+=l[h++],!g.payload&&p===4){if(String.fromCharCode(l[h+3],l[h+4],l[h+5],l[h+6])==="GA94"){g.payloadType=p,g.payloadSize=v,g.payload=l.subarray(h,h+v);break}g.payload=void 0}h+=v,p=0,v=0}return g},vv=function(l){return l.payload[0]!==181||(l.payload[1]<<8|l.payload[2])!=49||String.fromCharCode(l.payload[3],l.payload[4],l.payload[5],l.payload[6])!=="GA94"||l.payload[7]!==3?null:l.payload.subarray(8,l.payload.length-1)},yv=function(l,h){var g,p,v,T,S=[];if(!(64&h[0]))return S;for(p=31&h[0],g=0;g<p;g++)T={type:3&h[(v=3*g)+2],pts:l},4&h[v+2]&&(T.ccData=h[v+3]<<8|h[v+4],S.push(T));return S},_v=function(l){for(var h,g,p=l.byteLength,v=[],T=1;T<p-2;)l[T]===0&&l[T+1]===0&&l[T+2]===3?(v.push(T+2),T+=2):T++;if(v.length===0)return l;h=p-v.length,g=new Uint8Array(h);var S=0;for(T=0;T<h;S++,T++)S===v[0]&&(S++,v.shift()),g[T]=l[S];return g},bv=4,ce=function l(h){h=h||{},l.prototype.init.call(this),this.parse708captions_=typeof h.parse708captions!="boolean"||h.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Tt(0,0),new Tt(0,1),new Tt(1,0),new Tt(1,1)],this.parse708captions_&&(this.cc708Stream_=new vt({captionServices:h.captionServices})),this.reset(),this.ccStreams_.forEach(function(g){g.on("data",this.trigger.bind(this,"data")),g.on("partialdone",this.trigger.bind(this,"partialdone")),g.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")))};(ce.prototype=new Dt).push=function(l){var h,g,p;if(l.nalUnitType==="sei_rbsp"&&(h=gv(l.escapedRBSP)).payload&&h.payloadType===bv&&(g=vv(h)))if(l.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(l.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));p=yv(l.pts,g),this.captionPackets_=this.captionPackets_.concat(p),this.latestDts_!==l.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=l.dts}},ce.prototype.flushCCStreams=function(l){this.ccStreams_.forEach(function(h){return l==="flush"?h.flush():h.partialFlush()},this)},ce.prototype.flushStream=function(l){this.captionPackets_.length?(this.captionPackets_.forEach(function(h,g){h.presortIndex=g}),this.captionPackets_.sort(function(h,g){return h.pts===g.pts?h.presortIndex-g.presortIndex:h.pts-g.pts}),this.captionPackets_.forEach(function(h){h.type<2?this.dispatchCea608Packet(h):this.dispatchCea708Packet(h)},this),this.captionPackets_.length=0,this.flushCCStreams(l)):this.flushCCStreams(l)},ce.prototype.flush=function(){return this.flushStream("flush")},ce.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ce.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(l){l.reset()})},ce.prototype.dispatchCea608Packet=function(l){this.setsTextOrXDSActive(l)?this.activeCea608Channel_[l.type]=null:this.setsChannel1Active(l)?this.activeCea608Channel_[l.type]=0:this.setsChannel2Active(l)&&(this.activeCea608Channel_[l.type]=1),this.activeCea608Channel_[l.type]!==null&&this.ccStreams_[(l.type<<1)+this.activeCea608Channel_[l.type]].push(l)},ce.prototype.setsChannel1Active=function(l){return(30720&l.ccData)==4096},ce.prototype.setsChannel2Active=function(l){return(30720&l.ccData)==6144},ce.prototype.setsTextOrXDSActive=function(l){return(28928&l.ccData)==256||(30974&l.ccData)==4138||(30974&l.ccData)==6186},ce.prototype.dispatchCea708Packet=function(l){this.parse708captions_&&this.cc708Stream_.push(l)};var Tv={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},ra=function(l){return 32<=l&&l<=127||160<=l&&l<=255},ze=function(l){this.windowNum=l,this.reset()};ze.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},ze.prototype.getText=function(){return this.rows.join(`
- `)},ze.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ze.prototype.newLine=function(l){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(l),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ze.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},ze.prototype.addText=function(l){this.rows[this.rowIdx]+=l},ze.prototype.backspace=function(){if(!this.isEmpty()){var l=this.rows[this.rowIdx];this.rows[this.rowIdx]=l.substr(0,l.length-1)}};var aa=function(l,h,g){this.serviceNum=l,this.text="",this.currentWindow=new ze(-1),this.windows=[],this.stream=g,typeof h=="string"&&this.createTextDecoder(h)};aa.prototype.init=function(l,h){this.startPts=l;for(var g=0;g<8;g++)this.windows[g]=new ze(g),typeof h=="function"&&(this.windows[g].beforeRowOverflow=h)},aa.prototype.setCurrentWindow=function(l){this.currentWindow=this.windows[l]},aa.prototype.createTextDecoder=function(l){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(l)}catch(h){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+l+" encoding. "+h})}};var vt=function l(h){h=h||{},l.prototype.init.call(this);var g,p=this,v=h.captionServices||{},T={};Object.keys(v).forEach(function(S){g=v[S],/^SERVICE/.test(S)&&(T[S]=g.encoding)}),this.serviceEncodings=T,this.current708Packet=null,this.services={},this.push=function(S){S.type===3?(p.new708Packet(),p.add708Bytes(S)):(p.current708Packet===null&&p.new708Packet(),p.add708Bytes(S))}};vt.prototype=new Dt,vt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},vt.prototype.add708Bytes=function(l){var h=l.ccData,g=h>>>8,p=255&h;this.current708Packet.ptsVals.push(l.pts),this.current708Packet.data.push(g),this.current708Packet.data.push(p)},vt.prototype.push708Packet=function(){var l=this.current708Packet,h=l.data,g=null,p=null,v=0,T=h[v++];for(l.seq=T>>6,l.sizeCode=63&T;v<h.length;v++)p=31&(T=h[v++]),(g=T>>5)===7&&p>0&&(g=T=h[v++]),this.pushServiceBlock(g,v,p),p>0&&(v+=p-1)},vt.prototype.pushServiceBlock=function(l,h,g){var p,v=h,T=this.current708Packet.data,S=this.services[l];for(S||(S=this.initService(l,v));v<h+g&&v<T.length;v++)p=T[v],ra(p)?v=this.handleText(v,S):p===24?v=this.multiByteCharacter(v,S):p===16?v=this.extendedCommands(v,S):128<=p&&p<=135?v=this.setCurrentWindow(v,S):152<=p&&p<=159?v=this.defineWindow(v,S):p===136?v=this.clearWindows(v,S):p===140?v=this.deleteWindows(v,S):p===137?v=this.displayWindows(v,S):p===138?v=this.hideWindows(v,S):p===139?v=this.toggleWindows(v,S):p===151?v=this.setWindowAttributes(v,S):p===144?v=this.setPenAttributes(v,S):p===145?v=this.setPenColor(v,S):p===146?v=this.setPenLocation(v,S):p===143?S=this.reset(v,S):p===8?S.currentWindow.backspace():p===12?S.currentWindow.clearText():p===13?S.currentWindow.pendingNewLine=!0:p===14?S.currentWindow.clearText():p===141&&v++},vt.prototype.extendedCommands=function(l,h){var g=this.current708Packet.data[++l];return ra(g)&&(l=this.handleText(l,h,{isExtended:!0})),l},vt.prototype.getPts=function(l){return this.current708Packet.ptsVals[Math.floor(l/2)]},vt.prototype.initService=function(l,h){var g,p,v=this;return(g="SERVICE"+l)in this.serviceEncodings&&(p=this.serviceEncodings[g]),this.services[l]=new aa(l,p,v),this.services[l].init(this.getPts(h),function(T){v.flushDisplayed(T,v.services[l])}),this.services[l]},vt.prototype.handleText=function(l,h,g){var p,v,T,S,C=g&&g.isExtended,x=g&&g.isMultiByte,L=this.current708Packet.data,M=C?4096:0,j=L[l],W=L[l+1],z=h.currentWindow;return h.textDecoder_&&!C?(x?(v=[j,W],l++):v=[j],p=h.textDecoder_.decode(new Uint8Array(v))):(S=Tv[T=M|j]||T,p=4096&T&&T===S?"":String.fromCharCode(S)),z.pendingNewLine&&!z.isEmpty()&&z.newLine(this.getPts(l)),z.pendingNewLine=!1,z.addText(p),l},vt.prototype.multiByteCharacter=function(l,h){var g=this.current708Packet.data,p=g[l+1],v=g[l+2];return ra(p)&&ra(v)&&(l=this.handleText(++l,h,{isMultiByte:!0})),l},vt.prototype.setCurrentWindow=function(l,h){var g=7&this.current708Packet.data[l];return h.setCurrentWindow(g),l},vt.prototype.defineWindow=function(l,h){var g=this.current708Packet.data,p=g[l],v=7&p;h.setCurrentWindow(v);var T=h.currentWindow;return p=g[++l],T.visible=(32&p)>>5,T.rowLock=(16&p)>>4,T.columnLock=(8&p)>>3,T.priority=7&p,p=g[++l],T.relativePositioning=(128&p)>>7,T.anchorVertical=127&p,p=g[++l],T.anchorHorizontal=p,p=g[++l],T.anchorPoint=(240&p)>>4,T.rowCount=15&p,p=g[++l],T.columnCount=63&p,p=g[++l],T.windowStyle=(56&p)>>3,T.penStyle=7&p,T.virtualRowCount=T.rowCount+1,l},vt.prototype.setWindowAttributes=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.winAttr;return p=g[++l],v.fillOpacity=(192&p)>>6,v.fillRed=(48&p)>>4,v.fillGreen=(12&p)>>2,v.fillBlue=3&p,p=g[++l],v.borderType=(192&p)>>6,v.borderRed=(48&p)>>4,v.borderGreen=(12&p)>>2,v.borderBlue=3&p,p=g[++l],v.borderType+=(128&p)>>5,v.wordWrap=(64&p)>>6,v.printDirection=(48&p)>>4,v.scrollDirection=(12&p)>>2,v.justify=3&p,p=g[++l],v.effectSpeed=(240&p)>>4,v.effectDirection=(12&p)>>2,v.displayEffect=3&p,l},vt.prototype.flushDisplayed=function(l,h){for(var g=[],p=0;p<8;p++)h.windows[p].visible&&!h.windows[p].isEmpty()&&g.push(h.windows[p].getText());h.endPts=l,h.text=g.join(`
- `),this.pushCaption(h),h.startPts=l},vt.prototype.pushCaption=function(l){l.text!==""&&(this.trigger("data",{startPts:l.startPts,endPts:l.endPts,text:l.text,stream:"cc708_"+l.serviceNum}),l.text="",l.startPts=l.endPts)},vt.prototype.displayWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<<v&&(h.windows[v].visible=1);return l},vt.prototype.hideWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<<v&&(h.windows[v].visible=0);return l},vt.prototype.toggleWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<<v&&(h.windows[v].visible^=1);return l},vt.prototype.clearWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<<v&&h.windows[v].clearText();return l},vt.prototype.deleteWindows=function(l,h){var g=this.current708Packet.data[++l],p=this.getPts(l);this.flushDisplayed(p,h);for(var v=0;v<8;v++)g&1<<v&&h.windows[v].reset();return l},vt.prototype.setPenAttributes=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.penAttr;return p=g[++l],v.textTag=(240&p)>>4,v.offset=(12&p)>>2,v.penSize=3&p,p=g[++l],v.italics=(128&p)>>7,v.underline=(64&p)>>6,v.edgeType=(56&p)>>3,v.fontStyle=7&p,l},vt.prototype.setPenColor=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.penColor;return p=g[++l],v.fgOpacity=(192&p)>>6,v.fgRed=(48&p)>>4,v.fgGreen=(12&p)>>2,v.fgBlue=3&p,p=g[++l],v.bgOpacity=(192&p)>>6,v.bgRed=(48&p)>>4,v.bgGreen=(12&p)>>2,v.bgBlue=3&p,p=g[++l],v.edgeRed=(48&p)>>4,v.edgeGreen=(12&p)>>2,v.edgeBlue=3&p,l},vt.prototype.setPenLocation=function(l,h){var g=this.current708Packet.data,p=g[l],v=h.currentWindow.penLoc;return h.currentWindow.pendingNewLine=!0,p=g[++l],v.row=15&p,p=g[++l],v.column=63&p,l},vt.prototype.reset=function(l,h){var g=this.getPts(l);return this.flushDisplayed(g,h),this.initService(h.serviceNum,l)};var Sv={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},sa=function(l){return l===null?"":(l=Sv[l]||l,String.fromCharCode(l))},Ev=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],gn=function(){for(var l=[],h=15;h--;)l.push("");return l},Tt=function l(h,g){l.prototype.init.call(this),this.field_=h||0,this.dataChannel_=g||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(p){var v,T,S,C,x;if((v=32639&p.ccData)!==this.lastControlCode_){if((61440&v)==4096?this.lastControlCode_=v:v!==this.PADDING_&&(this.lastControlCode_=null),S=v>>>8,C=255&v,v!==this.PADDING_)if(v===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(v===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(p.pts),this.flushDisplayed(p.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=p.pts;else if(v===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(p.pts);else if(v===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(p.pts);else if(v===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(p.pts);else if(v===this.CARRIAGE_RETURN_)this.clearFormatting(p.pts),this.flushDisplayed(p.pts),this.shiftRowsUp_(),this.startPts_=p.pts;else if(v===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(v===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(p.pts),this.displayed_=gn();else if(v===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=gn();else if(v===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(p.pts),this.displayed_=gn()),this.mode_="paintOn",this.startPts_=p.pts;else if(this.isSpecialCharacter(S,C))x=sa((S=(3&S)<<8)|C),this[this.mode_](p.pts,x),this.column_++;else if(this.isExtCharacter(S,C))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),x=sa((S=(3&S)<<8)|C),this[this.mode_](p.pts,x),this.column_++;else if(this.isMidRowCode(S,C))this.clearFormatting(p.pts),this[this.mode_](p.pts," "),this.column_++,(14&C)==14&&this.addFormatting(p.pts,["i"]),(1&C)==1&&this.addFormatting(p.pts,["u"]);else if(this.isOffsetControlCode(S,C))this.column_+=3&C;else if(this.isPAC(S,C)){var L=Ev.indexOf(7968&v);this.mode_==="rollUp"&&(L-this.rollUpRows_+1<0&&(L=this.rollUpRows_-1),this.setRollUp(p.pts,L)),L!==this.row_&&(this.clearFormatting(p.pts),this.row_=L),1&C&&this.formatting_.indexOf("u")===-1&&this.addFormatting(p.pts,["u"]),(16&v)==16&&(this.column_=4*((14&v)>>1)),this.isColorPAC(C)&&(14&C)==14&&this.addFormatting(p.pts,["i"])}else this.isNormalChar(S)&&(C===0&&(C=null),x=sa(S),x+=sa(C),this[this.mode_](p.pts,x),this.column_+=x.length)}else this.lastControlCode_=null}};Tt.prototype=new Dt,Tt.prototype.flushDisplayed=function(l){var h=this.displayed_.map(function(g,p){try{return g.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+p+"."}),""}},this).join(`
- `).replace(/^\n+|\n+$/g,"");h.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,text:h,stream:this.name_})},Tt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=gn(),this.nonDisplayed_=gn(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Tt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Tt.prototype.isSpecialCharacter=function(l,h){return l===this.EXT_&&h>=48&&h<=63},Tt.prototype.isExtCharacter=function(l,h){return(l===this.EXT_+1||l===this.EXT_+2)&&h>=32&&h<=63},Tt.prototype.isMidRowCode=function(l,h){return l===this.EXT_&&h>=32&&h<=47},Tt.prototype.isOffsetControlCode=function(l,h){return l===this.OFFSET_&&h>=33&&h<=35},Tt.prototype.isPAC=function(l,h){return l>=this.BASE_&&l<this.BASE_+8&&h>=64&&h<=127},Tt.prototype.isColorPAC=function(l){return l>=64&&l<=79||l>=96&&l<=127},Tt.prototype.isNormalChar=function(l){return l>=32&&l<=127},Tt.prototype.setRollUp=function(l,h){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=gn(),this.displayed_=gn()),h!==void 0&&h!==this.row_)for(var g=0;g<this.rollUpRows_;g++)this.displayed_[h-g]=this.displayed_[this.row_-g],this.displayed_[this.row_-g]="";h===void 0&&(h=this.row_),this.topRow_=h-this.rollUpRows_+1},Tt.prototype.addFormatting=function(l,h){this.formatting_=this.formatting_.concat(h);var g=h.reduce(function(p,v){return p+"<"+v+">"},"");this[this.mode_](l,g)},Tt.prototype.clearFormatting=function(l){if(this.formatting_.length){var h=this.formatting_.reverse().reduce(function(g,p){return g+"</"+p+">"},"");this.formatting_=[],this[this.mode_](l,h)}},Tt.prototype.popOn=function(l,h){var g=this.nonDisplayed_[this.row_];g+=h,this.nonDisplayed_[this.row_]=g},Tt.prototype.rollUp=function(l,h){var g=this.displayed_[this.row_];g+=h,this.displayed_[this.row_]=g},Tt.prototype.shiftRowsUp_=function(){var l;for(l=0;l<this.topRow_;l++)this.displayed_[l]="";for(l=this.row_+1;l<15;l++)this.displayed_[l]="";for(l=this.topRow_;l<this.row_;l++)this.displayed_[l]=this.displayed_[l+1];this.displayed_[this.row_]=""},Tt.prototype.paintOn=function(l,h){var g=this.displayed_[this.row_];g+=h,this.displayed_[this.row_]=g};var oa={CaptionStream:ce,Cea608Stream:Tt,Cea708Stream:vt},Mt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Lh="shared",Oo=function(l,h){var g=1;for(l>h&&(g=-1);Math.abs(h-l)>4294967296;)l+=8589934592*g;return l},Oh=function l(h){var g,p;l.prototype.init.call(this),this.type_=h||Lh,this.push=function(v){this.type_!==Lh&&v.type!==this.type_||(p===void 0&&(p=v.dts),v.dts=Oo(v.dts,p),v.pts=Oo(v.pts,p),g=v.dts,this.trigger("data",v))},this.flush=function(){p=g,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){p=void 0,g=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Oh.prototype=new Dt;var ua,wv=Oh,kv=Oo,Rh=function(l,h,g){var p,v="";for(p=h;p<g;p++)v+="%"+("00"+l[p].toString(16)).slice(-2);return v},la=function(l,h,g){return decodeURIComponent(Rh(l,h,g))},ca=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},Nh={TXXX:function(l){var h;if(l.data[0]===3){for(h=1;h<l.data.length;h++)if(l.data[h]===0){l.description=la(l.data,1,h),l.value=la(l.data,h+1,l.data.length).replace(/\0*$/,"");break}l.data=l.value}},WXXX:function(l){var h;if(l.data[0]===3){for(h=1;h<l.data.length;h++)if(l.data[h]===0){l.description=la(l.data,1,h),l.url=la(l.data,h+1,l.data.length);break}}},PRIV:function(l){var h,g;for(h=0;h<l.data.length;h++)if(l.data[h]===0){l.owner=(g=l.data,unescape(Rh(g,0,h)));break}l.privateData=l.data.subarray(h+1),l.data=l.privateData}};ua=function(l){var h,g={descriptor:l&&l.descriptor},p=0,v=[],T=0;if(ua.prototype.init.call(this),this.dispatchType=Mt.METADATA_STREAM_TYPE.toString(16),g.descriptor)for(h=0;h<g.descriptor.length;h++)this.dispatchType+=("00"+g.descriptor[h].toString(16)).slice(-2);this.push=function(S){var C,x,L,M,j;if(S.type==="timed-metadata"){if(S.dataAlignmentIndicator&&(T=0,v.length=0),v.length===0&&(S.data.length<10||S.data[0]!=="I".charCodeAt(0)||S.data[1]!=="D".charCodeAt(0)||S.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(v.push(S),T+=S.data.byteLength,v.length===1&&(p=ca(S.data.subarray(6,10)),p+=10),!(T<p)){for(C={data:new Uint8Array(p),frames:[],pts:v[0].pts,dts:v[0].dts},j=0;j<p;)C.data.set(v[0].data.subarray(0,p-j),j),j+=v[0].data.byteLength,T-=v[0].data.byteLength,v.shift();x=10,64&C.data[5]&&(x+=4,x+=ca(C.data.subarray(10,14)),p-=ca(C.data.subarray(16,20)));do{if((L=ca(C.data.subarray(x+4,x+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if((M={id:String.fromCharCode(C.data[x],C.data[x+1],C.data[x+2],C.data[x+3]),data:C.data.subarray(x+10,x+L+10)}).key=M.id,Nh[M.id]&&(Nh[M.id](M),M.owner==="com.apple.streaming.transportStreamTimestamp")){var W=M.data,z=(1&W[3])<<30|W[4]<<22|W[5]<<14|W[6]<<6|W[7]>>>2;z*=4,z+=3&W[7],M.timeStamp=z,C.pts===void 0&&C.dts===void 0&&(C.pts=M.timeStamp,C.dts=M.timeStamp),this.trigger("timestamp",M)}C.frames.push(M),x+=10,x+=L}while(x<p);this.trigger("data",C)}}}},ua.prototype=new Dt;var Ro,Hi,da,Cv=ua,xv=wv,ei=188;(Ro=function(){var l=new Uint8Array(ei),h=0;Ro.prototype.init.call(this),this.push=function(g){var p,v=0,T=ei;for(h?((p=new Uint8Array(g.byteLength+h)).set(l.subarray(0,h)),p.set(g,h),h=0):p=g;T<p.byteLength;)p[v]!==71||p[T]!==71?(v++,T++):(this.trigger("data",p.subarray(v,T)),v+=ei,T+=ei);v<p.byteLength&&(l.set(p.subarray(v),0),h=p.byteLength-v)},this.flush=function(){h===ei&&l[0]===71&&(this.trigger("data",l),h=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){h=0,this.trigger("reset")}}).prototype=new Dt,Hi=function(){var l,h,g,p;Hi.prototype.init.call(this),p=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,l=function(v,T){var S=0;T.payloadUnitStartIndicator&&(S+=v[S]+1),T.type==="pat"?h(v.subarray(S),T):g(v.subarray(S),T)},h=function(v,T){T.section_number=v[7],T.last_section_number=v[8],p.pmtPid=(31&v[10])<<8|v[11],T.pmtPid=p.pmtPid},g=function(v,T){var S,C;if(1&v[5]){for(p.programMapTable={video:null,audio:null,"timed-metadata":{}},S=3+((15&v[1])<<8|v[2])-4,C=12+((15&v[10])<<8|v[11]);C<S;){var x=v[C],L=(31&v[C+1])<<8|v[C+2];x===Mt.H264_STREAM_TYPE&&p.programMapTable.video===null?p.programMapTable.video=L:x===Mt.ADTS_STREAM_TYPE&&p.programMapTable.audio===null?p.programMapTable.audio=L:x===Mt.METADATA_STREAM_TYPE&&(p.programMapTable["timed-metadata"][L]=x),C+=5+((15&v[C+3])<<8|v[C+4])}T.programMapTable=p.programMapTable}},this.push=function(v){var T={},S=4;if(T.payloadUnitStartIndicator=!!(64&v[1]),T.pid=31&v[1],T.pid<<=8,T.pid|=v[2],(48&v[3])>>>4>1&&(S+=v[S]+1),T.pid===0)T.type="pat",l(v.subarray(S),T),this.trigger("data",T);else if(T.pid===this.pmtPid)for(T.type="pmt",l(v.subarray(S),T),this.trigger("data",T);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,S,T]):this.processPes_(v,S,T)},this.processPes_=function(v,T,S){S.pid===this.programMapTable.video?S.streamType=Mt.H264_STREAM_TYPE:S.pid===this.programMapTable.audio?S.streamType=Mt.ADTS_STREAM_TYPE:S.streamType=this.programMapTable["timed-metadata"][S.pid],S.type="pes",S.data=v.subarray(T),this.trigger("data",S)}},Hi.prototype=new Dt,Hi.STREAM_TYPES={h264:27,adts:15},da=function(){var l,h=this,g=!1,p={data:[],size:0},v={data:[],size:0},T={data:[],size:0},S=function(C,x,L){var M,j,W=new Uint8Array(C.size),z={type:x},st=0,ct=0;if(C.data.length&&!(C.size<9)){for(z.trackId=C.data[0].pid,st=0;st<C.data.length;st++)j=C.data[st],W.set(j.data,ct),ct+=j.data.byteLength;var ut,lt,oe,de;lt=z,de=(ut=W)[0]<<16|ut[1]<<8|ut[2],lt.data=new Uint8Array,de===1&&(lt.packetLength=6+(ut[4]<<8|ut[5]),lt.dataAlignmentIndicator=(4&ut[6])!=0,192&(oe=ut[7])&&(lt.pts=(14&ut[9])<<27|(255&ut[10])<<20|(254&ut[11])<<12|(255&ut[12])<<5|(254&ut[13])>>>3,lt.pts*=4,lt.pts+=(6&ut[13])>>>1,lt.dts=lt.pts,64&oe&&(lt.dts=(14&ut[14])<<27|(255&ut[15])<<20|(254&ut[16])<<12|(255&ut[17])<<5|(254&ut[18])>>>3,lt.dts*=4,lt.dts+=(6&ut[18])>>>1)),lt.data=ut.subarray(9+ut[8])),M=x==="video"||z.packetLength<=C.size,(L||M)&&(C.size=0,C.data.length=0),M&&h.trigger("data",z)}};da.prototype.init.call(this),this.push=function(C){({pat:function(){},pes:function(){var x,L;switch(C.streamType){case Mt.H264_STREAM_TYPE:x=p,L="video";break;case Mt.ADTS_STREAM_TYPE:x=v,L="audio";break;case Mt.METADATA_STREAM_TYPE:x=T,L="timed-metadata";break;default:return}C.payloadUnitStartIndicator&&S(x,L,!0),x.data.push(C),x.size+=C.data.byteLength},pmt:function(){var x={type:"metadata",tracks:[]};(l=C.programMapTable).video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.video,codec:"avc",type:"video"}),l.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.audio,codec:"adts",type:"audio"}),g=!0,h.trigger("data",x)}})[C.type]()},this.reset=function(){p.size=0,p.data.length=0,v.size=0,v.data.length=0,this.trigger("reset")},this.flushStreams_=function(){S(p,"video"),S(v,"audio"),S(T,"timed-metadata")},this.flush=function(){if(!g&&l){var C={type:"metadata",tracks:[]};l.video!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.video,codec:"avc",type:"video"}),l.audio!==null&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+l.audio,codec:"adts",type:"audio"}),h.trigger("data",C)}g=!1,this.flushStreams_(),this.trigger("done")}},da.prototype=new Dt;var Mh={PAT_PID:0,MP2T_PACKET_LENGTH:ei,TransportPacketStream:Ro,TransportParseStream:Hi,ElementaryStream:da,TimestampRolloverStream:xv,CaptionStream:oa.CaptionStream,Cea608Stream:oa.Cea608Stream,Cea708Stream:oa.Cea708Stream,MetadataStream:Cv};for(var No in Mt)Mt.hasOwnProperty(No)&&(Mh[No]=Mt[No]);var ha,Xe=Mh,Dv=mn,Uh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ha=function(l){var h,g=0;ha.prototype.init.call(this),this.skipWarn_=function(p,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+p+" to "+v+" in frame "+g+" outside syncword"})},this.push=function(p){var v,T,S,C,x,L=0;if(l||(g=0),p.type==="audio"){var M;for(h&&h.length?(S=h,(h=new Uint8Array(S.byteLength+p.data.byteLength)).set(S),h.set(p.data,S.byteLength)):h=p.data;L+7<h.length;)if(h[L]===255&&(246&h[L+1])==240){if(typeof M=="number"&&(this.skipWarn_(M,L),M=null),T=2*(1&~h[L+1]),v=(3&h[L+3])<<11|h[L+4]<<3|(224&h[L+5])>>5,x=(C=1024*(1+(3&h[L+6])))*Dv/Uh[(60&h[L+2])>>>2],h.byteLength-L<v)break;this.trigger("data",{pts:p.pts+g*x,dts:p.dts+g*x,sampleCount:C,audioobjecttype:1+(h[L+2]>>>6&3),channelcount:(1&h[L+2])<<2|(192&h[L+3])>>>6,samplerate:Uh[(60&h[L+2])>>>2],samplingfrequencyindex:(60&h[L+2])>>>2,samplesize:16,data:h.subarray(L+7+T,L+v)}),g++,L+=v}else typeof M!="number"&&(M=L),L++;typeof M=="number"&&(this.skipWarn_(M,L),M=null),h=h.subarray(L)}},this.flush=function(){g=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},ha.prototype=new Dt;var Bh,Fh=ha;Bh=function(l){var h=l.byteLength,g=0,p=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+p},this.loadWord=function(){var v=l.byteLength-h,T=new Uint8Array(4),S=Math.min(4,h);if(S===0)throw new Error("no bytes available");T.set(l.subarray(v,v+S)),g=new DataView(T.buffer).getUint32(0),p=8*S,h-=S},this.skipBits=function(v){var T;p>v?(g<<=v,p-=v):(v-=p,v-=8*(T=Math.floor(v/8)),h-=T,this.loadWord(),g<<=v,p-=v)},this.readBits=function(v){var T=Math.min(p,v),S=g>>>32-T;return(p-=T)>0?g<<=T:h>0&&this.loadWord(),(T=v-T)>0?S<<T|this.readBits(T):S},this.skipLeadingZeros=function(){var v;for(v=0;v<p;++v)if(g&2147483648>>>v)return g<<=v,p-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var pa,Vi,jh,Iv=Bh;Vi=function(){var l,h,g=0;Vi.prototype.init.call(this),this.push=function(p){var v;h?((v=new Uint8Array(h.byteLength+p.data.byteLength)).set(h),v.set(p.data,h.byteLength),h=v):h=p.data;for(var T=h.byteLength;g<T-3;g++)if(h[g+2]===1){l=g+5;break}for(;l<T;)switch(h[l]){case 0:if(h[l-1]!==0){l+=2;break}if(h[l-2]!==0){l++;break}g+3!==l-2&&this.trigger("data",h.subarray(g+3,l-2));do l++;while(h[l]!==1&&l<T);g=l-2,l+=3;break;case 1:if(h[l-1]!==0||h[l-2]!==0){l+=3;break}this.trigger("data",h.subarray(g+3,l-2)),g=l-2,l+=3;break;default:l+=3}h=h.subarray(g),l-=g,g=0},this.reset=function(){h=null,g=0,this.trigger("reset")},this.flush=function(){h&&h.byteLength>3&&this.trigger("data",h.subarray(g+3)),h=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Vi.prototype=new Dt,jh={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},pa=function(){var l,h,g,p,v,T,S,C=new Vi;pa.prototype.init.call(this),l=this,this.push=function(x){x.type==="video"&&(h=x.trackId,g=x.pts,p=x.dts,C.push(x))},C.on("data",function(x){var L={trackId:h,pts:g,dts:p,data:x,nalUnitTypeCode:31&x[0]};switch(L.nalUnitTypeCode){case 5:L.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:L.nalUnitType="sei_rbsp",L.escapedRBSP=v(x.subarray(1));break;case 7:L.nalUnitType="seq_parameter_set_rbsp",L.escapedRBSP=v(x.subarray(1)),L.config=T(L.escapedRBSP);break;case 8:L.nalUnitType="pic_parameter_set_rbsp";break;case 9:L.nalUnitType="access_unit_delimiter_rbsp"}l.trigger("data",L)}),C.on("done",function(){l.trigger("done")}),C.on("partialdone",function(){l.trigger("partialdone")}),C.on("reset",function(){l.trigger("reset")}),C.on("endedtimeline",function(){l.trigger("endedtimeline")}),this.flush=function(){C.flush()},this.partialFlush=function(){C.partialFlush()},this.reset=function(){C.reset()},this.endTimeline=function(){C.endTimeline()},S=function(x,L){var M,j=8,W=8;for(M=0;M<x;M++)W!==0&&(W=(j+L.readExpGolomb()+256)%256),j=W===0?j:W},v=function(x){for(var L,M,j=x.byteLength,W=[],z=1;z<j-2;)x[z]===0&&x[z+1]===0&&x[z+2]===3?(W.push(z+2),z+=2):z++;if(W.length===0)return x;L=j-W.length,M=new Uint8Array(L);var st=0;for(z=0;z<L;st++,z++)st===W[0]&&(st++,W.shift()),M[z]=x[st];return M},T=function(x){var L,M,j,W,z,st,ct,ut,lt,oe,de,Ct,Qt=0,De=0,Ke=0,tn=0,gt=[1,1];if(M=(L=new Iv(x)).readUnsignedByte(),W=L.readUnsignedByte(),j=L.readUnsignedByte(),L.skipUnsignedExpGolomb(),jh[M]&&((z=L.readUnsignedExpGolomb())===3&&L.skipBits(1),L.skipUnsignedExpGolomb(),L.skipUnsignedExpGolomb(),L.skipBits(1),L.readBoolean()))for(de=z!==3?8:12,Ct=0;Ct<de;Ct++)L.readBoolean()&&S(Ct<6?16:64,L);if(L.skipUnsignedExpGolomb(),(st=L.readUnsignedExpGolomb())===0)L.readUnsignedExpGolomb();else if(st===1)for(L.skipBits(1),L.skipExpGolomb(),L.skipExpGolomb(),ct=L.readUnsignedExpGolomb(),Ct=0;Ct<ct;Ct++)L.skipExpGolomb();if(L.skipUnsignedExpGolomb(),L.skipBits(1),ut=L.readUnsignedExpGolomb(),lt=L.readUnsignedExpGolomb(),(oe=L.readBits(1))===0&&L.skipBits(1),L.skipBits(1),L.readBoolean()&&(Qt=L.readUnsignedExpGolomb(),De=L.readUnsignedExpGolomb(),Ke=L.readUnsignedExpGolomb(),tn=L.readUnsignedExpGolomb()),L.readBoolean()&&L.readBoolean()){switch(L.readUnsignedByte()){case 1:gt=[1,1];break;case 2:gt=[12,11];break;case 3:gt=[10,11];break;case 4:gt=[16,11];break;case 5:gt=[40,33];break;case 6:gt=[24,11];break;case 7:gt=[20,11];break;case 8:gt=[32,11];break;case 9:gt=[80,33];break;case 10:gt=[18,11];break;case 11:gt=[15,11];break;case 12:gt=[64,33];break;case 13:gt=[160,99];break;case 14:gt=[4,3];break;case 15:gt=[3,2];break;case 16:gt=[2,1];break;case 255:gt=[L.readUnsignedByte()<<8|L.readUnsignedByte(),L.readUnsignedByte()<<8|L.readUnsignedByte()]}gt&&(gt[0],gt[1])}return{profileIdc:M,levelIdc:j,profileCompatibility:W,width:16*(ut+1)-2*Qt-2*De,height:(2-oe)*(lt+1)*16-2*Ke-2*tn,sarRatio:gt}}},pa.prototype=new Dt;var Mo,Av={H264Stream:pa,NalByteStream:Vi},Pv=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],qh=function(l,h){var g=l[h+6]<<21|l[h+7]<<14|l[h+8]<<7|l[h+9];return g=g>=0?g:0,(16&l[h+5])>>4?g+20:g+10},Lv=function l(h,g){return h.length-g<10||h[g]!=="I".charCodeAt(0)||h[g+1]!=="D".charCodeAt(0)||h[g+2]!=="3".charCodeAt(0)?g:l(h,g+=qh(h,g))},Hh=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},fa={isLikelyAacData:function(l){var h=Lv(l,0);return l.length>=h+2&&(255&l[h])==255&&(240&l[h+1])==240&&(22&l[h+1])==16},parseId3TagSize:qh,parseAdtsSize:function(l,h){var g=(224&l[h+5])>>5,p=l[h+4]<<3;return 6144&l[h+3]|p|g},parseType:function(l,h){return l[h]==="I".charCodeAt(0)&&l[h+1]==="D".charCodeAt(0)&&l[h+2]==="3".charCodeAt(0)?"timed-metadata":!0&l[h]&&(240&l[h+1])==240?"audio":null},parseSampleRate:function(l){for(var h=0;h+5<l.length;){if(l[h]===255&&(246&l[h+1])==240)return Pv[(60&l[h+2])>>>2];h++}return null},parseAacTimestamp:function(l){var h,g,p;h=10,64&l[5]&&(h+=4,h+=Hh(l.subarray(10,14)));do{if((g=Hh(l.subarray(h+4,h+8)))<1)return null;if(String.fromCharCode(l[h],l[h+1],l[h+2],l[h+3])==="PRIV"){p=l.subarray(h+10,h+g+10);for(var v=0;v<p.byteLength;v++)if(p[v]===0){var T=unescape(function(x,L,M){var j,W="";for(j=L;j<M;j++)W+="%"+("00"+x[j].toString(16)).slice(-2);return W}(p,0,v));if(T==="com.apple.streaming.transportStreamTimestamp"){var S=p.subarray(v+1),C=(1&S[3])<<30|S[4]<<22|S[5]<<14|S[6]<<6|S[7]>>>2;return C*=4,C+=3&S[7]}break}}h+=10,h+=g}while(h<l.byteLength);return null}};(Mo=function(){var l=new Uint8Array,h=0;Mo.prototype.init.call(this),this.setTimestamp=function(g){h=g},this.push=function(g){var p,v,T,S,C=0,x=0;for(l.length?(S=l.length,(l=new Uint8Array(g.byteLength+S)).set(l.subarray(0,S)),l.set(g,S)):l=g;l.length-x>=3;)if(l[x]!=="I".charCodeAt(0)||l[x+1]!=="D".charCodeAt(0)||l[x+2]!=="3".charCodeAt(0))if((255&l[x])!=255||(240&l[x+1])!=240)x++;else{if(l.length-x<7||x+(C=fa.parseAdtsSize(l,x))>l.length)break;T={type:"audio",data:l.subarray(x,x+C),pts:h,dts:h},this.trigger("data",T),x+=C}else{if(l.length-x<10||x+(C=fa.parseId3TagSize(l,x))>l.length)break;v={type:"timed-metadata",data:l.subarray(x,x+C)},this.trigger("data",v),x+=C}p=l.length-x,l=p>0?l.subarray(x):new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new Dt;var Wi,ni,ma,vn,Ov=Mo,Uo=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Bo=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Rv=Av.H264Stream,Nv=fa.isLikelyAacData,Mv=mn,Uv=function(l,h){h.stream=l,this.trigger("log",h)},Vh=function(l,h){for(var g=Object.keys(h),p=0;p<g.length;p++){var v=g[p];v!=="headOfPipeline"&&h[v].on&&h[v].on("log",Uv.bind(l,v))}},Wh=function(l,h){var g;if(l.length!==h.length)return!1;for(g=0;g<l.length;g++)if(l[g]!==h[g])return!1;return!0},Fo=function(l,h,g,p,v,T){return{start:{dts:l,pts:l+(g-h)},end:{dts:l+(p-h),pts:l+(v-g)},prependedContentDuration:T,baseMediaDecodeTime:l}};ni=function(l,h){var g,p=[],v=0,T=0,S=1/0;g=(h=h||{}).firstSequenceNumber||0,ni.prototype.init.call(this),this.push=function(C){Lo(l,C),l&&Uo.forEach(function(x){l[x]=C[x]}),p.push(C)},this.setEarliestDts=function(C){v=C},this.setVideoBaseMediaDecodeTime=function(C){S=C},this.setAudioAppendStart=function(C){T=C},this.flush=function(){var C,x,L,M,j,W,z;p.length!==0?(C=hv(p,l,v),l.baseMediaDecodeTime=Ph(l,h.keepOriginalTimestamps),z=dv(l,C,T,S),l.samples=pv(C),L=xh(fv(C)),p=[],x=Dh(g,[l]),M=new Uint8Array(x.byteLength+L.byteLength),g++,M.set(x),M.set(L,x.byteLength),ti(l),j=Math.ceil(1024*Mv/l.samplerate),C.length&&(W=C.length*j,this.trigger("segmentTimingInfo",Fo(Ah(l.baseMediaDecodeTime,l.samplerate),C[0].dts,C[0].pts,C[0].dts+W,C[0].pts+W,z||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+W})),this.trigger("data",{track:l,boxes:M}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){ti(l),p=[],this.trigger("reset")}},ni.prototype=new Dt,Wi=function(l,h){var g,p,v,T=[],S=[];g=(h=h||{}).firstSequenceNumber||0,Wi.prototype.init.call(this),delete l.minPTS,this.gopCache_=[],this.push=function(C){Lo(l,C),C.nalUnitType!=="seq_parameter_set_rbsp"||p||(p=C.config,l.sps=[C.data],Bo.forEach(function(x){l[x]=p[x]},this)),C.nalUnitType!=="pic_parameter_set_rbsp"||v||(v=C.data,l.pps=[C.data]),T.push(C)},this.flush=function(){for(var C,x,L,M,j,W,z,st,ct=0;T.length&&T[0].nalUnitType!=="access_unit_delimiter_rbsp";)T.shift();if(T.length===0)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(C=rv(T),(L=av(C))[0][0].keyFrame||((x=this.getGopForFusion_(T[0],l))?(ct=x.duration,L.unshift(x),L.byteLength+=x.byteLength,L.nalCount+=x.nalCount,L.pts=x.pts,L.dts=x.dts,L.duration+=x.duration):L=sv(L)),S.length){var ut;if(!(ut=h.alignGopsAtEnd?this.alignGopsAtEnd_(L):this.alignGopsAtStart_(L)))return this.gopCache_.unshift({gop:L.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");ti(l),L=ut}Lo(l,L),l.samples=ov(L),j=xh(uv(L)),l.baseMediaDecodeTime=Ph(l,h.keepOriginalTimestamps),this.trigger("processedGopsInfo",L.map(function(lt){return{pts:lt.pts,dts:lt.dts,byteLength:lt.byteLength}})),z=L[0],st=L[L.length-1],this.trigger("segmentTimingInfo",Fo(l.baseMediaDecodeTime,z.dts,z.pts,st.dts+st.duration,st.pts+st.duration,ct)),this.trigger("timingInfo",{start:L[0].pts,end:L[L.length-1].pts+L[L.length-1].duration}),this.gopCache_.unshift({gop:L.pop(),pps:l.pps,sps:l.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),T=[],this.trigger("baseMediaDecodeTime",l.baseMediaDecodeTime),this.trigger("timelineStartInfo",l.timelineStartInfo),M=Dh(g,[l]),W=new Uint8Array(M.byteLength+j.byteLength),g++,W.set(M),W.set(j,M.byteLength),this.trigger("data",{track:l,boxes:W}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),T=[],this.gopCache_.length=0,S.length=0,this.trigger("reset")},this.resetStream_=function(){ti(l),p=void 0,v=void 0},this.getGopForFusion_=function(C){var x,L,M,j,W,z=1/0;for(W=0;W<this.gopCache_.length;W++)M=(j=this.gopCache_[W]).gop,l.pps&&Wh(l.pps[0],j.pps[0])&&l.sps&&Wh(l.sps[0],j.sps[0])&&(M.dts<l.timelineStartInfo.dts||(x=C.dts-M.dts-M.duration)>=-1e4&&x<=45e3&&(!L||z>x)&&(L=j,z=x));return L?L.gop:null},this.alignGopsAtStart_=function(C){var x,L,M,j,W,z,st,ct;for(W=C.byteLength,z=C.nalCount,st=C.duration,x=L=0;x<S.length&&L<C.length&&(M=S[x],j=C[L],M.pts!==j.pts);)j.pts>M.pts?x++:(L++,W-=j.byteLength,z-=j.nalCount,st-=j.duration);return L===0?C:L===C.length?null:((ct=C.slice(L)).byteLength=W,ct.duration=st,ct.nalCount=z,ct.pts=ct[0].pts,ct.dts=ct[0].dts,ct)},this.alignGopsAtEnd_=function(C){var x,L,M,j,W,z,st;for(x=S.length-1,L=C.length-1,W=null,z=!1;x>=0&&L>=0;){if(M=S[x],j=C[L],M.pts===j.pts){z=!0;break}M.pts>j.pts?x--:(x===S.length-1&&(W=L),L--)}if(!z&&W===null)return null;if((st=z?L:W)===0)return C;var ct=C.slice(st),ut=ct.reduce(function(lt,oe){return lt.byteLength+=oe.byteLength,lt.duration+=oe.duration,lt.nalCount+=oe.nalCount,lt},{byteLength:0,duration:0,nalCount:0});return ct.byteLength=ut.byteLength,ct.duration=ut.duration,ct.nalCount=ut.nalCount,ct.pts=ct[0].pts,ct.dts=ct[0].dts,ct},this.alignGopsWith=function(C){S=C}},Wi.prototype=new Dt,vn=function(l,h){this.numberOfTracks=0,this.metadataStream=h,(l=l||{}).remux!==void 0?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,vn.prototype.init.call(this),this.push=function(g){return g.text?this.pendingCaptions.push(g):g.frames?this.pendingMetadata.push(g):(this.pendingTracks.push(g.track),this.pendingBytes+=g.boxes.byteLength,g.track.type==="video"&&(this.videoTrack=g.track,this.pendingBoxes.push(g.boxes)),void(g.track.type==="audio"&&(this.audioTrack=g.track,this.pendingBoxes.unshift(g.boxes))))}},vn.prototype=new Dt,vn.prototype.flush=function(l){var h,g,p,v,T=0,S={captions:[],captionStreams:{},metadata:[],info:{}},C=0;if(this.pendingTracks.length<this.numberOfTracks){if(l!=="VideoSegmentStream"&&l!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(C=this.videoTrack.timelineStartInfo.pts,Bo.forEach(function(x){S.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(C=this.audioTrack.timelineStartInfo.pts,Uo.forEach(function(x){S.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,p=nv(this.pendingTracks),S.initSegment=new Uint8Array(p.byteLength),S.initSegment.set(p),S.data=new Uint8Array(this.pendingBytes),v=0;v<this.pendingBoxes.length;v++)S.data.set(this.pendingBoxes[v],T),T+=this.pendingBoxes[v].byteLength;for(v=0;v<this.pendingCaptions.length;v++)(h=this.pendingCaptions[v]).startTime=Po(h.startPts,C,this.keepOriginalTimestamps),h.endTime=Po(h.endPts,C,this.keepOriginalTimestamps),S.captionStreams[h.stream]=!0,S.captions.push(h);for(v=0;v<this.pendingMetadata.length;v++)(g=this.pendingMetadata[v]).cueTime=Po(g.pts,C,this.keepOriginalTimestamps),S.metadata.push(g);for(S.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",S),v=0;v<S.captions.length;v++)h=S.captions[v],this.trigger("caption",h);for(v=0;v<S.metadata.length;v++)g=S.metadata[v],this.trigger("id3Frame",g)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},vn.prototype.setRemux=function(l){this.remuxTracks=l},ma=function(l){var h,g,p=this,v=!0;ma.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="aac",T.metadataStream=new Xe.MetadataStream,T.aacStream=new Ov,T.audioTimestampRolloverStream=new Xe.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new Xe.TimestampRolloverStream("timed-metadata"),T.adtsStream=new Fh,T.coalesceStream=new vn(l,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(S){T.aacStream.setTimestamp(S.timeStamp)}),T.aacStream.on("data",function(S){S.type!=="timed-metadata"&&S.type!=="audio"||T.audioSegmentStream||(g=g||{timelineStartInfo:{baseMediaDecodeTime:p.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new ni(g,l),T.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream),p.trigger("trackinfo",{hasAudio:!!g,hasVideo:!!h}))}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),Vh(this,T)},this.setupTsPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="ts",T.metadataStream=new Xe.MetadataStream,T.packetStream=new Xe.TransportPacketStream,T.parseStream=new Xe.TransportParseStream,T.elementaryStream=new Xe.ElementaryStream,T.timestampRolloverStream=new Xe.TimestampRolloverStream,T.adtsStream=new Fh,T.h264Stream=new Rv,T.captionStream=new Xe.CaptionStream(l),T.coalesceStream=new vn(l,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(S){var C;if(S.type==="metadata"){for(C=S.tracks.length;C--;)h||S.tracks[C].type!=="video"?g||S.tracks[C].type!=="audio"||((g=S.tracks[C]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime):(h=S.tracks[C]).timelineStartInfo.baseMediaDecodeTime=p.baseMediaDecodeTime;h&&!T.videoSegmentStream&&(T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new Wi(h,l),T.videoSegmentStream.on("log",p.getLogTrigger_("videoSegmentStream")),T.videoSegmentStream.on("timelineStartInfo",function(x){g&&!l.keepOriginalTimestamps&&(g.timelineStartInfo=x,T.audioSegmentStream.setEarliestDts(x.dts-p.baseMediaDecodeTime))}),T.videoSegmentStream.on("processedGopsInfo",p.trigger.bind(p,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(x){g&&T.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),T.videoSegmentStream.on("timingInfo",p.trigger.bind(p,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream)),g&&!T.audioSegmentStream&&(T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new ni(g,l),T.audioSegmentStream.on("log",p.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",p.trigger.bind(p,"audioTimingInfo")),T.audioSegmentStream.on("segmentTimingInfo",p.trigger.bind(p,"audioSegmentTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),p.trigger("trackinfo",{hasAudio:!!g,hasVideo:!!h})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(S){S.dispatchType=T.metadataStream.dispatchType,p.trigger("id3Frame",S)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),Vh(this,T)},this.setBaseMediaDecodeTime=function(T){var S=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=T),g&&(g.timelineStartInfo.dts=void 0,g.timelineStartInfo.pts=void 0,ti(g),S.audioTimestampRolloverStream&&S.audioTimestampRolloverStream.discontinuity()),h&&(S.videoSegmentStream&&(S.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,ti(h),S.captionStream.reset()),S.timestampRolloverStream&&S.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){g&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var S=this.transmuxPipeline_;l.remux=T,S&&S.coalesceStream&&S.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.getLogTrigger_=function(T){var S=this;return function(C){C.stream=T,S.trigger("log",C)}},this.push=function(T){if(v){var S=Nv(T);S&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():S||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),v=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){v=!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()}},ma.prototype=new Dt;var Gh,zh,Xh,Bv={Transmuxer:ma,VideoSegmentStream:Wi,AudioSegmentStream:ni,AUDIO_PROPERTIES:Uo,VIDEO_PROPERTIES:Bo,generateSegmentTimingInfo:Fo},jo=function(l){return l>>>0},Gi=function(l){var h="";return h+=String.fromCharCode(l[0]),h+=String.fromCharCode(l[1]),h+=String.fromCharCode(l[2]),h+=String.fromCharCode(l[3])},Fv=jo,ne=function l(h,g){var p,v,T,S,C,x=[];if(!g.length)return null;for(p=0;p<h.byteLength;)v=Fv(h[p]<<24|h[p+1]<<16|h[p+2]<<8|h[p+3]),T=Gi(h.subarray(p+4,p+8)),S=v>1?p+v:h.byteLength,T===g[0]&&(g.length===1?x.push(h.subarray(p+8,S)):(C=l(h.subarray(p+8,S),g.slice(1))).length&&(x=x.concat(C))),p=S;return x},jv=jo,qv=qi.getUint64,Hv=function(l){var h={version:l[0],flags:new Uint8Array(l.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=qv(l.subarray(4)):h.baseMediaDecodeTime=jv(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),h},Kh=function(l){return{isLeading:(12&l[0])>>>2,dependsOn:3&l[0],isDependedOn:(192&l[1])>>>6,hasRedundancy:(48&l[1])>>>4,paddingValue:(14&l[1])>>>1,isNonSyncSample:1&l[1],degradationPriority:l[2]<<8|l[3]}},Vv=function(l){var h,g={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},p=new DataView(l.buffer,l.byteOffset,l.byteLength),v=1&g.flags[2],T=4&g.flags[2],S=1&g.flags[1],C=2&g.flags[1],x=4&g.flags[1],L=8&g.flags[1],M=p.getUint32(4),j=8;for(v&&(g.dataOffset=p.getInt32(j),j+=4),T&&M&&(h={flags:Kh(l.subarray(j,j+4))},j+=4,S&&(h.duration=p.getUint32(j),j+=4),C&&(h.size=p.getUint32(j),j+=4),L&&(g.version===1?h.compositionTimeOffset=p.getInt32(j):h.compositionTimeOffset=p.getUint32(j),j+=4),g.samples.push(h),M--);M--;)h={},S&&(h.duration=p.getUint32(j),j+=4),C&&(h.size=p.getUint32(j),j+=4),x&&(h.flags=Kh(l.subarray(j,j+4)),j+=4),L&&(g.version===1?h.compositionTimeOffset=p.getInt32(j):h.compositionTimeOffset=p.getUint32(j),j+=4),g.samples.push(h);return g},Wv=function(l){var h,g=new DataView(l.buffer,l.byteOffset,l.byteLength),p={version:l[0],flags:new Uint8Array(l.subarray(1,4)),trackId:g.getUint32(4)},v=1&p.flags[2],T=2&p.flags[2],S=8&p.flags[2],C=16&p.flags[2],x=32&p.flags[2],L=65536&p.flags[0],M=131072&p.flags[0];return h=8,v&&(h+=4,p.baseDataOffset=g.getUint32(12),h+=4),T&&(p.sampleDescriptionIndex=g.getUint32(h),h+=4),S&&(p.defaultSampleDuration=g.getUint32(h),h+=4),C&&(p.defaultSampleSize=g.getUint32(h),h+=4),x&&(p.defaultSampleFlags=g.getUint32(h)),L&&(p.durationIsEmpty=!0),!v&&M&&(p.baseDataOffsetIsMoof=!0),p},Yh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qo=typeof window<"u"?window:Yh!==void 0?Yh:typeof self<"u"?self:{},Gv=_v,zv=oa.CaptionStream,Xv=function(l,h){for(var g=l,p=0;p<h.length;p++){var v=h[p];if(g<v.size)return v;g-=v.size}return null},Kv=function(l,h){var g=ne(l,["moof","traf"]),p=ne(l,["mdat"]),v={},T=[];return p.forEach(function(S,C){var x=g[C];T.push({mdat:S,traf:x})}),T.forEach(function(S){var C,x,L=S.mdat,M=S.traf,j=ne(M,["tfhd"]),W=Wv(j[0]),z=W.trackId,st=ne(M,["tfdt"]),ct=st.length>0?Hv(st[0]).baseMediaDecodeTime:0,ut=ne(M,["trun"]);h===z&&ut.length>0&&(C=function(lt,oe,de){var Ct=oe,Qt=de.defaultSampleDuration||0,De=de.defaultSampleSize||0,Ke=de.trackId,tn=[];return lt.forEach(function(gt){var Xi=Vv(gt).samples;Xi.forEach(function(It){It.duration===void 0&&(It.duration=Qt),It.size===void 0&&(It.size=De),It.trackId=Ke,It.dts=Ct,It.compositionTimeOffset===void 0&&(It.compositionTimeOffset=0),typeof Ct=="bigint"?(It.pts=Ct+qo.BigInt(It.compositionTimeOffset),Ct+=qo.BigInt(It.duration)):(It.pts=Ct+It.compositionTimeOffset,Ct+=It.duration)}),tn=tn.concat(Xi)}),tn}(ut,ct,W),x=function(lt,oe,de){var Ct,Qt,De,Ke,tn=new DataView(lt.buffer,lt.byteOffset,lt.byteLength),gt={logs:[],seiNals:[]};for(Qt=0;Qt+4<lt.length;Qt+=De)if(De=tn.getUint32(Qt),Qt+=4,!(De<=0))switch(31<[Qt]){case 6:var Xi=lt.subarray(Qt+1,Qt+1+De),It=Xv(Qt,oe);if(Ct={nalUnitType:"sei_rbsp",size:De,data:Xi,escapedRBSP:Gv(Xi),trackId:de},It)Ct.pts=It.pts,Ct.dts=It.dts,Ke=It;else{if(!Ke){gt.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+Qt+" for trackId "+de+". See mux.js#223."});break}Ct.pts=Ke.pts,Ct.dts=Ke.dts}gt.seiNals.push(Ct)}return gt}(L,C,z),v[z]||(v[z]={seiNals:[],logs:[]}),v[z].seiNals=v[z].seiNals.concat(x.seiNals),v[z].logs=v[z].logs.concat(x.logs))}),v},Yv=function(){var l,h,g,p,v,T,S=!1;this.isInitialized=function(){return S},this.init=function(C){l=new zv,S=!0,T=!!C&&C.isPartial,l.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,v.captions.push(x),v.captionStreams[x.stream]=!0}),l.on("log",function(x){v.logs.push(x)})},this.isNewInit=function(C,x){return!(C&&C.length===0||x&&typeof x=="object"&&Object.keys(x).length===0)&&(g!==C[0]||p!==x[g])},this.parse=function(C,x,L){var M;if(!this.isInitialized()||!x||!L)return null;if(this.isNewInit(x,L))g=x[0],p=L[g];else if(g===null||!p)return h.push(C),null;for(;h.length>0;){var j=h.shift();this.parse(j,x,L)}return M=function(W,z,st){if(z===null)return null;var ct=Kv(W,z)[z]||{};return{seiNals:ct.seiNals,logs:ct.logs,timescale:st}}(C,g,p),M&&M.logs&&(v.logs=v.logs.concat(M.logs)),M!==null&&M.seiNals?(this.pushNals(M.seiNals),this.flushStream(),v):v.logs.length?{logs:v.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(x){l.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;T?l.partialFlush():l.flush()},this.clearParsedCaptions=function(){v.captions=[],v.captionStreams={},v.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;l.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],g=null,p=null,v?this.clearParsedCaptions():v={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Qh=jo,zi=function(l){return("00"+l.toString(16)).slice(-2)},Qv=qi.getUint64;Gh=function(l,h){var g=ne(h,["moof","traf"]).reduce(function(p,v){var T,S,C=ne(v,["tfhd"])[0],x=Qh(C[4]<<24|C[5]<<16|C[6]<<8|C[7]),L=l[x]||9e4,M=ne(v,["tfdt"])[0],j=new DataView(M.buffer,M.byteOffset,M.byteLength);return typeof(T=M[0]===1?Qv(M.subarray(4,12)):j.getUint32(4))=="bigint"?S=T/qo.BigInt(L):typeof T!="number"||isNaN(T)||(S=T/L),S<Number.MAX_SAFE_INTEGER&&(S=Number(S)),S<p&&(p=S),p},1/0);return typeof g=="bigint"||isFinite(g)?g:0},Xh=function(l){var h=l[0]===0?12:20;return Qh(l[h]<<24|l[h+1]<<16|l[h+2]<<8|l[h+3])},zh=function(l){var h=ne(l,["moov","trak"]),g=[];return h.forEach(function(p){var v,T,S={},C=ne(p,["tkhd"])[0];C&&(T=(v=new DataView(C.buffer,C.byteOffset,C.byteLength)).getUint8(0),S.id=T===0?v.getUint32(12):v.getUint32(20));var x=ne(p,["mdia","hdlr"])[0];if(x){var L=Gi(x.subarray(8,12));S.type=L==="vide"?"video":L==="soun"?"audio":L}var M=ne(p,["mdia","minf","stbl","stsd"])[0];if(M){var j=M.subarray(8);S.codec=Gi(j.subarray(4,8));var W,z=ne(j,[S.codec])[0];z&&(/^[asm]vc[1-9]$/i.test(S.codec)?(W=z.subarray(78),Gi(W.subarray(4,8))==="avcC"&&W.length>11?(S.codec+=".",S.codec+=zi(W[9]),S.codec+=zi(W[10]),S.codec+=zi(W[11])):S.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(S.codec)?(W=z.subarray(28),Gi(W.subarray(4,8))==="esds"&&W.length>20&&W[19]!==0?(S.codec+="."+zi(W[19]),S.codec+="."+zi(W[20]>>>2&63).replace(/^0/,"")):S.codec="mp4a.40.2"):S.codec=S.codec.toLowerCase())}var st=ne(p,["mdia","mdhd"])[0];st&&(S.timescale=Xh(st)),g.push(S)}),g};var $v=Gh,Jv=zh,$h=function(l){var h=31&l[1];return h<<=8,h|=l[2]},ga=function(l){return!!(64&l[1])},va=function(l){var h=0;return(48&l[3])>>>4>1&&(h+=l[4]+1),h},Ho=function(l){switch(l){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}},Zv={parseType:function(l,h){var g=$h(l);return g===0?"pat":g===h?"pmt":h?"pes":null},parsePat:function(l){var h=ga(l),g=4+va(l);return h&&(g+=l[g]+1),(31&l[g+10])<<8|l[g+11]},parsePmt:function(l){var h={},g=ga(l),p=4+va(l);if(g&&(p+=l[p]+1),1&l[p+5]){var v;v=3+((15&l[p+1])<<8|l[p+2])-4;for(var T=12+((15&l[p+10])<<8|l[p+11]);T<v;){var S=p+T;h[(31&l[S+1])<<8|l[S+2]]=l[S],T+=5+((15&l[S+3])<<8|l[S+4])}return h}},parsePayloadUnitStartIndicator:ga,parsePesType:function(l,h){switch(h[$h(l)]){case Mt.H264_STREAM_TYPE:return"video";case Mt.ADTS_STREAM_TYPE:return"audio";case Mt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(l){if(!ga(l))return null;var h=4+va(l);if(h>=l.byteLength)return null;var g,p=null;return 192&(g=l[h+7])&&((p={}).pts=(14&l[h+9])<<27|(255&l[h+10])<<20|(254&l[h+11])<<12|(255&l[h+12])<<5|(254&l[h+13])>>>3,p.pts*=4,p.pts+=(6&l[h+13])>>>1,p.dts=p.pts,64&g&&(p.dts=(14&l[h+14])<<27|(255&l[h+15])<<20|(254&l[h+16])<<12|(255&l[h+17])<<5|(254&l[h+18])>>>3,p.dts*=4,p.dts+=(6&l[h+18])>>>1)),p},videoPacketContainsKeyFrame:function(l){for(var h=4+va(l),g=l.subarray(h),p=0,v=0,T=!1;v<g.byteLength-3;v++)if(g[v+2]===1){p=v+5;break}for(;p<g.byteLength;)switch(g[p]){case 0:if(g[p-1]!==0){p+=2;break}if(g[p-2]!==0){p++;break}v+3!==p-2&&Ho(31&g[v+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0);do p++;while(g[p]!==1&&p<g.length);v=p-2,p+=3;break;case 1:if(g[p-1]!==0||g[p-2]!==0){p+=3;break}Ho(31&g[v+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),v=p-2,p+=3;break;default:p+=3}return g=g.subarray(v),p-=v,v=0,g&&g.byteLength>3&&Ho(31&g[v+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),T}},ii=kv,ft={};ft.ts=Zv,ft.aac=fa;var yn=mn,Yt=188,xe=71,ty=function(l,h,g){for(var p,v,T,S,C=0,x=Yt,L=!1;x<=l.byteLength;)if(l[C]!==xe||l[x]!==xe&&x!==l.byteLength)C++,x++;else{if(p=l.subarray(C,x),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="audio"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="audio",g.audio.push(S),L=!0)),L)break;C+=Yt,x+=Yt}for(C=(x=l.byteLength)-Yt,L=!1;C>=0;)if(l[C]!==xe||l[x]!==xe&&x!==l.byteLength)C--,x--;else{if(p=l.subarray(C,x),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="audio"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="audio",g.audio.push(S),L=!0)),L)break;C-=Yt,x-=Yt}},ey=function(l,h,g){for(var p,v,T,S,C,x,L,M=0,j=Yt,W=!1,z={data:[],size:0};j<l.byteLength;)if(l[M]!==xe||l[j]!==xe)M++,j++;else{if(p=l.subarray(M,j),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="video"&&(T&&!W&&(S=ft.ts.parsePesTime(p))&&(S.type="video",g.video.push(S),W=!0),!g.firstKeyFrame))){if(T&&z.size!==0){for(C=new Uint8Array(z.size),x=0;z.data.length;)L=z.data.shift(),C.set(L,x),x+=L.byteLength;if(ft.ts.videoPacketContainsKeyFrame(C)){var st=ft.ts.parsePesTime(C);st?(g.firstKeyFrame=st,g.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.")}z.size=0}z.data.push(p),z.size+=p.byteLength}if(W&&g.firstKeyFrame)break;M+=Yt,j+=Yt}for(M=(j=l.byteLength)-Yt,W=!1;M>=0;)if(l[M]!==xe||l[j]!==xe)M--,j--;else{if(p=l.subarray(M,j),ft.ts.parseType(p,h.pid)==="pes"&&(v=ft.ts.parsePesType(p,h.table),T=ft.ts.parsePayloadUnitStartIndicator(p),v==="video"&&T&&(S=ft.ts.parsePesTime(p))&&(S.type="video",g.video.push(S),W=!0)),W)break;M-=Yt,j-=Yt}},ny=function(l){var h={pid:null,table:null},g={};for(var p in function(v,T){for(var S,C=0,x=Yt;x<v.byteLength;)if(v[C]!==xe||v[x]!==xe)C++,x++;else{switch(S=v.subarray(C,x),ft.ts.parseType(S,T.pid)){case"pat":T.pid=ft.ts.parsePat(S);break;case"pmt":var L=ft.ts.parsePmt(S);T.table=T.table||{},Object.keys(L).forEach(function(M){T.table[M]=L[M]})}C+=Yt,x+=Yt}}(l,h),h.table)if(h.table.hasOwnProperty(p))switch(h.table[p]){case Mt.H264_STREAM_TYPE:g.video=[],ey(l,h,g),g.video.length===0&&delete g.video;break;case Mt.ADTS_STREAM_TYPE:g.audio=[],ty(l,h,g),g.audio.length===0&&delete g.audio}return g},iy=function(l,h){var g;return g=ft.aac.isLikelyAacData(l)?function(p){for(var v,T=!1,S=0,C=null,x=null,L=0,M=0;p.length-M>=3;){switch(ft.aac.parseType(p,M)){case"timed-metadata":if(p.length-M<10){T=!0;break}if((L=ft.aac.parseId3TagSize(p,M))>p.length){T=!0;break}x===null&&(v=p.subarray(M,M+L),x=ft.aac.parseAacTimestamp(v)),M+=L;break;case"audio":if(p.length-M<7){T=!0;break}if((L=ft.aac.parseAdtsSize(p,M))>p.length){T=!0;break}C===null&&(v=p.subarray(M,M+L),C=ft.aac.parseSampleRate(v)),S++,M+=L;break;default:M++}if(T)return null}if(C===null||x===null)return null;var j=yn/C;return{audio:[{type:"audio",dts:x,pts:x},{type:"audio",dts:x+1024*S*j,pts:x+1024*S*j}]}}(l):ny(l),g&&(g.audio||g.video)?(function(p,v){if(p.audio&&p.audio.length){var T=v;(T===void 0||isNaN(T))&&(T=p.audio[0].dts),p.audio.forEach(function(x){x.dts=ii(x.dts,T),x.pts=ii(x.pts,T),x.dtsTime=x.dts/yn,x.ptsTime=x.pts/yn})}if(p.video&&p.video.length){var S=v;if((S===void 0||isNaN(S))&&(S=p.video[0].dts),p.video.forEach(function(x){x.dts=ii(x.dts,S),x.pts=ii(x.pts,S),x.dtsTime=x.dts/yn,x.ptsTime=x.pts/yn}),p.firstKeyFrame){var C=p.firstKeyFrame;C.dts=ii(C.dts,S),C.pts=ii(C.pts,S),C.dtsTime=C.dts/yn,C.ptsTime=C.pts/yn}}}(g,h),g):null},Jh=function(){function l(g,p){this.options=p||{},this.self=g,this.init()}var h=l.prototype;return h.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Bv.Transmuxer(this.options),function(g,p){p.on("data",function(v){var T=v.initSegment;v.initSegment={data:T.buffer,byteOffset:T.byteOffset,byteLength:T.byteLength};var S=v.data;v.data=S.buffer,g.postMessage({action:"data",segment:v,byteOffset:S.byteOffset,byteLength:S.byteLength},[v.data])}),p.on("done",function(v){g.postMessage({action:"done"})}),p.on("gopInfo",function(v){g.postMessage({action:"gopInfo",gopInfo:v})}),p.on("videoSegmentTimingInfo",function(v){var T={start:{decode:jt(v.start.dts),presentation:jt(v.start.pts)},end:{decode:jt(v.end.dts),presentation:jt(v.end.pts)},baseMediaDecodeTime:jt(v.baseMediaDecodeTime)};v.prependedContentDuration&&(T.prependedContentDuration=jt(v.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:T})}),p.on("audioSegmentTimingInfo",function(v){var T={start:{decode:jt(v.start.dts),presentation:jt(v.start.pts)},end:{decode:jt(v.end.dts),presentation:jt(v.end.pts)},baseMediaDecodeTime:jt(v.baseMediaDecodeTime)};v.prependedContentDuration&&(T.prependedContentDuration=jt(v.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:T})}),p.on("id3Frame",function(v){g.postMessage({action:"id3Frame",id3Frame:v})}),p.on("caption",function(v){g.postMessage({action:"caption",caption:v})}),p.on("trackinfo",function(v){g.postMessage({action:"trackinfo",trackInfo:v})}),p.on("audioTimingInfo",function(v){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:jt(v.start),end:jt(v.end)}})}),p.on("videoTimingInfo",function(v){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:jt(v.start),end:jt(v.end)}})}),p.on("log",function(v){g.postMessage({action:"log",log:v})})}(this.self,this.transmuxer)},h.pushMp4Captions=function(g){this.captionParser||(this.captionParser=new Yv,this.captionParser.init());var p=new Uint8Array(g.data,g.byteOffset,g.byteLength),v=this.captionParser.parse(p,g.trackIds,g.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:p.buffer},[p.buffer])},h.probeMp4StartTime=function(g){var p=g.timescales,v=g.data,T=$v(p,v);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:v},[v.buffer])},h.probeMp4Tracks=function(g){var p=g.data,v=Jv(p);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:p},[p.buffer])},h.probeTs=function(g){var p=g.data,v=g.baseStartTime,T=typeof v!="number"||isNaN(v)?void 0:v*mn,S=iy(p,T),C=null;S&&((C={hasVideo:S.video&&S.video.length===2||!1,hasAudio:S.audio&&S.audio.length===2||!1}).hasVideo&&(C.videoStart=S.video[0].ptsTime),C.hasAudio&&(C.audioStart=S.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:p},[p.buffer])},h.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},h.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},h.push=function(g){var p=new Uint8Array(g.data,g.byteOffset,g.byteLength);this.transmuxer.push(p)},h.reset=function(){this.transmuxer.reset()},h.setTimestampOffset=function(g){var p=g.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Ih(p)))},h.setAudioAppendStart=function(g){this.transmuxer.setAudioAppendStart(Math.ceil(Ih(g.appendStart)))},h.setRemux=function(g){this.transmuxer.setRemux(g.remux)},h.flush=function(g){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},h.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},h.alignGopsWith=function(g){this.transmuxer.alignGopsWith(g.gopsToAlignWith.slice())},l}();self.onmessage=function(l){l.data.action==="init"&&l.data.options?this.messageHandlers=new Jh(self,l.data.options):(this.messageHandlers||(this.messageHandlers=new Jh(self)),l.data&&l.data.action&&l.data.action!=="init"&&this.messageHandlers[l.data.action]&&this.messageHandlers[l.data.action](l.data))}})),sg=Rd(ag),Ud=function(e){var i=e.transmuxer,r=e.bytes,t=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,m=e.onAudioSegmentTimingInfo,f=e.onId3,_=e.onCaptions,b=e.onDone,y=e.onEndedTimeline,E=e.onTransmuxerLog,w=e.isEndOfTimeline,k={buffer:[]},I=w;if(i.onmessage=function(A){i.currentTransmux===e&&(A.data.action==="data"&&function(U,B,R){var q=U.data.segment,$=q.type,Y=q.initSegment,K=q.captions,Q=q.captionStreams,X=q.metadata,nt=q.videoFrameDtsTime,at=q.videoFramePtsTime;B.buffer.push({captions:K,captionStreams:Q,metadata:X});var ht=U.data.segment.boxes||{data:U.data.segment.data},J={type:$,data:new Uint8Array(ht.data,ht.data.byteOffset,ht.data.byteLength),initSegment:new Uint8Array(Y.data,Y.byteOffset,Y.byteLength)};nt!==void 0&&(J.videoFrameDtsTime=nt),at!==void 0&&(J.videoFramePtsTime=at),R(J)}(A,k,s),A.data.action==="trackinfo"&&o(A.data.trackInfo),A.data.action==="gopInfo"&&function(U,B){B.gopInfo=U.data.gopInfo}(A,k),A.data.action==="audioTimingInfo"&&u(A.data.audioTimingInfo),A.data.action==="videoTimingInfo"&&c(A.data.videoTimingInfo),A.data.action==="videoSegmentTimingInfo"&&d(A.data.videoSegmentTimingInfo),A.data.action==="audioSegmentTimingInfo"&&m(A.data.audioSegmentTimingInfo),A.data.action==="id3Frame"&&f([A.data.id3Frame],A.data.id3Frame.dispatchType),A.data.action==="caption"&&_(A.data.caption),A.data.action==="endedtimeline"&&(I=!1,y()),A.data.action==="log"&&E(A.data.log),A.data.type==="transmuxed"&&(I||(i.onmessage=null,function(U){var B=U.transmuxedData,R=U.callback;B.buffer=[],R(B)}({transmuxedData:k,callback:b}),Bd(i))))},t&&i.postMessage({action:"setAudioAppendStart",appendStart:t}),Array.isArray(n)&&i.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),a!==void 0&&i.postMessage({action:"setRemux",remux:a}),r.byteLength){var P=r instanceof ArrayBuffer?r:r.buffer,N=r instanceof ArrayBuffer?0:r.byteOffset;i.postMessage({action:"push",data:P,byteOffset:N,byteLength:r.byteLength},[P])}w&&i.postMessage({action:"endTimeline"}),i.postMessage({action:"flush"})},Bd=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():Ud(e.currentTransmux))},Fd=function(e,i){e.postMessage({action:i}),Bd(e)},og=function(e,i){if(!i.currentTransmux)return i.currentTransmux=e,void Fd(i,e);i.transmuxQueue.push(Fd.bind(null,i,e))},ug=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ud(e);e.transmuxer.transmuxQueue.push(e)},jd=function(e){og("reset",e)},lg=function(e){var i=new sg;i.currentTransmux=null,i.transmuxQueue=[];var r=i.terminate;return i.terminate=function(){return i.currentTransmux=null,i.transmuxQueue.length=0,r.call(i)},i.postMessage({action:"init",options:e}),i},Kr=function(e){var i=e.transmuxer,r=e.endAction||e.action,t=e.callback,n=he({},e,{endAction:null,transmuxer:null,callback:null});if(i.addEventListener("message",function o(u){u.data.action===r&&(i.removeEventListener("message",o),u.data.data&&(u.data.data=new Uint8Array(u.data.data,e.byteOffset||0,e.byteLength||u.data.data.byteLength),e.data&&(e.data=u.data.data)),t(u.data))}),e.data){var a=e.data instanceof ArrayBuffer;n.byteOffset=a?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];i.postMessage(n,s)}else i.postMessage(n)},Yr=2,fo=-101,mo=-102,go=function(e){e.forEach(function(i){i.abort()})},vo=function(e,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:fo,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:mo,xhr:i}:e?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Yr,xhr:i}:i.responseType==="arraybuffer"&&i.response.byteLength===0?{status:i.status,message:"Empty HLS response at URL: "+i.uri,code:Yr,xhr:i}:null},qd=function(e,i,r){return function(t,n){var a=n.response,s=vo(t,n);if(s)return r(s,e);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Yr,xhr:n},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),c=0;c<i.length;c++)i[c].bytes=u;return r(null,e)}},Hd=function(e,i){var r=Za(e.map.bytes);if(r!=="mp4"){var t=e.map.resolvedUri||e.map.uri;return i({internal:!0,message:"Found unsupported "+(r||"unknown")+" container for initialization segment at URL: "+t,code:Yr})}Kr({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var a=n.tracks,s=n.data;return e.map.bytes=s,a.forEach(function(o){e.map.tracks=e.map.tracks||{},e.map.tracks[o.type]||(e.map.tracks[o.type]=o,typeof o.id=="number"&&o.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[o.id]=o.timescale))}),i(null)}})},cg=function(e){var i=e.segment,r=e.finishProcessingFn,t=e.responseType;return function(n,a){var s=vo(n,a);if(s)return r(s,i);var o=t!=="arraybuffer"&&a.responseText?function(u){for(var c=new Uint8Array(new ArrayBuffer(u.length)),d=0;d<u.length;d++)c[d]=u.charCodeAt(d);return c.buffer}(a.responseText.substring(i.lastReachedChar||0)):a.response;return i.stats=function(u){return{bandwidth:u.bandwidth,bytesReceived:u.bytesReceived||0,roundTripTime:u.roundTripTime||0}}(a),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),r(null,i)}},dg=function(e){var i=e.segment,r=e.bytes,t=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,m=e.dataFn,f=e.doneFn,_=e.onTransmuxerLog,b=i.map&&i.map.tracks||{},y=!!(b.audio&&b.video),E=n.bind(null,i,"audio","start"),w=n.bind(null,i,"audio","end"),k=n.bind(null,i,"video","start"),I=n.bind(null,i,"video","end");Kr({action:"probeTs",transmuxer:i.transmuxer,data:r,baseStartTime:i.baseStartTime,callback:function(P){i.bytes=r=P.data;var N=P.result;N&&(t(i,{hasAudio:N.hasAudio,hasVideo:N.hasVideo,isMuxed:y}),t=null,N.hasAudio&&!y&&E(N.audioStart),N.hasVideo&&k(N.videoStart),E=null,k=null),ug({bytes:r,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:function(A){A.type=A.type==="combined"?"video":A.type,m(i,A)},onTrackInfo:function(A){t&&(y&&(A.isMuxed=!0),t(i,A))},onAudioTimingInfo:function(A){E&&A.start!==void 0&&(E(A.start),E=null),w&&A.end!==void 0&&w(A.end)},onVideoTimingInfo:function(A){k&&A.start!==void 0&&(k(A.start),k=null),I&&A.end!==void 0&&I(A.end)},onVideoSegmentTimingInfo:function(A){a(A)},onAudioSegmentTimingInfo:function(A){s(A)},onId3:function(A,U){o(i,A,U)},onCaptions:function(A){u(i,[A])},isEndOfTimeline:c,onEndedTimeline:function(){d()},onTransmuxerLog:_,onDone:function(A){f&&(A.type=A.type==="combined"?"video":A.type,f(null,i,A))}})}})},Vd=function(e){var i=e.segment,r=e.bytes,t=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,m=e.dataFn,f=e.doneFn,_=e.onTransmuxerLog,b=new Uint8Array(r);if(function(k){return Nf(k,["moof"]).length>0}(b)){i.isFmp4=!0;var y=i.map.tracks,E={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(E.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(E.videoCodec=y.video.codec),y.video&&y.audio&&(E.isMuxed=!0),t(i,E);var w=function(k){m(i,{data:b,type:E.hasAudio&&!E.isMuxed?"audio":"video"}),k&&k.length&&u(i,k),f(null,i,{})};Kr({action:"probeMp4StartTime",timescales:i.map.timescales,data:b,transmuxer:i.transmuxer,callback:function(k){var I=k.data,P=k.startTime;r=I.buffer,i.bytes=b=I,E.hasAudio&&!E.isMuxed&&n(i,"audio","start",P),E.hasVideo&&n(i,"video","start",P),y.video&&I.byteLength&&i.transmuxer?Kr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:b,timescales:i.map.timescales,trackIds:[y.video.id],callback:function(N){r=N.data.buffer,i.bytes=b=N.data,N.logs.forEach(function(A){_(O.mergeOptions(A,{stream:"mp4CaptionParser"}))}),w(N.captions)}}):w()}})}else if(i.transmuxer){if(i.container===void 0&&(i.container=Za(b)),i.container!=="ts"&&i.container!=="aac")return t(i,{hasAudio:!1,hasVideo:!1}),void f(null,i,{});dg({segment:i,bytes:r,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_})}else f(null,i,{})},Wd=function(e,i){var r,t=e.id,n=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",function o(u){if(u.data.source===t){s.removeEventListener("message",o);var c=u.data.decrypted;i(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}}),r=n.bytes.slice?n.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.bytes)),s.postMessage(Cd({source:t,encrypted:a,key:r,iv:n.iv}),[a.buffer,r.buffer])},hg=function(e){var i=e.activeXhrs,r=e.decryptionWorker,t=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,d=e.endedTimelineFn,m=e.dataFn,f=e.doneFn,_=e.onTransmuxerLog,b=0,y=!1;return function(E,w){if(!y){if(E)return y=!0,go(i),f(E,w);if((b+=1)===i.length){var k=function(){if(w.encryptedBytes)return function(I){var P=I.decryptionWorker,N=I.segment,A=I.trackInfoFn,U=I.timingInfoFn,B=I.videoSegmentTimingInfoFn,R=I.audioSegmentTimingInfoFn,q=I.id3Fn,$=I.captionsFn,Y=I.isEndOfTimeline,K=I.endedTimelineFn,Q=I.dataFn,X=I.doneFn,nt=I.onTransmuxerLog;Wd({id:N.requestId,key:N.key,encryptedBytes:N.encryptedBytes,decryptionWorker:P},function(at){N.bytes=at,Vd({segment:N,bytes:N.bytes,trackInfoFn:A,timingInfoFn:U,videoSegmentTimingInfoFn:B,audioSegmentTimingInfoFn:R,id3Fn:q,captionsFn:$,isEndOfTimeline:Y,endedTimelineFn:K,dataFn:Q,doneFn:X,onTransmuxerLog:nt})})}({decryptionWorker:r,segment:w,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_});Vd({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:d,dataFn:m,doneFn:f,onTransmuxerLog:_})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return Wd({decryptionWorker:r,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key},function(I){w.map.bytes=I,Hd(w,function(P){if(P)return go(i),f(P,w);k()})});k()}}}},pg=function(e){var i=e.segment,r=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(t){if(!t.target.aborted)return i.stats=O.mergeOptions(i.stats,function(n){var a=n.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-a.requestTime||0};return s.bytesReceived=n.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s}(t)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),r(t,i)}},fg=function(e){var i=e.xhr,r=e.xhrOptions,t=e.decryptionWorker,n=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,d=e.audioSegmentTimingInfoFn,m=e.id3Fn,f=e.captionsFn,_=e.isEndOfTimeline,b=e.endedTimelineFn,y=e.dataFn,E=e.doneFn,w=e.onTransmuxerLog,k=[],I=hg({activeXhrs:k,decryptionWorker:t,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:f,isEndOfTimeline:_,endedTimelineFn:b,dataFn:y,doneFn:E,onTransmuxerLog:w});if(n.key&&!n.key.bytes){var P=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&P.push(n.map.key);var N=i(O.mergeOptions(r,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),qd(n,P,I));k.push(N)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){var A=i(O.mergeOptions(r,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),qd(n,[n.map.key],I));k.push(A)}var U=O.mergeOptions(r,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:ho(n.map)}),B=function(K){var Q=K.segment,X=K.finishProcessingFn;return function(nt,at){var ht=vo(nt,at);if(ht)return X(ht,Q);var J=new Uint8Array(at.response);if(Q.map.key)return Q.map.encryptedBytes=J,X(null,Q);Q.map.bytes=J,Hd(Q,function(rt){if(rt)return rt.xhr=at,rt.status=at.status,X(rt,Q);X(null,Q)})}}({segment:n,finishProcessingFn:I}),R=i(U,B);k.push(R)}var q=O.mergeOptions(r,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:ho(n)}),$=i(q,cg({segment:n,finishProcessingFn:I,responseType:q.responseType}));$.addEventListener("progress",pg({segment:n,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:f,isEndOfTimeline:_,endedTimelineFn:b,dataFn:y})),k.push($);var Y={};return k.forEach(function(K){K.addEventListener("loadend",function(Q){var X=Q.loadendState,nt=Q.abortFn;return function(at){at.target.aborted&&nt&&!X.calledAbortFn&&(nt(),X.calledAbortFn=!0)}}({loadendState:Y,abortFn:a}))}),function(){return go(k)}},mg=ye("CodecUtils"),Gd=function(e,i){var r=i.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&r.AUDIO&&e.mediaGroups.AUDIO[r.AUDIO]},Qr=function(e){var i={};return e.forEach(function(r){var t=r.mediaType,n=r.type,a=r.details;i[t]=i[t]||[],i[t].push(mu(""+n+a))}),Object.keys(i).forEach(function(r){if(i[r].length>1)return mg("multiple "+r+" codecs found as attributes: "+i[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(i[r]=null);i[r]=i[r][0]}),i},zd=function(e){var i=0;return e.audio&&i++,e.video&&i++,i},Mi=function(e,i){var r=i.attributes||{},t=Qr(function(a){var s=a.attributes||{};if(s.CODECS)return be(s.CODECS)}(i)||[]);if(Gd(e,i)&&!t.audio&&!function(a,s){if(!Gd(a,s))return!0;var o=s.attributes||{},u=a.mediaGroups.AUDIO[o.AUDIO];for(var c in u)if(!u[c].uri&&!u[c].playlists)return!0;return!1}(e,i)){var n=Qr(function(a,s){if(!a.mediaGroups.AUDIO||!s)return null;var o=a.mediaGroups.AUDIO[s];if(!o)return null;for(var u in o){var c=o[u];if(c.default&&c.playlists)return be(c.playlists[0].attributes.CODECS)}return null}(e,r.AUDIO)||[]);n.audio&&(t.audio=n.audio)}return t},$r=ye("PlaylistSelector"),Xd=function(e){if(e&&e.playlist){var i=e.playlist;return JSON.stringify({id:i.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:i.attributes&&i.attributes.CODECS||""})}},Jr=function(e,i){if(!e)return"";var r=D.getComputedStyle(e);return r?r[i]:""},Jn=function(e,i){var r=e.slice();e.sort(function(t,n){var a=i(t,n);return a===0?r.indexOf(t)-r.indexOf(n):a})},yo=function(e,i){var r,t;return e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||D.Number.MAX_VALUE,i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),r-(t=t||D.Number.MAX_VALUE)},Kd=function(e,i,r,t,n,a){if(e){var s={bandwidth:i,width:r,height:t,limitRenditionByPlayerDimensions:n},o=e.playlists;ee.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(R){var q=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,$=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return{bandwidth:R.attributes&&R.attributes.BANDWIDTH||D.Number.MAX_VALUE,width:q,height:$,playlist:R}});Jn(u,function(R,q){return R.bandwidth-q.bandwidth});var c=(u=u.filter(function(R){return!ee.isIncompatible(R.playlist)})).filter(function(R){return ee.isEnabled(R.playlist)});c.length||(c=u.filter(function(R){return!ee.isDisabled(R.playlist)}));var d=c.filter(function(R){return R.bandwidth*Ot.BANDWIDTH_VARIANCE<i}),m=d[d.length-1],f=d.filter(function(R){return R.bandwidth===m.bandwidth})[0];if(n===!1){var _=f||c[0]||u[0];if(_&&_.playlist){var b="sortedPlaylistReps";return f&&(b="bandwidthBestRep"),c[0]&&(b="enabledPlaylistReps"),$r("choosing "+Xd(_)+" using "+b+" with options",s),_.playlist}return $r("could not choose a playlist with options",s),null}var y=d.filter(function(R){return R.width&&R.height});Jn(y,function(R,q){return R.width-q.width});var E=y.filter(function(R){return R.width===r&&R.height===t});m=E[E.length-1];var w,k,I,P,N=E.filter(function(R){return R.bandwidth===m.bandwidth})[0];if(N||(k=(w=y.filter(function(R){return R.width>r||R.height>t})).filter(function(R){return R.width===w[0].width&&R.height===w[0].height}),m=k[k.length-1],I=k.filter(function(R){return R.bandwidth===m.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var A=y.map(function(R){return R.pixelDiff=Math.abs(R.width-r)+Math.abs(R.height-t),R});Jn(A,function(R,q){return R.pixelDiff===q.pixelDiff?q.bandwidth-R.bandwidth:R.pixelDiff-q.pixelDiff}),P=A[0]}var U=P||I||N||f||c[0]||u[0];if(U&&U.playlist){var B="sortedPlaylistReps";return P?B="leastPixelDiffRep":I?B="resolutionPlusOneRep":N?B="resolutionBestRep":f?B="bandwidthBestRep":c[0]&&(B="enabledPlaylistReps"),$r("choosing "+Xd(U)+" using "+B+" with options",s),U.playlist}return $r("could not choose a playlist with options",s),null}},Yd=function(){var e=this.useDevicePixelRatio&&D.devicePixelRatio||1;return Kd(this.playlists.master,this.systemBandwidth,parseInt(Jr(this.tech_.el(),"width"),10)*e,parseInt(Jr(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},gg=function(e){var i=e.inbandTextTracks,r=e.metadataArray,t=e.timestampOffset,n=e.videoDuration;if(r){var a=D.WebKitDataCue||D.VTTCue,s=i.metadataTrack_;if(s&&(r.forEach(function(f){var _=f.cueTime+t;!(typeof _!="number"||D.isNaN(_)||_<0)&&_<1/0&&f.frames.forEach(function(b){var y=new a(_,_,b.value||b.url||b.data||"");y.frame=b,y.value=b,function(E){Object.defineProperties(E.frame,{id:{get:function(){return O.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),E.value.key}},value:{get:function(){return O.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),E.value.data}},privateData:{get:function(){return O.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),E.value.data}}})}(y),s.addCue(y)})}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],c=0;c<o.length;c++)o[c]&&u.push(o[c]);var d=u.reduce(function(f,_){var b=f[_.startTime]||[];return b.push(_),f[_.startTime]=b,f},{}),m=Object.keys(d).sort(function(f,_){return Number(f)-Number(_)});m.forEach(function(f,_){var b=d[f],y=Number(m[_+1])||n;b.forEach(function(E){E.endTime=y})})}}},Ui=function(e,i,r){var t,n;if(r&&r.cues)for(t=r.cues.length;t--;)(n=r.cues[t]).startTime>=e&&n.endTime<=i&&r.removeCue(n)},Qd=function(e){return typeof e=="number"&&isFinite(e)},Zr=1/60,Zn=function(e){var i=e.startOfSegment,r=e.duration,t=e.segment,n=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,c=u===void 0?[]:u,d=e.mediaIndex,m=e.partIndex,f=e.timeline,_=c.length-1,b="mediaIndex/partIndex increment";e.getMediaInfoForTime?b="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(b="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(b+=" with independent "+e.independent);var y=typeof m=="number",E=e.segment.uri?"segment":"pre-segment",w=y?dd({preloadSegment:t})-1:0;return E+" ["+(s+d)+"/"+(s+_)+"]"+(y?" part ["+m+"/"+w+"]":"")+" segment start/end ["+t.start+" => "+t.end+"]"+(y?" part start/end ["+n.start+" => "+n.end+"]":"")+" startOfSegment ["+i+"] duration ["+r+"] timeline ["+f+"] selected by ["+b+"] playlist ["+o+"]"},$d=function(e){return e+"TimingInfo"},Jd=function(e){var i=e.timelineChangeController,r=e.currentTimeline,t=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(r===t)return!1;if(n==="audio"){var s=i.lastTimelineChange({type:"main"});return!s||s.to!==t}if(n==="main"&&a){var o=i.pendingTimelineChange({type:"audio"});return!o||o.to!==t}return!1},Zd=function(e){var i=e.segmentDuration,r=e.maxDuration;return!!i&&Math.round(i)>r+pn},vg=function(e,i){if(i!=="hls")return null;var r,t,n=(r={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},t=0,["video","audio"].forEach(function(c){var d=r[c+"TimingInfo"];if(d){var m,f=d.start,_=d.end;typeof f=="bigint"||typeof _=="bigint"?m=D.BigInt(_)-D.BigInt(f):typeof f=="number"&&typeof _=="number"&&(m=_-f),m!==void 0&&m>t&&(t=m)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t);if(!n)return null;var a=e.playlist.targetDuration,s=Zd({segmentDuration:n,maxDuration:2*a}),o=Zd({segmentDuration:n,maxDuration:a}),u="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+n+" when the reported duration is "+e.duration+" and the target duration is "+a+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return s||o?{severity:s?"warn":"info",message:u}:null},_o=function(e){function i(t,n){var a;if(a=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if(typeof t.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return a.bandwidth=t.bandwidth,a.throughput={rate:0,count:0},a.roundTrip=NaN,a.resetStats_(),a.mediaIndex=null,a.partIndex=null,a.hasPlayed_=t.hasPlayed,a.currentTime_=t.currentTime,a.seekable_=t.seekable,a.seeking_=t.seeking,a.duration_=t.duration,a.mediaSource_=t.mediaSource,a.vhs_=t.vhs,a.loaderType_=t.loaderType,a.currentMediaInfo_=void 0,a.startingMediaInfo_=void 0,a.segmentMetadataTrack_=t.segmentMetadataTrack,a.goalBufferLength_=t.goalBufferLength,a.sourceType_=t.sourceType,a.sourceUpdater_=t.sourceUpdater,a.inbandTextTracks_=t.inbandTextTracks,a.state_="INIT",a.timelineChangeController_=t.timelineChangeController,a.shouldSaveSegmentTimingInfo_=!0,a.parse708captions_=t.parse708captions,a.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,a.captionServices_=t.captionServices,a.experimentalExactManifestTimings=t.experimentalExactManifestTimings,a.checkBufferTimeout_=null,a.error_=void 0,a.currentTimeline_=-1,a.pendingSegment_=null,a.xhrOptions_=null,a.pendingSegments_=[],a.audioDisabled_=!1,a.isPendingTimestampOffset_=!1,a.gopBuffer_=[],a.timeMapping_=0,a.safeAppend_=O.browser.IE_VERSION>=11,a.appendInitSegment_={audio:!0,video:!0},a.playlistOfLastInitSegment_={audio:null,video:null},a.callQueue_=[],a.loadQueue_=[],a.metadataQueue_={id3:[],caption:[]},a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=null,a.activeInitSegmentId_=null,a.initSegments_={},a.cacheEncryptionKeys_=t.cacheEncryptionKeys,a.keyCache_={},a.decrypter_=t.decrypter,a.syncController_=t.syncController,a.syncPoint_={segmentIndex:0,time:0},a.transmuxer_=a.createTransmuxer_(),a.triggerSyncInfoUpdate_=function(){return a.trigger("syncinfoupdate")},a.syncController_.on("syncinfoupdate",a.triggerSyncInfoUpdate_),a.mediaSource_.addEventListener("sourceopen",function(){a.isEndOfStream_()||(a.ended_=!1)}),a.fetchAtBuffer_=!1,a.logger_=ye("SegmentLoader["+a.loaderType_+"]"),Object.defineProperty(tt(a),"state",{get:function(){return this.state_},set:function(s){s!==this.state_&&(this.logger_(this.state_+" -> "+s),this.state_=s,this.trigger("statechange"))}}),a.sourceUpdater_.on("ready",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="main"&&a.timelineChangeController_.on("pendingtimelinechange",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="audio"&&a.timelineChangeController_.on("timelinechange",function(){a.hasEnoughInfoToLoad_()&&a.processLoadQueue_(),a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a}V(i,e);var r=i.prototype;return r.createTransmuxer_=function(){return lg({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(t){this.audioDisabled_=!t,t?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,D.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(t){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==t:(this.state="READY",!0)},r.error=function(t){return t!==void 0&&(this.logger_("error occurred:",t),this.error_=t),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&jd(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var t=this.getMediaInfo_();if(!this.sourceUpdater_||!t)return O.createTimeRanges();if(this.loaderType_==="main"){var n=t.hasAudio,a=t.hasVideo,s=t.isMuxed;if(a&&n&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(t,n){if(n===void 0&&(n=!1),!t)return null;var a=Xr(t),s=this.initSegments_[a];return n&&!s&&t.bytes&&(this.initSegments_[a]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}),s||t},r.segmentKey=function(t,n){if(n===void 0&&(n=!1),!t)return null;var a=xd(t),s=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!s&&t.bytes&&(this.keyCache_[a]=s={resolvedUri:t.resolvedUri,bytes:t.bytes});var o={resolvedUri:(s||t).resolvedUri};return s&&(o.bytes=s.bytes),o},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),this.playlist_)return this.state==="INIT"&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY"))},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(t,n){if(n===void 0&&(n={}),t){var a=this.playlist_,s=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=n,this.state==="INIT"&&(t.syncInfo={mediaSequence:t.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(t));var o=null;if(a&&(a.id?o=a.id:a.uri&&(o=a.uri)),this.logger_("playlist update ["+o+" => "+(t.id||t.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==t.uri)return this.mediaIndex!==null&&(t.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var u=t.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var d=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=d}}s&&(s.mediaIndex-=u,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=t.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,t)}},r.pause=function(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(t){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,t),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&jd(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(t,n,a,s){if(a===void 0&&(a=function(){}),s===void 0&&(s=!1),n===1/0&&(n=this.duration_()),n<=t)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var o=1,u=function(){--o===0&&a()};for(var c in!s&&this.audioDisabled_||(o++,this.sourceUpdater_.removeAudio(t,n,u)),(s||this.loaderType_==="main")&&(this.gopBuffer_=function(d,m,f,_){for(var b=Math.ceil((m-_)*fr),y=Math.ceil((f-_)*fr),E=d.slice(),w=d.length;w--&&!(d[w].pts<=y););if(w===-1)return E;for(var k=w+1;k--&&!(d[k].pts<=b););return k=Math.max(k,0),E.splice(k,w-k+1),E}(this.gopBuffer_,t,n,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(t,n,u)),this.inbandTextTracks_)Ui(t,n,this.inbandTextTracks_[c]);Ui(t,n,this.segmentMetadataTrack_),u()}else this.logger_("skipping remove because no source updater or starting media info")},r.monitorBuffer_=function(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),500)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var t=this.chooseNextRequest_();t&&(typeof t.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})),this.loadSegment_(t))}},r.isEndOfStream_=function(t,n,a){if(t===void 0&&(t=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var s=typeof t=="number"&&n.segments[t],o=t+1===n.segments.length,u=!s||!s.parts||a+1===s.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&o&&u},r.chooseNextRequest_=function(){var t=this.buffered_(),n=ud(t)||0,a=eo(t,this.currentTime_()),s=!this.hasPlayed_()&&a>=1,o=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||s||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=function(N,A,U){A=A||[];for(var B=[],R=0,q=0;q<A.length;q++){var $=A[q];if(N===$.timeline&&(B.push(q),(R+=$.duration)>U))return q}return B.length===0?0:B[B.length-1]}(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var d=u[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=d.end?d.end:n,d.parts&&d.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var f=ee.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),_=f.segmentIndex,b=f.startTime,y=f.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=_,c.startOfSegment=b,c.partIndex=y}var E=u[c.mediaIndex],w=E&&typeof c.partIndex=="number"&&E.parts&&E.parts[c.partIndex];if(!E||typeof c.partIndex=="number"&&!w)return null;if(typeof c.partIndex!="number"&&E.parts&&(c.partIndex=0,w=E.parts[0]),!a&&w&&!w.independent)if(c.partIndex===0){var k=u[c.mediaIndex-1],I=k.parts&&k.parts.length&&k.parts[k.parts.length-1];I&&I.independent&&(c.mediaIndex-=1,c.partIndex=k.parts.length-1,c.independent="previous segment")}else E.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var P=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&P&&!this.seeking_()?null:this.generateSegmentInfo_(c)},r.generateSegmentInfo_=function(t){var n=t.independent,a=t.playlist,s=t.mediaIndex,o=t.startOfSegment,u=t.isSyncRequest,c=t.partIndex,d=t.forceTimestampOffset,m=t.getMediaInfoForTime,f=a.segments[s],_=typeof c=="number"&&f.parts[c],b={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||f.resolvedUri,mediaIndex:s,partIndex:_?c:null,isSyncRequest:u,startOfSegment:o,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:f.timeline,duration:_&&_.duration||f.duration,segment:f,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:n},y=d!==void 0?d:this.isPendingTimestampOffset_;b.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:f.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:y});var E=ud(this.sourceUpdater_.audioBuffered());return typeof E=="number"&&(b.audioAppendStart=E-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(b.gopsToAlignWith=function(w,k,I){if(k==null||!w.length)return[];var P,N=Math.ceil((k-I+3)*fr);for(P=0;P<w.length&&!(w[P].pts>N);P++);return w.slice(P)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),b},r.timestampOffsetForSegment_=function(t){return a=(n=t).segmentTimeline,s=n.currentTimeline,o=n.startOfSegment,u=n.buffered,n.overrideCheck||a!==s?a<s?o:u.length?u.end(u.length-1):o:null;var n,a,s,o,u},r.earlyAbortWhenNeeded_=function(t){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=t.bandwidth,s=this.pendingSegment_.duration,o=ee.estimateSegmentRequestTime(s,a,this.playlist_,t.bytesReceived),u=function(f,_,b){return b===void 0&&(b=1),((f.length?f.end(f.length-1):0)-_)/b}(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(o<=u)){var c=function(f){var _=f.master,b=f.currentTime,y=f.bandwidth,E=f.duration,w=f.segmentDuration,k=f.timeUntilRebuffer,I=f.currentTimeline,P=f.syncController,N=_.playlists.filter(function(R){return!ee.isIncompatible(R)}),A=N.filter(ee.isEnabled);A.length||(A=N.filter(function(R){return!ee.isDisabled(R)}));var U=A.filter(ee.hasAttribute.bind(null,"BANDWIDTH")).map(function(R){var q=P.getSyncPoint(R,E,I,b)?1:2;return{playlist:R,rebufferingImpact:ee.estimateSegmentRequestTime(w,y,R)*q-k}}),B=U.filter(function(R){return R.rebufferingImpact<=0});return Jn(B,function(R,q){return yo(q.playlist,R.playlist)}),B.length?B[0]:(Jn(U,function(R,q){return R.rebufferingImpact-q.rebufferingImpact}),U[0]||null)}({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var d=o-u-c.rebufferingImpact,m=.5;u<=pn&&(m=1),!c.playlist||c.playlist.uri===this.playlist_.uri||d<m||(this.bandwidth=c.playlist.attributes.BANDWIDTH*Ot.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},r.handleAbort_=function(t){this.logger_("Aborting "+Zn(t)),this.mediaRequestsAborted+=1},r.handleProgress_=function(t,n){this.earlyAbortWhenNeeded_(n.stats),this.checkForAbort_(n.requestId)||this.trigger("progress")},r.handleTrackInfo_=function(t,n){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.checkForIllegalMediaSwitch(n)||(n=n||{},function(a,s){if(!a&&!s||!a&&s||a&&!s)return!1;if(a===s)return!0;var o=Object.keys(a).sort(),u=Object.keys(s).sort();if(o.length!==u.length)return!1;for(var c=0;c<o.length;c++){var d=o[c];if(d!==u[c]||a[d]!==s[d])return!1}return!0}(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),this.checkForAbort_(t.requestId)||(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},r.handleTimingInfo_=function(t,n,a,s){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)){var o=this.pendingSegment_,u=$d(n);o[u]=o[u]||{},o[u][a]=s,this.logger_("timinginfo: "+n+" - "+a+" - "+s),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},r.handleCaptions_=function(t,n){var a=this;if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(n.length!==0)if(this.pendingSegment_.hasAppendedData_){var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),o={};n.forEach(function(u){o[u.stream]=o[u.stream]||{startTime:1/0,captions:[],endTime:0};var c=o[u.stream];c.startTime=Math.min(c.startTime,u.startTime+s),c.endTime=Math.max(c.endTime,u.endTime+s),c.captions.push(u)}),Object.keys(o).forEach(function(u){var c=o[u],d=c.startTime,m=c.endTime,f=c.captions,_=a.inbandTextTracks_;a.logger_("adding cues from "+d+" -> "+m+" for "+u),function(b,y,E){if(!b[E]){y.trigger({type:"usage",name:"vhs-608"}),y.trigger({type:"usage",name:"hls-608"});var w=E;/^cc708_/.test(E)&&(w="SERVICE"+E.split("_")[1]);var k=y.textTracks().getTrackById(w);if(k)b[E]=k;else{var I=E,P=E,N=!1,A=(y.options_.vhs&&y.options_.vhs.captionServices||{})[w];A&&(I=A.label,P=A.language,N=A.default),b[E]=y.addRemoteTextTrack({kind:"captions",id:w,default:N,label:I,language:P},!1).track}}}(_,a.vhs_.tech_,u),Ui(d,m,_[u]),function(b){var y=b.inbandTextTracks,E=b.captionArray,w=b.timestampOffset;if(E){var k=D.WebKitDataCue||D.VTTCue;E.forEach(function(I){var P=I.stream;y[P].addCue(new k(I.startTime+w,I.endTime+w,I.text))})}}({captionArray:f,inbandTextTracks:_,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,n));else this.logger_("SegmentLoader received no captions from a caption event")},r.handleId3_=function(t,n,a){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(this.pendingSegment_.hasAppendedData_){var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();(function(o,u,c){o.metadataTrack_||(o.metadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,o.metadataTrack_.inBandMetadataTrackDispatchType=u)})(this.inbandTextTracks_,a,this.vhs_.tech_),gg({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:s,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,n,a))},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(t){return t()}),this.metadataQueue_.caption.forEach(function(t){return t()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var t=this.callQueue_;this.callQueue_=[],t.forEach(function(n){return n()})},r.processLoadQueue_=function(){var t=this.loadQueue_;this.loadQueue_=[],t.forEach(function(n){return n()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var t=this.pendingSegment_;return!!t&&(!this.getCurrentMediaInfo_()||!Jd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.getCurrentMediaInfo_=function(t){return t===void 0&&(t=this.pendingSegment_),t&&t.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(t){return t===void 0&&(t=this.pendingSegment_),this.getCurrentMediaInfo_(t)||this.startingMediaInfo_},r.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var t=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!t||!n)return!1;var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed;return!(s&&!t.videoTimingInfo)&&!(a&&!this.audioDisabled_&&!o&&!t.audioTimingInfo)&&!Jd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})},r.handleData_=function(t,n){if(this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(t.map&&(t.map=this.initSegmentForMap(t.map,!0),a.segment.map=t.map),t.key&&this.segmentKey(t.key,!0),a.isFmp4=t.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[$d(n.type)].start;else{var s,o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo;u&&(s=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:s,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}else this.callQueue_.push(this.handleData_.bind(this,t,n))},r.updateAppendInitSegmentStatus=function(t,n){this.loaderType_!=="main"||typeof t.timestampOffset!="number"||t.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==t.playlist&&(this.appendInitSegment_[n]=!0)},r.getInitSegmentAndUpdateState_=function(t){var n=t.type,a=t.initSegment,s=t.map,o=t.playlist;if(s){var u=Xr(s);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=o,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},r.handleQuotaExceededError_=function(t,n){var a=this,s=t.segmentInfo,o=t.type,u=t.bytes,c=this.sourceUpdater_.audioBuffered(),d=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+fn(c).join(", ")),d.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+fn(d).join(", "));var m=c.length?c.start(0):0,f=c.length?c.end(c.length-1):0,_=d.length?d.start(0):0,b=d.length?d.end(d.length-1):0;if(f-m<=1&&b-_<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+u.byteLength+", audio buffer: "+fn(c).join(", ")+", video buffer: "+fn(d).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:s,type:o,bytes:u}));var y=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+y),this.remove(0,y,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=D.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3)},!0)},r.handleAppendError_=function(t,n){var a=t.segmentInfo,s=t.type,o=t.bytes;n&&(n.code!==22?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(s+" append of "+o.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:a,type:s,bytes:o}))},r.appendToSourceBuffer_=function(t){var n,a,s,o=t.segmentInfo,u=t.type,c=t.initSegment,d=t.data,m=t.bytes;if(!m){var f=[d],_=d.byteLength;c&&(f.unshift(c),_+=c.byteLength),s=0,(n={bytes:_,segments:f}).bytes&&(a=new Uint8Array(n.bytes),n.segments.forEach(function(b){a.set(b,s),s+=b.byteLength})),m=a}this.sourceUpdater_.appendBuffer({segmentInfo:o,type:u,bytes:m},this.handleAppendError_.bind(this,{segmentInfo:o,type:u,bytes:m}))},r.handleSegmentTimingInfo_=function(t,n,a){if(this.pendingSegment_&&n===this.pendingSegment_.requestId){var s=this.pendingSegment_.segment,o=t+"TimingInfo";s[o]||(s[o]={}),s[o].transmuxerPrependedSeconds=a.prependedContentDuration||0,s[o].transmuxedPresentationStart=a.start.presentation,s[o].transmuxedDecodeStart=a.start.decode,s[o].transmuxedPresentationEnd=a.end.presentation,s[o].transmuxedDecodeEnd=a.end.decode,s[o].baseMediaDecodeTime=a.baseMediaDecodeTime}},r.appendData_=function(t,n){var a=n.type,s=n.data;if(s&&s.byteLength&&(a!=="audio"||!this.audioDisabled_)){var o=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,type:a,initSegment:o,data:s})}},r.loadSegment_=function(t){var n=this;this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),typeof t.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(t):this.loadQueue_.push(function(){var a=he({},t,{forceTimestampOffset:!0});he(t,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(t)})},r.updateTransmuxerAndRequestSegment_=function(t){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)&&(this.gopBuffer_.length=0,t.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset}));var a=this.createSimplifiedSegmentObj_(t),s=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex),o=this.mediaIndex!==null,u=t.timeline!==this.currentTimeline_&&t.timeline>0,c=s||o&&u;this.logger_("Requesting "+Zn(t)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),t.abortRequests=fg({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(d){var m=d.message,f=d.level,_=d.stream;n.logger_(Zn(t)+" logged from transmuxer stream "+_+" as a "+f+": "+m)}})},r.trimBackBuffer_=function(t){var n=function(a,s,o){var u=s-Ot.BACK_BUFFER_LENGTH;a.length&&(u=Math.max(u,a.start(0)));var c=s-o;return Math.min(c,u)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},r.createSimplifiedSegmentObj_=function(t){var n=t.segment,a=t.part,s={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part},o=t.playlist.segments[t.mediaIndex-1];if(o&&o.timeline===n.timeline&&(o.videoTimingInfo?s.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(s.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);s.key=this.segmentKey(n.key),s.key.iv=u}return n.map&&(s.map=this.initSegmentForMap(n.map)),s},r.saveTransferStats_=function(t){this.mediaRequests+=1,t&&(this.mediaBytesTransferred+=t.bytesReceived,this.mediaTransferDuration+=t.roundTripTime)},r.saveBandwidthRelatedStats_=function(t,n){this.pendingSegment_.byteLength=n.bytesReceived,t<Zr?this.logger_("Ignoring segment's bandwidth because its duration of "+t+" is less than the min to record "+Zr):(this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime)},r.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},r.segmentRequestFinished_=function(t,n,a){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,n,a));else if(this.saveTransferStats_(n.stats),this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(t)return this.pendingSegment_=null,this.state="READY",t.code===mo?void 0:(this.pause(),t.code===fo?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error")));var s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,n.stats),s.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=function(o,u,c){if(!u.length)return o;if(c)return u.slice();for(var d=u[0].pts,m=0;m<o.length&&!(o[m].pts>=d);m++);return o.slice(0,m).concat(u)}(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}},r.setTimeMapping_=function(t){var n=this.syncController_.mappingForTimeline(t);n!==null&&(this.timeMapping_=n)},r.updateMediaSecondsLoaded_=function(t){typeof t.start=="number"&&typeof t.end=="number"?this.mediaSecondsLoaded+=t.end-t.start:this.mediaSecondsLoaded+=t.duration},r.shouldUpdateTransmuxerTimestampOffset_=function(t){return t!==null&&(this.loaderType_==="main"&&t!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset())},r.trueSegmentStart_=function(t){var n=t.currentStart,a=t.playlist,s=t.mediaIndex,o=t.firstVideoFrameTimeForData,u=t.currentVideoTimestampOffset,c=t.useVideoTimingInfo,d=t.videoTimingInfo,m=t.audioTimingInfo;if(n!==void 0)return n;if(!c)return m.start;var f=a.segments[s-1];return s!==0&&f&&f.start!==void 0&&f.end===o+u?d.start:o},r.waitForAppendsToComplete_=function(t){var n=this.getCurrentMediaInfo_(t);if(!n)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed,u=this.loaderType_==="main"&&s,c=!this.audioDisabled_&&a&&!o;if(t.waitingOnAppends=0,!t.hasAppendedData_)return t.timingInfo||typeof t.timestampOffset!="number"||(this.isPendingTimestampOffset_=!0),t.timingInfo={start:0},t.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(t),this.processMetadataQueue_()),void this.checkAppendsDone_(t);u&&t.waitingOnAppends++,c&&t.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))},r.checkAppendsDone_=function(t){this.checkForAbort_(t.requestId)||(t.waitingOnAppends--,t.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(t){var n=function(a,s,o){return a==="main"&&s&&o?o.hasAudio||o.hasVideo?s.hasVideo&&!o.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.":!s.hasVideo&&o.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),t);return!!n&&(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0)},r.updateSourceBufferTimestampOffset_=function(t){if(t.timestampOffset!==null&&typeof t.timingInfo.start=="number"&&!t.changedTimestampOffset&&this.loaderType_==="main"){var n=!1;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo}),t.changedTimestampOffset=!0,t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(t.timestampOffset),n=!0),t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(t.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(t){var n=t.videoTimingInfo,a=t.audioTimingInfo,s=t.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:s.start:s.start},r.updateTimingInfoEnd_=function(t){t.timingInfo=t.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;a&&(t.timingInfo.end=typeof a.end=="number"?a.end:a.start+t.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_;this.updateTimingInfoEnd_(t),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=vg(t,this.sourceType_);if(n&&(n.severity==="warn"?O.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(t),this.pendingSegment_=null,this.state="READY",!t.isSyncRequest||(this.trigger("syncinfoupdate"),t.hasAppendedData_)){this.logger_("Appended "+Zn(t)),this.addSegmentMetadataCue_(t),this.fetchAtBuffer_=!0,this.currentTimeline_!==t.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline}),this.loaderType_!=="main"||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})),this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate");var a=t.segment,s=t.part,o=a.end&&this.currentTime_()-a.end>3*t.playlist.targetDuration,u=s&&s.end&&this.currentTime_()-s.end>3*t.playlist.partTargetDuration;if(o||u)return this.logger_("bad "+(o?"segment":"part")+" "+Zn(t)),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=t.mediaIndex,this.partIndex=t.partIndex,this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)&&this.endOfStream(),this.trigger("appended"),t.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Zn(t))},r.recordThroughput_=function(t){if(t.duration<Zr)this.logger_("Ignoring segment's throughput because its duration of "+t.duration+" is less than the min to record "+Zr);else{var n=this.throughput.rate,a=Date.now()-t.endOfAllRequests+1,s=Math.floor(t.byteLength/a*8*1e3);this.throughput.rate+=(s-n)/++this.throughput.count}},r.addSegmentMetadataCue_=function(t){if(this.segmentMetadataTrack_){var n=t.segment,a=n.start,s=n.end;if(Qd(a)&&Qd(s)){Ui(a,s,this.segmentMetadataTrack_);var o=D.WebKitDataCue||D.VTTCue,u={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:a,end:s},c=new o(a,s,JSON.stringify(u));c.value=u,this.segmentMetadataTrack_.addCue(c)}}},i}(O.EventTarget);function Ve(){}var We,th=function(e){return typeof e!="string"?e:e.replace(/./,function(i){return i.toUpperCase()})},yg=["video","audio"],bo=function(e,i){var r=i[e+"Buffer"];return r&&r.updating||i.queuePending[e]},To=function e(i,r){if(r.queue.length!==0){var t=0,n=r.queue[t];if(n.type!=="mediaSource"){if(i!=="mediaSource"&&r.ready()&&r.mediaSource.readyState!=="closed"&&!bo(i,r)){if(n.type!==i){if(t=function(a,s){for(var o=0;o<s.length;o++){var u=s[o];if(u.type==="mediaSource")return null;if(u.type===a)return o}return null}(i,r.queue),t===null)return;n=r.queue[t]}return r.queue.splice(t,1),r.queuePending[i]=n,n.action(i,r),n.doneFn?void 0:(r.queuePending[i]=null,void e(i,r))}}else r.updating()||r.mediaSource.readyState==="closed"||(r.queue.shift(),n.action(r),n.doneFn&&n.doneFn(),e("audio",r),e("video",r))}},eh=function(e,i){var r=i[e+"Buffer"],t=th(e);r&&(r.removeEventListener("updateend",i["on"+t+"UpdateEnd_"]),r.removeEventListener("error",i["on"+t+"Error_"]),i.codecs[e]=null,i[e+"Buffer"]=null)},Ce=function(e,i){return e&&i&&Array.prototype.indexOf.call(e.sourceBuffers,i)!==-1},_g=function(e,i,r){return function(t,n){var a=n[t+"Buffer"];if(Ce(n.mediaSource,a)){n.logger_("Appending segment "+i.mediaIndex+"'s "+e.length+" bytes to "+t+"Buffer");try{a.appendBuffer(e)}catch(s){n.logger_("Error with code "+s.code+" "+(s.code===22?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+i.mediaIndex+" to "+t+"Buffer"),n.queuePending[t]=null,r(s)}}}},nh=function(e,i){return function(r,t){var n=t[r+"Buffer"];if(Ce(t.mediaSource,n)){t.logger_("Removing "+e+" to "+i+" from "+r+"Buffer");try{n.remove(e,i)}catch{t.logger_("Remove "+e+" to "+i+" from "+r+"Buffer failed")}}}},ih=function(e){return function(i,r){var t=r[i+"Buffer"];Ce(r.mediaSource,t)&&(r.logger_("Setting "+i+"timestampOffset to "+e),t.timestampOffset=e)}},rh=function(e){return function(i,r){e()}},bg=function(e){return function(i){if(i.mediaSource.readyState==="open"){i.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{i.mediaSource.endOfStream(e)}catch(r){O.log.warn("Failed to call media source endOfStream",r)}}}},Tg=function(e){return function(i){i.logger_("Setting mediaSource duration to "+e);try{i.mediaSource.duration=e}catch(r){O.log.warn("Failed to set media source duration",r)}}},Sg=function(){return function(e,i){if(i.mediaSource.readyState==="open"){var r=i[e+"Buffer"];if(Ce(i.mediaSource,r)){i.logger_("calling abort on "+e+"Buffer");try{r.abort()}catch(t){O.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},Eg=function(e,i){return function(r){var t=th(e),n=oi(i);r.logger_("Adding "+e+"Buffer with codec "+i+" to mediaSource");var a=r.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",r["on"+t+"UpdateEnd_"]),a.addEventListener("error",r["on"+t+"Error_"]),r.codecs[e]=i,r[e+"Buffer"]=a}},wg=function(e){return function(i){var r=i[e+"Buffer"];if(eh(e,i),Ce(i.mediaSource,r)){i.logger_("Removing "+e+"Buffer with codec "+i.codecs[e]+" from mediaSource");try{i.mediaSource.removeSourceBuffer(r)}catch(t){O.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},kg=function(e){return function(i,r){var t=r[i+"Buffer"],n=oi(e);Ce(r.mediaSource,t)&&r.codecs[i]!==e&&(r.logger_("changing "+i+"Buffer codec from "+r.codecs[i]+" to "+e),t.changeType(n),r.codecs[i]=e)}},ae=function(e){var i=e.type,r=e.sourceUpdater,t=e.action,n=e.doneFn,a=e.name;r.queue.push({type:i,action:t,doneFn:n,name:a}),To(i,r)},ah=function(e,i){return function(r){if(i.queuePending[e]){var t=i.queuePending[e].doneFn;i.queuePending[e]=null,t&&t(i[e+"Error_"])}To(e,i)}},sh=function(e){function i(t){var n;return(n=e.call(this)||this).mediaSource=t,n.sourceopenListener_=function(){return To("mediaSource",tt(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=ye("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=ah("video",tt(n)),n.onAudioUpdateEnd_=ah("audio",tt(n)),n.onVideoError_=function(a){n.videoError_=a},n.onAudioError_=function(a){n.audioError_=a},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}V(i,e);var r=i.prototype;return r.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},r.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},r.hasInitializedAnyEme=function(){return this.initializedEme_},r.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},r.createSourceBuffers=function(t){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(t),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},r.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},r.addSourceBuffer=function(t,n){ae({type:"mediaSource",sourceUpdater:this,action:Eg(t,n),name:"addSourceBuffer"})},r.abort=function(t){ae({type:t,sourceUpdater:this,action:Sg(t),name:"abort"})},r.removeSourceBuffer=function(t){this.canRemoveSourceBuffer()?ae({type:"mediaSource",sourceUpdater:this,action:wg(t),name:"removeSourceBuffer"}):O.log.error("removeSourceBuffer is not supported!")},r.canRemoveSourceBuffer=function(){return!O.browser.IE_VERSION&&!O.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&typeof D.MediaSource.prototype.removeSourceBuffer=="function"},i.canChangeType=function(){return D.SourceBuffer&&D.SourceBuffer.prototype&&typeof D.SourceBuffer.prototype.changeType=="function"},r.canChangeType=function(){return this.constructor.canChangeType()},r.changeType=function(t,n){this.canChangeType()?ae({type:t,sourceUpdater:this,action:kg(n),name:"changeType"}):O.log.error("changeType is not supported!")},r.addOrChangeSourceBuffers=function(t){var n=this;if(!t||typeof t!="object"||Object.keys(t).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(t).forEach(function(a){var s=t[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,s);n.canChangeType()&&n.changeType(a,s)})},r.appendBuffer=function(t,n){var a=this,s=t.segmentInfo,o=t.type,u=t.bytes;if(this.processedAppend_=!0,o==="audio"&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([t,n]),void this.logger_("delayed audio append of "+u.length+" until video append");if(ae({type:o,sourceUpdater:this,action:_g(u,s||{mediaIndex:-1},n),doneFn:n,name:"appendBuffer"}),o==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var c=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+c.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,c.forEach(function(d){a.appendBuffer.apply(a,d)})}},r.audioBuffered=function(){return Ce(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:O.createTimeRange()},r.videoBuffered=function(){return Ce(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:O.createTimeRange()},r.buffered=function(){var t=Ce(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Ce(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!t?this.audioBuffered():t&&!n?this.videoBuffered():function(a,s){var o=null,u=null,c=0,d=[],m=[];if(!(a&&a.length&&s&&s.length))return O.createTimeRange();for(var f=a.length;f--;)d.push({time:a.start(f),type:"start"}),d.push({time:a.end(f),type:"end"});for(f=s.length;f--;)d.push({time:s.start(f),type:"start"}),d.push({time:s.end(f),type:"end"});for(d.sort(function(_,b){return _.time-b.time}),f=0;f<d.length;f++)d[f].type==="start"?++c==2&&(o=d[f].time):d[f].type==="end"&&--c==1&&(u=d[f].time),o!==null&&u!==null&&(m.push([o,u]),o=null,u=null);return O.createTimeRanges(m)}(this.audioBuffered(),this.videoBuffered())},r.setDuration=function(t,n){n===void 0&&(n=Ve),ae({type:"mediaSource",sourceUpdater:this,action:Tg(t),name:"duration",doneFn:n})},r.endOfStream=function(t,n){t===void 0&&(t=null),n===void 0&&(n=Ve),typeof t!="string"&&(t=void 0),ae({type:"mediaSource",sourceUpdater:this,action:bg(t),name:"endOfStream",doneFn:n})},r.removeAudio=function(t,n,a){a===void 0&&(a=Ve),this.audioBuffered().length&&this.audioBuffered().end(0)!==0?ae({type:"audio",sourceUpdater:this,action:nh(t,n),doneFn:a,name:"remove"}):a()},r.removeVideo=function(t,n,a){a===void 0&&(a=Ve),this.videoBuffered().length&&this.videoBuffered().end(0)!==0?ae({type:"video",sourceUpdater:this,action:nh(t,n),doneFn:a,name:"remove"}):a()},r.updating=function(){return!(!bo("audio",this)&&!bo("video",this))},r.audioTimestampOffset=function(t){return t!==void 0&&this.audioBuffer&&this.audioTimestampOffset_!==t&&(ae({type:"audio",sourceUpdater:this,action:ih(t),name:"timestampOffset"}),this.audioTimestampOffset_=t),this.audioTimestampOffset_},r.videoTimestampOffset=function(t){return t!==void 0&&this.videoBuffer&&this.videoTimestampOffset!==t&&(ae({type:"video",sourceUpdater:this,action:ih(t),name:"timestampOffset"}),this.videoTimestampOffset_=t),this.videoTimestampOffset_},r.audioQueueCallback=function(t){this.audioBuffer&&ae({type:"audio",sourceUpdater:this,action:rh(t),name:"callback"})},r.videoQueueCallback=function(t){this.videoBuffer&&ae({type:"video",sourceUpdater:this,action:rh(t),name:"callback"})},r.dispose=function(){var t=this;this.trigger("dispose"),yg.forEach(function(n){t.abort(n),t.canRemoveSourceBuffer()?t.removeSourceBuffer(n):t[n+"QueueCallback"](function(){return eh(n,t)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},i}(O.EventTarget),oh=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},uh=new Uint8Array(`
- `.split("").map(function(e){return e.charCodeAt(0)})),Cg=function(e){function i(){return e.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return V(i,e),i}(ns(Error)),xg=function(e){function i(t,n){var a;return n===void 0&&(n={}),(a=e.call(this,t,n)||this).mediaSource_=null,a.subtitlesTrack_=null,a.loaderType_="subtitle",a.featuresNativeTextTracks_=t.featuresNativeTextTracks,a.loadVttJs=t.loadVttJs,a.shouldSaveSegmentTimingInfo_=!1,a}V(i,e);var r=i.prototype;return r.createTransmuxer_=function(){return null},r.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return O.createTimeRanges();var t=this.subtitlesTrack_.cues,n=t[0].startTime,a=t[t.length-1].startTime;return O.createTimeRanges([[n,a]])},r.initSegmentForMap=function(t,n){if(n===void 0&&(n=!1),!t)return null;var a=Xr(t),s=this.initSegments_[a];if(n&&!s&&t.bytes){var o=uh.byteLength+t.bytes.byteLength,u=new Uint8Array(o);u.set(t.bytes),u.set(uh,t.bytes.byteLength),this.initSegments_[a]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:u}}return s||t},r.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.track=function(t){return t===void 0||(this.subtitlesTrack_=t,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},r.remove=function(t,n){Ui(t,n,this.subtitlesTrack_)},r.fillBuffer_=function(){var t=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null)return this.syncController_.one("timestampoffset",function(){t.state="READY",t.paused()||t.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(n)}},r.timestampOffsetForSegment_=function(){return null},r.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},r.skipEmptySegments_=function(t){for(;t&&t.segment.empty;){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t},r.stopForError=function(t){this.error(t),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(t,n,a){var s=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(n.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(t)return t.code===fo&&this.handleTimeout_(),t.code===mo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(t);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=o.segment;if(u.map&&(u.map.bytes=n.map.bytes),o.bytes=n.bytes,typeof D.WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(function(){return s.segmentRequestFinished_(t,n,a)},function(){return s.stopForError({message:"Error loading vtt.js"})});u.requested=!0;try{this.parseVTTCues_(o)}catch(c){return void this.stopForError({message:c.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,o.cues.forEach(function(c){s.subtitlesTrack_.addCue(s.featuresNativeTextTracks_?new D.VTTCue(c.startTime,c.endTime,c.text):c)}),function(c){var d=c.cues;if(d)for(var m=0;m<d.length;m++){for(var f=[],_=0,b=0;b<d.length;b++)d[m].startTime===d[b].startTime&&d[m].endTime===d[b].endTime&&d[m].text===d[b].text&&++_>1&&f.push(d[b]);f.length&&f.forEach(function(y){return c.removeCue(y)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(t){var n,a=!1;if(typeof D.WebVTT!="function")throw new Cg;typeof D.TextDecoder=="function"?n=new D.TextDecoder("utf8"):(n=D.WebVTT.StringDecoder(),a=!0);var s=new D.WebVTT.Parser(D,D.vttjs,n);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=t.cues.push.bind(t.cues),s.ontimestampmap=function(c){t.timestampmap=c},s.onparsingerror=function(c){O.log.warn("Error encountered when parsing cues: "+c.message)},t.segment.map){var o=t.segment.map.bytes;a&&(o=oh(o)),s.parse(o)}var u=t.bytes;a&&(u=oh(u)),s.parse(u),s.flush()},r.updateTimeMapping_=function(t,n,a){var s=t.segment;if(n)if(t.cues.length){var o=t.timestampmap,u=o.MPEGTS/fr-o.LOCAL+n.mapping;if(t.cues.forEach(function(m){m.startTime+=u,m.endTime+=u}),!a.syncInfo){var c=t.cues[0].startTime,d=t.cues[t.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+t.mediaIndex,time:Math.min(c,d-s.duration)}}}else s.empty=!0},i}(_o),Dg=function(e,i){for(var r=e.cues,t=0;t<r.length;t++){var n=r[t];if(i>=n.adStartTime&&i<=n.adEndTime)return n}return null},lh=[{name:"VOD",run:function(e,i,r,t,n){return r!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,i,r,t,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=io(i);n=n||0;for(var u=0;u<o.length;u++){var c=o[i.endList||n===0?u:o.length-(u+1)],d=c.segment,m=e.timelineToDatetimeMappings[d.timeline];if(m&&d.dateTimeObject){var f=d.dateTimeObject.getTime()/1e3+m;if(d.parts&&typeof c.partIndex=="number")for(var _=0;_<c.partIndex;_++)f+=d.parts[_].duration;var b=Math.abs(n-f);if(s!==null&&(b===0||s<b))break;s=b,a={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}}return a}},{name:"Segment",run:function(e,i,r,t,n){var a=null,s=null;n=n||0;for(var o=io(i),u=0;u<o.length;u++){var c=o[i.endList||n===0?u:o.length-(u+1)],d=c.segment,m=c.part&&c.part.start||d&&d.start;if(d.timeline===t&&m!==void 0){var f=Math.abs(n-m);if(s!==null&&s<f)break;(!a||s===null||s>=f)&&(s=f,a={time:m,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,i,r,t,n){var a=null;if(n=n||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var s=null,o=0;o<i.discontinuityStarts.length;o++){var u=i.discontinuityStarts[o],c=i.discontinuitySequence+o+1,d=e.discontinuities[c];if(d){var m=Math.abs(n-d.time);if(s!==null&&s<m)break;(!a||s===null||s>=m)&&(s=m,a={time:d.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,i,r,t,n){return i.syncInfo?{time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence,partIndex:null}:null}}],Ig=function(e){function i(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=ye("SyncController"),n}V(i,e);var r=i.prototype;return r.getSyncPoint=function(t,n,a,s){var o=this.runStrategies_(t,n,a,s);return o.length?this.selectSyncPoint_(o,{key:"time",value:s}):null},r.getExpiredTime=function(t,n){if(!t||!t.segments)return null;var a=this.runStrategies_(t,n,t.discontinuitySequence,0);if(!a.length)return null;var s=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Ri({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))},r.runStrategies_=function(t,n,a,s){for(var o=[],u=0;u<lh.length;u++){var c=lh[u],d=c.run(this,t,n,a,s);d&&(d.strategy=c.name,o.push({strategy:c.name,syncPoint:d}))}return o},r.selectSyncPoint_=function(t,n){for(var a=t[0].syncPoint,s=Math.abs(t[0].syncPoint[n.key]-n.value),o=t[0].strategy,u=1;u<t.length;u++){var c=Math.abs(t[u].syncPoint[n.key]-n.value);c<s&&(s=c,a=t[u].syncPoint,o=t[u].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy ["+o+"]: [time:"+a.time+", segmentIndex:"+a.segmentIndex+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},r.saveExpiredSegmentInfo=function(t,n){var a=n.mediaSequence-t.mediaSequence;if(a>86400)O.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var s=a-1;s>=0;s--){var o=t.segments[s];if(o&&o.start!==void 0){n.syncInfo={mediaSequence:t.mediaSequence+s,time:o.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+", mediaSequence: "+n.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(t){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){var n=t.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},r.saveSegmentTimingInfo=function(t){var n=t.segmentInfo,a=t.shouldSaveTimelineMapping,s=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),o=n.segment;s&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:o.start}));var u=o.dateTimeObject;o.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[o.timeline]=-u.getTime()/1e3)},r.timestampOffsetForTimeline=function(t){return this.timelines[t]===void 0?null:this.timelines[t].time},r.mappingForTimeline=function(t){return this.timelines[t]===void 0?null:this.timelines[t].mapping},r.calculateSegmentTimeMapping_=function(t,n,a){var s,o,u=t.segment,c=t.part,d=this.timelines[t.timeline];if(typeof t.timestampOffset=="number")d={time:t.startOfSegment,mapping:t.startOfSegment-n.start},a&&(this.timelines[t.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+t.timeline+": [time: "+d.time+"] [mapping: "+d.mapping+"]")),s=t.startOfSegment,o=n.end+d.mapping;else{if(!d)return!1;s=n.start+d.mapping,o=n.end+d.mapping}return c&&(c.start=s,c.end=o),(!u.start||s<u.start)&&(u.start=s),u.end=o,!0},r.saveDiscontinuitySyncInfo_=function(t){var n=t.playlist,a=t.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var s=0;s<n.discontinuityStarts.length;s++){var o=n.discontinuityStarts[s],u=n.discontinuitySequence+s+1,c=o-t.mediaIndex,d=Math.abs(c);if(!this.discontinuities[u]||this.discontinuities[u].accuracy>d){var m=void 0;m=c<0?a.start-Ri({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:t.mediaIndex,endIndex:o}):a.end+Ri({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:t.mediaIndex+1,endIndex:o}),this.discontinuities[u]={time:m,accuracy:d}}}},r.dispose=function(){this.trigger("dispose"),this.off()},i}(O.EventTarget),Ag=function(e){function i(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}V(i,e);var r=i.prototype;return r.clearPendingTimelineChange=function(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(t){var n=t.type,a=t.from,s=t.to;return typeof a=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},r.lastTimelineChange=function(t){var n=t.type,a=t.from,s=t.to;return typeof a=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:s},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},i}(O.EventTarget),Pg=Nd(Md(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i(b,y,E){return b(E={path:y,exports:{},require:function(w,k){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(k==null&&E.path)}},E.exports),E.exports}var r=i(function(b){function y(E,w){for(var k=0;k<w.length;k++){var I=w[k];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(E,I.key,I)}}b.exports=function(E,w,k){return w&&y(E.prototype,w),k&&y(E,k),E},b.exports.default=b.exports,b.exports.__esModule=!0}),t=i(function(b){function y(E,w){return b.exports=y=Object.setPrototypeOf||function(k,I){return k.__proto__=I,k},b.exports.default=b.exports,b.exports.__esModule=!0,y(E,w)}b.exports=y,b.exports.default=b.exports,b.exports.__esModule=!0}),n=i(function(b){b.exports=function(y,E){y.prototype=Object.create(E.prototype),y.prototype.constructor=y,t(y,E)},b.exports.default=b.exports,b.exports.__esModule=!0}),a=function(){function b(){this.listeners={}}var y=b.prototype;return y.on=function(E,w){this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push(w)},y.off=function(E,w){if(!this.listeners[E])return!1;var k=this.listeners[E].indexOf(w);return this.listeners[E]=this.listeners[E].slice(0),this.listeners[E].splice(k,1),k>-1},y.trigger=function(E){var w=this.listeners[E];if(w)if(arguments.length===2)for(var k=w.length,I=0;I<k;++I)w[I].call(this,arguments[1]);else for(var P=Array.prototype.slice.call(arguments,1),N=w.length,A=0;A<N;++A)w[A].apply(this,P)},y.dispose=function(){this.listeners={}},y.pipe=function(E){this.on("data",function(w){E.push(w)})},b}(),s,o=null,u=function(){function b(y){var E,w,k;o||(o=function(){var R,q,$,Y,K,Q,X,nt,at=[[[],[],[],[],[]],[[],[],[],[],[]]],ht=at[0],J=at[1],rt=ht[4],se=J[4],le=[],Kt=[];for(R=0;R<256;R++)Kt[(le[R]=R<<1^283*(R>>7))^R]=R;for(q=$=0;!rt[q];q^=Y||1,$=Kt[$]||1)for(Q=(Q=$^$<<1^$<<2^$<<3^$<<4)>>8^255&Q^99,rt[q]=Q,se[Q]=q,nt=16843009*le[K=le[Y=le[q]]]^65537*K^257*Y^16843008*q,X=257*le[Q]^16843008*Q,R=0;R<4;R++)ht[R][q]=X=X<<24^X>>>8,J[R][Q]=nt=nt<<24^nt>>>8;for(R=0;R<5;R++)ht[R]=ht[R].slice(0),J[R]=J[R].slice(0);return at}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var I=this._tables[0][4],P=this._tables[1],N=y.length,A=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");var U=y.slice(0),B=[];for(this._key=[U,B],E=N;E<4*N+28;E++)k=U[E-1],(E%N==0||N===8&&E%N==4)&&(k=I[k>>>24]<<24^I[k>>16&255]<<16^I[k>>8&255]<<8^I[255&k],E%N==0&&(k=k<<8^k>>>24^A<<24,A=A<<1^283*(A>>7))),U[E]=U[E-N]^k;for(w=0;E;w++,E--)k=U[3&w?E:E-4],B[w]=E<=4||w<4?k:P[0][I[k>>>24]]^P[1][I[k>>16&255]]^P[2][I[k>>8&255]]^P[3][I[255&k]]}return b.prototype.decrypt=function(y,E,w,k,I,P){var N,A,U,B,R=this._key[1],q=y^R[0],$=k^R[1],Y=w^R[2],K=E^R[3],Q=R.length/4-2,X=4,nt=this._tables[1],at=nt[0],ht=nt[1],J=nt[2],rt=nt[3],se=nt[4];for(B=0;B<Q;B++)N=at[q>>>24]^ht[$>>16&255]^J[Y>>8&255]^rt[255&K]^R[X],A=at[$>>>24]^ht[Y>>16&255]^J[K>>8&255]^rt[255&q]^R[X+1],U=at[Y>>>24]^ht[K>>16&255]^J[q>>8&255]^rt[255&$]^R[X+2],K=at[K>>>24]^ht[q>>16&255]^J[$>>8&255]^rt[255&Y]^R[X+3],X+=4,q=N,$=A,Y=U;for(B=0;B<4;B++)I[(3&-B)+P]=se[q>>>24]<<24^se[$>>16&255]<<16^se[Y>>8&255]<<8^se[255&K]^R[X++],N=q,q=$,$=Y,Y=K,K=N},b}(),c=function(b){function y(){var w;return(w=b.call(this,a)||this).jobs=[],w.delay=1,w.timeout_=null,w}n(y,b);var E=y.prototype;return E.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},E.push=function(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},y}(a),d=function(b){return b<<24|(65280&b)<<8|(16711680&b)>>8|b>>>24},m=function(){function b(y,E,w,k){var I=b.STEP,P=new Int32Array(y.buffer),N=new Uint8Array(y.byteLength),A=0;for(this.asyncStream_=new c,this.asyncStream_.push(this.decryptChunk_(P.subarray(A,A+I),E,w,N)),A=I;A<P.length;A+=I)w=new Uint32Array([d(P[A-4]),d(P[A-3]),d(P[A-2]),d(P[A-1])]),this.asyncStream_.push(this.decryptChunk_(P.subarray(A,A+I),E,w,N));this.asyncStream_.push(function(){var U;k(null,(U=N).subarray(0,U.byteLength-U[U.byteLength-1]))})}return b.prototype.decryptChunk_=function(y,E,w,k){return function(){var I=function(P,N,A){var U,B,R,q,$,Y,K,Q,X,nt=new Int32Array(P.buffer,P.byteOffset,P.byteLength>>2),at=new u(Array.prototype.slice.call(N)),ht=new Uint8Array(P.byteLength),J=new Int32Array(ht.buffer);for(U=A[0],B=A[1],R=A[2],q=A[3],X=0;X<nt.length;X+=4)$=d(nt[X]),Y=d(nt[X+1]),K=d(nt[X+2]),Q=d(nt[X+3]),at.decrypt($,Y,K,Q,J,X),J[X]=d(J[X]^U),J[X+1]=d(J[X+1]^B),J[X+2]=d(J[X+2]^R),J[X+3]=d(J[X+3]^q),U=$,B=Y,R=K,q=Q;return ht}(y,E,w);k.set(I,y.byteOffset)}},r(b,null,[{key:"STEP",get:function(){return 32e3}}]),b}();s=typeof window<"u"?window:e!==void 0?e:typeof self<"u"?self:{};var f=s.BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000");var _=function(b){var y={};return Object.keys(b).forEach(function(E){var w,k=b[E];w=k,(ArrayBuffer.isView==="function"?ArrayBuffer.isView(w):w&&w.buffer instanceof ArrayBuffer)?y[E]={bytes:k.buffer,byteOffset:k.byteOffset,byteLength:k.byteLength}:y[E]=k}),y};self.onmessage=function(b){var y=b.data,E=new Uint8Array(y.encrypted.bytes,y.encrypted.byteOffset,y.encrypted.byteLength),w=new Uint32Array(y.key.bytes,y.key.byteOffset,y.key.byteLength/4),k=new Uint32Array(y.iv.bytes,y.iv.byteOffset,y.iv.byteLength/4);new m(E,w,k,function(I,P){self.postMessage(_({source:y.source,decrypted:P}),[P.buffer])})}})),Lg=Rd(Pg),Og=function(e){var i=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(i="main-desc"),i},ta=function(e,i){e.abort(),e.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)},So=function(e,i){i.activePlaylistLoader=e,e.load()},ea={AUDIO:function(e,i){return function(){var r=i.segmentLoaders[e],t=i.mediaTypes[e],n=i.blacklistCurrentPlaylist;ta(r,t);var a=t.activeTrack(),s=t.activeGroup(),o=(s.filter(function(d){return d.default})[0]||s[0]).id,u=t.tracks[o];if(a!==u){for(var c in O.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),t.tracks)t.tracks[c].enabled=t.tracks[c]===u;t.onTrackChanged()}else n({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,i){return function(){var r=i.segmentLoaders[e],t=i.mediaTypes[e];O.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),ta(r,t);var n=t.activeTrack();n&&(n.mode="disabled"),t.onTrackChanged()}}},ch={AUDIO:function(e,i,r){if(i){var t=r.tech,n=r.requestOptions,a=r.segmentLoaders[e];i.on("loadedmetadata",function(){var s=i.media();a.playlist(s,n),(!t.paused()||s.endList&&t.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),t.paused()||a.load()}),i.on("error",ea[e](e,r))}},SUBTITLES:function(e,i,r){var t=r.tech,n=r.requestOptions,a=r.segmentLoaders[e],s=r.mediaTypes[e];i.on("loadedmetadata",function(){var o=i.media();a.playlist(o,n),a.track(s.activeTrack()),(!t.paused()||o.endList&&t.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),t.paused()||a.load()}),i.on("error",ea[e](e,r))}},Rg={AUDIO:function(e,i){var r=i.vhs,t=i.sourceType,n=i.segmentLoaders[e],a=i.requestOptions,s=i.master.mediaGroups,o=i.mediaTypes[e],u=o.groups,c=o.tracks,d=o.logger_,m=i.masterPlaylistLoader,f=Ni(m.master);for(var _ in s[e]&&Object.keys(s[e]).length!==0||(s[e]={main:{default:{default:!0}}},f&&(s[e].main.default.playlists=m.master.playlists)),s[e])for(var b in u[_]||(u[_]=[]),s[e][_]){var y=s[e][_][b],E=void 0;if(f?(d("AUDIO group '"+_+"' label '"+b+"' is a master playlist"),y.isMasterPlaylist=!0,E=null):E=t==="vhs-json"&&y.playlists?new $n(y.playlists[0],r,a):y.resolvedUri?new $n(y.resolvedUri,r,a):y.playlists&&t==="dash"?new po(y.playlists[0],r,a,m):null,y=O.mergeOptions({id:b,playlistLoader:E},y),ch[e](e,y.playlistLoader,i),u[_].push(y),c[b]===void 0){var w=new O.AudioTrack({id:b,kind:Og(y),enabled:!1,language:y.language,default:y.default,label:b});c[b]=w}}n.on("error",ea[e](e,i))},SUBTITLES:function(e,i){var r=i.tech,t=i.vhs,n=i.sourceType,a=i.segmentLoaders[e],s=i.requestOptions,o=i.master.mediaGroups,u=i.mediaTypes[e],c=u.groups,d=u.tracks,m=i.masterPlaylistLoader;for(var f in o[e])for(var _ in c[f]||(c[f]=[]),o[e][f])if(!o[e][f][_].forced){var b=o[e][f][_],y=void 0;if(n==="hls")y=new $n(b.resolvedUri,t,s);else if(n==="dash"){if(!b.playlists.filter(function(w){return w.excludeUntil!==1/0}).length)return;y=new po(b.playlists[0],t,s,m)}else n==="vhs-json"&&(y=new $n(b.playlists?b.playlists[0]:b.resolvedUri,t,s));if(b=O.mergeOptions({id:_,playlistLoader:y},b),ch[e](e,b.playlistLoader,i),c[f].push(b),d[_]===void 0){var E=r.addRemoteTextTrack({id:_,kind:"subtitles",default:b.default&&b.autoselect,language:b.language,label:_},!1).track;d[_]=E}}a.on("error",ea[e](e,i))},"CLOSED-CAPTIONS":function(e,i){var r=i.tech,t=i.master.mediaGroups,n=i.mediaTypes[e],a=n.groups,s=n.tracks;for(var o in t[e])for(var u in a[o]||(a[o]=[]),t[e][o]){var c=t[e][o][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var d=r.options_.vhs&&r.options_.vhs.captionServices||{},m={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(d[m.instreamId]&&(m=O.mergeOptions(m,d[m.instreamId])),m.default===void 0&&delete m.default,a[o].push(O.mergeOptions({id:u},c)),s[u]===void 0){var f=r.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;s[u]=f}}}}},Ng=function e(i,r){for(var t=0;t<i.length;t++)if(so(r,i[t])||i[t].playlists&&e(i[t].playlists,r))return!0;return!1},Mg={AUDIO:function(e,i){return function(){var r=i.mediaTypes[e].tracks;for(var t in r)if(r[t].enabled)return r[t];return null}},SUBTITLES:function(e,i){return function(){var r=i.mediaTypes[e].tracks;for(var t in r)if(r[t].mode==="showing"||r[t].mode==="hidden")return r[t];return null}}},Ug=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(f){Rg[f](f,e)});var i=e.mediaTypes,r=e.masterPlaylistLoader,t=e.tech,n=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach(function(f){i[f].activeGroup=function(_,b){return function(y){var E=b.masterPlaylistLoader,w=b.mediaTypes[_].groups,k=E.media();if(!k)return null;var I=null;k.attributes[_]&&(I=w[k.attributes[_]]);var P=Object.keys(w);if(!I)if(_==="AUDIO"&&P.length>1&&Ni(b.master))for(var N=0;N<P.length;N++){var A=w[P[N]];if(Ng(A,k)){I=A;break}}else w.main?I=w.main:P.length===1&&(I=w[P[0]]);return y===void 0?I:y!==null&&I&&I.filter(function(U){return U.id===y.id})[0]||null}}(f,e),i[f].activeTrack=Mg[f](f,e),i[f].onGroupChanged=function(_,b){return function(){var y=b.segmentLoaders,E=y[_],w=y.main,k=b.mediaTypes[_],I=k.activeTrack(),P=k.getActiveGroup(),N=k.activePlaylistLoader,A=k.lastGroup_;P&&A&&P.id===A.id||(k.lastGroup_=P,k.lastTrack_=I,ta(E,k),P&&!P.isMasterPlaylist&&(P.playlistLoader?(E.resyncLoader(),So(P.playlistLoader,k)):N&&w.resetEverything()))}}(f,e),i[f].onGroupChanging=function(_,b){return function(){var y=b.segmentLoaders[_];b.mediaTypes[_].lastGroup_=null,y.abort(),y.pause()}}(f,e),i[f].onTrackChanged=function(_,b){return function(){var y=b.masterPlaylistLoader,E=b.segmentLoaders,w=E[_],k=E.main,I=b.mediaTypes[_],P=I.activeTrack(),N=I.getActiveGroup(),A=I.activePlaylistLoader,U=I.lastTrack_;if((!U||!P||U.id!==P.id)&&(I.lastGroup_=N,I.lastTrack_=P,ta(w,I),N)){if(N.isMasterPlaylist){if(!P||!U||P.id===U.id)return;var B=b.vhs.masterPlaylistController_,R=B.selectPlaylist();return B.media()===R?void 0:(I.logger_("track change. Switching master audio from "+U.id+" to "+P.id),y.pause(),k.resetEverything(),void B.fastQualityChange_(R))}if(_==="AUDIO"){if(!N.playlistLoader)return k.setAudio(!0),void k.resetEverything();w.setAudio(!0),k.setAudio(!1)}A!==N.playlistLoader&&(w.track&&w.track(P),w.resetEverything()),So(N.playlistLoader,I)}}}(f,e),i[f].getActiveGroup=function(_,b){var y=b.mediaTypes;return function(){var E=y[_].activeTrack();return E?y[_].activeGroup(E):null}}(f,e)});var u=i.AUDIO.activeGroup();if(u){var c=(u.filter(function(f){return f.default})[0]||u[0]).id;i.AUDIO.tracks[c].enabled=!0,i.AUDIO.onGroupChanged(),i.AUDIO.onTrackChanged(),i.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(f){return i[f].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(f){return i[f].onGroupChanging()})});var d=function(){i.AUDIO.onTrackChanged(),t.trigger({type:"usage",name:"vhs-audio-change"}),t.trigger({type:"usage",name:"hls-audio-change"})};for(var m in t.audioTracks().addEventListener("change",d),t.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged),n.on("dispose",function(){t.audioTracks().removeEventListener("change",d),t.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)}),t.clearTracks("audio"),i.AUDIO.tracks)t.audioTracks().addTrack(i.AUDIO.tracks[m])},Bg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Fg=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},jg=function(e){function i(t){var n;n=e.call(this)||this;var a=t.src,s=t.handleManifestRedirects,o=t.withCredentials,u=t.tech,c=t.bandwidth,d=t.externVhs,m=t.useCueTags,f=t.blacklistDuration,_=t.enableLowInitialPlaylist,b=t.sourceType,y=t.cacheEncryptionKeys,E=t.experimentalBufferBasedABR,w=t.experimentalLeastPixelDiffSelector,k=t.captionServices;if(!a)throw new Error("A non-empty playlist URL or JSON manifest string is required");var I=t.maxPlaylistRetries;I==null&&(I=1/0),We=d,n.experimentalBufferBasedABR=!!E,n.experimentalLeastPixelDiffSelector=!!w,n.withCredentials=o,n.tech_=u,n.vhs_=u.vhs,n.sourceType_=b,n.useCueTags_=m,n.blacklistDuration=f,n.maxPlaylistRetries=I,n.enableLowInitialPlaylist=_,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:I,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=function(){var A={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(U){A[U]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ve,activeTrack:Ve,getActiveGroup:Ve,onGroupChanged:Ve,onTrackChanged:Ve,lastTrack_:null,logger_:ye("MediaGroups["+U+"]")}}),A}(),n.mediaSource=new D.MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(tt(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(tt(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(tt(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=O.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Ig(t),n.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new Lg,n.sourceUpdater_=new sh(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Ag;var P={vhs:n.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:k,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:c,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_=n.sourceType_==="dash"?new po(a,n.vhs_,n.requestOptions_):new $n(a,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new _o(O.mergeOptions(P,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new _o(O.mergeOptions(P,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new xg(O.mergeOptions(P,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(A,U){function B(){u.off("vttjserror",R),A()}function R(){u.off("vttjsloaded",B),U()}u.one("vttjsloaded",B),u.one("vttjserror",R),u.addWebVttScript_()})}}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),Bg.forEach(function(A){n[A+"_"]=Fg.bind(tt(n),A)}),n.logger_=ye("MPC"),n.triggeredFmp4Usage=!1,n.tech_.preload()==="none"?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var N=n.tech_.preload()==="none"?"play":"loadstart";return n.tech_.one(N,function(){var A=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-A,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}V(i,e);var r=i.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var t=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return t===-1||n===-1?-1:t+n},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(t){t===void 0&&(t="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,t)},r.switchMedia_=function(t,n,a){var s=this.media(),o=s&&(s.id||s.uri),u=t.id||t.uri;o&&o!==u&&(this.logger_("switch media "+o+" -> "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(t,a)},r.startABRTimer_=function(){var t=this;this.stopABRTimer_(),this.abrTimer_=D.setInterval(function(){return t.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var t=this.master(),n=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return n;var a,s=t.mediaGroups.AUDIO,o=Object.keys(s);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{var u=s.main||o.length&&s[o[0]];for(var c in u)if(u[c].default){a={label:c};break}}if(!a)return n;var d=[];for(var m in s)if(s[m][a.label]){var f=s[m][a.label];if(f.playlists&&f.playlists.length)d.push.apply(d,f.playlists);else if(f.uri)d.push(f);else if(t.playlists.length)for(var _=0;_<t.playlists.length;_++){var b=t.playlists[_];b.attributes&&b.attributes.AUDIO&&b.attributes.AUDIO===m&&d.push(b)}}return d.length?d:n},r.setupMasterPlaylistLoaderListeners_=function(){var t=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=t.masterPlaylistLoader_.media(),a=1.5*n.targetDuration*1e3;ao(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=a,n.endList&&t.tech_.preload()!=="none"&&(t.mainSegmentLoader_.playlist(n,t.requestOptions_),t.mainSegmentLoader_.load()),Ug({sourceType:t.sourceType_,segmentLoaders:{AUDIO:t.audioSegmentLoader_,SUBTITLES:t.subtitleSegmentLoader_,main:t.mainSegmentLoader_},tech:t.tech_,requestOptions:t.requestOptions_,masterPlaylistLoader:t.masterPlaylistLoader_,vhs:t.vhs_,master:t.master(),mediaTypes:t.mediaTypes_,blacklistCurrentPlaylist:t.blacklistCurrentPlaylist.bind(t)}),t.triggerPresenceUsage_(t.master(),n),t.setupFirstPlay(),!t.mediaTypes_.AUDIO.activePlaylistLoader||t.mediaTypes_.AUDIO.activePlaylistLoader.media()?t.trigger("selectedinitialmedia"):t.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){t.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){t.loadOnPlay_&&t.tech_.off("play",t.loadOnPlay_);var n=t.masterPlaylistLoader_.media();if(!n){var a;if(t.excludeUnsupportedVariants_(),t.enableLowInitialPlaylist&&(a=t.selectInitialPlaylist()),a||(a=t.selectPlaylist()),!a||!t.shouldSwitchToMedia_(a)||(t.initialMedia_=a,t.switchMedia_(t.initialMedia_,"initial"),!(t.sourceType_==="vhs-json"&&t.initialMedia_.segments)))return;n=t.initialMedia_}t.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){t.mainSegmentLoader_.abort(),t.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=t.masterPlaylistLoader_.media(),a=1.5*n.targetDuration*1e3;ao(t.masterPlaylistLoader_.master,t.masterPlaylistLoader_.media())?t.requestOptions_.timeout=0:t.requestOptions_.timeout=a,t.masterPlaylistLoader_.load(),t.mainSegmentLoader_.playlist(n,t.requestOptions_),t.mainSegmentLoader_.load(),t.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=t.masterPlaylistLoader_.media();n.lastExcludeReason_!=="playlist-unchanged"&&t.stuckAtPlaylistEnd_(n)&&(t.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),t.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){t.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),t.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){t.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),t.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},r.handleUpdatedMediaPlaylist=function(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},r.triggerPresenceUsage_=function(t,n){var a=t.mediaGroups||{},s=!0,o=Object.keys(a.AUDIO);for(var u in a.AUDIO)for(var c in a.AUDIO[u])a.AUDIO[u][c].uri||(s=!1);s&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),We.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),o.length&&Object.keys(a.AUDIO[o[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(t){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),s=this.bufferLowWaterLine(),o=this.bufferHighWaterLine();return function(u){var c=u.currentPlaylist,d=u.buffered,m=u.currentTime,f=u.nextPlaylist,_=u.bufferLowWaterLine,b=u.bufferHighWaterLine,y=u.duration,E=u.experimentalBufferBasedABR,w=u.log;if(!f)return O.log.warn("We received no playlist to switch to. Please check your stream."),!1;var k="allowing switch "+(c&&c.id||"null")+" -> "+f.id;if(!c)return w(k+" as current playlist is not set"),!0;if(f.id===c.id)return!1;var I=!!Yn(d,m).length;if(!c.endList)return I||typeof c.partTargetDuration!="number"?(w(k+" as current playlist is live"),!0):(w("not "+k+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var P=eo(d,m),N=E?Ot.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ot.MAX_BUFFER_LOW_WATER_LINE;if(y<N)return w(k+" as duration < max low water line ("+y+" < "+N+")"),!0;var A=f.attributes.BANDWIDTH,U=c.attributes.BANDWIDTH;if(A<U&&(!E||P<b)){var B=k+" as next bandwidth < current bandwidth ("+A+" < "+U+")";return E&&(B+=" and forwardBuffer < bufferHighWaterLine ("+P+" < "+b+")"),w(B),!0}if((!E||A>U)&&P>=_){var R=k+" as forwardBuffer >= bufferLowWaterLine ("+P+" >= "+_+")";return E&&(R+=" and next bandwidth > current bandwidth ("+A+" > "+U+")"),w(R),!0}return w("not "+k+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:a,currentPlaylist:n,nextPlaylist:t,bufferLowWaterLine:s,bufferHighWaterLine:o,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var t=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){t.checkABR_("bandwidthupdate"),t.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){t.experimentalBufferBasedABR&&t.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){t.error=t.mainSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){t.error=t.audioSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){t.logger_("main segment loader ended"),t.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){t.experimentalBufferBasedABR||(t.delegateLoaders_("all",["abort"]),t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var n=function(){if(!t.sourceUpdater_.hasCreatedSourceBuffers())return t.tryToCreateSourceBuffers_();var a=t.getCodecsOrExclude_();a&&t.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){t.logger_("audioSegmentLoader ended"),t.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(t){t===void 0&&(t=this.selectPlaylist()),this.fastQualityChange_(t)},r.fastQualityChange_=function(t){var n=this;t===void 0&&(t=this.selectPlaylist()),t!==this.masterPlaylistLoader_.media()?(this.switchMedia_(t,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){O.browser.IE_VERSION||O.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.tech_.setCurrentTime(t.end(t.length-1)):void 0}},r.setupFirstPlay=function(){var t=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(O.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){t.trigger("firstplay"),t.tech_.setCurrentTime(a.end(0)),t.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},r.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var t=this.tech_.play();t!==void 0&&typeof t.then=="function"&&t.then(null,function(n){})}this.trigger("sourceopen")},r.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var t=this.inbandTextTracks_.metadataTrack_.cues;if(t&&t.length){var n=this.duration();t[t.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},r.handleDurationChange_=function(){this.tech_.trigger("durationchange")},r.onEndOfStream=function(){var t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();t=!n||n.hasVideo?t&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},r.stuckAtPlaylistEnd_=function(t){if(!this.seekable().length)return!1;var n=this.syncController_.getExpiredTime(t,this.duration());if(n===null)return!1;var a=We.Playlist.playlistEnd(t,n),s=this.tech_.currentTime(),o=this.tech_.buffered();if(!o.length)return a-s<=ke;var u=o.end(o.length-1);return u-s<=ke&&a-u<=ke},r.blacklistCurrentPlaylist=function(t,n){t===void 0&&(t={});var a=t.playlist||this.masterPlaylistLoader_.media();if(n=n||t.blacklistDuration||this.blacklistDuration,!a)return this.error=t,void(this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));a.playlistErrors_++;var s,o=this.masterPlaylistLoader_.master.playlists,u=o.filter(Gr),c=u.length===1&&u[0]===a;if(o.length===1&&n!==1/0)return O.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(c);if(c){var d=!1;o.forEach(function(E){if(E!==a){var w=E.excludeUntil;w!==void 0&&w!==1/0&&(d=!0,delete E.excludeUntil)}}),d&&(O.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}s=a.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,a.excludeUntil=s,t.reason&&(a.lastExcludeReason_=t.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var m=this.selectPlaylist();if(!m)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var f=t.internal?this.logger_:O.log.warn,_=t.message?" "+t.message:"";f((t.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+_+" Switching to playlist "+m.id+"."),m.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var b=m.targetDuration/2*1e3||5e3,y=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=b;return this.switchMedia_(m,"exclude",c||y)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(t,n){var a=this,s=[],o=t==="all";(o||t==="main")&&s.push(this.masterPlaylistLoader_);var u=[];(o||t==="audio")&&u.push("AUDIO"),(o||t==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var d=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;d&&s.push(d)}),["main","audio","subtitle"].forEach(function(c){var d=a[c+"SegmentLoader_"];!d||t!==c&&t!=="all"||s.push(d)}),s.forEach(function(c){return n.forEach(function(d){typeof c[d]=="function"&&c[d]()})})},r.setCurrentTime=function(t){var n=Yn(this.tech_.buffered(),t);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?n&&n.length?t:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var t=this.masterPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:We.Playlist.duration(t):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var t;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var s=this.masterPlaylistLoader_.master,o=We.Playlist.seekable(n,a,We.Playlist.liveEdgeDelay(s,n));if(o.length!==0){if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),(a=this.syncController_.getExpiredTime(n,this.duration()))===null||(t=We.Playlist.seekable(n,a,We.Playlist.liveEdgeDelay(s,n))).length===0))return;var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),t?t.start(0)>o.end(0)||o.start(0)>t.end(0)?this.seekable_=o:this.seekable_=O.createTimeRanges([[t.start(0)>o.start(0)?t.start(0):o.start(0),t.end(0)<o.end(0)?t.end(0):o.end(0)]]):this.seekable_=o,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===u&&this.seekable_.start(0)===c||(this.logger_("seekable updated ["+od(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},r.updateDuration=function(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open")return this.updateDuration_=this.updateDuration.bind(this,t),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(t){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1))}else{var a=this.tech_.buffered(),s=We.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(s=Math.max(s,a.end(a.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}},r.dispose=function(){var t=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=t.mediaTypes_[n].groups;for(var s in a)a[s].forEach(function(o){o.playlistLoader&&o.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!t||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!n||!a)},r.getCodecsOrExclude_=function(){var t=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var s=Mi(this.master(),a),o={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(o.video=s.video||n.main.videoCodec||"avc1.4d400d"),n.main.isMuxed&&(o.video+=","+(s.audio||n.main.audioCodec||vu)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(o.audio=s.audio||n.main.audioCodec||n.audio.audioCodec||vu,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),o.audio||o.video){var c,d={};if(["video","audio"].forEach(function(b){if(o.hasOwnProperty(b)&&(E=n[b].isFmp4,w=o[b],!(E?Zi(w):Da(w)))){var y=n[b].isFmp4?"browser":"muxer";d[y]=d[y]||[],d[y].push(o[b]),b==="audio"&&(c=y)}var E,w}),u&&c&&a.attributes.AUDIO){var m=a.attributes.AUDIO;this.master().playlists.forEach(function(b){(b.attributes&&b.attributes.AUDIO)===m&&b!==a&&(b.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+c+' does not support codec(s): "'+o.audio+'"')}if(!Object.keys(d).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var f=[];if(["video","audio"].forEach(function(b){var y=(be(t.sourceUpdater_.codecs[b]||"")[0]||{}).type,E=(be(o[b]||"")[0]||{}).type;y&&E&&y.toLowerCase()!==E.toLowerCase()&&f.push('"'+t.sourceUpdater_.codecs[b]+'" -> "'+o[b]+'"')}),f.length)return void this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+f.join(", ")+".",blacklistDuration:1/0,internal:!0})}return o}var _=Object.keys(d).reduce(function(b,y){return b&&(b+=", "),b+=y+' does not support codec(s): "'+d[y].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:_,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},r.tryToCreateSourceBuffers_=function(){if(this.mediaSource.readyState==="open"&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var t=this.getCodecsOrExclude_();if(t){this.sourceUpdater_.createSourceBuffers(t);var n=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},r.excludeUnsupportedVariants_=function(){var t=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(s){var o=n[s];if(a.indexOf(o.id)===-1){a.push(o.id);var u=Mi(t.master,o),c=[];!u.audio||Da(u.audio)||Zi(u.audio)||c.push("audio codec "+u.audio),!u.video||Da(u.video)||Zi(u.video)||c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(o.excludeUntil=1/0,t.logger_("excluding "+o.id+" for unsupported: "+c.join(", ")))}})},r.excludeIncompatibleVariants_=function(t){var n=this,a=[],s=this.master().playlists,o=Qr(be(t)),u=zd(o),c=o.video&&be(o.video)[0]||null,d=o.audio&&be(o.audio)[0]||null;Object.keys(s).forEach(function(m){var f=s[m];if(a.indexOf(f.id)===-1&&f.excludeUntil!==1/0){a.push(f.id);var _=[],b=Mi(n.masterPlaylistLoader_.master,f),y=zd(b);if(b.audio||b.video){if(y!==u&&_.push('codec count "'+y+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var E=b.video&&be(b.video)[0]||null,w=b.audio&&be(b.audio)[0]||null;E&&c&&E.type.toLowerCase()!==c.type.toLowerCase()&&_.push('video codec "'+E.type+'" !== "'+c.type+'"'),w&&d&&w.type.toLowerCase()!==d.type.toLowerCase()&&_.push('audio codec "'+w.type+'" !== "'+d.type+'"')}_.length&&(f.excludeUntil=1/0,n.logger_("blacklisting "+f.id+": "+_.join(" && ")))}}})},r.updateAdCues_=function(t){var n=0,a=this.seekable();a.length&&(n=a.start(0)),function(s,o,u){if(u===void 0&&(u=0),s.segments)for(var c,d=u,m=0;m<s.segments.length;m++){var f=s.segments[m];if(c||(c=Dg(o,d+f.duration/2)),c){if("cueIn"in f){c.endTime=d,c.adEndTime=d,d+=f.duration,c=null;continue}if(d<c.endTime){d+=f.duration;continue}c.endTime+=f.duration}else if("cueOut"in f&&((c=new D.VTTCue(d,d+f.duration,f.cueOut)).adStartTime=d,c.adEndTime=d+parseFloat(f.cueOut),o.addCue(c)),"cueOutCont"in f){var _=f.cueOutCont.split("/").map(parseFloat),b=_[0],y=_[1];(c=new D.VTTCue(d,d+f.duration,"")).adStartTime=d-b,c.adEndTime=c.adStartTime+y,o.addCue(c)}d+=f.duration}}(t,this.cueTagsTrack_,n)},r.goalBufferLength=function(){var t=this.tech_.currentTime(),n=Ot.GOAL_BUFFER_LENGTH,a=Ot.GOAL_BUFFER_LENGTH_RATE,s=Math.max(n,Ot.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+t*a,s)},r.bufferLowWaterLine=function(){var t=this.tech_.currentTime(),n=Ot.BUFFER_LOW_WATER_LINE,a=Ot.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(n,Ot.MAX_BUFFER_LOW_WATER_LINE),o=Math.max(n,Ot.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+t*a,this.experimentalBufferBasedABR?o:s)},r.bufferHighWaterLine=function(){return Ot.BUFFER_HIGH_WATER_LINE},i}(O.EventTarget),qg=function(e,i,r){var t,n,a,s=e.masterPlaylistController_,o=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);if(i.attributes){var u=i.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=Mi(s.master(),i),this.playlist=i,this.id=r,this.enabled=(t=e.playlists,n=i.id,a=o,function(c){var d=t.master.playlists[n],m=ro(d),f=Gr(d);return c===void 0?f:(c?delete d.disabled:d.disabled=!0,c===f||m||(a(),c?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),c)})},dh=["seeking","seeked","pause","playing","error"],Hg=function(){function e(r){var t=this;this.masterPlaylistController_=r.masterPlaylistController,this.tech_=r.tech,this.seekable=r.seekable,this.allowSeeksWithinUnsafeLiveWindow=r.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=r.liveRangeSafeTimeDelta,this.media=r.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=ye("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},a=function(){return t.monitorCurrentTime_()},s=function(){return t.techWaiting_()},o=function(){return t.cancelTimer_()},u=this.masterPlaylistController_,c=["main","subtitle","audio"],d={};c.forEach(function(f){d[f]={reset:function(){return t.resetSegmentDownloads_(f)},updateend:function(){return t.checkSegmentDownloads_(f)}},u[f+"SegmentLoader_"].on("appendsdone",d[f].updateend),u[f+"SegmentLoader_"].on("playlistupdate",d[f].reset),t.tech_.on(["seeked","seeking"],d[f].reset)});var m=function(f){["main","audio"].forEach(function(_){u[_+"SegmentLoader_"][f]("appended",t.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),m("off"))},this.clearSeekingAppendCheck_=function(){return m("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),m("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(dh,o),this.tech_.on("canplay",a),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",s),t.tech_.off(dh,o),t.tech_.off("canplay",a),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),c.forEach(function(f){u[f+"SegmentLoader_"].off("appendsdone",d[f].updateend),u[f+"SegmentLoader_"].off("playlistupdate",d[f].reset),t.tech_.off(["seeked","seeking"],d[f].reset)}),t.checkCurrentTimeTimeout_&&D.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var i=e.prototype;return i.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)},i.resetSegmentDownloads_=function(r){var t=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=t.buffered_()},i.checkSegmentDownloads_=function(r){var t=this.masterPlaylistController_,n=t[r+"SegmentLoader_"],a=n.buffered_(),s=function(o,u){if(o===u)return!1;if(!o&&u||!u&&o||o.length!==u.length)return!0;for(var c=0;c<o.length;c++)if(o.start(c)!==u.start(c)||o.end(c)!==u.end(c))return!0;return!1}(this[r+"Buffered_"],a);this[r+"Buffered_"]=a,s?this.resetSegmentDownloads_(r):(this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:fn(a)}),this[r+"StalledDownloads_"]<10||(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&t.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0)))},i.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var r=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===r&&(!t.length||r+ke>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},i.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},i.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var r,t=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(r=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){var a=t.start(0);r=a+(a===t.end(0)?0:ke)}if(r!==void 0)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+od(t)+". Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0;for(var s=this.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=s.audioBuffer?s.audioBuffered():null,c=s.videoBuffer?s.videoBuffered():null,d=this.media(),m=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-pn),f=[u,c],_=0;_<f.length;_++)if(f[_]&&eo(f[_],n)<m)return!1;var b=Wr(o,n);return b.length!==0&&(r=b.start(0)+ke,this.logger_("Buffered region starts ("+b.start(0)+") just beyond seek point ("+n+"). Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0)},i.waiting_=function(){if(!this.techWaiting_()){var r=this.tech_.currentTime(),t=this.tech_.buffered(),n=Yn(t,r);return n.length&&r+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(r),this.logger_("Stopped at "+r+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},i.techWaiting_=function(){var r=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,t)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=Wr(s,t);if(o.length>0){var u=o.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+u+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*u,t),!0}return!1},i.afterSeekableWindow_=function(r,t,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var s=r.end(r.length-1)+ke;return!n.endList&&a&&(s=r.end(r.length-1)+3*n.targetDuration),t>s},i.beforeSeekableWindow_=function(r,t){return!!(r.length&&r.start(0)>0&&t<r.start(0)-this.liveRangeSafeTimeDelta)},i.videoUnderflow_=function(r){var t=r.videoBuffered,n=r.audioBuffered,a=r.currentTime;if(t){var s;if(t.length&&n.length){var o=Yn(t,a-3),u=Yn(t,a),c=Yn(n,a);c.length&&!u.length&&o.length&&(s={start:o.end(0),end:c.end(0)})}else Wr(t,a).length||(s=this.gapFromVideoUnderflow_(t,a));return!!s&&(this.logger_("Encountered a gap in video from "+s.start+" to "+s.end+". Seeking to current time "+a),!0)}},i.skipTheGap_=function(r){var t=this.tech_.buffered(),n=this.tech_.currentTime(),a=Wr(t,n);this.cancelTimer_(),a.length!==0&&n===r&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",r,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+pn),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},i.gapFromVideoUnderflow_=function(r,t){for(var n=function(u){if(u.length<2)return O.createTimeRanges();for(var c=[],d=1;d<u.length;d++){var m=u.end(d-1),f=u.start(d);c.push([m,f])}return O.createTimeRanges(c)}(r),a=0;a<n.length;a++){var s=n.start(a),o=n.end(a);if(t-s<4&&t-s>2)return{start:s,end:o}}return null},e}(),Vg={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Wg=function e(i,r){var t=0,n=0,a=O.mergeOptions(Vg,r);i.ready(function(){i.trigger({type:"usage",name:"vhs-error-reload-initialized"}),i.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){n&&i.currentTime(n)},o=function(d){d!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(d),i.trigger({type:"usage",name:"vhs-error-reload"}),i.trigger({type:"usage",name:"hls-error-reload"}),i.play())},u=function(){return Date.now()-t<1e3*a.errorInterval?(i.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void i.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&typeof a.getSource=="function"?(t=Date.now(),a.getSource.call(i,o)):void O.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},c=function d(){i.off("loadedmetadata",s),i.off("error",u),i.off("dispose",d)};i.on("error",u),i.on("dispose",c),i.reloadSourceOnError=function(d){c(),e(i,d)}},hh="2.16.2",Nt={PlaylistLoader:$n,Playlist:ee,utils:$m,STANDARD_PLAYLIST_SELECTOR:Yd,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,i=this.playlists.master.playlists.filter(ee.isEnabled);return Jn(i,function(r,t){return yo(r,t)}),i.filter(function(r){return!!Mi(e.playlists.master,r).video})[0]||null},lastBandwidthSelector:Yd,movingAverageBandwidthSelector:function(e){var i=-1,r=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var t=this.useDevicePixelRatio&&D.devicePixelRatio||1;return i<0&&(i=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(i=e*this.systemBandwidth+(1-e)*i,r=this.systemBandwidth),Kd(this.playlists.master,i,parseInt(Jr(this.tech_.el(),"width"),10)*t,parseInt(Jr(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:yo,comparePlaylistResolution:function(e,i){var r,t;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||D.Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),r===(t=t||D.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?e.attributes.BANDWIDTH-i.attributes.BANDWIDTH:r-t},xhr:kd()};Object.keys(Ot).forEach(function(e){Object.defineProperty(Nt,e,{get:function(){return O.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Ot[e]},set:function(i){O.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0?O.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Ot[e]=i}})});var ph="videojs-vhs",fh=function(e,i){for(var r=i.media(),t=-1,n=0;n<e.length;n++)if(e[n].id===r.id){t=n;break}e.selectedIndex_=t,e.trigger({selectedIndex:t,type:"change"})};Nt.canPlaySource=function(){return O.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Gg=function(e){var i=e.player,r=e.sourceKeySystems,t=e.audioMedia,n=e.mainPlaylists;if(!i.eme.initializeMediaKeys)return Promise.resolve();var a=function(u,c){return u.reduce(function(d,m){if(!m.contentProtection)return d;var f=c.reduce(function(_,b){var y=m.contentProtection[b];return y&&y.pssh&&(_[b]={pssh:y.pssh}),_},{});return Object.keys(f).length&&d.push(f),d},[])}(t?n.concat([t]):n,Object.keys(r)),s=[],o=[];return a.forEach(function(u){o.push(new Promise(function(c,d){i.tech_.one("keysessioncreated",c)})),s.push(new Promise(function(c,d){i.eme.initializeMediaKeys({keySystems:u},function(m){m?d(m):c()})}))}),Promise.race([Promise.all(s),Promise.race(o)])},zg=function(e){var i=e.player,r=function(t,n,a){if(!t)return t;var s={};n&&n.attributes&&n.attributes.CODECS&&(s=Qr(be(n.attributes.CODECS))),a&&a.attributes&&a.attributes.CODECS&&(s.audio=a.attributes.CODECS);var o=oi(s.video),u=oi(s.audio),c={};for(var d in t)c[d]={},u&&(c[d].audioContentType=u),o&&(c[d].videoContentType=o),n.contentProtection&&n.contentProtection[d]&&n.contentProtection[d].pssh&&(c[d].pssh=n.contentProtection[d].pssh),typeof t[d]=="string"&&(c[d].url=t[d]);return O.mergeOptions(t,c)}(e.sourceKeySystems,e.media,e.audioMedia);return!!r&&(i.currentSource().keySystems=r,!(r&&!i.eme)||(O.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},mh=function(){if(!D.localStorage)return null;var e=D.localStorage.getItem(ph);if(!e)return null;try{return JSON.parse(e)}catch{return null}};Nt.supportsNativeHls=function(){if(!H||!H.createElement)return!1;var e=H.createElement("video");return O.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(e.canPlayType(i))}):!1}(),Nt.supportsNativeDash=!!(H&&H.createElement&&O.getTech("Html5").isSupported())&&/maybe|probably/i.test(H.createElement("video").canPlayType("application/dash+xml")),Nt.supportsTypeNatively=function(e){return e==="hls"?Nt.supportsNativeHls:e==="dash"&&Nt.supportsNativeDash},Nt.isSupported=function(){return O.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Eo=function(e){function i(t,n,a){var s;if(s=e.call(this,n,O.mergeOptions(a.hls,a.vhs))||this,a.hls&&Object.keys(a.hls).length&&O.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof a.initialBandwidth=="number"&&(s.options_.bandwidth=a.initialBandwidth),s.logger_=ye("VhsHandler"),n.options_&&n.options_.playerId){var o=O(n.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return O.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),tt(s)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return O.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),tt(s)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return O.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),tt(s)},configurable:!0}),s.player_=o}if(s.tech_=n,s.source_=t,s.stats={},s.ignoreNextSeekingEvent_=!1,s.setOptions_(),s.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(s.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return s.on(H,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(u){var c=H.fullscreenElement||H.webkitFullscreenElement||H.mozFullScreenElement||H.msFullscreenElement;c&&c.contains(s.tech_.el())?s.masterPlaylistController_.fastQualityChange_():s.masterPlaylistController_.checkABR_()}),s.on(s.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),s.on(s.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),s.on(s.tech_,"play",s.play),s}V(i,e);var r=i.prototype;return r.setOptions_=function(){var t=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=this.source_.useBandwidthFromLocalStorage!==void 0?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=mh();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ot.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ot.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){t.source_[a]!==void 0&&(t.options_[a]=t.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},r.src=function(t,n){var a=this;if(t){var s;this.setOptions_(),this.options_.src=(s=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,this.options_.tech=this.tech_,this.options_.externVhs=Nt,this.options_.sourceType=yu(n),this.options_.seekTo=function(c){a.tech_.setCurrentTime(c)},this.options_.smoothQualityChange&&O.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new jg(this.options_);var o=O.mergeOptions({liveRangeSafeTimeDelta:ke},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Hg(o),this.masterPlaylistController_.on("error",function(){var c=O.players[a.tech_.options_.playerId],d=a.masterPlaylistController_.error;typeof d!="object"||d.code?typeof d=="string"&&(d={message:d,code:3}):d.code=3,c.error(d)});var u=this.options_.experimentalBufferBasedABR?Nt.movingAverageBandwidthSelector(.55):Nt.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):u.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Nt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,d=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection,m=1e7;if(this.options_.useNetworkInformationApi&&d){var f=1e3*d.downlink*1e3;c=f>=m&&c>=m?Math.max(c,f):f}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c,d=1/(this.bandwidth||1);return c=this.throughput>0?1/this.throughput:0,Math.floor(1/(d+c))},set:function(){O.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return fn(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return fn(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&function(c){if(!D.localStorage)return!1;var d=mh();d=d?O.mergeOptions(d,c):c;try{D.localStorage.setItem(ph,JSON.stringify(d))}catch{return!1}}({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var c;(c=a).representations=function(){var d=c.masterPlaylistController_.master(),m=Ni(d)?c.masterPlaylistController_.getAudioTrackPlaylists_():d.playlists;return m?m.filter(function(f){return!ro(f)}).map(function(f,_){return new qg(c,f,f.id)}):[]}}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var t=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Gg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){t.logger_("created EME key session"),t.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){t.logger_("error while creating EME key session",a),t.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var t=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=zg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});this.player_.tech_.on("keystatuschange",function(s){if(s.status==="output-restricted"){var o=t.masterPlaylistController_.master();if(o&&o.playlists){var u,c=[];o.playlists.forEach(function(d){d&&d.attributes&&d.attributes.RESOLUTION&&d.attributes.RESOLUTION.height>=720&&(!d.excludeUntil||d.excludeUntil<1/0)&&(d.excludeUntil=1/0,c.push(d))}),c.length&&((u=O.log).warn.apply(u,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(c)),t.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),O.browser.IE_VERSION!==11&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},r.setupQualityLevels_=function(){var t=this,n=O.players[this.tech_.options_.playerId];n&&n.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var a,s;a=t.qualityLevels_,(s=t).representations().forEach(function(o){a.addQualityLevel(o)}),fh(a,s.playlists)}),this.playlists.on("mediachange",function(){fh(t.qualityLevels_,t.playlists)}))},i.version=function(){return{"@videojs/http-streaming":hh,"mux.js":"6.0.1","mpd-parser":"0.22.1","m3u8-parser":"4.8.0","aes-decrypter":"3.1.3"}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return sh.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(t){this.masterPlaylistController_.setCurrentTime(t)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},r.convertToProgramTime=function(t,n){return Jm({playlist:this.masterPlaylistController_.media(),time:t,callback:n})},r.seekToProgramTime=function(t,n,a,s){return a===void 0&&(a=!0),s===void 0&&(s=2),Zm({programTime:t,playlist:this.masterPlaylistController_.media(),retryCount:s,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},i}(O.getComponent("Component")),Bi={name:"videojs-http-streaming",VERSION:hh,canHandleSource:function(e,i){i===void 0&&(i={});var r=O.mergeOptions(O.options,i);return Bi.canPlayType(e.type,r)},handleSource:function(e,i,r){r===void 0&&(r={});var t=O.mergeOptions(O.options,r);return i.vhs=new Eo(e,i,t),O.hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return O.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),i.vhs},configurable:!0}),i.vhs.xhr=kd(),i.vhs.src(e.src,e.type),i.vhs},canPlayType:function(e,i){var r=yu(e);if(!r)return"";var t=Bi.getOverrideNative(i);return!Nt.supportsTypeNatively(r)||t?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var i=e,r=i.vhs,t=r===void 0?{}:r,n=i.hls,a=n===void 0?{}:n,s=!(O.browser.IS_ANY_SAFARI||O.browser.IS_IOS),o=t.overrideNative,u=o===void 0?s:o,c=a.overrideNative;return c!==void 0&&c||u}};Zi("avc1.4d400d,mp4a.40.2")&&O.getTech("Html5").registerSourceHandler(Bi,0),O.VhsHandler=Eo,Object.defineProperty(O,"HlsHandler",{get:function(){return O.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Eo},configurable:!0}),O.VhsSourceHandler=Bi,Object.defineProperty(O,"HlsSourceHandler",{get:function(){return O.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bi},configurable:!0}),O.Vhs=Nt,Object.defineProperty(O,"Hls",{get:function(){return O.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Nt},configurable:!0}),O.use||(O.registerComponent("Hls",Nt),O.registerComponent("Vhs",Nt)),O.options.vhs=O.options.vhs||{},O.options.hls=O.options.hls||{},O.getPlugin&&O.getPlugin("reloadSourceOnError")||(O.registerPlugin||O.plugin)("reloadSourceOnError",function(e){Wg(this,e)});function wo(e,i){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.indexOf(t)<0&&(r[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)i.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(r[t[n]]=e[t[n]])}return r}var Xg={src:{type:String,onChange:function(e,i){return e.src(i)}},width:{type:Number,onChange:function(e,i){return e.width(i)},onEvent:function(e,i){e.on(["playerresize","resize"],function(){return i(e.width())})}},height:{type:Number,onChange:function(e,i){return e.height(i)},onEvent:function(e,i){e.on(["playerresize","resize"],function(){return i(e.height())})}},preload:{type:String,onChange:function(e,i){return e.preload(i)}},loop:{type:Boolean,onChange:function(e,i){return e.loop(i)}},muted:{type:Boolean,onChange:function(e,i){return e.muted(i)},onEvent:function(e,i){return e.on("volumechange",function(){return i(e.muted())})}},poster:{type:String,onChange:function(e,i){return e.poster(i)},onEvent:function(e,i){return e.on("posterchange",function(){return i(e.poster())})}},controls:{type:Boolean,onChange:function(e,i){return e.controls(i)},onEvent:function(e,i){e.on("controlsenabled",function(){return i(!0)}),e.on("controlsdisabled",function(){return i(!1)})}},autoplay:{type:[Boolean,String],onChange:function(e,i){return e.autoplay(i)}},crossorigin:{type:String,onChange:function(e,i){return e.crossOrigin(i)}},crossOrigin:{type:String,onChange:function(e,i){return e.crossOrigin(i)}},playsinline:{type:Boolean,onChange:function(e,i){return e.playsinline(i)}},playsInline:{type:Boolean,onChange:function(e,i){return e.playsinline(i)}}},Kg={id:{type:String},sources:{type:Array,onChange:function(e,i){return e.src(i)}},tracks:{type:Array,onChange:function(e,i){for(var r=e.remoteTextTracks(),t=(r==null?void 0:r.length)||0;t--;)e.removeRemoteTextTrack(r[t]);e.ready(function(){i.forEach(function(n){return e.addRemoteTextTrack(n,!1)})})}},textTrackSettings:{type:Object,onChange:function(e,i){return e.textTrackSettings.options(i)}},language:{type:String,onChange:function(e,i){return e.language(i)},onEvent:function(e,i){return e.on("languagechange",function(){return i(e.language())})}},languages:{type:Object},playbackRates:{type:Array,onChange:function(e,i){return e.playbackRates(i??[])},onEvent:function(e,i){e.on("playbackrateschange",function(){return i(e.playbackRates())})}},audioOnlyMode:{type:Boolean,onChange:function(e,i){return e.audioOnlyMode(i)}},audioPosterMode:{type:Boolean,onChange:function(e,i){return e.audioPosterMode(i)}},responsive:{type:Boolean,onChange:function(e,i){return e.responsive(i)}},breakpoints:{type:Object,onChange:function(e,i){return e.breakpoints(i)}},fluid:{type:Boolean,onChange:function(e,i){return e.fluid(i)}},fill:{type:Boolean,onChange:function(e,i){return e.fill(i)}},aspectRatio:{type:String,onChange:function(e,i){return e.aspectRatio(i)}},fullscreen:{type:Object},liveui:{type:Boolean},liveTracker:{type:Object},disablePictureInPicture:{type:Boolean,onChange:function(e,i){return e.disablePictureInPicture(i)}},notSupportedMessage:{type:String},normalizeAutoplay:{type:Boolean},noUITitleAttributes:{type:Boolean},preferFullWindow:{type:Boolean},suppressNotSupportedError:{type:Boolean},techCanOverridePoster:{type:Boolean},reportTouchActivity:{type:Boolean},techOrder:{type:Array},inactivityTimeout:{type:Number},userActions:{type:Object},plugins:{type:Object},restoreEl:{type:[Boolean,Object]},"vtt.js":{type:String}},Yg={children:{type:[Array,Object]},controlBar:{type:Object,onChange:function(e,i){return e.controlBar.options(i)}}},Qg={html5:{type:Object}},$g={volume:{type:Number,onChange:function(e,i){return e.volume(i)},onEvent:function(e,i){return e.on("volumechange",function(){return i(e.volume())})}},playbackRate:{type:Number,onChange:function(e,i){e.playbackRate(i),e.defaultPlaybackRate(i)},onEvent:function(e,i){e.on("ratechange",function(){i(e.playbackRate())})}},options:{type:Object}},Fi=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xg),Kg),Yg),Qg),$g),ko=Object.keys(Fi),gh=Object.assign(Object.assign(Object.assign(Object.assign({},{loadstart:"onLoadStart",suspend:"onSuspend",abort:"onAbort",error:"onError",emptied:"onEmptied",stalled:"onStalled",loadedmetadata:"onLoadedMetadata",loadeddata:"onLoadedData",canplay:"onCanPlay",canplaythrough:"onCanPlayThrough",playing:"onPlaying",waiting:"onWaiting",seeking:"onSeeking",seeked:"onSeeked",ended:"onEnded",durationchange:"onDurationChange",timeupdate:"onTimeUpdate",progress:"onProgress",play:"onPlay",pause:"onpause",ratechange:"onRateChange",resize:"onResize",volumechange:"onVolumeChange"}),{posterchange:"onPosterChange",languagechange:"onLanguageChange",fullscreenchange:"onFullscreenChange",playbackrateschange:"onPlaybackRatesChange",controlsdisabled:"onControlsDisabled",controlsenabled:"onControlsEnabled",enterFullWindow:"onEnterFullWindow",exitFullWindow:"onExitFullWindow",enterpictureinpicture:"onEnterPictureInPicture",leavepictureinpicture:"onLeavePictureInPicture",sourceset:"onSourceSet",texttrackchange:"onTextTrackChange",textdata:"onTextData",useractive:"onUserActive",userinactive:"onUserInactive",usingcustomcontrols:"onUsingCustomControls",usingnativecontrols:"onUsingNativeControls",dispose:"onDispose"}),{beforepluginsetup:"onBeforePluginSetup",pluginsetup:"onPluginSetup"}),{componentresize:"onComponentResize",playerresize:"onPlayerResize",ready:"onReady",tap:"onTap"}),vh=Object.keys(gh);Object.values(gh);var Co=function(e){var i,r=e==null?void 0:e.trim().replace(/\s+/g," ");return r&&(i=r.split(" "))!==null&&i!==void 0?i:[]},xo={src:{getter:function(e){return e.src()}},currentSrc:{getter:function(e){return e.currentSrc()}},currentSource:{getter:function(e){return e.currentSource()}},width:{events:["resize","playerresize"],getter:function(e){return e.width()}},height:{events:["resize","playerresize"],getter:function(e){return e.height()}},currentWidth:{events:["resize","playerresize"],getter:function(e){return e.currentWidth()}},currentHeight:{events:["resize","playerresize"],getter:function(e){return e.currentHeight()}},videoWidth:{events:["resize","playerresize"],getter:function(e){return e.videoWidth()}},videoHeight:{events:["resize","playerresize"],getter:function(e){return e.videoHeight()}},controls:{events:["controlsdisabled","controlsenabled"],getter:function(e){return e.controls()}},volume:{events:["volumechange"],getter:function(e){return e.volume()}},muted:{events:["volumechange"],getter:function(e){return e.muted()}},poster:{events:["posterchange"],getter:function(e){return e.poster()}},seeking:{events:["seeking"],getter:function(e){return e.seeking()}},paused:{events:["pause","play","playing"],getter:function(e){return e.paused()}},ended:{events:["ended","play"],getter:function(e){return e.ended()}},currentTime:{events:["timeupdate"],getter:function(e){return e.currentTime()}},duration:{events:["durationchange"],getter:function(e){return e.duration()}},playbackRate:{events:["ratechange"],getter:function(e){return e.playbackRate()}},playbackRates:{events:["playbackrateschange"],getter:function(e){return e.playbackRates()}},isFullscreen:{events:["fullscreenchange"],getter:function(e){return e.isFullscreen()}},isInPictureInPicture:{events:["enterpictureinpicture","leavepictureinpicture"],getter:function(e){return e.isInPictureInPicture()}},isLive:{getter:function(e){var i;return(i=e.liveTracker)===null||i===void 0?void 0:i.isLive()}},language:{events:["languagechange"],getter:function(e){return e.language()}},userActive:{events:["useractive","userinactive"],getter:function(e){return e.userActive()}},readyState:{events:["loadeddata"],getter:function(e){return e.readyState()}},networkState:{events:["loadeddata","error"],getter:function(e){return e.networkState()}},error:{events:["loadeddata","error"],getter:function(e){return e.error()}},buffered:{events:["progress"],getter:function(e){return e.buffered()}},bufferedPercent:{events:["progress"],getter:function(e){return e.bufferedPercent()}},played:{events:["timeupdate"],getter:function(e){return e.played()}},seekable:{events:["progress","seeked"],getter:function(e){return e.seekable()}},audioTracks:{getter:function(e){var i;return(i=e.audioTracks)===null||i===void 0?void 0:i.call(e)}},videoTracks:{getter:function(e){var i;return(i=e.videoTracks)===null||i===void 0?void 0:i.call(e)}},textTracks:{getter:function(e){var i;return(i=e.textTracks)===null||i===void 0?void 0:i.call(e)}}},yh=ko.filter(function(e){return!!Fi[e].onEvent}),_h=function(e){return"update:"+e},Jg=vh.concat(yh.map(_h)),Zg=ko.reduce(function(e,i){var r,t=Fi[i],n=Array.isArray(t.type)?t.type:[t.type],a=Object.assign({},t);return n.includes(Boolean)&&(a.default=void 0),Object.assign(Object.assign({},e),((r={})[i]=a,r))},{}),tv=Zh({name:"VueVideoPlayer",props:Object.assign(Object.assign({},Zg),{class:[String,Object,Array]}),emits:Jg.concat(["mounted"],["unmounted"]),setup:function(e,i){var r=ay(e),t=r.class,n=wo(r,["class"]),a=Vo(!1),s=Vo(null),o=Vo(null),u=tp(function(){return o.value?o.value.player:null}),c=ep(null),d=tp(function(){return c.value?sy(c.value):null});return oy(function(){var m,f=function(_){var b,y=_.props,E=_.element,w=_.className,k=_.onEvent,I=y.options;I===void 0&&(I={});var P=wo(y,["options"]),N={};Object.keys(P).forEach(function(Y){var K=P[Y];K!==void 0&&(N[Y]=K)});var A=Object.assign(Object.assign({},N),I),U=A.volume,B=A.playbackRate,R=wo(A,["volume","playbackRate"]),q=O(E,Object.assign(Object.assign({},R),{playsinline:(b=R.playsinline)!==null&&b!==void 0?b:R.playsInline}),function(){var Y=this;vh.forEach(function(K){Y.on(K,function(Q){k(K,Q)})}),R.src&&!R.sources&&this.src(R.src),U&&Number.isFinite(U)&&this.volume(U),B&&Number.isFinite(B)&&(this.defaultPlaybackRate(B),setTimeout(function(){Y.playbackRate(B)},0))});w&&Co(w).map(function(Y){return q.addClass(Y)});var $=function(Y){var K;(K=q.options)===null||K===void 0||K.call(q,Y??{})};return{player:q,dispose:function(){return q.dispose()},updateClassNames:function(Y,K){Co(Y).map(function(Q){return q.removeClass(Q)}),Co(K).map(function(Q){return q.addClass(Q)})},updateOptions:$,updatePropOption:function(Y,K){var Q,X,nt;$(((Q={})[Y]=K,Q)),(nt=(X=Fi[Y])===null||X===void 0?void 0:X.onChange)===null||nt===void 0||nt.call(X,q,K)}}}({element:s.value,props:n,onEvent:i.emit});m={player:f.player,onEvent:i.emit},yh.forEach(function(_){var b,y;(y=(b=Fi[_])===null||b===void 0?void 0:b.onEvent)===null||y===void 0||y.call(b,m.player,function(E){m.onEvent(_h(_),E)})}),Wo(function(){return e.class},function(_,b){var y=Go(b),E=Go(_);f.updateClassNames(y,E)},{immediate:!0}),Wo(function(){return e.options},function(_){return f.updateOptions(_??{})},{deep:!0}),ko.filter(function(_){return _!=="options"}).forEach(function(_){Wo(function(){return e[_]},function(b){return f.updatePropOption(_,b)},{deep:!0})}),function(_,b){var y=Object.keys(xo),E=y.reduce(function(k,I){var P;return Object.assign(Object.assign({},k),((P={})[I]=xo[I].getter(_),P))},{playing:!1,waiting:!1}),w=function(k,I){E[k]=I,b.onUpdate(k,I,Object.assign({},E))};_.on(["pause","ended"],function(){w("playing",!1)}),_.on(["play","playing"],function(){w("playing",!0)}),_.on("waiting",function(){w("waiting",!0);var k=_.currentTime(),I=function(){k!==_.currentTime()&&(w("waiting",!1),_.off("timeupdate",I))};_.on("timeupdate",I)}),y.forEach(function(k){var I,P=xo[k];_.on(["loadstart","loadedmetadata"].concat((I=P.events)!==null&&I!==void 0?I:[]),function(){w(k,P.getter(_))})}),b.onInit(Object.assign({},E))}(f.player,{onInit:function(_){c.value=_},onUpdate:function(_,b){c.value&&(c.value[_]=b)}}),o.value=f,a.value=!0,i.emit("mounted",{video:s.value,player:u.value,state:d.value})}),uy(function(){o.value&&(o.value.dispose(),o.value=null,c.value=null,i.emit("unmounted"))}),function(){var m,f;return np("div",{"data-vjs-player":"",class:Go(t)},[np("video",{class:["video-js","v-video-player"],ref:s}),a.value&&((f=(m=i.slots).default)===null||f===void 0?void 0:f.call(m,{video:s.value,player:u.value,state:d.value}))])}}}),ev=tv;let bh;bh=rp("p",{class:"text-sm"},"\u70B9\u51FB\u64AD\u653E\u89C6\u9891",-1),sp=gy(Zh({name:"WxVideoPlayer",__name:"main",props:{url:{type:String,required:!0}},setup(e){const i=e,r=ep(!1);return(t,n)=>{const a=fy,s=my;return ip(),ly("div",{onClick:n[1]||(n[1]=o=>{r.value=!0})},[rp("div",null,[ap(a,{icon:"ep:video-play",size:32,class:"mr-5px"}),bh]),ap(s,{modelValue:zo(r),"onUpdate:modelValue":n[0]||(n[0]=o=>py(r)?r.value=o:null),title:"\u89C6\u9891\u64AD\u653E","append-to-body":""},{default:cy(()=>[zo(r)?(ip(),dy(zo(ev),{key:0,class:"video-player vjs-big-play-centered",src:i.url,poster:"",crossorigin:"anonymous",controls:"",playsinline:"",volume:.6,width:800,"playback-rates":[.7,1,1.5,2]},null,8,["src"])):hy("",!0)]),_:1},8,["modelValue"])])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mp/components/wx-video-play/main.vue"]])});export{yy as __tla,sp as default};
|