import{X as Mn,a3 as dd,z as Hp,r as qp,V as jp,U as Gp,a0 as Wp,o as zp,c as $p,l as Mu,J as Kp,_ as Xp}from"./index.afd881ee.js";var _i;typeof window<"u"?_i=window:typeof Mn<"u"?_i=Mn:typeof self<"u"?_i=self:_i={};var A=_i;const Yp=new Proxy({},{get(a,t){throw new Error(`Module "" has been externalized for browser compatibility. Cannot access ".${t}" in client code.`)}}),Qp=Object.freeze(Object.defineProperty({__proto__:null,default:Yp},Symbol.toStringTag,{value:"Module"})),Jp=dd(Qp);var Nu=typeof Mn<"u"?Mn:typeof window<"u"?window:{},Zp=Jp,Ti;typeof document<"u"?Ti=document:(Ti=Nu["__GLOBAL_DOCUMENT_CACHE@4"],Ti||(Ti=Nu["__GLOBAL_DOCUMENT_CACHE@4"]=Zp));var G=Ti;function ot(){return ot=Object.assign?Object.assign.bind():function(a){for(var t=1;t=400&&e.statusCode<=599){var s=i;if(r)if(om.TextDecoder){var o=lm(e.headers&&e.headers["content-type"]);try{s=new TextDecoder(o).decode(i)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(i));t({cause:s});return}t(null,i)}};function lm(a){return a===void 0&&(a=""),a.toLowerCase().split(";").reduce(function(t,r){var n=r.split("="),e=n[0],i=n[1];return e.trim()==="charset"?i.trim():t},"utf-8")}var dm=um,cd=A,cm=im,fm=nm;xt.httpHandler=dm;/** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * */var hm=function(t){var r={};return t&&t.trim().split(` `).forEach(function(n){var e=n.indexOf(":"),i=n.slice(0,e).trim().toLowerCase(),s=n.slice(e+1).trim();typeof r[i]>"u"?r[i]=s:Array.isArray(r[i])?r[i].push(s):r[i]=[r[i],s]}),r};oa.exports=xt;oa.exports.default=xt;xt.XMLHttpRequest=cd.XMLHttpRequest||vm;xt.XDomainRequest="withCredentials"in new xt.XMLHttpRequest?xt.XMLHttpRequest:cd.XDomainRequest;pm(["get","put","post","patch","head","delete"],function(a){xt[a==="delete"?"del":a]=function(t,r,n){return r=fd(t,r,n),r.method=a.toUpperCase(),hd(r)}});function pm(a,t){for(var r=0;r"u")throw new Error("callback argument missing");var t=!1,r=function(H,L,F){t||(t=!0,a.callback(H,L,F))};function n(){o.readyState===4&&setTimeout(s,0)}function e(){var O=void 0;if(o.response?O=o.response:O=o.responseText||gm(o),S)try{O=JSON.parse(O)}catch{}return O}function i(O){return clearTimeout(x),O instanceof Error||(O=new Error(""+(O||"Unknown XMLHttpRequest Error"))),O.statusCode=0,r(O,w)}function s(){if(!l){var O;clearTimeout(x),a.useXDR&&o.status===void 0?O=200:O=o.status===1223?204:o.status;var H=w,L=null;return O!==0?(H={body:e(),statusCode:O,method:g,headers:{},url:c,rawRequest:o},o.getAllResponseHeaders&&(H.headers=hm(o.getAllResponseHeaders()))):L=new Error("Internal XMLHttpRequest Error"),r(L,H,H.body)}}var o=a.xhr||null;o||(a.cors||a.useXDR?o=new xt.XDomainRequest:o=new xt.XMLHttpRequest);var u,l,c=o.url=a.uri||a.url,g=o.method=a.method||"GET",m=a.body||a.data,_=o.headers=a.headers||{},b=!!a.sync,S=!1,x,w={body:void 0,headers:{},statusCode:0,method:g,url:c,rawRequest:o};if("json"in a&&a.json!==!1&&(S=!0,_.accept||_.Accept||(_.Accept="application/json"),g!=="GET"&&g!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),m=JSON.stringify(a.json===!0?m:a.json))),o.onreadystatechange=n,o.onload=s,o.onerror=i,o.onprogress=function(){},o.onabort=function(){l=!0},o.ontimeout=i,o.open(g,c,!b,a.username,a.password),b||(o.withCredentials=!!a.withCredentials),!b&&a.timeout>0&&(x=setTimeout(function(){if(!l){l=!0,o.abort("timeout");var O=new Error("XMLHttpRequest timeout");O.code="ETIMEDOUT",i(O)}},a.timeout)),o.setRequestHeader)for(u in _)_.hasOwnProperty(u)&&o.setRequestHeader(u,_[u]);else if(a.headers&&!mm(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(o.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(o),o.send(m||null),o}function gm(a){try{if(a.responseType==="document")return a.responseXML;var t=a.responseXML&&a.responseXML.documentElement.nodeName==="parsererror";if(a.responseType===""&&!t)return a.responseXML}catch{}return null}function vm(){}var ps={exports:{}},Bu=G,Gs=Object.create||function(){function a(){}return function(t){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=t,new a}}();function rt(a,t){this.name="ParsingError",this.code=a.code,this.message=t||a.message}rt.prototype=Gs(Error.prototype);rt.prototype.constructor=rt;rt.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Ws(a){function t(n,e,i,s){return(n|0)*3600+(e|0)*60+(i|0)+(s|0)/1e3}var r=a.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return r?r[3]?t(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?t(r[1],r[2],0,r[4]):t(0,r[1],r[2],r[4]):null}function Ci(){this.values=Gs(null)}Ci.prototype={set:function(a,t){!this.get(a)&&t!==""&&(this.values[a]=t)},get:function(a,t,r){return r?this.has(a)?this.values[a]:t[r]:this.has(a)?this.values[a]:t},has:function(a){return a in this.values},alt:function(a,t,r){for(var n=0;n=0&&t<=100)?(this.set(a,t),!0):!1}};function bi(a,t,r,n){var e=n?a.split(n):[a];for(var i in e)if(typeof e[i]=="string"){var s=e[i].split(r);if(s.length===2){var o=s[0].trim(),u=s[1].trim();t(o,u)}}}function ym(a,t,r){var n=a;function e(){var o=Ws(a);if(o===null)throw new rt(rt.Errors.BadTimeStamp,"Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function i(o,u){var l=new Ci;bi(o,function(c,g){switch(c){case"region":for(var m=r.length-1;m>=0;m--)if(r[m].id===g){l.set(c,r[m].region);break}break;case"vertical":l.alt(c,g,["rl","lr"]);break;case"line":var _=g.split(","),b=_[0];l.integer(c,b),l.percent(c,b)&&l.set("snapToLines",!1),l.alt(c,b,["auto"]),_.length===2&&l.alt("lineAlign",_[1],["start","center","end"]);break;case"position":_=g.split(","),l.percent(c,_[0]),_.length===2&&l.alt("positionAlign",_[1],["start","center","end"]);break;case"size":l.percent(c,g);break;case"align":l.alt(c,g,["start","center","end","left","right"]);break}},/:/,/\s/),u.region=l.get("region",null),u.vertical=l.get("vertical","");try{u.line=l.get("line","auto")}catch{}u.lineAlign=l.get("lineAlign","start"),u.snapToLines=l.get("snapToLines",!0),u.size=l.get("size",100);try{u.align=l.get("align","center")}catch{u.align=l.get("align","middle")}try{u.position=l.get("position","auto")}catch{u.position=l.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},u.align)}u.positionAlign=l.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},u.align)}function s(){a=a.replace(/^\s+/,"")}if(s(),t.startTime=e(),s(),a.substr(0,3)!=="-->")throw new rt(rt.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.substr(3),s(),t.endTime=e(),s(),i(a,t)}var Ga=Bu.createElement&&Bu.createElement("textarea"),_m={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Uu={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)"},Tm={v:"title",lang:"lang"},Vu={rt:"ruby"};function pd(a,t){function r(){if(!t)return null;function b(x){return t=t.substr(x.length),x}var S=t.match(/^([^<]*)(<[^>]*>?)?/);return b(S[1]?S[1]:S[2])}function n(b){return Ga.innerHTML=b,b=Ga.textContent,Ga.textContent="",b}function e(b,S){return!Vu[S.localName]||Vu[S.localName]===b.localName}function i(b,S){var x=_m[b];if(!x)return null;var w=a.document.createElement(x),O=Tm[b];return O&&S&&(w[O]=S.trim()),w}for(var s=a.document.createElement("div"),o=s,u,l=[];(u=r())!==null;){if(u[0]==="<"){if(u[1]==="/"){l.length&&l[l.length-1]===u.substr(2).replace(">","")&&(l.pop(),o=o.parentNode);continue}var c=Ws(u.substr(1,u.length-2)),g;if(c){g=a.document.createProcessingInstruction("timestamp",c),o.appendChild(g);continue}var m=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!m||(g=i(m[1],m[3]),!g)||!e(o,g))continue;if(m[2]){var _=m[2].split(".");_.forEach(function(b){var S=/^bg_/.test(b),x=S?b.slice(3):b;if(Uu.hasOwnProperty(x)){var w=S?"background-color":"color",O=Uu[x];g.style[w]=O}}),g.className=_.join(" ")}l.push(m[1]),o.appendChild(g),o=g;continue}o.appendChild(a.document.createTextNode(n(u)))}return s}var Hu=[[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 bm(a){for(var t=0;t=r[0]&&a<=r[1])return!0}return!1}function xm(a){var t=[],r="",n;if(!a||!a.childNodes)return"ltr";function e(o,u){for(var l=u.childNodes.length-1;l>=0;l--)o.push(u.childNodes[l])}function i(o){if(!o||!o.length)return null;var u=o.pop(),l=u.textContent||u.innerText;if(l){var c=l.match(/^.*(\n|\r)/);return c?(o.length=0,c[0]):l}if(u.tagName==="ruby")return i(o);if(u.childNodes)return e(o,u),i(o)}for(e(t,a);r=i(t);)for(var s=0;s=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var t=a.track,r=t.textTrackList,n=0,e=0;ea.left&&this.topa.top};je.prototype.overlapsAny=function(a){for(var t=0;t=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right};je.prototype.overlapsOppositeAxis=function(a,t){switch(t){case"+x":return this.lefta.right;case"+y":return this.topa.bottom}};je.prototype.intersectPercentage=function(a){var t=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),r=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),n=t*r;return n/(this.height*this.width)};je.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}};je.getSimpleBoxPosition=function(a){var t=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,r=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,n=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||n,height:a.height||t,bottom:a.bottom||n+(a.height||t),width:a.width||r};return e};function Em(a,t,r,n){function e(x,w){for(var O,H=new je(x),L=1,F=0;Fq&&(O=new je(x),L=q),x=new je(H)}return O||H}var i=new je(t),s=t.cue,o=Sm(s),u=[];if(s.snapToLines){var l;switch(s.vertical){case"":u=["+y","-y"],l="height";break;case"rl":u=["+x","-x"],l="width";break;case"lr":u=["-x","+x"],l="width";break}var c=i.lineHeight,g=c*Math.round(o),m=r[l]+c,_=u[0];Math.abs(g)>m&&(g=g<0?-1:1,g*=Math.ceil(m/c)*c),o<0&&(g+=s.vertical===""?r.height:r.width,u=u.reverse()),i.move(_,g)}else{var b=i.lineHeight/r.height*100;switch(s.lineAlign){case"center":o-=b/2;break;case"end":o-=b;break}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"],i=new je(t)}var S=e(i,u);t.move(S.toCSSCompatValues(r))}function Xr(){}Xr.StringDecoder=function(){return{decode:function(a){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}};Xr.convertCueToDOMTree=function(a,t){return!a||!t?null:pd(a,t)};var Cm=.05,Am="sans-serif",Dm="1.5%";Xr.processCues=function(a,t,r){if(!a||!t||!r)return null;for(;r.firstChild;)r.removeChild(r.firstChild);var n=a.document.createElement("div");n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=Dm,r.appendChild(n);function e(c){for(var g=0;g")===-1){t.cue.id=s;continue}case"CUE":try{ym(s,t.cue,t.regionList)}catch(c){t.reportOrThrowError(c),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var l=s.indexOf("-->")!==-1;if(!s||l&&(u=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+=` `),t.cue.text+=s.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":s||(t.state="ID");continue}}}catch(c){t.reportOrThrowError(c),t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||a.state==="HEADER")&&(a.buffer+=` `,a.parse()),a.state==="INITIAL")throw new rt(rt.Errors.BadSignature)}catch(t){a.reportOrThrowError(t)}return a.onflush&&a.onflush(),this}};var wm=Xr,km="auto",Pm={"":1,lr:1,rl:1},Im={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Om(a){if(typeof a!="string")return!1;var t=Pm[a.toLowerCase()];return t?a.toLowerCase():!1}function Wa(a){if(typeof a!="string")return!1;var t=Im[a.toLowerCase()];return t?a.toLowerCase():!1}function md(a,t,r){this.hasBeenReset=!1;var n="",e=!1,i=a,s=t,o=r,u=null,l="",c=!0,g="auto",m="start",_="auto",b="auto",S=100,x="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(w){n=""+w}},pauseOnExit:{enumerable:!0,get:function(){return e},set:function(w){e=!!w}},startTime:{enumerable:!0,get:function(){return i},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");i=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 l},set:function(w){var O=Om(w);if(O===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=O,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(w){c=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return g},set:function(w){if(typeof w!="number"&&w!==km)throw new SyntaxError("Line: an invalid number or illegal string was specified.");g=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(w){var O=Wa(w);O?(m=O,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 O=Wa(w);O?(b=O,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return S},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");S=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return x},set:function(w){var O=Wa(w);if(!O)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");x=O,this.hasBeenReset=!0}}}),this.displayState=void 0}md.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Lm=md,Fm={"":!0,up:!0};function Rm(a){if(typeof a!="string")return!1;var t=Fm[a.toLowerCase()];return t?a.toLowerCase():!1}function fi(a){return typeof a=="number"&&a>=0&&a<=100}function Mm(){var a=100,t=3,r=0,n=100,e=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(o){if(!fi(o))throw new Error("Width must be between 0 and 100.");a=o}},lines:{enumerable:!0,get:function(){return t},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");t=o}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!fi(o))throw new Error("RegionAnchorX must be between 0 and 100.");n=o}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!fi(o))throw new Error("RegionAnchorY must be between 0 and 100.");r=o}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(o){if(!fi(o))throw new Error("ViewportAnchorY must be between 0 and 100.");i=o}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(o){if(!fi(o))throw new Error("ViewportAnchorX must be between 0 and 100.");e=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=Rm(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})}var Nm=Mm,Mt=A,pr=ps.exports={WebVTT:wm,VTTCue:Lm,VTTRegion:Nm};Mt.vttjs=pr;Mt.WebVTT=pr.WebVTT;var Bm=pr.VTTCue,Um=pr.VTTRegion,Vm=Mt.VTTCue,Hm=Mt.VTTRegion;pr.shim=function(){Mt.VTTCue=Bm,Mt.VTTRegion=Um};pr.restore=function(){Mt.VTTCue=Vm,Mt.VTTRegion=Hm};Mt.VTTCue||pr.shim();function qm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ai(a,t,r){return qm()?Ai=Reflect.construct.bind():Ai=function(e,i,s){var o=[null];o.push.apply(o,i);var u=Function.bind.apply(e,o),l=new u;return s&&Nr(l,s.prototype),l},Ai.apply(null,arguments)}function jm(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),t&&Nr(a,t)}var gd={exports:{}};(function(a,t){(function(r){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,e=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(u,l,c){if(c=c||{},u=u.trim(),l=l.trim(),!l){if(!c.alwaysNormalize)return u;var g=o.parseURL(u);if(!g)throw new Error("Error trying to parse base URL.");return g.path=o.normalizePath(g.path),o.buildURLFromParts(g)}var m=o.parseURL(l);if(!m)throw new Error("Error trying to parse relative URL.");if(m.scheme)return c.alwaysNormalize?(m.path=o.normalizePath(m.path),o.buildURLFromParts(m)):l;var _=o.parseURL(u);if(!_)throw new Error("Error trying to parse base URL.");if(!_.netLoc&&_.path&&_.path[0]!=="/"){var b=e.exec(_.path);_.netLoc=b[1],_.path=b[2]}_.netLoc&&!_.path&&(_.path="/");var S={scheme:_.scheme,netLoc:m.netLoc,path:null,params:m.params,query:m.query,fragment:m.fragment};if(!m.netLoc&&(S.netLoc=_.netLoc,m.path[0]!=="/"))if(!m.path)S.path=_.path,m.params||(S.params=_.params,m.query||(S.query=_.query));else{var x=_.path,w=x.substring(0,x.lastIndexOf("/")+1)+m.path;S.path=o.normalizePath(w)}return S.path===null&&(S.path=c.alwaysNormalize?o.normalizePath(m.path):m.path),o.buildURLFromParts(S)},parseURL:function(u){var l=n.exec(u);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(i,"");u.length!==(u=u.replace(s,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};a.exports=o})()})(gd);const qu=gd.exports;var ju="http://example.com",la=function(t,r){if(/^[a-z]+:/i.test(r))return r;/^data:/.test(t)&&(t=A.location&&A.location.href||"");var n=typeof A.URL=="function",e=/^\/\//.test(t),i=!A.location&&!/\/\//i.test(t);if(n?t=new A.URL(t,A.location||ju):/\/\//i.test(t)||(t=qu.buildAbsoluteURL(A.location&&A.location.href||"",t)),n){var s=new URL(r,t);return i?s.href.slice(ju.length):e?s.href.slice(s.protocol.length):s.href}return qu.buildAbsoluteURL(t,r)},zs=function(){function a(){this.listeners={}}var t=a.prototype;return t.on=function(n,e){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(e)},t.off=function(n,e){if(!this.listeners[n])return!1;var i=this.listeners[n].indexOf(e);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(i,1),i>-1},t.trigger=function(n){var e=this.listeners[n];if(!!e)if(arguments.length===2)for(var i=e.length,s=0;s-1;i=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)},t}(zs),zm=String.fromCharCode(9),za=function(t){var r=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),n={};return r[1]&&(n.length=parseInt(r[1],10)),r[2]&&(n.offset=parseInt(r[2],10)),n},$m=function(){var t="[^=]*",r='"[^"]*"|[^,]*',n="(?:"+t+")=(?:"+r+")";return new RegExp("(?:^|,)("+n+")")},lt=function(t){for(var r=t.split($m()),n={},e=r.length,i;e--;)r[e]!==""&&(i=/([^=]*)=(.*)/.exec(r[e]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),n[i[0]]=i[1]);return n},Km=function(a){W(t,a);function t(){var n;return n=a.call(this)||this,n.customParsers=[],n.tagMappers=[],n}var r=t.prototype;return r.push=function(e){var i=this,s,o;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}var u=this.tagMappers.reduce(function(l,c){var g=c(e);return g===e?l:l.concat([g])},[e]);u.forEach(function(l){for(var c=0;c0&&(s.duration=x.duration),x.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key:function(){if(!x.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(x.attributes.METHOD==="NONE"){u=null;return}if(!x.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(x.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:x.attributes};return}if(x.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:x.attributes.URI};return}if(x.attributes.KEYFORMAT===m){var F=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(F.indexOf(x.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(x.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),x.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(x.attributes.KEYID&&x.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:x.attributes.KEYFORMAT,keyId:x.attributes.KEYID.substring(2)},pssh:vd(x.attributes.URI.split(",")[1])};return}x.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:x.attributes.METHOD||"AES-128",uri:x.attributes.URI},typeof x.attributes.IV<"u"&&(u.iv=x.attributes.IV)},"media-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+x.number});return}this.manifest.mediaSequence=x.number},"discontinuity-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+x.number});return}this.manifest.discontinuitySequence=x.number,_=x.number},"playlist-type":function(){if(!/VOD|EVENT/.test(x.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+x.playlist});return}this.manifest.playlistType=x.playlistType},map:function(){o={},x.uri&&(o.uri=x.uri),x.byterange&&(o.byterange=x.byterange),u&&(o.key=u)},"stream-inf":function(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||g,!x.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),ot(s.attributes,x.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||g,!(x.attributes&&x.attributes.TYPE&&x.attributes["GROUP-ID"]&&x.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var F=this.manifest.mediaGroups[x.attributes.TYPE];F[x.attributes["GROUP-ID"]]=F[x.attributes["GROUP-ID"]]||{},w=F[x.attributes["GROUP-ID"]],O={default:/yes/i.test(x.attributes.DEFAULT)},O.default?O.autoselect=!0:O.autoselect=/yes/i.test(x.attributes.AUTOSELECT),x.attributes.LANGUAGE&&(O.language=x.attributes.LANGUAGE),x.attributes.URI&&(O.uri=x.attributes.URI),x.attributes["INSTREAM-ID"]&&(O.instreamId=x.attributes["INSTREAM-ID"]),x.attributes.CHARACTERISTICS&&(O.characteristics=x.attributes.CHARACTERISTICS),x.attributes.FORCED&&(O.forced=/yes/i.test(x.attributes.FORCED)),w[x.attributes.NAME]=O},discontinuity:function(){_+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=x.dateTimeString,this.manifest.dateTimeObject=x.dateTimeObject),s.dateTimeString=x.dateTimeString,s.dateTimeObject=x.dateTimeObject},targetduration:function(){if(!isFinite(x.duration)||x.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+x.duration});return}this.manifest.targetDuration=x.duration,$a.call(this,this.manifest)},start:function(){if(!x.attributes||isNaN(x.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:x.attributes["TIME-OFFSET"],precise:x.attributes.PRECISE}},"cue-out":function(){s.cueOut=x.data},"cue-out-cont":function(){s.cueOutCont=x.data},"cue-in":function(){s.cueIn=x.data},skip:function(){this.manifest.skip=xr(x.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",x.attributes,["SKIPPED-SEGMENTS"])},part:function(){var F=this;l=!0;var q=this.manifest.segments.length,B=xr(x.attributes);s.parts=s.parts||[],s.parts.push(B),B.byterange&&(B.byterange.hasOwnProperty("offset")||(B.byterange.offset=S),S=B.byterange.offset+B.byterange.length);var R=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+R+" for segment #"+q,x.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(U,N){U.hasOwnProperty("lastPart")||F.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+N+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var F=this.manifest.serverControl=xr(x.attributes);F.hasOwnProperty("canBlockReload")||(F.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),$a.call(this,this.manifest),F.canSkipDateranges&&!F.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 F=this.manifest.segments.length,q=xr(x.attributes),B=q.type&&q.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(q),q.byterange&&(q.byterange.hasOwnProperty("offset")||(q.byterange.offset=B?S:0,B&&(S=q.byterange.offset+q.byterange.length)));var R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+R+" for segment #"+F,x.attributes,["TYPE","URI"]),!!q.type)for(var U=0;Ug&&(c-=g,c-=g,c-=Le(2))}return Number(c)},og=function(t,r){var n=r===void 0?{}:r,e=n.le,i=e===void 0?!1:e;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!==t)&&(t=0),t=Le(t);for(var s=ng(t),o=new Uint8Array(new ArrayBuffer(s)),u=0;u=r.length&&l.call(r,function(c,g){var m=u[g]?u[g]&t[s+g]:t[s+g];return c===m})},lg=function(t,r,n){r.forEach(function(e){for(var i in t.mediaGroups[e])for(var s in t.mediaGroups[e][i]){var o=t.mediaGroups[e][i][s];n(o,e,i,s)}})},Qt={},Ht={};function dg(a,t,r){if(r===void 0&&(r=Array.prototype),a&&typeof r.find=="function")return r.find.call(a,t);for(var n=0;n=0){for(var e=t.length-1;n0},lookupPrefix:function(a){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===a)return n}t=t.nodeType==Br?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(a){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a];t=t.nodeType==Br?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(a){var t=this.lookupPrefix(a);return t==null}};function Rd(a){return a=="<"&&"<"||a==">"&&">"||a=="&"&&"&"||a=='"'&&"""||"&#"+a.charCodeAt()+";"}Vi(Je,ce);Vi(Je,ce.prototype);function Oi(a,t){if(t(a))return!0;if(a=a.firstChild)do if(Oi(a,t))return!0;while(a=a.nextSibling)}function Hi(){this.ownerDocument=this}function yg(a,t,r){a&&a._inc++;var n=r.namespaceURI;n===Ii.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function Md(a,t,r,n){a&&a._inc++;var e=r.namespaceURI;e===Ii.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Xs(a,t,r){if(a&&a._inc){a._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var e=t.firstChild,i=0;e;)n[i++]=e,e=e.nextSibling;n.length=i,delete n[n.length]}}}function Nd(a,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:a.firstChild=n,n?n.previousSibling=r:a.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Xs(a.ownerDocument,a),t}function _g(a){return a&&(a.nodeType===ce.DOCUMENT_NODE||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.ELEMENT_NODE)}function Tg(a){return a&&(Et(a)||Ys(a)||Bt(a)||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.COMMENT_NODE||a.nodeType===ce.PROCESSING_INSTRUCTION_NODE)}function Bt(a){return a&&a.nodeType===ce.DOCUMENT_TYPE_NODE}function Et(a){return a&&a.nodeType===ce.ELEMENT_NODE}function Ys(a){return a&&a.nodeType===ce.TEXT_NODE}function Yu(a,t){var r=a.childNodes||[];if(St(r,Et)||Bt(t))return!1;var n=St(r,Bt);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Qu(a,t){var r=a.childNodes||[];function n(i){return Et(i)&&i!==t}if(St(r,n))return!1;var e=St(r,Bt);return!(t&&e&&r.indexOf(e)>r.indexOf(t))}function bg(a,t,r){if(!_g(a))throw new Ce(Xe,"Unexpected parent node type "+a.nodeType);if(r&&r.parentNode!==a)throw new Ce(Od,"child not in parent");if(!Tg(t)||Bt(t)&&a.nodeType!==ce.DOCUMENT_NODE)throw new Ce(Xe,"Unexpected node type "+t.nodeType+" for parent node type "+a.nodeType)}function xg(a,t,r){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===ce.DOCUMENT_FRAGMENT_NODE){var i=e.filter(Et);if(i.length>1||St(e,Ys))throw new Ce(Xe,"More than one element or text in fragment");if(i.length===1&&!Yu(a,r))throw new Ce(Xe,"Element in fragment can not be inserted before doctype")}if(Et(t)&&!Yu(a,r))throw new Ce(Xe,"Only one element can be added and only after doctype");if(Bt(t)){if(St(n,Bt))throw new Ce(Xe,"Only one doctype is allowed");var s=St(n,Et);if(r&&n.indexOf(s)1||St(e,Ys))throw new Ce(Xe,"More than one element or text in fragment");if(i.length===1&&!Qu(a,r))throw new Ce(Xe,"Element in fragment can not be inserted before doctype")}if(Et(t)&&!Qu(a,r))throw new Ce(Xe,"Only one element can be added and only after doctype");if(Bt(t)){if(St(n,function(u){return Bt(u)&&u!==r}))throw new Ce(Xe,"Only one doctype is allowed");var s=St(n,Et);if(r&&n.indexOf(s)0&&Oi(r.documentElement,function(e){if(e!==r&&e.nodeType===ct){var i=e.getAttribute("class");if(i){var s=a===i;if(!s){var o=zu(i);s=t.every(mg(o))}s&&n.push(e)}}}),n})},createElement:function(a){var t=new hr;t.ownerDocument=this,t.nodeName=a,t.tagName=a,t.localName=a,t.childNodes=new Lt;var r=t.attributes=new Un;return r._ownerElement=t,t},createDocumentFragment:function(){var a=new ca;return a.ownerDocument=this,a.childNodes=new Lt,a},createTextNode:function(a){var t=new Qs;return t.ownerDocument=this,t.appendData(a),t},createComment:function(a){var t=new Js;return t.ownerDocument=this,t.appendData(a),t},createCDATASection:function(a){var t=new Zs;return t.ownerDocument=this,t.appendData(a),t},createProcessingInstruction:function(a,t){var r=new to;return r.ownerDocument=this,r.tagName=r.target=a,r.nodeValue=r.data=t,r},createAttribute:function(a){var t=new Hn;return t.ownerDocument=this,t.name=a,t.nodeName=a,t.localName=a,t.specified=!0,t},createEntityReference:function(a){var t=new eo;return t.ownerDocument=this,t.nodeName=a,t},createElementNS:function(a,t){var r=new hr,n=t.split(":"),e=r.attributes=new Un;return r.childNodes=new Lt,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=a,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,e._ownerElement=r,r},createAttributeNS:function(a,t){var r=new Hn,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=a,r.specified=!0,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}};Qe(Hi,ce);function hr(){this._nsMap={}}hr.prototype={nodeType:ct,hasAttribute:function(a){return this.getAttributeNode(a)!=null},getAttribute:function(a){var t=this.getAttributeNode(a);return t&&t.value||""},getAttributeNode:function(a){return this.attributes.getNamedItem(a)},setAttribute:function(a,t){var r=this.ownerDocument.createAttribute(a);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(a){var t=this.getAttributeNode(a);t&&this.removeAttributeNode(t)},appendChild:function(a){return a.nodeType===Nt?this.insertBefore(a,null):Sg(this,a)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(a,t){return this.getAttributeNodeNS(a,t)!=null},getAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);return r&&r.value||""},setAttributeNS:function(a,t,r){var n=this.ownerDocument.createAttributeNS(a,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(a,t){return this.attributes.getNamedItemNS(a,t)},getElementsByTagName:function(a){return new Ur(this,function(t){var r=[];return Oi(t,function(n){n!==t&&n.nodeType==ct&&(a==="*"||n.tagName==a)&&r.push(n)}),r})},getElementsByTagNameNS:function(a,t){return new Ur(this,function(r){var n=[];return Oi(r,function(e){e!==r&&e.nodeType===ct&&(a==="*"||e.namespaceURI===a)&&(t==="*"||e.localName==t)&&n.push(e)}),n})}};Hi.prototype.getElementsByTagName=hr.prototype.getElementsByTagName;Hi.prototype.getElementsByTagNameNS=hr.prototype.getElementsByTagNameNS;Qe(hr,ce);function Hn(){}Hn.prototype.nodeType=Br;Qe(Hn,ce);function qi(){}qi.prototype={data:"",substringData:function(a,t){return this.data.substring(a,a+t)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,t){this.replaceData(a,0,t)},appendChild:function(a){throw new Error(Pe[Xe])},deleteData:function(a,t){this.replaceData(a,t,"")},replaceData:function(a,t,r){var n=this.data.substring(0,a),e=this.data.substring(a+t);r=n+r+e,this.nodeValue=this.data=r,this.length=r.length}};Qe(qi,ce);function Qs(){}Qs.prototype={nodeName:"#text",nodeType:Bn,splitText:function(a){var t=this.data,r=t.substring(a);t=t.substring(0,a),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};Qe(Qs,qi);function Js(){}Js.prototype={nodeName:"#comment",nodeType:kd};Qe(Js,qi);function Zs(){}Zs.prototype={nodeName:"#cdata-section",nodeType:Ad};Qe(Zs,qi);function da(){}da.prototype.nodeType=Id;Qe(da,ce);function Ud(){}Ud.prototype.nodeType=vg;Qe(Ud,ce);function Vd(){}Vd.prototype.nodeType=gg;Qe(Vd,ce);function eo(){}eo.prototype.nodeType=Dd;Qe(eo,ce);function ca(){}ca.prototype.nodeName="#document-fragment";ca.prototype.nodeType=Nt;Qe(ca,ce);function to(){}to.prototype.nodeType=wd;Qe(to,ce);function Hd(){}Hd.prototype.serializeToString=function(a,t,r){return qd.call(a,t,r)};ce.prototype.toString=qd;function qd(a,t){var r=[],n=this.nodeType==9&&this.documentElement||this,e=n.prefix,i=n.namespaceURI;if(i&&e==null){var e=n.lookupPrefix(i);if(e==null)var s=[{namespace:i,prefix:null}]}return Pr(this,r,a,t,s),r.join("")}function Ju(a,t,r){var n=a.prefix||"",e=a.namespaceURI;if(!e||n==="xml"&&e===Ii.XML||e===Ii.XMLNS)return!1;for(var i=r.length;i--;){var s=r[i];if(s.prefix===n)return s.namespace!==e}return!0}function Xa(a,t,r){a.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Rd),'"')}function Pr(a,t,r,n,e){if(e||(e=[]),n)if(a=n(a),a){if(typeof a=="string"){t.push(a);return}}else return;switch(a.nodeType){case ct:var i=a.attributes,s=i.length,w=a.firstChild,o=a.tagName;r=Ii.isHTML(a.namespaceURI)||r;var u=o;if(!r&&!a.prefix&&a.namespaceURI){for(var l,c=0;c=0;g--){var m=e[g];if(m.prefix===""&&m.namespace===a.namespaceURI){l=m.namespace;break}}if(l!==a.namespaceURI)for(var g=e.length-1;g>=0;g--){var m=e[g];if(m.namespace===a.namespaceURI){m.prefix&&(u=m.prefix+":"+o);break}}}t.push("<",u);for(var _=0;_"),r&&/^script$/i.test(o))for(;w;)w.data?t.push(w.data):Pr(w,t,r,n,e.slice()),w=w.nextSibling;else for(;w;)Pr(w,t,r,n,e.slice()),w=w.nextSibling;t.push("")}else t.push("/>");return;case Pd:case Nt:for(var w=a.firstChild;w;)Pr(w,t,r,n,e.slice()),w=w.nextSibling;return;case Br:return Xa(t,a.name,a.value);case Bn:return t.push(a.data.replace(/[<&>]/g,Rd));case Ad:return t.push("");case kd:return t.push("");case Id:var O=a.publicId,H=a.systemId;if(t.push("");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var L=a.internalSubset;L&&t.push(" [",L,"]"),t.push(">")}return;case wd:return t.push("");case Dd:return t.push("&",a.nodeName,";");default:t.push("??",a.nodeName)}}function jd(a,t,r){var n;switch(t.nodeType){case ct:n=t.cloneNode(!1),n.ownerDocument=a;case Nt:break;case Br:r=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=a,n.parentNode=null,r)for(var e=t.firstChild;e;)n.appendChild(jd(a,e,r)),e=e.nextSibling;return n}function gs(a,t,r){var n=new t.constructor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var i=t[e];typeof i!="object"&&i!=n[e]&&(n[e]=i)}switch(t.childNodes&&(n.childNodes=new Lt),n.ownerDocument=a,n.nodeType){case ct:var s=t.attributes,o=n.attributes=new Un,u=s.length;o._ownerElement=n;for(var l=0;l",lt:"<",quot:'"'}),a.HTML_ENTITIES=t({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"}),a.entityMap=a.HTML_ENTITIES})(Wd);var ro={},Li=Ht.NAMESPACE,vs=/[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]/,Zu=new RegExp("[\\-\\.0-9"+vs.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),el=new RegExp("^"+vs.source+Zu.source+"*(?::"+vs.source+Zu.source+"*)?$"),hi=0,$t=1,Sr=2,pi=3,Er=4,Cr=5,mi=6,Tn=7;function Vr(a,t){this.message=a,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Vr)}Vr.prototype=new Error;Vr.prototype.name=Vr.name;function zd(){}zd.prototype={parse:function(a,t,r){var n=this.domBuilder;n.startDocument(),$d(t,t={}),Eg(a,t,r,n,this.errorHandler),n.endDocument()}};function Eg(a,t,r,n,e){function i(re){if(re>65535){re-=65536;var ae=55296+(re>>10),pe=56320+(re&1023);return String.fromCharCode(ae,pe)}else return String.fromCharCode(re)}function s(re){var ae=re.slice(1,-1);return Object.hasOwnProperty.call(r,ae)?r[ae]:ae.charAt(0)==="#"?i(parseInt(ae.substr(1).replace("x","0x"))):(e.error("entity not found:"+re),re)}function o(re){if(re>S){var ae=a.substring(S,re).replace(/&#?\w+;/g,s);m&&u(S),n.characters(ae,0,re-S),S=re}}function u(re,ae){for(;re>=c&&(ae=g.exec(a));)l=ae.index,c=l+ae[0].length,m.lineNumber++;m.columnNumber=re-l+1}for(var l=0,c=0,g=/.*(?:\r\n?|\n)|.*$/g,m=n.locator,_=[{currentNSMap:t}],b={},S=0;;){try{var x=a.indexOf("<",S);if(x<0){if(!a.substr(S).match(/^\s*$/)){var w=n.doc,O=w.createTextNode(a.substr(S));w.appendChild(O),n.currentElement=O}return}switch(x>S&&o(x),a.charAt(x+1)){case"/":var X=a.indexOf(">",x+3),H=a.substring(x+2,X).replace(/[ \t\n\r]+$/g,""),L=_.pop();X<0?(H=a.substring(x+2).replace(/[\s<].*/,""),e.error("end tag name: "+H+" is not complete:"+L.tagName),X=x+1+H.length):H.match(/\sS?S=X:o(Math.max(x,S)+1)}}function tl(a,t){return t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber,t}function Cg(a,t,r,n,e,i){function s(m,_,b){r.attributeNames.hasOwnProperty(m)&&i.fatalError("Attribute "+m+" redefined"),r.addValue(m,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,e),b)}for(var o,u,l=++t,c=hi;;){var g=a.charAt(l);switch(g){case"=":if(c===$t)o=a.slice(t,l),c=pi;else if(c===Sr)c=pi;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===pi||c===$t)if(c===$t&&(i.warning('attribute value must after "="'),o=a.slice(t,l)),t=l+1,l=a.indexOf(g,t),l>0)u=a.slice(t,l),s(o,u,t-1),c=Cr;else throw new Error("attribute value no end '"+g+"' match");else if(c==Er)u=a.slice(t,l),s(o,u,t),i.warning('attribute "'+o+'" missed start quot('+g+")!!"),t=l+1,c=Cr;else throw new Error('attribute value must after "="');break;case"/":switch(c){case hi:r.setTagName(a.slice(t,l));case Cr:case mi:case Tn:c=Tn,r.closed=!0;case Er:case $t:break;case Sr:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),c==hi&&r.setTagName(a.slice(t,l)),l;case">":switch(c){case hi:r.setTagName(a.slice(t,l));case Cr:case mi:case Tn:break;case Er:case $t:u=a.slice(t,l),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Sr:c===Sr&&(u=o),c==Er?(i.warning('attribute "'+u+'" missed quot(")!'),s(o,u,t)):((!Li.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case pi:throw new Error("attribute value missed!!")}return l;case"\x80":g=" ";default:if(g<=" ")switch(c){case hi:r.setTagName(a.slice(t,l)),c=mi;break;case $t:o=a.slice(t,l),c=Sr;break;case Er:var u=a.slice(t,l);i.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case Cr:c=mi;break}else switch(c){case Sr:r.tagName,(!Li.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=$t;break;case Cr:i.warning('attribute space is required"'+o+'"!!');case mi:c=$t,t=l;break;case pi:c=Er,t=l;break;case Tn:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function rl(a,t,r){for(var n=a.tagName,e=null,g=a.length;g--;){var i=a[g],s=i.qName,o=i.value,m=s.indexOf(":");if(m>0)var u=i.prefix=s.slice(0,m),l=s.slice(m+1),c=u==="xmlns"&&l;else l=s,u=null,c=s==="xmlns"&&"";i.localName=l,c!==!1&&(e==null&&(e={},$d(r,r={})),r[c]=e[c]=o,i.uri=Li.XMLNS,t.startPrefixMapping(c,o))}for(var g=a.length;g--;){i=a[g];var u=i.prefix;u&&(u==="xml"&&(i.uri=Li.XML),u!=="xmlns"&&(i.uri=r[u||""]))}var m=n.indexOf(":");m>0?(u=a.prefix=n.slice(0,m),l=a.localName=n.slice(m+1)):(u=null,l=a.localName=n);var _=a.uri=r[u||""];if(t.startElement(_,l,n,a),a.closed){if(t.endElement(_,l,n),e)for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&t.endPrefixMapping(u)}else return a.currentNSMap=r,a.localNSMap=e,!0}function Ag(a,t,r,n,e){if(/^(?:script|textarea)$/i.test(r)){var i=a.indexOf("",t),s=a.substring(t+1,i);if(/[&<]/.test(s))return/^script$/i.test(r)?(e.characters(s,0,s.length),i):(s=s.replace(/&#?\w+;/g,n),e.characters(s,0,s.length),i)}return t+1}function Dg(a,t,r,n){var e=n[r];return e==null&&(e=a.lastIndexOf(""),e",t+4);return i>t?(r.comment(a,t+4,i-t-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(a.substr(t+3,6)=="CDATA["){var i=a.indexOf("]]>",t+9);return r.startCDATA(),r.characters(a,t+9,i-t-9),r.endCDATA(),i+3}var s=Pg(a,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var g=s[o-1];return r.startDTD(u,l,c),r.endDTD(),g.index+g[0].length}}return-1}function kg(a,t,r){var n=a.indexOf("?>",t);if(n){var e=a.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return e?(e[0].length,r.processingInstruction(e[1],e[2]),n+2):-1}return-1}function Kd(){this.attributeNames={}}Kd.prototype={setTagName:function(a){if(!el.test(a))throw new Error("invalid tagName:"+a);this.tagName=a},addValue:function(a,t,r){if(!el.test(a))throw new Error("invalid attribute:"+a);this.attributeNames[a]=this.length,this[this.length++]={qName:a,value:t,offset:r}},length:0,getLocalName:function(a){return this[a].localName},getLocator:function(a){return this[a].locator},getQName:function(a){return this[a].qName},getURI:function(a){return this[a].uri},getValue:function(a){return this[a].value}};function Pg(a,t){var r,n=[],e=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(e.lastIndex=t,e.exec(a);r=e.exec(a);)if(n.push(r),r[1])return n}ro.XMLReader=zd;ro.ParseError=Vr;var Ig=Ht,Og=Qt,il=Wd,Xd=ro,Lg=Og.DOMImplementation,nl=Ig.NAMESPACE,Fg=Xd.ParseError,Rg=Xd.XMLReader;function Yd(a){return a.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function Qd(a){this.options=a||{locator:{}}}Qd.prototype.parseFromString=function(a,t){var r=this.options,n=new Rg,e=r.domBuilder||new ji,i=r.errorHandler,s=r.locator,o=r.xmlns||{},u=/\/x?html?$/.test(t),l=u?il.HTML_ENTITIES:il.XML_ENTITIES;s&&e.setDocumentLocator(s),n.errorHandler=Mg(i,e,s),n.domBuilder=r.domBuilder||e,u&&(o[""]=nl.HTML),o.xml=o.xml||nl.XML;var c=r.normalizeLineEndings||Yd;return a&&typeof a=="string"?n.parse(c(a),o,l):n.errorHandler.error("invalid doc source"),e.doc};function Mg(a,t,r){if(!a){if(t instanceof ji)return t;a=t}var n={},e=a instanceof Function;r=r||{};function i(s){var o=a[s];!o&&e&&(o=a.length==2?function(u){a(s,u)}:a),n[s]=o&&function(u){o("[xmldom "+s+"] "+u+ys(r))}||function(){}}return i("warning"),i("error"),i("fatalError"),n}function ji(){this.cdata=!1}function Ar(a,t){t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber}ji.prototype={startDocument:function(){this.doc=new Lg().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(a,t,r,n){var e=this.doc,i=e.createElementNS(a,r||t),s=n.length;bn(this,i),this.currentElement=i,this.locator&&Ar(this.locator,i);for(var o=0;o=t+r||t?new java.lang.String(a,t,r)+"":a}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(a){ji.prototype[a]=function(){return null}});function bn(a,t){a.currentElement?a.currentElement.appendChild(t):a.doc.appendChild(t)}fa.__DOMHandler=ji;fa.normalizeLineEndings=Yd;fa.DOMParser=Qd;var Ng=fa.DOMParser;/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var sl=function(t){return!!t&&typeof t=="object"},Ge=function a(){for(var t=arguments.length,r=new Array(t),n=0;nn.timeline?1:-1})},zg=function(t,r){for(var n=0;ns.timeline||s.segments.length&&i.timeline>s.segments[s.segments.length-1].timeline)&&i.discontinuitySequence--;return}var l=s.segments[u];l.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),ll({playlist:i,mediaSequence:s.segments[u].number})}})},Kg=function(t){var r=t.oldManifest,n=t.newManifest,e=r.playlists.concat(ul(r)),i=n.playlists.concat(ul(n));return n.timelineStarts=tc([r.timelineStarts,n.timelineStarts]),$g({oldPlaylists:e,newPlaylists:i,timelineStarts:n.timelineStarts}),n},pa=function(t){return t&&t.uri+"-"+Hg(t.byterange)},Ya=function(t){var r=Jd(t.reduce(function(n,e){var i=e.attributes.id+(e.attributes.lang||"");if(!n[i])n[i]=e,n[i].attributes.timelineStarts=[];else{if(e.segments){var s;e.segments[0]&&(e.segments[0].discontinuity=!0),(s=n[i].segments).push.apply(s,e.segments)}e.attributes.contentProtection&&(n[i].attributes.contentProtection=e.attributes.contentProtection)}return n[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),n},{}));return r.map(function(n){return n.discontinuityStarts=Ug(n.segments||[],"discontinuity"),n})},ao=function(t,r){var n=pa(t.sidx),e=n&&r[n]&&r[n].sidx;return e&&no(t,e,t.sidx.resolvedUri),t},Xg=function(t,r){if(r===void 0&&(r={}),!Object.keys(r).length)return t;for(var n in t)t[n]=ao(t[n],r);return t},Yg=function(t,r){var n,e=t.attributes,i=t.segments,s=t.sidx,o=t.mediaSequence,u=t.discontinuitySequence,l=t.discontinuityStarts,c={attributes:(n={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:u,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:o,segments:i};return e.contentProtection&&(c.contentProtection=e.contentProtection),s&&(c.sidx=s),r&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},Qg=function(t){var r,n=t.attributes,e=t.segments,i=t.mediaSequence,s=t.discontinuityStarts,o=t.discontinuitySequence;typeof e>"u"&&(e=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var u=(r={NAME:n.id,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r);return n.codecs&&(u.CODECS=n.codecs),{attributes:u,uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:s,discontinuitySequence:o,mediaSequence:i,segments:e}},Jg=function(t,r,n){r===void 0&&(r={}),n===void 0&&(n=!1);var e,i=t.reduce(function(o,u){var l=u.attributes.role&&u.attributes.role.value||"",c=u.attributes.lang||"",g=u.attributes.label||"main";if(c&&!u.attributes.label){var m=l?" ("+l+")":"";g=""+u.attributes.lang+m}o[g]||(o[g]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});var _=ao(Yg(u,n),r);return o[g].playlists.push(_),typeof e>"u"&&l==="main"&&(e=u,e.default=!0),o},{});if(!e){var s=Object.keys(i)[0];i[s].default=!0}return i},Zg=function(t,r){return r===void 0&&(r={}),t.reduce(function(n,e){var i=e.attributes.lang||"text";return n[i]||(n[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),n[i].playlists.push(ao(Qg(e),r)),n},{})},ev=function(t){return t.reduce(function(r,n){return n&&n.forEach(function(e){var i=e.channel,s=e.language;r[s]={autoselect:!1,default:!1,instreamId:i,language:s},e.hasOwnProperty("aspectRatio")&&(r[s].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(r[s].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(r[s]["3D"]=e["3D"])}),r},{})},tv=function(t){var r,n=t.attributes,e=t.segments,i=t.sidx,s=t.discontinuityStarts,o={attributes:(r={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r),uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:s,timelineStarts:n.timelineStarts,segments:e};return n.frameRate&&(o.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(o.contentProtection=n.contentProtection),i&&(o.sidx=i),o},rv=function(t){var r=t.attributes;return r.mimeType==="video/mp4"||r.mimeType==="video/webm"||r.contentType==="video"},iv=function(t){var r=t.attributes;return r.mimeType==="audio/mp4"||r.mimeType==="audio/webm"||r.contentType==="audio"},nv=function(t){var r=t.attributes;return r.mimeType==="text/vtt"||r.contentType==="text"},av=function(t,r){t.forEach(function(n){n.mediaSequence=0,n.discontinuitySequence=_s(r,function(e){var i=e.timeline;return i===n.timeline}),n.segments&&n.segments.forEach(function(e,i){e.number=i})})},dl=function(t){return t?Object.keys(t).reduce(function(r,n){var e=t[n];return r.concat(e.playlists)},[]):[]},sv=function(t){var r,n=t.dashPlaylists,e=t.locations,i=t.sidxMapping,s=i===void 0?{}:i,o=t.previousManifest;if(!n.length)return{};var u=n[0].attributes,l=u.sourceDuration,c=u.type,g=u.suggestedPresentationDelay,m=u.minimumUpdatePeriod,_=Ya(n.filter(rv)).map(tv),b=Ya(n.filter(iv)),S=Ya(n.filter(nv)),x=n.map(function(B){return B.attributes.captionServices}).filter(Boolean),w={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(r={AUDIO:{},VIDEO:{}},r["CLOSED-CAPTIONS"]={},r.SUBTITLES={},r),uri:"",duration:l,playlists:Xg(_,s)};m>=0&&(w.minimumUpdatePeriod=m*1e3),e&&(w.locations=e),c==="dynamic"&&(w.suggestedPresentationDelay=g);var O=w.playlists.length===0,H=b.length?Jg(b,s,O):null,L=S.length?Zg(S,s):null,F=_.concat(dl(H),dl(L)),q=F.map(function(B){var R=B.timelineStarts;return R});return w.timelineStarts=tc(q),av(F,w.timelineStarts),H&&(w.mediaGroups.AUDIO.audio=H),L&&(w.mediaGroups.SUBTITLES.subs=L),x.length&&(w.mediaGroups["CLOSED-CAPTIONS"].cc=ev(x)),o?Kg({oldManifest:o,newManifest:w}):w},ov=function(t,r,n){var e=t.NOW,i=t.clientOffset,s=t.availabilityStartTime,o=t.timescale,u=o===void 0?1:o,l=t.periodStart,c=l===void 0?0:l,g=t.minimumUpdatePeriod,m=g===void 0?0:g,_=(e+i)/1e3,b=s+c,S=_+m,x=S-b;return Math.ceil((x*u-r)/n)},rc=function(t,r){for(var n=t.type,e=t.minimumUpdatePeriod,i=e===void 0?0:e,s=t.media,o=s===void 0?"":s,u=t.sourceDuration,l=t.timescale,c=l===void 0?1:l,g=t.startNumber,m=g===void 0?1:g,_=t.periodStart,b=[],S=-1,x=0;xS&&(S=L);var F=void 0;if(H<0){var q=x+1;q===r.length?n==="dynamic"&&i>0&&o.indexOf("$Number$")>0?F=ov(t,S,O):F=(u*c-S)/O:F=(r[q].t-S)/O}else F=H+1;for(var B=m+b.length+F,R=m+b.length;R"u")return r;var s=""+t[n];return n==="RepresentationID"||(e?i=parseInt(i,10):i=1,s.length>=i)?s:""+new Array(i-s.length+1).join("0")+s}},cl=function(t,r){return t.replace(uv,lv(r))},dv=function(t,r){return!t.duration&&!r?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?io(t):rc(t,r)},cv=function(t,r){var n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,i=e===void 0?{sourceURL:"",range:""}:e,s=Fi({baseUrl:t.baseUrl,source:cl(i.sourceURL,n),range:i.range}),o=dv(t,r);return o.map(function(u){n.Number=u.number,n.Time=u.time;var l=cl(t.media||"",n),c=t.timescale||1,g=t.presentationTimeOffset||0,m=t.periodStart+(u.time-g)/c,_={uri:l,timeline:u.timeline,duration:u.duration,resolvedUri:la(t.baseUrl||"",l),map:s,number:u.number,presentationTime:m};return _})},fv=function(t,r){var n=t.baseUrl,e=t.initialization,i=e===void 0?{}:e,s=Fi({baseUrl:n,source:i.sourceURL,range:i.range}),o=Fi({baseUrl:n,source:r.media,range:r.mediaRange});return o.map=s,o},hv=function(t,r){var n=t.duration,e=t.segmentUrls,i=e===void 0?[]:e,s=t.periodStart;if(!n&&!r||n&&r)throw new Error(Hr.SEGMENT_TIME_UNSPECIFIED);var o=i.map(function(c){return fv(t,c)}),u;n&&(u=io(t)),r&&(u=rc(t,r));var l=u.map(function(c,g){if(o[g]){var m=o[g],_=t.timescale||1,b=t.presentationTimeOffset||0;return m.timeline=c.timeline,m.duration=c.duration,m.number=c.number,m.presentationTime=s+(c.time-b)/_,m}}).filter(function(c){return c});return l},pv=function(t){var r=t.attributes,n=t.segmentInfo,e,i;n.template?(i=cv,e=Ge(r,n.template)):n.base?(i=ec,e=Ge(r,n.base)):n.list&&(i=hv,e=Ge(r,n.list));var s={attributes:r};if(!i)return s;var o=i(e,n.segmentTimeline);if(e.duration){var u=e,l=u.duration,c=u.timescale,g=c===void 0?1:c;e.duration=l/g}else o.length?e.duration=o.reduce(function(m,_){return Math.max(m,Math.ceil(_.duration))},0):e.duration=0;return s.attributes=e,s.segments=o,n.base&&e.indexRange&&(s.sidx=o[0],s.segments=[]),s},mv=function(t){return t.map(pv)},Se=function(t,r){return Zd(t.childNodes).filter(function(n){var e=n.tagName;return e===r})},so=function(t){return t.textContent.trim()},gv=function(t){return parseFloat(t.split("/").reduce(function(r,n){return r/n}))},Dr=function(t){var r=31536e3,n=30*24*60*60,e=24*60*60,i=60*60,s=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,u=o.exec(t);if(!u)return 0;var l=u.slice(1),c=l[0],g=l[1],m=l[2],_=l[3],b=l[4],S=l[5];return parseFloat(c||0)*r+parseFloat(g||0)*n+parseFloat(m||0)*e+parseFloat(_||0)*i+parseFloat(b||0)*s+parseFloat(S||0)},vv=function(t){var r=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return r.test(t)&&(t+="Z"),Date.parse(t)},fl={mediaPresentationDuration:function(t){return Dr(t)},availabilityStartTime:function(t){return vv(t)/1e3},minimumUpdatePeriod:function(t){return Dr(t)},suggestedPresentationDelay:function(t){return Dr(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return Dr(t)},start:function(t){return Dr(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},frameRate:function(t){return gv(t)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var r=parseInt(t,10);return isNaN(r)?Dr(t):r},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},Me=function(t){return t&&t.attributes?Zd(t.attributes).reduce(function(r,n){var e=fl[n.name]||fl.DEFAULT;return r[n.name]=e(n.value),r},{}):{}},yv={"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"},ma=function(t,r){return r.length?ha(t.map(function(n){return r.map(function(e){return la(n,so(e))})})):t},oo=function(t){var r=Se(t,"SegmentTemplate")[0],n=Se(t,"SegmentList")[0],e=n&&Se(n,"SegmentURL").map(function(m){return Ge({tag:"SegmentURL"},Me(m))}),i=Se(t,"SegmentBase")[0],s=n||r,o=s&&Se(s,"SegmentTimeline")[0],u=n||i||r,l=u&&Se(u,"Initialization")[0],c=r&&Me(r);c&&l?c.initialization=l&&Me(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var g={template:c,segmentTimeline:o&&Se(o,"S").map(function(m){return Me(m)}),list:n&&Ge(Me(n),{segmentUrls:e,initialization:Me(l)}),base:i&&Ge(Me(i),{initialization:Me(l)})};return Object.keys(g).forEach(function(m){g[m]||delete g[m]}),g},_v=function(t,r,n){return function(e){var i=Se(e,"BaseURL"),s=ma(r,i),o=Ge(t,Me(e)),u=oo(e);return s.map(function(l){return{segmentInfo:Ge(n,u),attributes:Ge(o,{baseUrl:l})}})}},Tv=function(t){return t.reduce(function(r,n){var e=Me(n);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var i=yv[e.schemeIdUri];if(i){r[i]={attributes:e};var s=Se(n,"cenc:pssh")[0];if(s){var o=so(s);r[i].pssh=o&&vd(o)}}return r},{})},bv=function(t){if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var r=typeof t.value!="string"?[]:t.value.split(";");return r.map(function(e){var i,s;if(s=e,/^CC\d=/.test(e)){var o=e.split("=");i=o[0],s=o[1]}else/^CC\d$/.test(e)&&(i=e);return{channel:i,language:s}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var n=typeof t.value!="string"?[]:t.value.split(";");return n.map(function(e){var i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var s=e.split("="),o=s[0],u=s[1],l=u===void 0?"":u;i.channel=o,i.language=e,l.split(",").forEach(function(c){var g=c.split(":"),m=g[0],_=g[1];m==="lang"?i.language=_:m==="er"?i.easyReader=Number(_):m==="war"?i.aspectRatio=Number(_):m==="3D"&&(i["3D"]=Number(_))})}else i.language=e;return i.channel&&(i.channel="SERVICE"+i.channel),i})}},xv=function(t,r,n){return function(e){var i=Me(e),s=ma(r,Se(e,"BaseURL")),o=Se(e,"Role")[0],u={role:Me(o)},l=Ge(t,i,u),c=Se(e,"Accessibility")[0],g=bv(Me(c));g&&(l=Ge(l,{captionServices:g}));var m=Se(e,"Label")[0];if(m&&m.childNodes.length){var _=m.childNodes[0].nodeValue.trim();l=Ge(l,{label:_})}var b=Tv(Se(e,"ContentProtection"));Object.keys(b).length&&(l=Ge(l,{contentProtection:b}));var S=oo(e),x=Se(e,"Representation"),w=Ge(n,S);return ha(x.map(_v(l,s,w)))}},Sv=function(t,r){return function(n,e){var i=ma(r,Se(n.node,"BaseURL")),s=Ge(t,{periodStart:n.attributes.start});typeof n.attributes.duration=="number"&&(s.periodDuration=n.attributes.duration);var o=Se(n.node,"AdaptationSet"),u=oo(n.node);return ha(o.map(xv(s,i,u)))}},Ev=function(t){var r=t.attributes,n=t.priorPeriodAttributes,e=t.mpdType;return typeof r.start=="number"?r.start:n&&typeof n.start=="number"&&typeof n.duration=="number"?n.start+n.duration:!n&&e==="static"?0:null},Cv=function(t,r){r===void 0&&(r={});var n=r,e=n.manifestUri,i=e===void 0?"":e,s=n.NOW,o=s===void 0?Date.now():s,u=n.clientOffset,l=u===void 0?0:u,c=Se(t,"Period");if(!c.length)throw new Error(Hr.INVALID_NUMBER_OF_PERIOD);var g=Se(t,"Location"),m=Me(t),_=ma([i],Se(t,"BaseURL"));m.type=m.type||"static",m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=l,g.length&&(m.locations=g.map(so));var b=[];return c.forEach(function(S,x){var w=Me(S),O=b[x-1];w.start=Ev({attributes:w,priorPeriodAttributes:O?O.attributes:null,mpdType:m.type}),b.push({node:S,attributes:w})}),{locations:m.locations,representationInfo:ha(b.map(Sv(m,_)))}},ic=function(t){if(t==="")throw new Error(Hr.DASH_EMPTY_MANIFEST);var r=new Ng,n,e;try{n=r.parseFromString(t,"application/xml"),e=n&&n.documentElement.tagName==="MPD"?n.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error(Hr.DASH_INVALID_XML);return e},Av=function(t){var r=Se(t,"UTCTiming")[0];if(!r)return null;var n=Me(r);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.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":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Hr.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},Dv=function(t,r){r===void 0&&(r={});var n=Cv(ic(t),r),e=mv(n.representationInfo);return sv({dashPlaylists:e,locations:n.locations,sidxMapping:r.sidxMapping,previousManifest:r.previousManifest})},wv=function(t){return Av(ic(t))},nc=Math.pow(2,32),kv=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),r;return t.getBigUint64?(r=t.getBigUint64(0),r0;n+=12,e--)r.references.push({referenceType:(a[n]&128)>>>7,referencedSize:t.getUint32(n)&2147483647,subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(a[n+8]&128),sapType:(a[n+8]&112)>>>4,sapDeltaTime:t.getUint32(n+8)&268435455});return r},Ov=Iv,Lv=Q([73,68,51]),Fv=function(t,r){r===void 0&&(r=0),t=Q(t);var n=t[r+5],e=t[r+6]<<21|t[r+7]<<14|t[r+8]<<7|t[r+9],i=(n&16)>>4;return i?e+20:e+10},xi=function a(t,r){return r===void 0&&(r=0),t=Q(t),t.length-r<10||!_e(t,Lv,{offset:r})?r:(r+=Fv(t,r),a(t,r))},pl=function(t){return typeof t=="string"?xd(t):t},Rv=function(t){return Array.isArray(t)?t.map(function(r){return pl(r)}):[pl(t)]},Mv=function a(t,r,n){n===void 0&&(n=!1),r=Rv(r),t=Q(t);var e=[];if(!r.length)return e;for(var i=0;i>>0,o=t.subarray(i+4,i+8);if(s===0)break;var u=i+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(i+8,u);_e(o,r[0])&&(r.length===1?e.push(l):e.push.apply(e,a(l,r.slice(1),n))),i=u}return e},xn={EBML:Q([26,69,223,163]),DocType:Q([66,130]),Segment:Q([24,83,128,103]),SegmentInfo:Q([21,73,169,102]),Tracks:Q([22,84,174,107]),Track:Q([174]),TrackNumber:Q([215]),DefaultDuration:Q([35,227,131]),TrackEntry:Q([174]),TrackType:Q([131]),FlagDefault:Q([136]),CodecID:Q([134]),CodecPrivate:Q([99,162]),VideoTrack:Q([224]),AudioTrack:Q([225]),Cluster:Q([31,67,182,117]),Timestamp:Q([231]),TimestampScale:Q([42,215,177]),BlockGroup:Q([160]),BlockDuration:Q([155]),Block:Q([161]),SimpleBlock:Q([163])},Ts=[128,64,32,16,8,4,2,1],Nv=function(t){for(var r=1,n=0;n=r.length)return r.length;var e=qn(r,n,!1);if(_e(t.bytes,e.bytes))return n;var i=qn(r,n+e.length);return a(t,r,n+i.length+i.value+e.length)},gl=function a(t,r){r=Bv(r),t=Q(t);var n=[];if(!r.length)return n;for(var e=0;et.length?t.length:o+s.value,l=t.subarray(o,u);_e(r[0],i.bytes)&&(r.length===1?n.push(l):n=n.concat(a(l,r.slice(1))));var c=i.length+s.length+l.length;e+=c}return n},Vv=Q([0,0,0,1]),Hv=Q([0,0,1]),qv=Q([0,0,3]),jv=function(t){for(var r=[],n=1;n>1&63),n.indexOf(l)!==-1&&(s=i+u),i+=u+(r==="h264"?1:2)}return t.subarray(0,0)},Gv=function(t,r,n){return ac(t,"h264",r,n)},Wv=function(t,r,n){return ac(t,"h265",r,n)},He={webm:Q([119,101,98,109]),matroska:Q([109,97,116,114,111,115,107,97]),flac:Q([102,76,97,67]),ogg:Q([79,103,103,83]),ac3:Q([11,119]),riff:Q([82,73,70,70]),avi:Q([65,86,73]),wav:Q([87,65,86,69]),"3gp":Q([102,116,121,112,51,103]),mp4:Q([102,116,121,112]),fmp4:Q([115,116,121,112]),mov:Q([102,116,121,112,113,116]),moov:Q([109,111,111,118]),moof:Q([109,111,111,102])},qr={aac:function(t){var r=xi(t);return _e(t,[255,16],{offset:r,mask:[255,22]})},mp3:function(t){var r=xi(t);return _e(t,[255,2],{offset:r,mask:[255,6]})},webm:function(t){var r=gl(t,[xn.EBML,xn.DocType])[0];return _e(r,He.webm)},mkv:function(t){var r=gl(t,[xn.EBML,xn.DocType])[0];return _e(r,He.matroska)},mp4:function(t){if(qr["3gp"](t)||qr.mov(t))return!1;if(_e(t,He.mp4,{offset:4})||_e(t,He.fmp4,{offset:4})||_e(t,He.moof,{offset:4})||_e(t,He.moov,{offset:4}))return!0},mov:function(t){return _e(t,He.mov,{offset:4})},"3gp":function(t){return _e(t,He["3gp"],{offset:4})},ac3:function(t){var r=xi(t);return _e(t,He.ac3,{offset:r})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var r=0;r+1880},lo=9e4,co,fo,ga,ho,sc,oc,uc;co=function(a){return a*lo};fo=function(a,t){return a*t};ga=function(a){return a/lo};ho=function(a,t){return a/t};sc=function(a,t){return co(ho(a,t))};oc=function(a,t){return fo(ga(a),t)};uc=function(a,t,r){return ga(r?a:a-t)};var jn={ONE_SECOND_IN_TS:lo,secondsToVideoTs:co,secondsToAudioTs:fo,videoTsToSeconds:ga,audioTsToSeconds:ho,audioTsToVideoTs:sc,videoTsToAudioTs:oc,metadataTsToSeconds:uc};function xs(a){return xs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xs(a)}function Kv(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function Ss(a){var t=typeof Map=="function"?new Map:void 0;return Ss=function(n){if(n===null||!Kv(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,e)}function e(){return Ai(n,arguments,xs(this).constructor)}return e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Nr(e,n)},Ss(a)}/** * @license * Video.js 7.21.4 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */var lc="7.21.4",It={},Kt=function(t,r){return It[t]=It[t]||[],r&&(It[t]=It[t].concat(r)),It[t]},Xv=function(t,r){Kt(t,r)},dc=function(t,r){var n=Kt(t).indexOf(r);return n<=-1?!1:(It[t]=It[t].slice(),It[t].splice(n,1),!0)},Yv=function(t,r){Kt(t,[].concat(r).map(function(n){var e=function i(){return dc(t,i),n.apply(void 0,arguments)};return e}))},Gn={prefixed:!0},On=[["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"]],vl=On[0],Si;for(var Sn=0;Sn0?u:0)}if(!!A.console){var l=A.console[n];!l&&n==="debug"&&(l=A.console.info||A.console.log),!(!l||!s||!o.test(n))&&l[Array.isArray(i)?"apply":"call"](A.console,i)}}};function cc(a){var t="info",r,n=function(){for(var i=arguments.length,s=new Array(i),o=0;o1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function i0(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function Yr(){return G===A.document}function Qr(a){return Ut(a)&&a.nodeType===1}function Tc(){try{return A.parent!==A.self}catch{return!0}}function bc(a){return function(t,r){if(!_l(t))return G[a](null);_l(r)&&(r=G.querySelector(r));var n=Qr(r)?r:G;return n[a]&&n[a](t)}}function ne(a,t,r,n){a===void 0&&(a="div"),t===void 0&&(t={}),r===void 0&&(r={});var e=G.createElement(a);return Object.getOwnPropertyNames(t).forEach(function(i){var s=t[i];i.indexOf("aria-")!==-1||i==="role"||i==="type"?(ie.warn(`Setting attributes in the second argument of createEl() has been deprecated. Use the third argument instead. `+("createEl(type, properties, attributes). Attempting to set "+i+" to "+s+".")),e.setAttribute(i,s)):i==="textContent"?mr(e,s):(e[i]!==s||i==="tabIndex")&&(e[i]=s)}),Object.getOwnPropertyNames(r).forEach(function(i){e.setAttribute(i,r[i])}),n&&_o(e,n),e}function mr(a,t){return typeof a.textContent>"u"?a.innerText=t:a.textContent=t,a}function Es(a,t){t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)}function dr(a,t){return _c(t),a.classList?a.classList.contains(t):i0(t).test(a.className)}function Ft(a,t){return a.classList?a.classList.add(t):dr(a,t)||(a.className=(a.className+" "+t).trim()),a}function zi(a,t){return a?(a.classList?a.classList.remove(t):(_c(t),a.className=a.className.split(/\s+/).filter(function(r){return r!==t}).join(" ")),a):(ie.warn("removeClass was called with an element that doesn't exist"),null)}function xc(a,t,r){var n=dr(a,t);if(typeof r=="function"&&(r=r(a,t)),typeof r!="boolean"&&(r=!n),r!==n)return r?Ft(a,t):zi(a,t),a}function Sc(a,t){Object.getOwnPropertyNames(t).forEach(function(r){var n=t[r];n===null||typeof n>"u"||n===!1?a.removeAttribute(r):a.setAttribute(r,n===!0?"":n)})}function Pt(a){var t={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(a&&a.attributes&&a.attributes.length>0)for(var n=a.attributes,e=n.length-1;e>=0;e--){var i=n[e].name,s=n[e].value;(typeof a[i]=="boolean"||r.indexOf(","+i+",")!==-1)&&(s=s!==null),t[i]=s}return t}function Ec(a,t){return a.getAttribute(t)}function Gr(a,t,r){a.setAttribute(t,r)}function ya(a,t){a.removeAttribute(t)}function Cc(){G.body.focus(),G.onselectstart=function(){return!1}}function Ac(){G.onselectstart=function(){return!0}}function Wr(a){if(a&&a.getBoundingClientRect&&a.parentNode){var t=a.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(n){t[n]!==void 0&&(r[n]=t[n])}),r.height||(r.height=parseFloat(Mi(a,"height"))),r.width||(r.width=parseFloat(Mi(a,"width"))),r}}function Ni(a){if(!a||a&&!a.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=a.offsetWidth,r=a.offsetHeight,n=0,e=0;a.offsetParent&&a!==G[Gn.fullscreenElement];)n+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;return{left:n,top:e,width:t,height:r}}function _a(a,t){var r={x:0,y:0};if($e)for(var n=a;n&&n.nodeName.toLowerCase()!=="html";){var e=Mi(n,"transform");if(/^matrix/.test(e)){var i=e.slice(7,-1).split(/,\s/).map(Number);r.x+=i[4],r.y+=i[5]}else if(/^matrix3d/.test(e)){var s=e.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}n=n.parentNode}var o={},u=Ni(t.target),l=Ni(a),c=l.width,g=l.height,m=t.offsetY-(l.top-u.top),_=t.offsetX-(l.left-u.left);return t.changedTouches&&(_=t.changedTouches[0].pageX-l.left,m=t.changedTouches[0].pageY+l.top,$e&&(_-=r.x,m-=r.y)),o.y=1-Math.max(0,Math.min(1,m/g)),o.x=Math.max(0,Math.min(1,_/c)),o}function Dc(a){return Ut(a)&&a.nodeType===3}function yo(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function wc(a){return typeof a=="function"&&(a=a()),(Array.isArray(a)?a:[a]).map(function(t){if(typeof t=="function"&&(t=t()),Qr(t)||Dc(t))return t;if(typeof t=="string"&&/\S/.test(t))return G.createTextNode(t)}).filter(function(t){return t})}function _o(a,t){return wc(t).forEach(function(r){return a.appendChild(r)}),a}function kc(a,t){return _o(yo(a),t)}function Bi(a){return a.button===void 0&&a.buttons===void 0||a.button===0&&a.buttons===void 0||a.type==="mouseup"&&a.button===0&&a.buttons===0?!0:!(a.button!==0||a.buttons!==1)}var Xt=bc("querySelector"),Pc=bc("querySelectorAll"),Ic=Object.freeze({__proto__:null,isReal:Yr,isEl:Qr,isInFrame:Tc,createEl:ne,textContent:mr,prependTo:Es,hasClass:dr,addClass:Ft,removeClass:zi,toggleClass:xc,setAttributes:Sc,getAttributes:Pt,getAttribute:Ec,setAttribute:Gr,removeAttribute:ya,blockTextSelection:Cc,unblockTextSelection:Ac,getBoundingClientRect:Wr,findPosition:Ni,getPointerPosition:_a,isTextNode:Dc,emptyEl:yo,normalizeContent:wc,appendContent:_o,insertContent:kc,isSingleLeftClick:Bi,$:Xt,$$:Pc}),Oc=!1,Cs,n0=function(){if(Cs.options.autoSetup!==!1){var t=Array.prototype.slice.call(G.getElementsByTagName("video")),r=Array.prototype.slice.call(G.getElementsByTagName("audio")),n=Array.prototype.slice.call(G.getElementsByTagName("video-js")),e=t.concat(r,n);if(e&&e.length>0)for(var i=0,s=e.length;i-1&&(e={passive:!0}),a.addEventListener(t,n.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+t,n.dispatcher)}function Ne(a,t,r){if(!!We.has(a)){var n=We.get(a);if(!!n.handlers){if(Array.isArray(t))return To(Ne,a,t,r);var e=function(l,c){n.handlers[c]=[],Tl(l,c)};if(t===void 0){for(var i in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},i)&&e(a,i);return}var s=n.handlers[t];if(!!s){if(!r){e(a,t);return}if(r.guid)for(var o=0;o=r&&(t.apply(void 0,arguments),n=s)};return e},d0=function(t,r,n,e){e===void 0&&(e=A);var i,s=function(){e.clearTimeout(i),i=null},o=function(){var l=this,c=arguments,g=function(){i=null,g=null,n||t.apply(l,c)};!i&&n&&t.apply(l,c),e.clearTimeout(i),i=e.setTimeout(g,r)};return o.cancel=s,o},Ie=function(){};Ie.prototype.allowedEvents_={};Ie.prototype.on=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},it(this,a,t),this.addEventListener=r};Ie.prototype.addEventListener=Ie.prototype.on;Ie.prototype.off=function(a,t){Ne(this,a,t)};Ie.prototype.removeEventListener=Ie.prototype.off;Ie.prototype.one=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},ba(this,a,t),this.addEventListener=r};Ie.prototype.any=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},Mc(this,a,t),this.addEventListener=r};Ie.prototype.trigger=function(a){var t=a.type||a;typeof a=="string"&&(a={type:t}),a=Ta(a),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](a),Jr(this,a)};Ie.prototype.dispatchEvent=Ie.prototype.trigger;var gi;Ie.prototype.queueTrigger=function(a){var t=this;gi||(gi=new Map);var r=a.type||a,n=gi.get(this);n||(n=new Map,gi.set(this,n));var e=n.get(r);n.delete(r),A.clearTimeout(e);var i=A.setTimeout(function(){n.delete(r),n.size===0&&(n=null,gi.delete(t)),t.trigger(a)},0);n.set(r,i)};var xa=function(t){return typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},Rt=function(t){return t instanceof Ie||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(r){return typeof t[r]=="function"})},c0=function(t,r){Rt(t)?r():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(r))},ws=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},Wn=function(t,r,n){if(!t||!t.nodeName&&!Rt(t))throw new Error("Invalid target for "+xa(r)+"#"+n+"; must be a DOM node or evented object.")},Nc=function(t,r,n){if(!ws(t))throw new Error("Invalid event type for "+xa(r)+"#"+n+"; must be a non-empty string or array.")},Bc=function(t,r,n){if(typeof t!="function")throw new Error("Invalid listener for "+xa(r)+"#"+n+"; must be a function.")},Qa=function(t,r,n){var e=r.length<3||r[0]===t||r[0]===t.eventBusEl_,i,s,o;return e?(i=t.eventBusEl_,r.length>=3&&r.shift(),s=r[0],o=r[1]):(i=r[0],s=r[1],o=r[2]),Wn(i,t,n),Nc(s,t,n),Bc(o,t,n),o=ye(t,o),{isTargetingSelf:e,target:i,type:s,listener:o}},ar=function(t,r,n,e){Wn(t,t,r),t.nodeName?l0[r](t,n,e):t[r](n,e)},f0={on:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(n.restoreEl?this.el_.parentNode.replaceChild(n.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(n){return n?(this.options_=ve(this.options_,n),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(n,e,i){return ne(n,e,i)},t.localize=function(n,e,i){i===void 0&&(i=n);var s=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),u=o&&o[s],l=s&&s.split("-")[0],c=o&&o[l],g=i;return u&&u[n]?g=u[n]:c&&c[n]&&(g=c[n]),e&&(g=g.replace(/\{(\d+)\}/g,function(m,_){var b=e[_-1],S=b;return typeof b>"u"&&(S=m),S})),g},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(n){return this.childIndex_[n]},t.getChild=function(n){if(!!n)return this.childNameIndex_[n]},t.getDescendant=function(){for(var n=arguments.length,e=new Array(n),i=0;i=0;i--)if(this.children_[i]===n){e=!0,this.children_.splice(i,1);break}if(!!e){n.parentComponent_=null,this.childIndex_[n.id()]=null,this.childNameIndex_[Ee(n.name())]=null,this.childNameIndex_[Ln(n.name())]=null;var s=n.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(n.el())}}},t.initChildren=function(){var n=this,e=this.options_.children;if(e){var i=this.options_,s=function(c){var g=c.name,m=c.opts;if(i[g]!==void 0&&(m=i[g]),m!==!1){m===!0&&(m={}),m.playerOptions=n.options_.playerOptions;var _=n.addChild(g,m);_&&(n[g]=_)}},o,u=a.getComponent("Tech");Array.isArray(e)?o=e:o=Object.keys(e),o.concat(Object.keys(this.options_).filter(function(l){return!o.some(function(c){return typeof c=="string"?l===c:l===c.name})})).map(function(l){var c,g;return typeof l=="string"?(c=l,g=e[c]||n.options_[c]||{}):(c=l.name,g=l),{name:c,opts:g}}).filter(function(l){var c=a.getComponent(l.opts.componentClass||Ee(l.name));return c&&!u.isTech(c)}).forEach(s)}},t.buildCSSClass=function(){return""},t.ready=function(n,e){if(e===void 0&&(e=!1),!!n){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(n);return}e?n.call(this):this.setTimeout(n,1)}},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var n=this.readyQueue_;this.readyQueue_=[],n&&n.length>0&&n.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(n,e){return Xt(n,e||this.contentEl())},t.$$=function(n,e){return Pc(n,e||this.contentEl())},t.hasClass=function(n){return dr(this.el_,n)},t.addClass=function(n){Ft(this.el_,n)},t.removeClass=function(n){zi(this.el_,n)},t.toggleClass=function(n,e){xc(this.el_,n,e)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(n){return Ec(this.el_,n)},t.setAttribute=function(n,e){Gr(this.el_,n,e)},t.removeAttribute=function(n){ya(this.el_,n)},t.width=function(n,e){return this.dimension("width",n,e)},t.height=function(n,e){return this.dimension("height",n,e)},t.dimensions=function(n,e){this.width(n,!0),this.height(e)},t.dimension=function(n,e,i){if(e!==void 0){(e===null||e!==e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[n]=e:e==="auto"?this.el_.style[n]="":this.el_.style[n]=e+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;var s=this.el_.style[n],o=s.indexOf("px");return parseInt(o!==-1?s.slice(0,o):this.el_["offset"+Ee(n)],10)},t.currentDimension=function(n){var e=0;if(n!=="width"&&n!=="height")throw new Error("currentDimension only accepts width or height value");if(e=Mi(this.el_,n),e=parseFloat(e),e===0||isNaN(e)){var i="offset"+Ee(n);e=this.el_[i]}return e},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(n){this.player_&&(te.isEventKey(n,"Tab")||n.stopPropagation(),this.player_.handleKeyDown(n))},t.handleKeyPress=function(n){this.handleKeyDown(n)},t.emitTapEvents=function(){var n=0,e=null,i=10,s=200,o;this.on("touchstart",function(l){l.touches.length===1&&(e={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},n=A.performance.now(),o=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)o=!1;else if(e){var c=l.touches[0].pageX-e.pageX,g=l.touches[0].pageY-e.pageY,m=Math.sqrt(c*c+g*g);m>i&&(o=!1)}});var u=function(){o=!1};this.on("touchleave",u),this.on("touchcancel",u),this.on("touchend",function(l){if(e=null,o===!0){var c=A.performance.now()-n;c0&&g.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[n]=e,a.components_[Ln(n)]=e,e},a.getComponent=function(n){if(!(!n||!a.components_))return a.components_[n]},a}();V.prototype.supportsRaf_=typeof A.requestAnimationFrame=="function"&&typeof A.cancelAnimationFrame=="function";V.registerComponent("Component",V);function y0(a,t,r){if(typeof t!="number"||t<0||t>r)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+r+").")}function bl(a,t,r,n){return y0(a,n,r.length-1),r[n][t]}function Za(a){var t;return a===void 0||a.length===0?t={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:t={length:a.length,start:bl.bind(null,"start",0,a),end:bl.bind(null,"end",1,a)},A.Symbol&&A.Symbol.iterator&&(t[A.Symbol.iterator]=function(){return(a||[]).values()}),t}function cr(a,t){return Array.isArray(a)?Za(a):a===void 0||t===void 0?Za():Za([[a,t]])}function Vc(a,t){var r=0,n,e;if(!t)return 0;(!a||!a.length)&&(a=cr(0,0));for(var i=0;it&&(e=t),r+=e-n;return r/t}function ze(a){if(a instanceof ze)return a;typeof a=="number"?this.code=a:typeof a=="string"?this.message=a:Ut(a)&&(typeof a.code=="number"&&(this.code=a.code),be(this,a)),this.message||(this.message=ze.defaultMessages[this.code]||"")}ze.prototype.code=0;ze.prototype.message="";ze.prototype.status=null;ze.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ze.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 wr=0;wr=0;i--)if(n[i].enabled){ts(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,e}var r=t.prototype;return r.addTrack=function(e){var i=this;e.enabled&&ts(this,e),a.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){i.changing_||(i.changing_=!0,ts(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},t}(zr),rs=function(t,r){for(var n=0;n=0;i--)if(n[i].selected){rs(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,Object.defineProperty(ee(e),"selectedIndex",{get:function(){for(var o=0;o0&&(A.console&&A.console.groupCollapsed&&A.console.groupCollapsed("Text Track parsing errors for "+r.src),e.forEach(function(i){return ie.error(i)}),A.console&&A.console.groupEnd&&A.console.groupEnd()),n.flush()},Al=function(t,r){var n={uri:t},e=Sa(t);e&&(n.cors=e);var i=r.tech_.crossOrigin()==="use-credentials";i&&(n.withCredentials=i),oa.exports(n,ye(this,function(s,o,u){if(s)return ie.error(s,o);r.loaded_=!0,typeof A.WebVTT!="function"?r.tech_&&r.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type==="vttjserror"){ie.error("vttjs failed to load, stopping trying to process "+r.src);return}return Cl(u,r)}):Cl(u,r)}))},$i=function(a){W(t,a);function t(n){var e;if(n===void 0&&(n={}),!n.tech)throw new Error("A tech was not provided.");var i=ve(n,{kind:D0[n.kind]||"subtitles",language:n.language||n.srclang||""}),s=El[i.mode]||"disabled",o=i.default;(i.kind==="metadata"||i.kind==="chapters")&&(s="hidden"),e=a.call(this,i)||this,e.tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=e.tech_.preloadTextTracks!==!1;var u=new Sl(e.cues_),l=new Sl(e.activeCues_),c=!1;e.timeupdateHandler=ye(ee(e),function(m){if(m===void 0&&(m={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var g=function(){e.stopTracking()};return e.tech_.one("dispose",g),s!=="disabled"&&e.startTracking(),Object.defineProperties(ee(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(_){!El[_]||s!==_&&(s=_,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Al(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 l;for(var _=this.tech_.currentTime(),b=[],S=0,x=this.cues.length;S=_||w.startTime===w.endTime&&w.startTime<=_&&w.startTime+.5>=_)&&b.push(w)}if(c=!1,b.length!==this.activeCues_.length)c=!0;else for(var O=0;O0){this.trigger("vttjsloaded");return}var i=G.createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){e.trigger("vttjsloaded")},i.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){i.onload=null,i.onerror=null}),A.WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,i=this.textTracks(),s=this.remoteTextTracks(),o=function(m){return i.addTrack(m.track)},u=function(m){return i.removeTrack(m.track)};s.on("addtrack",o),s.on("removetrack",u),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var m=0;m=0;e--){var i=a[e];i[t]&&i[t](n,r)}}function V0(a){Ps[a.id()]=null}function H0(a,t){var r=Ps[a.id()],n=null;if(r==null)return n=t(a),Ps[a.id()]=[[t,n]],n;for(var e=0;e0;this.player_.tech(!0)&&!((Wi||Gi)&&i)&&this.player_.tech(!0).focus(),this.player_.paused()?_t(this.player_.play()):this.player_.pause()}},t}(Ea);V.registerComponent("PosterImage",z0);var at="#222",Pl="#ccc",$0={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 is(a,t){var r;if(a.length===4)r=a[1]+a[1]+a[2]+a[2]+a[3]+a[3];else if(a.length===7)r=a.slice(1);else throw new Error("Invalid color code provided, "+a+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}function ns(a,t,r){try{a.style[t]=r}catch{return}}var K0=function(a){W(t,a);function t(n,e,i){var s;s=a.call(this,n,e,i)||this;var o=function(l){return s.updateDisplay(l)};return n.on("loadstart",function(u){return s.toggleDisplay(u)}),n.on("texttrackchange",o),n.on("loadedmetadata",function(u){return s.preselectTrack(u)}),n.ready(ye(ee(s),function(){if(n.tech_&&n.tech_.featuresNativeTextTracks){this.hide();return}n.on("fullscreenchange",o),n.on("playerresize",o),A.addEventListener("orientationchange",o),n.on("dispose",function(){return A.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],l=0;l0;_t(i),this.player_.tech(!0)&&!((Wi||Gi)&&s)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),u=o&&o.getChild("playToggle");if(!u){this.player_.tech(!0).focus();return}var l=function(){return u.focus()};Di(i)?i.then(l,function(){}):this.setTimeout(l,1)},r.handleKeyDown=function(e){this.mouseused_=!1,a.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(e){this.mouseused_=!0},t}(ft);$c.prototype.controlText_="Play Video";V.registerComponent("BigPlayButton",$c);var Y0=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.controlText(e&&e.controlText||i.localize("Close")),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){te.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(ft);V.registerComponent("CloseButton",Y0);var Kc=function(a){W(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,e.replay=e.replay===void 0||e.replay,i.on(n,"play",function(s){return i.handlePlay(s)}),i.on(n,"pause",function(s){return i.handlePause(s)}),e.replay&&i.on(n,"ended",function(s){return i.handleEnded(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?_t(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(e){var i=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(s){return i.handleSeeked(s)})},t}(ft);Kc.prototype.controlText_="Play";V.registerComponent("PlayToggle",Kc);var Xc=function(t,r){t=t<0?0:t;var n=Math.floor(t%60),e=Math.floor(t/60%60),i=Math.floor(t/3600),s=Math.floor(r/60%60),o=Math.floor(r/3600);return(isNaN(t)||t===1/0)&&(i=e=n="-"),i=i>0||o>0?i+":":"",e=((i||s>=10)&&e<10?"0"+e:e)+":",n=n<10?"0"+n:n,i+e+n},Ao=Xc;function Q0(a){Ao=a}function J0(){Ao=Xc}function Kr(a,t){return t===void 0&&(t=a),Ao(a,t)}var ti=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["timeupdate","ended"],function(s){return i.updateContent(s)}),i.updateTextNode_(),i}var r=t.prototype;return r.createEl=function(){var e=this.buildCSSClass(),i=a.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),s=ne("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xA0"},{role:"presentation"});return i.appendChild(s),this.contentEl_=ne("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},r.dispose=function(){this.contentEl_=null,this.textNode_=null,a.prototype.dispose.call(this)},r.updateTextNode_=function(e){var i=this;e===void 0&&(e=0),e=Kr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(!!i.contentEl_){var s=i.textNode_;s&&i.contentEl_.firstChild!==s&&(s=null,ie.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),i.textNode_=G.createTextNode(i.formattedTime_),i.textNode_&&(s?i.contentEl_.replaceChild(i.textNode_,s):i.contentEl_.appendChild(i.textNode_))}}))},r.updateContent=function(e){},t}(V);ti.prototype.labelText_="Time";ti.prototype.controlText_="Time";V.registerComponent("TimeDisplay",ti);var Do=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(e){var i;this.player_.ended()?i=this.player_.duration():i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)},t}(ti);Do.prototype.labelText_="Current Time";Do.prototype.controlText_="Current Time";V.registerComponent("CurrentTimeDisplay",Do);var wo=function(a){W(t,a);function t(n,e){var i;i=a.call(this,n,e)||this;var s=function(u){return i.updateContent(u)};return i.on(n,"durationchange",s),i.on(n,"loadstart",s),i.on(n,"loadedmetadata",s),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var i=this.player_.duration();this.updateTextNode_(i)},t}(ti);wo.prototype.labelText_="Duration";wo.prototype.controlText_="Duration";V.registerComponent("DurationDisplay",wo);var Z0=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=a.prototype.createEl.call(this,"div"),s=a.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(s),e.appendChild(i),e},t}(V);V.registerComponent("TimeDivider",Z0);var ko=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"durationchange",function(s){return i.updateContent(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=a.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(ne("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(e){if(typeof this.player_.duration()=="number"){var i;this.player_.ended()?i=0:this.player_.remainingTimeDisplay?i=this.player_.remainingTimeDisplay():i=this.player_.remainingTime(),this.updateTextNode_(i)}},t}(ti);ko.prototype.labelText_="Remaining Time";ko.prototype.controlText_="Remaining Time";V.registerComponent("RemainingTimeDisplay",ko);var ey=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateShowing(),i.on(i.player(),"durationchange",function(s){return i.updateShowing(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ne("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ne("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xA0"})),this.contentEl_.appendChild(G.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(V);V.registerComponent("LiveDisplay",ey);var Yc=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(s){return i.updateLiveEdgeStatus(s)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ne("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,a.prototype.dispose.call(this)},t}(ft);Yc.prototype.controlText_="Seek to live, currently playing live";V.registerComponent("SeekToLive",Yc);var Ca=function(t,r,n){return t=Number(t),Math.min(n,Math.max(r,isNaN(t)?r:t))},Po=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseDown_=function(s){return i.handleMouseDown(s)},i.handleMouseUp_=function(s){return i.handleMouseUp(s)},i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.handleClick_=function(s){return i.handleClick(s)},i.handleMouseMove_=function(s){return i.handleMouseMove(s)},i.update_=function(s){return i.update(s)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}var r=t.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(!!this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i.className=i.className+" vjs-slider",i=be({tabIndex:0},i),s=be({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},s),a.prototype.createEl.call(this,e,i,s)},r.handleMouseDown=function(e){var i=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!jt&&e.preventDefault(),Cc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ac(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var e=this;if(!(!this.el_||!this.bar)){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var s=e.vertical()?"height":"width";e.bar.el().style[s]=(i*100).toFixed(2)+"%"})),i}},r.getProgress=function(){return Number(Ca(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var i=_a(this.el_,e);return this.vertical()?i.y:i.x},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):te.isEventKey(e,"Right")||te.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):a.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(V);V.registerComponent("Slider",Po);var as=function(t,r){return Ca(t/r*100,0,100).toFixed(2)+"%"},ty=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.partEls_=[],i.on(n,"progress",function(s){return i.update(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=ne("span",{className:"vjs-control-text"}),s=ne("span",{textContent:this.localize("Loaded")}),o=G.createTextNode(": ");return this.percentageEl_=ne("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(s),i.appendChild(o),i.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,a.prototype.dispose.call(this)},r.update=function(e){var i=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var s=i.player_.liveTracker,o=i.player_.buffered(),u=s&&s.isLive()?s.seekableEnd():i.player_.duration(),l=i.player_.bufferedEnd(),c=i.partEls_,g=as(l,u);i.percent_!==g&&(i.el_.style.width=g,mr(i.percentageEl_,g),i.percent_=g);for(var m=0;mo.length;x--)i.el_.removeChild(c[x-1]);c.length=o.length})},t}(V);V.registerComponent("LoadProgressBar",ty);var ry=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Vt(ye(ee(i),i.update),ht),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s){var o=Ni(this.el_),u=Wr(this.player_.el()),l=e.width*i;if(!(!u||!o)){var c=e.left-u.left+l,g=e.width-l+(u.right-e.right),m=o.width/2;co.width&&(m=o.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(s)}},r.write=function(e){mr(this.el_,e)},r.updateTime=function(e,i,s,o){var u=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,c=u.player_.duration();if(u.player_.liveTracker&&u.player_.liveTracker.isLive()){var g=u.player_.liveTracker.liveWindow(),m=g-i*g;l=(m<1?"":"-")+Kr(m,g)}else l=Kr(s,c);u.update(e,i,l),o&&o()})},t}(V);V.registerComponent("TimeTooltip",ry);var Io=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Vt(ye(ee(i),i.update),ht),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,i){var s=this.getChild("timeTooltip");if(!!s){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,i,o)}},t}(V);Io.prototype.options_={children:[]};!$e&&!qt&&Io.prototype.options_.children.push("timeTooltip");V.registerComponent("PlayProgressBar",Io);var Qc=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Vt(ye(ee(i),i.update),ht),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i){var s=this,o=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,o,function(){s.el_.style.left=e.width*i+"px"})},t}(V);Qc.prototype.options_={children:["timeTooltip"]};V.registerComponent("MouseTimeDisplay",Qc);var An=5,Il=12,Oo=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.setEventHandlers_(),i}var r=t.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=ye(this,this.update),this.update=Vt(this.update_,ht),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(i){return e.enableInterval_(i)},this.disableIntervalHandler_=function(i){return e.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in G&&"visibilityState"in G&&this.on(G,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){G.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ht))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var i=this;if(G.visibilityState!=="hidden"){var s=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),u=i.player_.liveTracker,l=i.player_.duration();u&&u.isLive()&&(l=i.player_.liveTracker.liveCurrentTime()),i.percent_!==s&&(i.el_.setAttribute("aria-valuenow",(s*100).toFixed(2)),i.percent_=s),(i.currentTime_!==o||i.duration_!==l)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Kr(o,l),Kr(l,l)],"{1} of {2}")),i.currentTime_=o,i.duration_=l),i.bar&&i.bar.update(Wr(i.el()),i.getProgress())}),s}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e=this.getCurrentTime_(),i,s=this.player_.liveTracker;return s&&s.isLive()?(i=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i},r.handleMouseDown=function(e){!Bi(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(e,i){if(i===void 0&&(i=!1),!!Bi(e)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var s,o=this.calculateDistance(e),u=this.player_.liveTracker;if(!u||!u.isLive())s=o*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(o>=.99){u.seekToLiveEdge();return}var l=u.seekableStart(),c=u.liveCurrentTime();if(s=l+o*u.liveWindow(),s>=c&&(s=c),s<=l&&(s=l+.1),s===1/0)return}this.userSeek_(s)}},r.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},r.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},r.handleMouseUp=function(e){a.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?_t(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+An)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-An)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var i=this.player_.liveTracker;if(te.isEventKey(e,"Space")||te.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(te.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(te.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(te(e))){e.preventDefault(),e.stopPropagation();var s=(te.codes[te(e)]-te.codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else te.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-An*Il)):te.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+An*Il)):a.prototype.handleKeyDown.call(this,e)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in G&&"visibilityState"in G&&this.off(G,"visibilitychange",this.toggleVisibility_),a.prototype.dispose.call(this)},t}(Po);Oo.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!$e&&!qt&&Oo.prototype.options_.children.splice(1,0,"mouseTimeDisplay");V.registerComponent("SeekBar",Oo);var Jc=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseMove=Vt(ye(ee(i),i.handleMouseMove),ht),i.throttledHandleMouseSeek=Vt(ye(ee(i),i.handleMouseSeek),ht),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.handleMouseDownHandler_=function(s){return i.handleMouseDown(s)},i.enable(),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var i=this.getChild("seekBar");if(!!i){var s=i.getChild("playProgressBar"),o=i.getChild("mouseTimeDisplay");if(!(!s&&!o)){var u=i.el(),l=Ni(u),c=_a(u,e).x;c=Ca(c,0,1),o&&o.update(l,c),s&&s.update(l,i.getProgress())}}},r.handleMouseSeek=function(e){var i=this.getChild("seekBar");i&&i.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&_t(this.player_.play())}},r.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(e){var i=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(V);Jc.prototype.options_={children:["seekBar"]};V.registerComponent("ProgressControl",Jc);var Zc=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["enterpictureinpicture","leavepictureinpicture"],function(s){return i.handlePictureInPictureChange(s)}),i.on(n,["disablepictureinpicturechanged","loadedmetadata"],function(s){return i.handlePictureInPictureEnabledChange(s)}),i.on(n,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var s=n.currentType().substring(0,5)==="audio";s||n.audioPosterMode()||n.audioOnlyMode()?(n.isInPictureInPicture()&&n.exitPictureInPicture(),i.hide()):i.show()}),i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+a.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){G.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(ft);Zc.prototype.controlText_="Picture-in-Picture";V.registerComponent("PictureInPictureToggle",Zc);var ef=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"fullscreenchange",function(s){return i.handleFullscreenChange(s)}),G[n.fsApi_.fullscreenEnabled]===!1&&i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ft);ef.prototype.controlText_="Fullscreen";V.registerComponent("FullscreenToggle",ef);var iy=function(t,r){r.tech_&&!r.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},ny=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(a.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},t}(V);V.registerComponent("VolumeLevel",ny);var ay=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Vt(ye(ee(i),i.update),ht),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s,o){if(!s){var u=Wr(this.el_),l=Wr(this.player_.el()),c=e.width*i;if(!l||!u)return;var g=e.left-l.left+c,m=e.width-c+(l.right-e.right),_=u.width/2;g<_?_+=_-g:m<_&&(_=m),_<0?_=0:_>u.width&&(_=u.width),this.el_.style.right="-"+_+"px"}this.write(o+"%")},r.write=function(e){mr(this.el_,e)},r.updateVolume=function(e,i,s,o,u){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,i,s,o.toFixed(0)),u&&u()})},t}(V);V.registerComponent("VolumeLevelTooltip",ay);var tf=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Vt(ye(ee(i),i.update),ht),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i,s){var o=this,u=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,s,u,function(){s?o.el_.style.bottom=e.height*i+"px":o.el_.style.left=e.width*i+"px"})},t}(V);tf.prototype.options_={children:["volumeLevelTooltip"]};V.registerComponent("MouseVolumeLevelDisplay",tf);var Aa=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on("slideractive",function(s){return i.updateLastVolume_(s)}),i.on(n,"volumechange",function(s){return i.updateARIAAttributes(s)}),n.ready(function(){return i.updateARIAAttributes()}),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){!Bi(e)||a.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(e){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var s=this.el(),o=Wr(s),u=this.vertical(),l=_a(s,e);l=u?l.y:l.x,l=Ca(l,0,1),i.update(o,l,u)}!Bi(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},r.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},r.updateLastVolume_=function(){var e=this,i=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(i)})},t}(Po);Aa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!$e&&!qt&&Aa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Aa.prototype.playerEvent="volumechange";V.registerComponent("VolumeBar",Aa);var rf=function(a){W(t,a);function t(n,e){var i;return e===void 0&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||Ri(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),i=a.call(this,n,e)||this,iy(ee(i),n),i.throttledHandleMouseMove=Vt(ye(ee(i),i.handleMouseMove),ht),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.on("mousedown",function(s){return i.handleMouseDown(s)}),i.on("touchstart",function(s){return i.handleMouseDown(s)}),i.on("mousemove",function(s){return i.handleMouseMove(s)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}var r=t.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(e){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(V);rf.prototype.options_={children:["volumeBar"]};V.registerComponent("VolumeControl",rf);var sy=function(t,r){r.tech_&&!r.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},nf=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,sy(ee(i),n),i.on(n,["loadstart","volumechange"],function(s){return i.update(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var i=this.player_.volume(),s=this.player_.lastVolume_();if(i===0){var o=s<.1?.1:s;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),i=3;$e&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?i=0:e<.33?i=1:e<.67&&(i=2);for(var s=0;s<4;s++)zi(this.el_,"vjs-vol-"+s);Ft(this.el_,"vjs-vol-"+i)},r.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0,i=e?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},t}(ft);nf.prototype.controlText_="Mute";V.registerComponent("MuteToggle",nf);var af=function(a){W(t,a);function t(n,e){var i;return e===void 0&&(e={}),typeof e.inline<"u"?e.inline=e.inline:e.inline=!0,(typeof e.volumeControl>"u"||Ri(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),i=a.call(this,n,e)||this,i.handleKeyPressHandler_=function(s){return i.handleKeyPress(s)},i.on(n,["loadstart"],function(s){return i.volumePanelState_(s)}),i.on(i.muteToggle,"keyup",function(s){return i.handleKeyPress(s)}),i.on(i.volumeControl,"keyup",function(s){return i.handleVolumeControlKeyUp(s)}),i.on("keydown",function(s){return i.handleKeyPress(s)}),i.on("mouseover",function(s){return i.handleMouseOver(s)}),i.on("mouseout",function(s){return i.handleMouseOut(s)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}var r=t.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),a.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){te.isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),it(G,"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Ne(G,"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){te.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(V);af.prototype.options_={children:["muteToggle","volumeControl"]};V.registerComponent("VolumePanel",af);var sf=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,e&&(i.menuButton_=e.menuButton),i.focusedChild_=-1,i.on("keydown",function(s){return i.handleKeyDown(s)}),i.boundHandleBlur_=function(s){return i.handleBlur(s)},i.boundHandleTapClick_=function(s){return i.handleTapClick(s)},i}var r=t.prototype;return r.addEventListenerForItem=function(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),a.prototype.removeChild.call(this,e)},r.addItem=function(e){var i=this.addChild(e);i&&this.addEventListenerForItem(i)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=ne(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),it(i,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),i},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,a.prototype.dispose.call(this)},r.handleBlur=function(e){var i=e.relatedTarget||G.activeElement;if(!this.children().some(function(o){return o.el()===i})){var s=this.menuButton_;s&&s.buttonPressed_&&i!==s.el().firstChild&&s.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var s=i.filter(function(o){return o.el()===e.target})[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(te.isEventKey(e,"Right")||te.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){e===void 0&&(e=0);var i=this.children().slice(),s=i.length&&i[0].hasClass("vjs-menu-title");s&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())},t}(V);V.registerComponent("Menu",sf);var Lo=function(a){W(t,a);function t(n,e){var i;e===void 0&&(e={}),i=a.call(this,n,e)||this,i.menuButton_=new ft(n,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ft.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+s,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var o=function(l){return i.handleClick(l)};return i.handleMenuKeyUp_=function(u){return i.handleMenuKeyUp(u)},i.on(i.menuButton_,"tap",o),i.on(i.menuButton_,"click",o),i.on(i.menuButton_,"keydown",function(u){return i.handleKeyDown(u)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),it(G,"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(u){return i.handleMouseLeave(u)}),i.on("keydown",function(u){return i.handleSubmenuKeyDown(u)}),i}var r=t.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var e=new sf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=ne("li",{className:"vjs-menu-title",textContent:Ee(this.options_.title),tabIndex:-1}),s=new V(this.player_,{el:i});e.addItem(s)}if(this.items=this.createItems(),this.items)for(var o=0;o-1&&l.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)},r.handleSelectedLanguageChange=function(e){for(var i=this.player().textTracks(),s=!0,o=0,u=i.length;o-1&&l.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Xi);V.registerComponent("OffTextTrackMenuItem",of);var ri=function(a){W(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.textTracks(),a.call(this,n,e)||this}var r=t.prototype;return r.createItems=function(e,i){e===void 0&&(e=[]),i===void 0&&(i=Xi);var s;this.label_&&(s=this.label_+" off"),e.push(new of(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var u=0;u-1){var c=new i(this.player_,{track:l,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+l.kind+"-menu-item"),e.push(c)}}return e},t}(Fo);V.registerComponent("TextTrackButton",ri);var uf=function(a){W(t,a);function t(n,e){var i,s=e.track,o=e.cue,u=n.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=u&&u=0;i--){var s=e[i];if(s.kind===this.kind_)return s}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ee(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var i=this.track_.cues;if(!i)return e;for(var s=0,o=i.length;s-1&&(i.label_="captions"),i.menuButton_.controlText(Ee(i.label_)),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Bo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=a.prototype.createItems.call(this,e,lf),e},t}(ri);Vo.prototype.kinds_=["captions","subtitles"];Vo.prototype.controlText_="Subtitles";V.registerComponent("SubsCapsButton",Vo);var df=function(a){W(t,a);function t(n,e){var i,s=e.track,o=n.audioTracks();e.label=s.label||s.language||"Unknown",e.selected=s.enabled,i=a.call(this,n,e)||this,i.track=s,i.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,g=new Array(c),m=0;m=0;s--)i.push(new Ho(this.player(),{rate:e[s]+"x"}));return i},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){var i=this.player().playbackRate(),s=this.playbackRates(),o=s.indexOf(i),u=(o+1)%s.length;this.player().playbackRate(s[u])},r.handlePlaybackRateschange=function(e){this.update()},r.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Lo);ff.prototype.controlText_="Playback Rate";V.registerComponent("PlaybackRateMenuButton",ff);var hf=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(e,i,s){return e===void 0&&(e="div"),i===void 0&&(i={}),s===void 0&&(s={}),i.className||(i.className=this.buildCSSClass()),a.prototype.createEl.call(this,e,i,s)},t}(V);V.registerComponent("Spacer",hf);var uy=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xA0"})},t}(hf);V.registerComponent("CustomControlSpacer",uy);var Kn=function(a){W(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(V);Kn.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in G&&Kn.prototype.options_.children.splice(Kn.prototype.options_.children.length-1,0,"pictureInPictureToggle");V.registerComponent("ControlBar",Kn);var pf=function(a){W(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"error",function(s){return i.open(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Zr);pf.prototype.options_=ot({},Zr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});V.registerComponent("ErrorDisplay",pf);var ss="vjs-text-track-settings",Ol=["#000","Black"],Ll=["#00F","Blue"],Fl=["#0FF","Cyan"],Rl=["#0F0","Green"],Ml=["#F0F","Magenta"],Nl=["#F00","Red"],Bl=["#FFF","White"],Ul=["#FF0","Yellow"],os=["1","Opaque"],us=["0.5","Semi-Transparent"],Vl=["0","Transparent"],or={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Ol,Bl,Nl,Rl,Ll,Ul,Ml,Fl]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[os,us,Vl]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Bl,Ol,Nl,Rl,Ll,Ul,Ml,Fl]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[os,us]},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:[Vl,us,os]}};or.windowColor.options=or.backgroundColor.options;function mf(a,t){if(t&&(a=t(a)),a&&a!=="none")return a}function ly(a,t){var r=a.options[a.options.selectedIndex].value;return mf(r,t)}function dy(a,t,r){if(!!t){for(var n=0;n',this.localize(u.label),"",'").join("")},r.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},r.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},r.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},r.createElColors_=function(){return ne("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return ne("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},r.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ne("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].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 a.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var e=this;return Zv(or,function(i,s,o){var u=ly(e.$(s.selector),s.parser);return u!==void 0&&(i[o]=u),i},{})},r.setValues=function(e){var i=this;Fr(or,function(s,o){dy(i.$(s.selector),e[o],s.parser)})},r.setDefaults=function(){var e=this;Fr(or,function(i){var s=i.hasOwnProperty("default")?i.default:0;e.$(i.selector).selectedIndex=s})},r.restoreSettings=function(){var e;try{e=JSON.parse(A.localStorage.getItem(ss))}catch(i){ie.warn(i)}e&&this.setValues(e)},r.saveSettings=function(){if(!!this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?A.localStorage.setItem(ss,JSON.stringify(e)):A.localStorage.removeItem(ss)}catch(i){ie.warn(i)}}},r.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,i=e&&e.subsCapsButton,s=e&&e.captionsButton;i?i.focus():s&&s.focus()},t}(Zr);V.registerComponent("TextTrackSettings",cy);var fy=function(a){W(t,a);function t(n,e){var i,s=e.ResizeObserver||A.ResizeObserver;e.ResizeObserver===null&&(s=!1);var o=ve({createEl:!s,reportTouchActivity:!1},e);return i=a.call(this,n,o)||this,i.ResizeObserver=e.ResizeObserver||A.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=d0(function(){i.resizeHandler()},100,!1,ee(i)),s?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(n.el())):(i.loadListener_=function(){if(!(!i.el_||!i.el_.contentWindow)){var u=i.debouncedHandler_,l=i.unloadListener_=function(){Ne(this,"resize",u),Ne(this,"unload",l),l=null};it(i.el_.contentWindow,"unload",l),it(i.el_.contentWindow,"resize",u)}},i.one("load",i.loadListener_)),i}var r=t.prototype;return r.createEl=function(){return a.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,a.prototype.dispose.call(this)},t}(V);V.registerComponent("ResizeManager",fy);var hy={trackingThreshold:20,liveTolerance:15},py=function(a){W(t,a);function t(n,e){var i,s=ve(hy,e,{createEl:!1});return i=a.call(this,n,s)||this,i.handleVisibilityChange_=function(o){return i.handleVisibilityChange(o)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(o){return i.handlePlay(o)},i.handleFirstTimeupdate_=function(o){return i.handleFirstTimeupdate(o)},i.handleSeeked_=function(o){return i.handleSeeked(o)},i.seekToLiveEdge_=function(o){return i.seekToLiveEdge(o)},i.reset_(),i.on(i.player_,"durationchange",function(o){return i.handleDurationchange(o)}),i.on(i.player_,"canplay",function(){return i.toggleTracking()}),Wi&&"hidden"in G&&"visibilityState"in G&&i.on(G,"visibilitychange",i.handleVisibilityChange_),i}var r=t.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(G.hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var e=this.player_.seekable();if(!(!e||!e.length)){var i=Number(A.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+s;var o=this.liveCurrentTime(),u=this.player_.currentTime(),l=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-u)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(l=!1),l!==this.behindLiveEdge_&&(this.behindLiveEdge_=l,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ht),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.end(s));return i.length?i.sort()[i.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.start(s));return i.length?i.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(G,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),a.prototype.dispose.call(this)},t}(V);V.registerComponent("LiveTracker",py);var Is=function(t){var r=t.el();if(r.hasAttribute("src"))return t.triggerSourceset(r.src),!0;var n=t.$$("source"),e=[],i="";if(!n.length)return!1;for(var s=0;s=2&&u.push("loadeddata"),e.readyState>=3&&u.push("canplay"),e.readyState>=4&&u.push("canplaythrough"),this.ready(function(){u.forEach(function(l){this.trigger(l)},this)})}},r.setScrubbing=function(e){this.isScrubbing_=e},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&va?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){ie(i,"Video is not ready. (Video.js)")}},r.duration=function(){var e=this;if(this.el_.duration===1/0&&qt&&jt&&this.el_.currentTime===0){var i=function s(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",s))};return this.on("timeupdate",i),NaN}return this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},s=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",s),this.on("dispose",function(){e.off("webkitbeginfullscreen",s),e.off("webkitendfullscreen",i)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=A.navigator&&A.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},r.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)_t(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},r.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):a.prototype.requestVideoFrameCallback.call(this,e)},r.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):a.prototype.cancelVideoFrameCallback.call(this,e)},r.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},r.reset=function(){t.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(e){this.el_.controls=!!e},r.addTextTrack=function(e,i,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,s):a.prototype.addTextTrack.call(this,e,i,s)},r.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,e);var i=G.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},r.addRemoteTextTrack=function(e,i){var s=a.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(s),s},r.removeRemoteTextTrack=function(e){if(a.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),s=i.length;s--;)(e===i[s]||e===i[s].track)&&this.el().removeChild(i[s])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A.performance&&typeof A.performance.now=="function"?e.creationTime=A.performance.now():A.performance&&A.performance.timing&&typeof A.performance.timing.navigationStart=="number"&&(e.creationTime=A.Date.now()-A.performance.timing.navigationStart),e},t}(he);qo(K,"TEST_VID",function(){if(!!Yr()){var a=G.createElement("video"),t=G.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",a.appendChild(t),a}});K.isSupported=function(){try{K.TEST_VID.volume=.5}catch{return!1}return!!(K.TEST_VID&&K.TEST_VID.canPlayType)};K.canPlayType=function(a){return K.TEST_VID.canPlayType(a)};K.canPlaySource=function(a,t){return K.canPlayType(a.type)};K.canControlVolume=function(){try{var a=K.TEST_VID.volume;K.TEST_VID.volume=a/2+.1;var t=a!==K.TEST_VID.volume;return t&&$e?(A.setTimeout(function(){K&&K.prototype&&(K.prototype.featuresVolumeControl=a!==K.TEST_VID.volume)}),!1):t}catch{return!1}};K.canMuteVolume=function(){try{var a=K.TEST_VID.muted;return K.TEST_VID.muted=!a,K.TEST_VID.muted?Gr(K.TEST_VID,"muted","muted"):ya(K.TEST_VID,"muted","muted"),a!==K.TEST_VID.muted}catch{return!1}};K.canControlPlaybackRate=function(){if(qt&&jt&&vc<58)return!1;try{var a=K.TEST_VID.playbackRate;return K.TEST_VID.playbackRate=a/2+.1,a!==K.TEST_VID.playbackRate}catch{return!1}};K.canOverrideAttributes=function(){try{var a=function(){};Object.defineProperty(G.createElement("video"),"src",{get:a,set:a}),Object.defineProperty(G.createElement("audio"),"src",{get:a,set:a}),Object.defineProperty(G.createElement("video"),"innerHTML",{get:a,set:a}),Object.defineProperty(G.createElement("audio"),"innerHTML",{get:a,set:a})}catch{return!1}return!0};K.supportsNativeTextTracks=function(){return va||$e&&jt};K.supportsNativeVideoTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.videoTracks)};K.supportsNativeAudioTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.audioTracks)};K.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(a){var t=a[0],r=a[1];qo(K.prototype,t,function(){return K[r]()},!0)});K.prototype.featuresVolumeControl=K.canControlVolume();K.prototype.movingMediaElementInDOM=!$e;K.prototype.featuresFullscreenResize=!0;K.prototype.featuresProgressEvents=!0;K.prototype.featuresTimeupdateEvents=!0;K.prototype.featuresVideoFrameCallback=!!(K.TEST_VID&&K.TEST_VID.requestVideoFrameCallback);var Xn;K.patchCanPlayType=function(){po>=4&&!gc&&!jt&&(Xn=K.TEST_VID&&K.TEST_VID.constructor.prototype.canPlayType,K.TEST_VID.constructor.prototype.canPlayType=function(a){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return a&&t.test(a)?"maybe":Xn.call(this,a)})};K.unpatchCanPlayType=function(){var a=K.TEST_VID.constructor.prototype.canPlayType;return Xn&&(K.TEST_VID.constructor.prototype.canPlayType=Xn),a};K.patchCanPlayType();K.disposeMediaElement=function(a){if(!!a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};K.resetMediaElement=function(a){if(!!a){for(var t=a.querySelectorAll("source"),r=t.length;r--;)a.removeChild(t[r]);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]||this.el_.hasAttribute(a)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t,t?this.el_.setAttribute(a,a):this.el_.removeAttribute(a)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t}});["pause","load","play"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]()}});he.withSourceHandlers(K);K.nativeSourceHandler={};K.nativeSourceHandler.canPlayType=function(a){try{return K.TEST_VID.canPlayType(a)}catch{return""}};K.nativeSourceHandler.canHandleSource=function(a,t){if(a.type)return K.nativeSourceHandler.canPlayType(a.type);if(a.src){var r=Eo(a.src);return K.nativeSourceHandler.canPlayType("video/"+r)}return""};K.nativeSourceHandler.handleSource=function(a,t,r){t.setSrc(a.src)};K.nativeSourceHandler.dispose=function(){};K.registerSourceHandler(K.nativeSourceHandler);he.registerTech("Html5",K);var vf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ls={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Os=["tiny","xsmall","small","medium","large","xlarge","huge"],Fn={};Os.forEach(function(a){var t=a.charAt(0)==="x"?"x-"+a.substring(1):a;Fn[a]="vjs-layout-"+t});var Ty={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ae=function(a){W(t,a);function t(n,e,i){var s;if(n.id=n.id||e.id||"vjs_video_"+Gt(),e=be(t.getTagSettings(n),e),e.initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if(typeof n.closest=="function"){var o=n.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var u=n;u&&u.nodeType===1;){if(Pt(u).hasOwnProperty("lang")){e.language=u.getAttribute("lang");break}u=u.parentNode}if(s=a.call(this,null,e,i)||this,s.boundDocumentFullscreenChange_=function(m){return s.documentFullscreenChange_(m)},s.boundFullWindowOnEscKey_=function(m){return s.fullWindowOnEscKey(m)},s.boundUpdateStyleEl_=function(m){return s.updateStyleEl_(m)},s.boundApplyInitTime_=function(m){return s.applyInitTime_(m)},s.boundUpdateCurrentBreakpoint_=function(m){return s.updateCurrentBreakpoint_(m)},s.boundHandleTechClick_=function(m){return s.handleTechClick_(m)},s.boundHandleTechDoubleClick_=function(m){return s.handleTechDoubleClick_(m)},s.boundHandleTechTouchStart_=function(m){return s.handleTechTouchStart_(m)},s.boundHandleTechTouchMove_=function(m){return s.handleTechTouchMove_(m)},s.boundHandleTechTouchEnd_=function(m){return s.handleTechTouchEnd_(m)},s.boundHandleTechTap_=function(m){return s.handleTechTap_(m)},s.isFullscreen_=!1,s.log=fc(s.id_),s.fsApi_=Gn,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=n,s.tagAttributes=n&&Pt(n),s.language(s.options_.language),e.languages){var l={};Object.getOwnPropertyNames(e.languages).forEach(function(m){l[m.toLowerCase()]=e.languages[m]}),s.languages_=l}else s.languages_=t.prototype.options_.languages;s.resetCache_(),s.poster_=e.poster||"",s.controls_=!!e.controls,n.controls=!1,n.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],n.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(m){if(typeof s[m]!="function")throw new Error('plugin "'+m+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),bo(ee(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(it(G,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var c=ve(s.options_);e.plugins&&Object.keys(e.plugins).forEach(function(m){s[m](e.plugins[m])}),e.debug&&s.debug(!0),s.options_.playerOptions=c,s.middleware_=[],s.playbackRates(e.playbackRates),s.initChildren(),s.isAudio(n.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"),jr&&s.addClass("vjs-touch-enabled"),$e||s.addClass("vjs-workinghover"),t.players[s.id_]=ee(s);var g=lc.split(".")[0];return s.addClass("vjs-v"+g),s.userActive(!0),s.reportUserActivity(),s.one("play",function(m){return s.listenForUserActivity_(m)}),s.on("stageclick",function(m){return s.handleStageClick_(m)}),s.on("keydown",function(m){return s.handleKeyDown(m)}),s.on("languagechange",function(m){return s.handleLanguagechange(m)}),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}var r=t.prototype;return r.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Ne(G,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ne(G,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.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),V0(this),qe.names.forEach(function(i){var s=qe[i],o=e[s.getterName]();o&&o.off&&o.off()}),a.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var e=this.tag,i,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";s?i=this.el_=e.parentNode:o||(i=this.el_=a.prototype.createEl.call(this,"div"));var u=Pt(e);if(o){for(i=this.el_=e,e=this.tag=G.createElement("video");i.children.length;)e.appendChild(i.firstChild);dr(i,"video-js")||Ft(i,"video-js"),i.appendChild(e),s=this.playerElIngest_=i,Object.keys(i).forEach(function(b){try{e[b]=i[b]}catch{}})}if(e.setAttribute("tabindex","-1"),u.tabindex="-1",(Wi||jt&&yc)&&(e.setAttribute("role","application"),u.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in u&&delete u.width,"height"in u&&delete u.height,Object.getOwnPropertyNames(u).forEach(function(b){o&&b==="class"||i.setAttribute(b,u[b]),o&&e.setAttribute(b,u[b])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),A.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Lc("vjs-styles-dimensions");var l=Xt(".vjs-styles-defaults"),c=Xt("head");c.insertBefore(this.styleEl_,l?l.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 g=e.getElementsByTagName("a"),m=0;m=0&&(s.width=e),i>=0&&(s.height=i));return}var o,u,l,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?l=this.aspectRatio_:this.videoWidth()>0?l=this.videoWidth()+":"+this.videoHeight():l="16:9";var g=l.split(":"),m=g[1]/g[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/m:o=this.videoWidth()||300,this.height_!==void 0?u=this.height_:u=o*m,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Fc(this.styleEl_,` .`+c+` { width: `+o+`px; height: `+u+`px; } .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: `+m*100+`%; } `)},r.loadTech_=function(e,i){var s=this;this.tech_&&this.unloadTech_();var o=Ee(e),u=e.charAt(0).toLowerCase()+e.slice(1);o!=="Html5"&&this.tag&&(he.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);var c={source:i,autoplay:l,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+u+"_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};qe.names.forEach(function(m){var _=qe[m];c[_.getterName]=s[_.privateName]}),be(c,this.options_[o]),be(c,this.options_[u]),be(c,this.options_[e.toLowerCase()]),this.tag&&(c.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var g=he.getTech(e);if(!g)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new g(c),this.tech_.ready(ye(this,this.handleTechReady_),!0),xl.jsonToTextTracks(this.textTracksJson_||[],this.tech_),vf.forEach(function(m){s.on(s.tech_,m,function(_){return s["handleTech"+Ee(m)+"_"](_)})}),Object.keys(ls).forEach(function(m){s.on(s.tech_,m,function(_){if(s.tech_.playbackRate()===0&&s.tech_.seeking()){s.queuedCallbacks_.push({callback:s["handleTech"+ls[m]+"_"].bind(s),event:_});return}s["handleTech"+ls[m]+"_"](_)})}),this.on(this.tech_,"loadstart",function(m){return s.handleTechLoadStart_(m)}),this.on(this.tech_,"sourceset",function(m){return s.handleTechSourceset_(m)}),this.on(this.tech_,"waiting",function(m){return s.handleTechWaiting_(m)}),this.on(this.tech_,"ended",function(m){return s.handleTechEnded_(m)}),this.on(this.tech_,"seeking",function(m){return s.handleTechSeeking_(m)}),this.on(this.tech_,"play",function(m){return s.handleTechPlay_(m)}),this.on(this.tech_,"firstplay",function(m){return s.handleTechFirstPlay_(m)}),this.on(this.tech_,"pause",function(m){return s.handleTechPause_(m)}),this.on(this.tech_,"durationchange",function(m){return s.handleTechDurationChange_(m)}),this.on(this.tech_,"fullscreenchange",function(m,_){return s.handleTechFullscreenChange_(m,_)}),this.on(this.tech_,"fullscreenerror",function(m,_){return s.handleTechFullscreenError_(m,_)}),this.on(this.tech_,"enterpictureinpicture",function(m){return s.handleTechEnterPictureInPicture_(m)}),this.on(this.tech_,"leavepictureinpicture",function(m){return s.handleTechLeavePictureInPicture_(m)}),this.on(this.tech_,"error",function(m){return s.handleTechError_(m)}),this.on(this.tech_,"posterchange",function(m){return s.handleTechPosterChange_(m)}),this.on(this.tech_,"textdata",function(m){return s.handleTechTextData_(m)}),this.on(this.tech_,"ratechange",function(m){return s.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()&&(o!=="Html5"||!this.tag)&&Es(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var e=this;qe.names.forEach(function(i){var s=qe[i];e[s.privateName]=e[s.getterName]()}),this.textTracksJson_=xl.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(e){return e===void 0&&ie.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var i=this;if(!(!this.tech_||typeof e!="string")){var s=function(){var l=i.muted();i.muted(!0);var c=function(){i.muted(l)};i.playTerminatedQueue_.push(c);var g=i.play();if(!!Di(g))return g.catch(function(m){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(m||""))})},o;if(e==="any"&&!this.muted()?(o=this.play(),Di(o)&&(o=o.catch(s))):e==="muted"&&!this.muted()?o=s():o=this.play(),!!Di(o))return o.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){e===void 0&&(e="");var i=e,s="";typeof i!="string"&&(i=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!s&&(s=j0(this,i)),this.cache_.source=ve({},e,{src:i,type:s});for(var o=this.cache_.sources.filter(function(_){return _.src&&_.src===i}),u=[],l=this.$$("source"),c=[],g=0;g0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime(),s=function o(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))};this.on("timeupdate",s)},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&&(ie.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){!this.controls_||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?_t(this.play()):this.pause())},r.handleTechDoubleClick_=function(e){if(!!this.controls_){var i=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(s){return s.contains(e.target)});i||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var i=e.target.player;if(!(i&&i!==this)){var s=this.el(),o=G[this.fsApi_.fullscreenElement]===s;!o&&s.matches?o=s.matches(":"+this.fsApi_.fullscreen):!o&&s.msMatchesSelector&&(o=s.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},r.handleTechFullscreenChange_=function(e,i){var s=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){s.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},r.handleTechFullscreenError_=function(e,i){this.trigger("fullscreenerror",i)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,i){this.ready(function(){if(e in B0)return M0(this.middleware_,this.tech_,e,i);if(e in wl)return Dl(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(s){throw ie(s),s}},!0)},r.techGet_=function(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in N0)return R0(this.middleware_,this.tech_,e);if(e in wl)return Dl(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw this.tech_[e]===void 0?(ie("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",i),i):i.name==="TypeError"?(ie("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(ie(i),i)}}},r.play=function(){var e=this,i=this.options_.Promise||A.Promise;return i?new i(function(s){e.play_(s)}):this.play_()},r.play_=function(e){var i=this;e===void 0&&(e=_t),this.playCallbacks_.push(e);var s=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),o=Boolean(va||$e);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!s){this.waitToPlay_=function(c){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!s&&o&&this.load();return}var u=this.techGet_("play"),l=o&&this.hasClass("vjs-ended");l&&this.resetProgressBar_(),u===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(u)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})},r.runPlayCallbacks_=function(e){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(s){s(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||cr(0,0)},r.scrubbing=function(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){if(typeof e<"u"){if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=cr(0,0)),e},r.bufferedPercent=function(){return Vc(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),i=this.duration(),s=e.end(e.length-1);return s>i&&(s=i),s},r.volume=function(e){var i;if(e!==void 0){i=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i},r.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},r.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(e!==void 0){var i=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},r.requestFullscreen=function(e){var i=this.options_.Promise||A.Promise;if(i){var s=this;return new i(function(o,u){function l(){s.off("fullscreenerror",g),s.off("fullscreenchange",c)}function c(){l(),o()}function g(_,b){l(),u(b)}s.one("fullscreenchange",c),s.one("fullscreenerror",g);var m=s.requestFullscreenHelper_(e);m&&(m.then(l,l),m.then(o,u))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var i=this,s;if(this.fsApi_.prefixed||(s=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(s=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](s);return o&&o.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||A.Promise;if(e){var i=this;return new e(function(s,o){function u(){i.off("fullscreenerror",c),i.off("fullscreenchange",l)}function l(){u(),s()}function c(m,_){u(),o(_)}i.one("fullscreenchange",l),i.one("fullscreenerror",c);var g=i.exitFullscreenHelper_();g&&(g.then(u,u),g.then(s,o))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var i=G[this.fsApi_.exitFullscreen]();return i&&_t(i.then(function(){return e.isFullscreen(!1)})),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=G.documentElement.style.overflow,it(G,"keydown",this.boundFullWindowOnEscKey_),G.documentElement.style.overflow="hidden",Ft(G.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){te.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ne(G,"keydown",this.boundFullWindowOnEscKey_),G.documentElement.style.overflow=this.docOrigOverflow,zi(G.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in G&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in G)return G.exitPictureInPicture()},r.handleKeyDown=function(e){var i=this.options_.userActions;if(!(!i||!i.hotkeys)){var s=function(u){var l=u.tagName.toLowerCase();if(u.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(l==="input")return c.indexOf(u.type)===-1;var g=["textarea"];return g.indexOf(l)!==-1};s(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,e):this.handleHotkeys(e))}},r.handleHotkeys=function(e){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},s=i.fullscreenKey,o=s===void 0?function(S){return te.isEventKey(S,"f")}:s,u=i.muteKey,l=u===void 0?function(S){return te.isEventKey(S,"m")}:u,c=i.playPauseKey,g=c===void 0?function(S){return te.isEventKey(S,"k")||te.isEventKey(S,"Space")}:c;if(o.call(this,e)){e.preventDefault(),e.stopPropagation();var m=V.getComponent("FullscreenToggle");G[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation();var _=V.getComponent("MuteToggle");_.prototype.handleClick.call(this,e)}else if(g.call(this,e)){e.preventDefault(),e.stopPropagation();var b=V.getComponent("PlayToggle");b.prototype.handleClick.call(this,e)}},r.canPlayType=function(e){for(var i,s=0,o=this.options_.techOrder;s"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=G0(e);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),L0(this,o[0],function(c,g){s.middleware_=g,i||(s.cache_.sources=o),s.updateSourceCaches_(c);var m=s.src_(c);if(m){if(o.length>1)return s.handleSrc_(o.slice(1));s.changingSrc_=!1,s.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),s.triggerReady();return}F0(g,s.tech_)}),this.options_.retryOnError&&o.length>1){var u=function(){s.error(null),s.handleSrc_(o.slice(1),!0)},l=function(){s.off("error",u)};this.one("error",u),this.one("playing",l),this.resetRetryOnError_=function(){s.off("error",u),s.off("playing",l)}}},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var i=this,s=this.selectSource([e]);return s?p0(s.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(s.tech,s.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1):!0},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,i=this.options_.Promise||A.Promise;if(this.paused()||!i)this.doReset_();else{var s=this.play();_t(s.then(function(){return e.doReset_()}))}},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Rt(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},i=e.durationDisplay,s=e.remainingTimeDisplay;i&&i.updateContent(),s&&s.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),i=[];return Object.keys(e).length!==0&&i.push(e),this.cache_.sources||i},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},r.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var i;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),i=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},r.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},r.poster=function(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(e){var i=this;if(e===void 0)return this.error_||null;if(Kt("beforeerror").forEach(function(o){var u=o(i,e);if(!(Ut(u)&&!Array.isArray(u)||typeof u=="string"||typeof u=="number"||u===null)){i.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=u}),this.options_.suppressNotSupportedError&&e&&e.code===4){var s=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],s),this.one("loadstart",function(){this.off(["click","touchstart"],s)});return}if(e===null){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ze(e),this.addClass("vjs-error"),ie.error("(CODE:"+this.error_.code+" "+ze.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Kt("error").forEach(function(o){return o(i,i.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,i,s,o=ye(this,this.reportUserActivity),u=function(b){(b.screenX!==i||b.screenY!==s)&&(i=b.screenX,s=b.screenY,o())},l=function(){o(),this.clearInterval(e),e=this.setInterval(o,250)},c=function(b){o(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",u),this.on("mouseup",c),this.on("mouseleave",c);var g=this.getChild("controlBar");g&&!$e&&!qt&&(g.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),g.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var m;this.setInterval(function(){if(!!this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);var _=this.options_.inactivityTimeout;_<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))}},250)},r.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},r.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var i=this.children(),s=this.getChild("ControlBar"),o=s&&s.currentHeight();i.forEach(function(u){u!==s&&u.el_&&!u.hasClass("vjs-hidden")&&(u.hide(),e.audioOnlyCache_.hiddenChildren.push(u))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),s.all(o).then(function(){return i.enableAudioOnlyUI_()})}return s.resolve().then(function(){return i.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.disablePosterModeUI_()})}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},r.addTextTrack=function(e,i,s){if(this.tech_)return this.tech_.addTextTrack(e,i,s)},r.addRemoteTextTrack=function(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)},r.removeRemoteTextTrack=function(e){e===void 0&&(e={});var i=e,s=i.track;if(s||(s=e),this.tech_)return this.tech_.removeRemoteTextTrack(s)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Rt(this)&&this.trigger("languagechange"))},r.languages=function(){return ve(t.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=ve(this.options_),i=e.tracks;e.tracks=[];for(var s=0;s"):function(){}},Yt=1/30,Tt=Yt*3,Tf=function(t,r){var n=[],e;if(t&&t.length)for(e=0;e=r})},wn=function(t,r){return Tf(t,function(n){return n-Yt>=r})},Sy=function(t){if(t.length<2)return I.createTimeRanges();for(var r=[],n=1;n "+t.end(n));return r.join(", ")},Cy=function(t,r,n){n===void 0&&(n=1);var e=t.length?t.end(t.length-1):0;return(e-r)/n},ur=function(t){for(var r=[],n=0;ns)){if(r>i&&r<=s){n+=s-r;continue}n+=s-i}}return n},Wl=I.createTimeRange,Go=function(t,r){if(!r.preload)return r.duration;var n=0;return(r.parts||[]).forEach(function(e){n+=e.duration}),(r.preloadHints||[]).forEach(function(e){e.type==="PART"&&(n+=t.partTargetDuration)}),n},Ls=function(t){return(t.segments||[]).reduce(function(r,n,e){return n.parts?n.parts.forEach(function(i,s){r.push({duration:i.duration,segmentIndex:e,partIndex:s,part:i,segment:n})}):r.push({duration:n.duration,segmentIndex:e,partIndex:null,segment:n,part:null}),r},[])},xf=function(t){var r=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return r&&r.parts||[]},Sf=function(t){var r=t.preloadSegment;if(!!r){var n=r.parts,e=r.preloadHints,i=(e||[]).reduce(function(s,o){return s+(o.type==="PART"?1:0)},0);return i+=n&&n.length?n.length:0,i}},Ef=function(t,r){if(r.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var n=xf(r).length>0;return n&&r.serverControl&&r.serverControl.partHoldBack?r.serverControl.partHoldBack:n&&r.partTargetDuration?r.partTargetDuration*3:r.serverControl&&r.serverControl.holdBack?r.serverControl.holdBack:r.targetDuration?r.targetDuration*3:0},Dy=function(t,r){var n=0,e=r-t.mediaSequence,i=t.segments[e];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;e--;){if(i=t.segments[e],typeof i.end<"u")return{result:n+i.end,precise:!0};if(n+=Go(t,i),typeof i.start<"u")return{result:n+i.start,precise:!0}}return{result:n,precise:!1}},wy=function(t,r){for(var n=0,e,i=r-t.mediaSequence;i"u"&&(r=t.mediaSequence+t.segments.length),r"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return A.Infinity}return Cf(t,r,n)},wi=function(t){var r=t.defaultDuration,n=t.durationList,e=t.startIndex,i=t.endIndex,s=0;if(e>i){var o=[i,e];e=o[0],i=o[1]}if(e<0){for(var u=e;u0)for(var _=c-1;_>=0;_--){var b=l[_];if(u+=b.duration,o){if(u<0)continue}else if(u+Yt<=0)continue;return{partIndex:b.partIndex,segmentIndex:b.segmentIndex,startTime:s-wi({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:_})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n}}if(c<0){for(var S=c;S<0;S++)if(u-=r.targetDuration,u<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n};c=0}for(var x=c;x0)continue}else if(u-Yt>=0)continue;return{partIndex:w.partIndex,segmentIndex:w.segmentIndex,startTime:s+wi({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:x})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:n}},wf=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},Wo=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Da=function(t){var r=wf(t);return!t.disabled&&!r},Iy=function(t){return t.disabled},Oy=function(t){for(var r=0;r-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&i--}n._HLS_msn=i}if(r.serverControl&&r.serverControl.canSkipUntil&&(n._HLS_skip=r.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var u=new A.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){!n.hasOwnProperty(l)||u.searchParams.set(l,n[l])}),t=u.toString()}return t},Hy=function(t,r){if(!t)return r;var n=ea(t,r);if(t.preloadHints&&!r.preloadHints&&delete n.preloadHints,t.parts&&!r.parts)delete n.parts;else if(t.parts&&r.parts)for(var e=0;e=500?4:2},this.trigger("error")},r.parseManifest_=function(e){var i=this,s=e.url,o=e.manifestString;return Ry({onwarn:function(l){var c=l.message;return i.logger_("m3u8-parser warn for "+s+": "+c)},oninfo:function(l){var c=l.message;return i.logger_("m3u8-parser info for "+s+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(e){var i=e.playlistString,s=e.playlistObject,o=e.url,u=e.id;this.request=null,this.state="HAVE_METADATA";var l=s||this.parseManifest_({url:o,manifestString:i});l.lastRequest=Date.now(),If({playlist:l,uri:o,id:u});var c=Rs(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[u]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ms(this.media(),!!c)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),A.clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e,i){var s=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(A.clearTimeout(this.finalRenditionTimeout),i){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A.setTimeout(this.media.bind(this,e,!1),o);return}var u=this.state,l=!this.media_||e.id!==this.media_.id,c=this.master.playlists[e.id];if(c&&c.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,l&&(this.trigger("mediachanging"),u==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Ms(e,!0)),!!l){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(g,m){if(!!s.request){if(e.lastRequest=Date.now(),e.resolvedUri=Zn(s.handleManifestRedirects,e.resolvedUri,m),g)return s.playlistRequestError(s.request,e,u);s.haveMetadata({playlistString:m.responseText,url:e.uri,id:e.id}),u==="HAVE_MASTER"?s.trigger("loadedmetadata"):s.trigger("mediachange")}})}},r.pause=function(){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var s=this.media();if(e){var o=s?(s.partTargetDuration||s.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},r.updateMediaUpdateTimeout_=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(e)},e))},r.start=function(){var e=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=A.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){e.setupInitialPlaylist(e.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,s){if(!!e.request){if(e.request=null,i)return e.error={status:s.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:s.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=Zn(e.handleManifestRedirects,e.src,s);var o=e.parseManifest_({manifestString:s.responseText,url:e.src});e.setupInitialPlaylist(o)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,Of(this.master,this.srcUri()),e.playlists.forEach(function(s){s.segments=Ff(s),s.segments.forEach(function(o){Lf(o,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var i=this.srcUri()||A.location.href;this.master=By(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Uy),jy=I.xhr,Gy=I.mergeOptions,Ns=function(t,r,n,e){var i=t.responseType==="arraybuffer"?t.response:t.responseText;!r&&i&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=i.byteLength||i.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),n.headers&&(t.responseHeaders=n.headers),r&&r.code==="ETIMEDOUT"&&(t.timedout=!0),!r&&!t.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(r=new Error("XHR Failed with a response of: "+(t&&(i||t.responseText)))),e(r,t)},Mf=function(){var t=function r(n,e){n=Gy({timeout:45e3},n);var i=r.beforeRequest||I.Vhs.xhr.beforeRequest;if(i&&typeof i=="function"){var s=i(n);s&&(n=s)}var o=I.Vhs.xhr.original===!0?jy:I.Vhs.xhr,u=o(n,function(c,g){return Ns(u,c,g,e)}),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=n.uri,u.requestTime=Date.now(),u};return t.original=!0,t},Wy=function(t){var r,n=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?r=A.BigInt(t.offset)+A.BigInt(t.length)-A.BigInt(1):r=t.offset+t.length-1,"bytes="+n+"-"+r},Bs=function(t){var r={};return t.byterange&&(r.Range=Wy(t.byterange)),r},zy=function(t,r){return t.start(r)+"-"+t.end(r)},$y=function(t,r){var n=t.toString(16);return"00".substring(0,2-n.length)+n+(r%2?" ":"")},Ky=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Nf=function(t){var r={};return Object.keys(t).forEach(function(n){var e=t[n];bd(e)?r[n]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:r[n]=e}),r},ta=function(t){var r=t.byterange||{length:1/0,offset:0};return[r.length,r.offset,t.resolvedUri].join(",")},Bf=function(t){return t.resolvedUri},Uf=function(t){for(var r=Array.prototype.slice.call(t),n=16,e="",i,s,o=0;oc?null:(n>u&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:Ye.duration(r,r.mediaSequence+r.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},t_=function(t,r){if(!r||!r.segments||r.segments.length===0)return null;for(var n=0,e,i=0;in){if(t>n+s.duration*Vf)return null;e=s}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:n-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}},r_=function(t,r){var n,e;try{n=new Date(t),e=new Date(r)}catch{}var i=n.getTime(),s=e.getTime();return(s-i)/1e3},i_=function(t){if(!t.segments||t.segments.length===0)return!1;for(var r=0;r"u"||!n||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!i_(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var g=e_(r,n);if(!g)return c({message:r+" was not found in the stream"});var m=g.segment,_=r_(m.dateTimeObject,r);if(g.type==="estimate"){if(i===0)return c({message:r+" is not buffered yet. Try again"});s(g.estimatedStart+_),l.one("seeked",function(){a({programTime:r,playlist:n,retryCount:i-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})});return}var b=m.start+_,S=function(){return c(null,l.currentTime())};l.one("seeked",S),u&&l.pause(),s(b)},cs=function(t,r){if(t.readyState===4)return r()},s_=function(t,r,n){var e=[],i,s=!1,o=function(m,_,b,S){return _.abort(),s=!0,n(m,_,b,S)},u=function(m,_){if(!s){if(m)return o(m,_,"",e);var b=_.responseText.substring(e&&e.byteLength||0,_.responseText.length);if(e=ug(e,xd(b,!0)),i=i||xi(e),e.length<10||i&&e.length=w+x)return c(g,{response:b.subarray(x,x+w),status:m.status,uri:m.uri});o.request=o.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:Bs({byterange:e.sidx.byterange})},c)})},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A.clearTimeout(this.minimumUpdatePeriodTimeout_),A.clearTimeout(this.mediaRequest_),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e){var i=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var s=this.state;if(typeof e=="string"){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}!o||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,s,function(u){i.haveMetadata({startingState:s,playlist:e})}))},r.haveMetadata=function(e){var i=e.startingState,s=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[s.id]=s,this.mediaRequest_=null,this.refreshMedia_(s.id),i==="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(),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(A.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(e){var i=this;A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var s=this.media();if(e){var o=s?s.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(function(){return i.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},r.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=A.setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(i,s){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])})},r.requestMaster_=function(e){var i=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(s,o){if(i.requestErrored_(s,o)){i.state==="HAVE_NOTHING"&&(i.started=!1);return}var u=o.responseText!==i.masterPlaylistLoader_.masterXml_;if(i.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?i.masterLoaded_=Date.parse(o.responseHeaders.date):i.masterLoaded_=Date.now(),i.masterPlaylistLoader_.srcUrl=Zn(i.handleManifestRedirects,i.masterPlaylistLoader_.srcUrl,o),u){i.handleMaster_(),i.syncClientServerClock_(function(){return e(o,u)});return}return e(o,u)})},r.syncClientServerClock_=function(e){var i=this,s=wv(this.masterPlaylistLoader_.masterXml_);if(s===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e();if(s.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=s.value-Date.now(),e();this.request=this.vhs_.xhr({uri:dt(this.masterPlaylistLoader_.srcUrl,s.value),method:s.method,withCredentials:this.withCredentials},function(o,u){if(!!i.request){if(o)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),e();var l;s.method==="HEAD"?!u.responseHeaders||!u.responseHeaders.date?l=i.masterLoaded_:l=Date.parse(u.responseHeaders.date):l=Date.parse(u.responseText),i.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}})},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,i=l_({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(i=c_(e,i,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=i||e;var s=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return s&&s!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=s),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(i)},r.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(A.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var i=e.master&&e.master.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_("found invalid minimumUpdatePeriod of "+i+", not setting a timeout");return}this.createMUPTimeout_(i)},r.createMUPTimeout_=function(e){var i=this.masterPlaylistLoader_;i.minimumUpdatePeriodTimeout_=A.setTimeout(function(){i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)},r.refreshXml_=function(){var e=this;this.requestMaster_(function(i,s){!s||(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=h_(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(o){e.refreshMedia_(e.media().id)}))})},r.refreshMedia_=function(e){var i=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var s=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==s[e];if(o?this.media_=s[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var u=function l(){i.media().endList||(i.mediaUpdateTimeout=A.setTimeout(function(){i.trigger("mediaupdatetimeout"),l()},Ms(i.media(),Boolean(o))))};u()}this.trigger("loadedplaylist")},t}(o_),we={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},p_=function(t){for(var r=new Uint8Array(new ArrayBuffer(t.length)),n=0;n-1):!1},this.trigger=function(h){var f,p,v,y;if(f=d[h],!!f)if(arguments.length===2)for(v=f.length,p=0;p"u")){for(T in $)$.hasOwnProperty(T)&&($[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);J=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),fe=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),oe=new Uint8Array([0,0,0,1]),re=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]),ae=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]),pe={video:re,audio:ae},Qi=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ue=new Uint8Array([0,0,0,0,0,0,0,0]),nt=new Uint8Array([0,0,0,0,0,0,0,0]),At=nt,Wt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Jt=nt,Re=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),s=function(d){var h=[],f=0,p,v,y;for(p=1;p>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},l=function(){return s($.ftyp,J,oe,J,fe)},F=function(d){return s($.hdlr,pe[d])},c=function(d){return s($.mdat,d)},L=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,d.duration>>>24&255,d.duration>>>16&255,d.duration>>>8&255,d.duration&255,85,196,0,0]);return d.samplerate&&(h[12]=d.samplerate>>>24&255,h[13]=d.samplerate>>>16&255,h[14]=d.samplerate>>>8&255,h[15]=d.samplerate&255),s($.mdhd,h)},H=function(d){return s($.mdia,L(d),F(d.type),m(d))},g=function(d){return s($.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},m=function(d){return s($.minf,d.type==="video"?s($.vmhd,Re):s($.smhd,ue),o(),B(d))},_=function(d,h){for(var f=[],p=h.length;p--;)f[p]=U(h[p]);return s.apply(null,[$.moof,g(d)].concat(f))},b=function(d){for(var h=d.length,f=[];h--;)f[h]=w(d[h]);return s.apply(null,[$.moov,x(4294967295)].concat(f).concat(S(d)))},S=function(d){for(var h=d.length,f=[];h--;)f[h]=N(d[h]);return s.apply(null,[$.mvex].concat(f))},x=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return s($.mvhd,h)},q=function(d){var h=d.samples||[],f=new Uint8Array(4+h.length),p,v;for(v=0;v>>8),y.push(p[C].byteLength&255),y=y.concat(Array.prototype.slice.call(p[C]));for(C=0;C>>8),E.push(v[C].byteLength&255),E=E.concat(Array.prototype.slice.call(v[C]));if(k=[$.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,(f.width&65280)>>8,f.width&255,(f.height&65280)>>8,f.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s($.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([p.length],y,[v.length],E))),s($.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var D=f.sarRatio[0],P=f.sarRatio[1];k.push(s($.pasp,new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return s.apply(null,k)},d=function(f){return s($.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(f.channelcount&65280)>>8,f.channelcount&255,(f.samplesize&65280)>>8,f.samplesize&255,0,0,0,0,(f.samplerate&65280)>>8,f.samplerate&255,0,0]),u(f))}}(),O=function(d){var h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,0,(d.duration&4278190080)>>24,(d.duration&16711680)>>16,(d.duration&65280)>>8,d.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(d.width&65280)>>8,d.width&255,0,0,(d.height&65280)>>8,d.height&255,0,0]);return s($.tkhd,h)},U=function(d){var h,f,p,v,y,E,C;return h=s($.tfhd,new Uint8Array([0,0,0,58,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),E=Math.floor(d.baseMediaDecodeTime/i),C=Math.floor(d.baseMediaDecodeTime%i),f=s($.tfdt,new Uint8Array([1,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255])),y=32+20+8+16+8+8,d.type==="audio"?(p=X(d,y),s($.traf,h,f,p)):(v=q(d),p=X(d,v.length+y),s($.traf,h,f,p,v))},w=function(d){return d.duration=d.duration||4294967295,s($.trak,O(d),H(d))},N=function(d){var h=new Uint8Array([0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return d.type!=="video"&&(h[h.length-1]=0),s($.trex,h)},function(){var T,d,h;h=function(p,v){var y=0,E=0,C=0,k=0;return p.length&&(p[0].duration!==void 0&&(y=1),p[0].size!==void 0&&(E=2),p[0].flags!==void 0&&(C=4),p[0].compositionTimeOffset!==void 0&&(k=8)),[0,0,y|E|C|k,1,(p.length&4278190080)>>>24,(p.length&16711680)>>>16,(p.length&65280)>>>8,p.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]},d=function(p,v){var y,E,C,k,D,P;for(k=p.samples||[],v+=8+12+16*k.length,C=h(k,v),E=new Uint8Array(C.length+k.length*16),E.set(C),y=C.length,P=0;P>>24,E[y++]=(D.duration&16711680)>>>16,E[y++]=(D.duration&65280)>>>8,E[y++]=D.duration&255,E[y++]=(D.size&4278190080)>>>24,E[y++]=(D.size&16711680)>>>16,E[y++]=(D.size&65280)>>>8,E[y++]=D.size&255,E[y++]=D.flags.isLeading<<2|D.flags.dependsOn,E[y++]=D.flags.isDependedOn<<6|D.flags.hasRedundancy<<4|D.flags.paddingValue<<1|D.flags.isNonSyncSample,E[y++]=D.flags.degradationPriority&240<<8,E[y++]=D.flags.degradationPriority&15,E[y++]=(D.compositionTimeOffset&4278190080)>>>24,E[y++]=(D.compositionTimeOffset&16711680)>>>16,E[y++]=(D.compositionTimeOffset&65280)>>>8,E[y++]=D.compositionTimeOffset&255;return s($.trun,E)},T=function(p,v){var y,E,C,k,D,P;for(k=p.samples||[],v+=8+12+8*k.length,C=h(k,v),y=new Uint8Array(C.length+k.length*8),y.set(C),E=C.length,P=0;P>>24,y[E++]=(D.duration&16711680)>>>16,y[E++]=(D.duration&65280)>>>8,y[E++]=D.duration&255,y[E++]=(D.size&4278190080)>>>24,y[E++]=(D.size&16711680)>>>16,y[E++]=(D.size&65280)>>>8,y[E++]=D.size&255;return s($.trun,y)},X=function(p,v){return p.type==="audio"?T(p,v):d(p,v)}}();var mt={ftyp:l,mdat:c,moof:_,moov:b,initSegment:function(d){var h=l(),f=b(d),p;return p=new Uint8Array(h.byteLength+f.byteLength),p.set(h),p.set(f,h.byteLength),p}},gr=function(d){var h,f,p=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,p.byteLength=0,h=0;h1&&(h=d.shift(),d.byteLength-=h.byteLength,d.nalCount-=h.nalCount,d[0][0].dts=h.dts,d[0][0].pts=h.pts,d[0][0].duration+=h.duration),d},lh=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Jo=function(d,h){var f=lh();return f.dataOffset=h,f.compositionTimeOffset=d.pts-d.dts,f.duration=d.duration,f.size=4*d.length,f.size+=d.byteLength,d.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},dh=function(d,h){var f,p,v,y,E,C=h||0,k=[];for(f=0;fse.ONE_SECOND_IN_TS/2))){for(D=mh()[d.samplerate],D||(D=h[0].data),P=0;P=f?d:(h.minSegmentDts=1/0,d.filter(function(p){return p.dts>=f?(h.minSegmentDts=Math.min(h.minSegmentDts,p.dts),h.minSegmentPts=h.minSegmentDts,!0):!1}))},_h=function(d){var h,f,p=[];for(h=0;h=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(T),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Dt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Dt.prototype.addText=function(T){this.rows[this.rowIdx]+=T},Dt.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var tn=function(d,h,f){this.serviceNum=d,this.text="",this.currentWindow=new Dt(-1),this.windows=[],this.stream=f,typeof h=="string"&&this.createTextDecoder(h)};tn.prototype.init=function(T,d){this.startPts=T;for(var h=0;h<8;h++)this.windows[h]=new Dt(h),typeof d=="function"&&(this.windows[h].beforeRowOverflow=d)},tn.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},tn.prototype.createTextDecoder=function(T){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(T)}catch(d){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+T+" encoding. "+d})}};var me=function T(d){d=d||{},T.prototype.init.call(this);var h=this,f=d.captionServices||{},p={},v;Object.keys(f).forEach(function(y){v=f[y],/^SERVICE/.test(y)&&(p[y]=v.encoding)}),this.serviceEncodings=p,this.current708Packet=null,this.services={},this.push=function(y){y.type===3?(h.new708Packet(),h.add708Bytes(y)):(h.current708Packet===null&&h.new708Packet(),h.add708Bytes(y))}};me.prototype=new t,me.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},me.prototype.add708Bytes=function(T){var d=T.ccData,h=d>>>8,f=d&255;this.current708Packet.ptsVals.push(T.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(f)},me.prototype.push708Packet=function(){var T=this.current708Packet,d=T.data,h=null,f=null,p=0,v=d[p++];for(T.seq=v>>6,T.sizeCode=v&63;p>5,f=v&31,h===7&&f>0&&(v=d[p++],h=v),this.pushServiceBlock(h,p,f),f>0&&(p+=f-1)},me.prototype.pushServiceBlock=function(T,d,h){var f,p=d,v=this.current708Packet.data,y=this.services[T];for(y||(y=this.initService(T,p));p>5,v.rowLock=(f&16)>>4,v.columnLock=(f&8)>>3,v.priority=f&7,f=h[++T],v.relativePositioning=(f&128)>>7,v.anchorVertical=f&127,f=h[++T],v.anchorHorizontal=f,f=h[++T],v.anchorPoint=(f&240)>>4,v.rowCount=f&15,f=h[++T],v.columnCount=f&63,f=h[++T],v.windowStyle=(f&56)>>3,v.penStyle=f&7,v.virtualRowCount=v.rowCount+1,T},me.prototype.setWindowAttributes=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.winAttr;return f=h[++T],p.fillOpacity=(f&192)>>6,p.fillRed=(f&48)>>4,p.fillGreen=(f&12)>>2,p.fillBlue=f&3,f=h[++T],p.borderType=(f&192)>>6,p.borderRed=(f&48)>>4,p.borderGreen=(f&12)>>2,p.borderBlue=f&3,f=h[++T],p.borderType+=(f&128)>>5,p.wordWrap=(f&64)>>6,p.printDirection=(f&48)>>4,p.scrollDirection=(f&12)>>2,p.justify=f&3,f=h[++T],p.effectSpeed=(f&240)>>4,p.effectDirection=(f&12)>>2,p.displayEffect=f&3,T},me.prototype.flushDisplayed=function(T,d){for(var h=[],f=0;f<8;f++)d.windows[f].visible&&!d.windows[f].isEmpty()&&h.push(d.windows[f].getText());d.endPts=T,d.text=h.join(` `),this.pushCaption(d),d.startPts=T},me.prototype.pushCaption=function(T){T.text!==""&&(this.trigger("data",{startPts:T.startPts,endPts:T.endPts,text:T.text,stream:"cc708_"+T.serviceNum}),T.text="",T.startPts=T.endPts)},me.prototype.displayWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<>4,p.offset=(f&12)>>2,p.penSize=f&3,f=h[++T],p.italics=(f&128)>>7,p.underline=(f&64)>>6,p.edgeType=(f&56)>>3,p.fontStyle=f&7,T},me.prototype.setPenColor=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.penColor;return f=h[++T],p.fgOpacity=(f&192)>>6,p.fgRed=(f&48)>>4,p.fgGreen=(f&12)>>2,p.fgBlue=f&3,f=h[++T],p.bgOpacity=(f&192)>>6,p.bgRed=(f&48)>>4,p.bgGreen=(f&12)>>2,p.bgBlue=f&3,f=h[++T],p.edgeRed=(f&48)>>4,p.edgeGreen=(f&12)>>2,p.edgeBlue=f&3,T},me.prototype.setPenLocation=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,f=h[++T],p.row=f&15,f=h[++T],p.column=f&63,T},me.prototype.reset=function(T,d){var h=this.getPts(T);return this.flushDisplayed(h,d),this.initService(d.serviceNum,T)};var Oh={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},rn=function(d){return d===null?"":(d=Oh[d]||d,String.fromCharCode(d))},nn=14,Lh=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Zt=function(){for(var d=[],h=nn+1;h--;)d.push("");return d},Te=function T(d,h){T.prototype.init.call(this),this.field_=d||0,this.dataChannel_=h||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var p,v,y,E,C;if(p=f.ccData&32639,p===this.lastControlCode_){this.lastControlCode_=null;return}if((p&61440)===4096?this.lastControlCode_=p:p!==this.PADDING_&&(this.lastControlCode_=null),y=p>>>8,E=p&255,p!==this.PADDING_)if(p===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(p===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),v=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=v,this.startPts_=f.pts;else if(p===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(p===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(p===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(p===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(p===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(p===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=Zt();else if(p===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Zt();else if(p===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=Zt()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(y,E))y=(y&3)<<8,C=rn(y|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isExtCharacter(y,E))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),y=(y&3)<<8,C=rn(y|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isMidRowCode(y,E))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(E&14)===14&&this.addFormatting(f.pts,["i"]),(E&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(y,E))this.column_+=E&3;else if(this.isPAC(y,E)){var k=Lh.indexOf(p&7968);this.mode_==="rollUp"&&(k-this.rollUpRows_+1<0&&(k=this.rollUpRows_-1),this.setRollUp(f.pts,k)),k!==this.row_&&(this.clearFormatting(f.pts),this.row_=k),E&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(p&16)===16&&(this.column_=((p&14)>>1)*4),this.isColorPAC(E)&&(E&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(y)&&(E===0&&(E=null),C=rn(y),C+=rn(E),this[this.mode_](f.pts,C),this.column_+=C.length)}};Te.prototype=new t,Te.prototype.flushDisplayed=function(T){var d=this.displayed_.map(function(h,f){try{return h.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+f+"."}),""}},this).join(` `).replace(/^\n+|\n+$/g,"");d.length&&this.trigger("data",{startPts:this.startPts_,endPts:T,text:d,stream:this.name_})},Te.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Zt(),this.nonDisplayed_=Zt(),this.lastControlCode_=null,this.column_=0,this.row_=nn,this.rollUpRows_=2,this.formatting_=[]},Te.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Te.prototype.isSpecialCharacter=function(T,d){return T===this.EXT_&&d>=48&&d<=63},Te.prototype.isExtCharacter=function(T,d){return(T===this.EXT_+1||T===this.EXT_+2)&&d>=32&&d<=63},Te.prototype.isMidRowCode=function(T,d){return T===this.EXT_&&d>=32&&d<=47},Te.prototype.isOffsetControlCode=function(T,d){return T===this.OFFSET_&&d>=33&&d<=35},Te.prototype.isPAC=function(T,d){return T>=this.BASE_&&T=64&&d<=127},Te.prototype.isColorPAC=function(T){return T>=64&&T<=79||T>=96&&T<=127},Te.prototype.isNormalChar=function(T){return T>=32&&T<=127},Te.prototype.setRollUp=function(T,d){if(this.mode_!=="rollUp"&&(this.row_=nn,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=Zt(),this.displayed_=Zt()),d!==void 0&&d!==this.row_)for(var h=0;h"},"");this[this.mode_](T,h)},Te.prototype.clearFormatting=function(T){if(!!this.formatting_.length){var d=this.formatting_.reverse().reduce(function(h,f){return h+""},"");this.formatting_=[],this[this.mode_](T,d)}},Te.prototype.popOn=function(T,d){var h=this.nonDisplayed_[this.row_];h+=d,this.nonDisplayed_[this.row_]=h},Te.prototype.rollUp=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h},Te.prototype.shiftRowsUp_=function(){var T;for(T=0;Th&&(f=-1);Math.abs(h-d)>Rh;)d+=f*Fh;return d},nu=function T(d){var h,f;T.prototype.init.call(this),this.type_=d||iu,this.push=function(p){this.type_!==iu&&p.type!==this.type_||(f===void 0&&(f=p.dts),p.dts=Fa(p.dts,f),p.pts=Fa(p.pts,f),h=p.dts,this.trigger("data",p))},this.flush=function(){f=h,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,h=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};nu.prototype=new t;var au={TimestampRolloverStream:nu,handleRollover:Fa},su=function(d,h,f){var p,v="";for(p=h;p>>2;j*=4,j+=Y[7]&3,P.timeStamp=j,C.pts===void 0&&C.dts===void 0&&(C.pts=P.timeStamp,C.dts=P.timeStamp),this.trigger("timestamp",P)}C.frames.push(P),k+=10,k+=D}while(k>>4>1&&(E+=v[E]+1),y.pid===0)y.type="pat",d(v.subarray(E),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",d(v.subarray(E),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,E,y]):this.processPes_(v,E,y)},this.processPes_=function(v,y,E){E.pid===this.programMapTable.video?E.streamType=Oe.H264_STREAM_TYPE:E.pid===this.programMapTable.audio?E.streamType=Oe.ADTS_STREAM_TYPE:E.streamType=this.programMapTable["timed-metadata"][E.pid],E.type="pes",E.data=v.subarray(y),this.trigger("data",E)}},si.prototype=new t,si.STREAM_TYPES={h264:27,adts:15},dn=function(){var d=this,h=!1,f={data:[],size:0},p={data:[],size:0},v={data:[],size:0},y,E=function(D,P){var M,z=D[0]<<16|D[1]<<8|D[2];P.data=new Uint8Array,z===1&&(P.packetLength=6+(D[4]<<8|D[5]),P.dataAlignmentIndicator=(D[6]&4)!==0,M=D[7],M&192&&(P.pts=(D[9]&14)<<27|(D[10]&255)<<20|(D[11]&254)<<12|(D[12]&255)<<5|(D[13]&254)>>>3,P.pts*=4,P.pts+=(D[13]&6)>>>1,P.dts=P.pts,M&64&&(P.dts=(D[14]&14)<<27|(D[15]&255)<<20|(D[16]&254)<<12|(D[17]&255)<<5|(D[18]&254)>>>3,P.dts*=4,P.dts+=(D[18]&6)>>>1)),P.data=D.subarray(9+D[8]))},C=function(D,P,M){var z=new Uint8Array(D.size),Y={type:P},j=0,Z=0,De=!1,Ve;if(!(!D.data.length||D.size<9)){for(Y.trackId=D.data[0].pid,j=0;j>5,k=((h[v+6]&3)+1)*1024,D=k*Uh/lu[(h[v+2]&60)>>>2],h.byteLength-v>>6&3)+1,channelcount:(h[v+2]&1)<<2|(h[v+3]&192)>>>6,samplerate:lu[(h[v+2]&60)>>>2],samplingfrequencyindex:(h[v+2]&60)>>>2,samplesize:16,data:h.subarray(v+7+E,v+y)}),f++,v+=y}typeof P=="number"&&(this.skipWarn_(P,v),P=null),h=h.subarray(v)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},cn.prototype=new t;var du=cn,cu;cu=function(d){var h=d.byteLength,f=0,p=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+p},this.loadWord=function(){var v=d.byteLength-h,y=new Uint8Array(4),E=Math.min(4,h);if(E===0)throw new Error("no bytes available");y.set(d.subarray(v,v+E)),f=new DataView(y.buffer).getUint32(0),p=E*8,h-=E},this.skipBits=function(v){var y;p>v?(f<<=v,p-=v):(v-=p,y=Math.floor(v/8),v-=y*8,h-=y,this.loadWord(),f<<=v,p-=v)},this.readBits=function(v){var y=Math.min(p,v),E=f>>>32-y;return p-=y,p>0?f<<=y:h>0&&this.loadWord(),y=v-y,y>0?E<>>v)!==0)return f<<=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 Vh=cu,fn,oi,fu;oi=function(){var d=0,h,f;oi.prototype.init.call(this),this.push=function(p){var v;f?(v=new Uint8Array(f.byteLength+p.data.byteLength),v.set(f),v.set(p.data,f.byteLength),f=v):f=p.data;for(var y=f.byteLength;d3&&this.trigger("data",f.subarray(d+3)),f=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},oi.prototype=new t,fu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},fn=function(){var d=new oi,h,f,p,v,y,E,C;fn.prototype.init.call(this),h=this,this.push=function(k){k.type==="video"&&(f=k.trackId,p=k.pts,v=k.dts,d.push(k))},d.on("data",function(k){var D={trackId:f,pts:p,dts:v,data:k,nalUnitTypeCode:k[0]&31};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=y(k.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=y(k.subarray(1)),D.config=E(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp";break}h.trigger("data",D)}),d.on("done",function(){h.trigger("done")}),d.on("partialdone",function(){h.trigger("partialdone")}),d.on("reset",function(){h.trigger("reset")}),d.on("endedtimeline",function(){h.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},C=function(D,P){var M=8,z=8,Y,j;for(Y=0;Y>4;return f=f>=0?f:0,v?f+20:f+10},jh=function T(d,h){return d.length-h<10||d[h]!=="I".charCodeAt(0)||d[h+1]!=="D".charCodeAt(0)||d[h+2]!=="3".charCodeAt(0)?h:(h+=hu(d,h),T(d,h))},Gh=function(d){var h=jh(d,0);return d.length>=h+2&&(d[h]&255)===255&&(d[h+1]&240)===240&&(d[h+1]&22)===16},pu=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Wh=function(d,h,f){var p,v="";for(p=h;p>5,p=d[h+4]<<3,v=d[h+3]&3<<11;return v|p|f},Kh=function(d,h){return d[h]==="I".charCodeAt(0)&&d[h+1]==="D".charCodeAt(0)&&d[h+2]==="3".charCodeAt(0)?"timed-metadata":d[h]&!0&&(d[h+1]&240)===240?"audio":null},Xh=function(d){for(var h=0;h+5>>2]}return null},Yh=function(d){var h,f,p,v;h=10,d[5]&64&&(h+=4,h+=pu(d.subarray(10,14)));do{if(f=pu(d.subarray(h+4,h+8)),f<1)return null;if(v=String.fromCharCode(d[h],d[h+1],d[h+2],d[h+3]),v==="PRIV"){p=d.subarray(h+10,h+f+10);for(var y=0;y>>2;return k*=4,k+=C[7]&3,k}break}}h+=10,h+=f}while(h=3;){if(d[v]==="I".charCodeAt(0)&&d[v+1]==="D".charCodeAt(0)&&d[v+2]==="3".charCodeAt(0)){if(d.length-v<10||(p=hn.parseId3TagSize(d,v),v+p>d.length))break;E={type:"timed-metadata",data:d.subarray(v,v+p)},this.trigger("data",E),v+=p;continue}else if((d[v]&255)===255&&(d[v+1]&240)===240){if(d.length-v<7||(p=hn.parseAdtsSize(d,v),v+p>d.length))break;C={type:"audio",data:d.subarray(v,v+p),pts:h,dts:h},this.trigger("data",C),v+=p;continue}v++}y=d.length-v,y>0?d=d.subarray(v):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},pn.prototype=new t;var Qh=pn,Jh=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Na=Jh,Zh=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ba=Zh,ep=Hh.H264Stream,tp=hn.isLikelyAacData,rp=se.ONE_SECOND_IN_TS,ui,Tr,mn,er,ip=function(d,h){h.stream=d,this.trigger("log",h)},mu=function(d,h){for(var f=Object.keys(h),p=0;p=-D&&M<=k&&(!z||P>M)&&(z=j,P=M)));return z?z.gop:null},this.alignGopsAtStart_=function(C){var k,D,P,M,z,Y,j,Z;for(z=C.byteLength,Y=C.nalCount,j=C.duration,k=D=0;kP.pts){k++;continue}D++,z-=M.byteLength,Y-=M.nalCount,j-=M.duration}return D===0?C:D===C.length?null:(Z=C.slice(D),Z.byteLength=z,Z.duration=j,Z.nalCount=Y,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z)},this.alignGopsAtEnd_=function(C){var k,D,P,M,z,Y;for(k=v.length-1,D=C.length-1,z=null,Y=!1;k>=0&&D>=0;){if(P=v[k],M=C[D],P.pts===M.pts){Y=!0;break}if(P.pts>M.pts){k--;continue}k===v.length-1&&(z=D),D--}if(!Y&&z===null)return null;var j;if(Y?j=D:j=z,j===0)return C;var Z=C.slice(j),De=Z.reduce(function(Ve,ir){return Ve.byteLength+=ir.byteLength,Ve.duration+=ir.duration,Ve.nalCount+=ir.nalCount,Ve},{byteLength:0,duration:0,nalCount:0});return Z.byteLength=De.byteLength,Z.duration=De.duration,Z.nalCount=De.nalCount,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z},this.alignGopsWith=function(C){v=C}},ui.prototype=new t,er=function(d,h){this.numberOfTracks=0,this.metadataStream=h,d=d||{},typeof d.remux<"u"?this.remuxTracks=!!d.remux:this.remuxTracks=!0,typeof d.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=d.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,er.prototype.init.call(this),this.push=function(f){if(f.text)return this.pendingCaptions.push(f);if(f.frames)return this.pendingMetadata.push(f);this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))}},er.prototype=new t,er.prototype.flush=function(T){var d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},f,p,v,y=0,E;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,Ba.forEach(function(C){h.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,Na.forEach(function(C){h.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,v=mt.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),E=0;E=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},er.prototype.setRemux=function(T){this.remuxTracks=T},mn=function(d){var h=this,f=!0,p,v;mn.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new wt.MetadataStream,y.aacStream=new Qh,y.audioTimestampRolloverStream=new wt.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new wt.TimestampRolloverStream("timed-metadata"),y.adtsStream=new du,y.coalesceStream=new er(d,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(E){y.aacStream.setTimestamp(E.timeStamp)}),y.aacStream.on("data",function(E){E.type!=="timed-metadata"&&E.type!=="audio"||y.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new Tr(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!p}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),mu(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new wt.MetadataStream,y.packetStream=new wt.TransportPacketStream,y.parseStream=new wt.TransportParseStream,y.elementaryStream=new wt.ElementaryStream,y.timestampRolloverStream=new wt.TimestampRolloverStream,y.adtsStream=new du,y.h264Stream=new ep,y.captionStream=new wt.CaptionStream(d),y.coalesceStream=new er(d,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(E){var C;if(E.type==="metadata"){for(C=E.tracks.length;C--;)!p&&E.tracks[C].type==="video"?(p=E.tracks[C],p.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):!v&&E.tracks[C].type==="audio"&&(v=E.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime);p&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new ui(p,d),y.videoSegmentStream.on("log",h.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(k){v&&!d.keepOriginalTimestamps&&(v.timelineStartInfo=k,y.audioSegmentStream.setEarliestDts(k.dts-h.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",h.trigger.bind(h,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(k){v&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(k)}),y.videoSegmentStream.on("timingInfo",h.trigger.bind(h,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),v&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new Tr(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!p})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(E){E.dispatchType=y.metadataStream.dispatchType,h.trigger("id3Frame",E)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),mu(this,y)},this.setBaseMediaDecodeTime=function(y){var E=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,ut.clearDtsInfo(v),E.audioTimestampRolloverStream&&E.audioTimestampRolloverStream.discontinuity()),p&&(E.videoSegmentStream&&(E.videoSegmentStream.gopCache_=[]),p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ut.clearDtsInfo(p),E.captionStream.reset()),E.timestampRolloverStream&&E.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var E=this.transmuxPipeline_;d.remux=y,E&&E.coalesceStream&&E.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){p&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var E=this;return function(C){C.stream=y,E.trigger("log",C)}},this.push=function(y){if(f){var E=tp(y);E&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!E&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){f=!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()}},mn.prototype=new t;var np={Transmuxer:mn,VideoSegmentStream:ui,AudioSegmentStream:Tr,AUDIO_PROPERTIES:Na,VIDEO_PROPERTIES:Ba,generateSegmentTimingInfo:Ua},ap=function(d){return d>>>0},sp=function(d){return("00"+d.toString(16)).slice(-2)},gn={toUnsigned:ap,toHexString:sp},op=function(d){var h="";return h+=String.fromCharCode(d[0]),h+=String.fromCharCode(d[1]),h+=String.fromCharCode(d[2]),h+=String.fromCharCode(d[3]),h},tr=op,up=gn.toUnsigned,lp=function T(d,h){var f=[],p,v,y,E,C;if(!h.length)return null;for(p=0;p1?p+v:d.byteLength,y===h[0]&&(h.length===1?f.push(d.subarray(p+8,E)):(C=T(d.subarray(p+8,E),h.slice(1)),C.length&&(f=f.concat(C)))),p=E;return f},ge=lp,dp=gn.toUnsigned,cp=e.getUint64,fp=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=cp(d.subarray(4)):h.baseMediaDecodeTime=dp(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),h},vu=fp,hp=function(d){return{isLeading:(d[0]&12)>>>2,dependsOn:d[0]&3,isDependedOn:(d[1]&192)>>>6,hasRedundancy:(d[1]&48)>>>4,paddingValue:(d[1]&14)>>>1,isNonSyncSample:d[1]&1,degradationPriority:d[2]<<8|d[3]}},yu=hp,pp=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},f=new DataView(d.buffer,d.byteOffset,d.byteLength),p=h.flags[2]&1,v=h.flags[2]&4,y=h.flags[1]&1,E=h.flags[1]&2,C=h.flags[1]&4,k=h.flags[1]&8,D=f.getUint32(4),P=8,M;for(p&&(h.dataOffset=f.getInt32(P),P+=4),v&&D&&(M={flags:yu(d.subarray(P,P+4))},P+=4,y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),k&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M),D--);D--;)M={},y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),C&&(M.flags=yu(d.subarray(P,P+4)),P+=4),k&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M);return h},_u=pp,mp=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:h.getUint32(4)},p=f.flags[2]&1,v=f.flags[2]&2,y=f.flags[2]&8,E=f.flags[2]&16,C=f.flags[2]&32,k=f.flags[0]&65536,D=f.flags[0]&131072,P;return P=8,p&&(P+=4,f.baseDataOffset=h.getUint32(12),P+=4),v&&(f.sampleDescriptionIndex=h.getUint32(P),P+=4),y&&(f.defaultSampleDuration=h.getUint32(P),P+=4),E&&(f.defaultSampleSize=h.getUint32(P),P+=4),C&&(f.defaultSampleFlags=h.getUint32(P)),k&&(f.durationIsEmpty=!0),!p&&D&&(f.baseDataOffsetIsMoof=!0),f},Tu=mp,bu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},li;typeof window<"u"?li=window:typeof bu<"u"?li=bu:typeof self<"u"?li=self:li={};var di=li,gp=ai.discardEmulationPreventionBytes,vp=an.CaptionStream,yp=function(d,h){for(var f=d,p=0;p0?vu(z[0]).baseMediaDecodeTime:0,j=ge(k,["trun"]),Z,De;h===M&&j.length>0&&(Z=Tp(j,Y,P),De=_p(C,Z,M),v[M]||(v[M]={seiNals:[],logs:[]}),v[M].seiNals=v[M].seiNals.concat(De.seiNals),v[M].logs=v[M].logs.concat(De.logs))}),v},xp=function(d,h,f){var p;if(h===null)return null;p=bp(d,h);var v=p[h]||{};return{seiNals:v.seiNals,logs:v.logs,timescale:f}},Sp=function(){var d=!1,h,f,p,v,y,E;this.isInitialized=function(){return d},this.init=function(C){h=new vp,d=!0,E=C?C.isPartial:!1,h.on("data",function(k){k.startTime=k.startPts/v,k.endTime=k.endPts/v,y.captions.push(k),y.captionStreams[k.stream]=!0}),h.on("log",function(k){y.logs.push(k)})},this.isNewInit=function(C,k){return C&&C.length===0||k&&typeof k=="object"&&Object.keys(k).length===0?!1:p!==C[0]||v!==k[p]},this.parse=function(C,k,D){var P;if(this.isInitialized()){if(!k||!D)return null;if(this.isNewInit(k,D))p=k[0],v=D[p];else if(p===null||!v)return f.push(C),null}else return null;for(;f.length>0;){var M=f.shift();this.parse(M,k,D)}return P=xp(C,p,v),P&&P.logs&&(y.logs=y.logs.concat(P.logs)),P===null||!P.seiNals?y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),y)},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(k){h.push(k)})},this.flushStream=function(){if(!this.isInitialized())return null;E?h.partialFlush():h.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;h.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],p=null,v=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ep=Sp,vn=gn.toUnsigned,ci=gn.toHexString,Cp=e.getUint64,xu,Su,Eu,Cu,Au,Va;xu=function(d){var h={},f=ge(d,["moov","trak"]);return f.reduce(function(p,v){var y,E,C,k,D;return y=ge(v,["tkhd"])[0],!y||(E=y[0],C=E===0?12:20,k=vn(y[C]<<24|y[C+1]<<16|y[C+2]<<8|y[C+3]),D=ge(v,["mdia","mdhd"])[0],!D)?null:(E=D[0],C=E===0?12:20,p[k]=vn(D[C]<<24|D[C+1]<<16|D[C+2]<<8|D[C+3]),p)},h)},Su=function(d,h){var f;f=ge(h,["moof","traf"]);var p=f.reduce(function(v,y){var E=ge(y,["tfhd"])[0],C=vn(E[4]<<24|E[5]<<16|E[6]<<8|E[7]),k=d[C]||9e4,D=ge(y,["tfdt"])[0],P=new DataView(D.buffer,D.byteOffset,D.byteLength),M;D[0]===1?M=Cp(D.subarray(4,12)):M=P.getUint32(4);var z;return typeof M=="bigint"?z=M/di.BigInt(k):typeof M=="number"&&!isNaN(M)&&(z=M/k),z11?(v.codec+=".",v.codec+=ci(Y[9]),v.codec+=ci(Y[10]),v.codec+=ci(Y[11])):v.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(v.codec)?(Y=z.subarray(28),j=tr(Y.subarray(4,8)),j==="esds"&&Y.length>20&&Y[19]!==0?(v.codec+="."+ci(Y[19]),v.codec+="."+ci(Y[20]>>>2&63).replace(/^0/,"")):v.codec="mp4a.40.2"):v.codec=v.codec.toLowerCase())}var Z=ge(p,["mdia","mdhd"])[0];Z&&(v.timescale=Va(Z)),f.push(v)}),f};var Du={findBox:ge,parseType:tr,timescale:xu,startTime:Su,compositionStartTime:Eu,videoTrackIds:Cu,tracks:Au,getTimescaleFromMediaHeader:Va},wu=function(d){var h=d[1]&31;return h<<=8,h|=d[2],h},yn=function(d){return!!(d[1]&64)},_n=function(d){var h=0;return(d[3]&48)>>>4>1&&(h+=d[4]+1),h},Ap=function(d,h){var f=wu(d);return f===0?"pat":f===h?"pmt":h?"pes":null},Dp=function(d){var h=yn(d),f=4+_n(d);return h&&(f+=d[f]+1),(d[f+10]&31)<<8|d[f+11]},wp=function(d){var h={},f=yn(d),p=4+_n(d);if(f&&(p+=d[p]+1),!!(d[p+5]&1)){var v,y,E;v=(d[p+1]&15)<<8|d[p+2],y=3+v-4,E=(d[p+10]&15)<<8|d[p+11];for(var C=12+E;C=d.byteLength)return null;var p=null,v;return v=d[f+7],v&192&&(p={},p.pts=(d[f+9]&14)<<27|(d[f+10]&255)<<20|(d[f+11]&254)<<12|(d[f+12]&255)<<5|(d[f+13]&254)>>>3,p.pts*=4,p.pts+=(d[f+13]&6)>>>1,p.dts=p.pts,v&64&&(p.dts=(d[f+14]&14)<<27|(d[f+15]&255)<<20|(d[f+16]&254)<<12|(d[f+17]&255)<<5|(d[f+18]&254)>>>3,p.dts*=4,p.dts+=(d[f+18]&6)>>>1)),p},Ha=function(d){switch(d){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}},Ip=function(d){for(var h=4+_n(d),f=d.subarray(h),p=0,v=0,y=!1,E;v3&&(E=Ha(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0)),y},Op={parseType:Ap,parsePat:Dp,parsePmt:wp,parsePayloadUnitStartIndicator:yn,parsePesType:kp,parsePesTime:Pp,videoPacketContainsKeyFrame:Ip},br=au.handleRollover,de={};de.ts=Op,de.aac=hn;var rr=se.ONE_SECOND_IN_TS,Ue=188,gt=71,Lp=function(d,h){for(var f=0,p=Ue,v,y;p=0;){if(d[p]===gt&&(d[v]===gt||v===d.byteLength)){switch(y=d.subarray(p,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),k=de.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&k&&(D=de.ts.parsePesTime(y),D&&(D.type="audio",f.audio.push(D),P=!0));break}if(P)break;p-=Ue,v-=Ue;continue}p--,v--}},Fp=function(d,h,f){for(var p=0,v=Ue,y,E,C,k,D,P,M,z,Y=!1,j={data:[],size:0};v=0;){if(d[p]===gt&&d[v]===gt){switch(y=d.subarray(p,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),k=de.ts.parsePayloadUnitStartIndicator(y),C==="video"&&k&&(D=de.ts.parsePesTime(y),D&&(D.type="video",f.video.push(D),Y=!0));break}if(Y)break;p-=Ue,v-=Ue;continue}p--,v--}},Rp=function(d,h){if(d.audio&&d.audio.length){var f=h;(typeof f>"u"||isNaN(f))&&(f=d.audio[0].dts),d.audio.forEach(function(y){y.dts=br(y.dts,f),y.pts=br(y.pts,f),y.dtsTime=y.dts/rr,y.ptsTime=y.pts/rr})}if(d.video&&d.video.length){var p=h;if((typeof p>"u"||isNaN(p))&&(p=d.video[0].dts),d.video.forEach(function(y){y.dts=br(y.dts,p),y.pts=br(y.pts,p),y.dtsTime=y.dts/rr,y.ptsTime=y.pts/rr}),d.firstKeyFrame){var v=d.firstKeyFrame;v.dts=br(v.dts,p),v.pts=br(v.pts,p),v.dtsTime=v.dts/rr,v.ptsTime=v.pts/rr}}},Mp=function(d){for(var h=!1,f=0,p=null,v=null,y=0,E=0,C;d.length-E>=3;){var k=de.aac.parseType(d,E);switch(k){case"timed-metadata":if(d.length-E<10){h=!0;break}if(y=de.aac.parseId3TagSize(d,E),y>d.length){h=!0;break}v===null&&(C=d.subarray(E,E+y),v=de.aac.parseAacTimestamp(C)),E+=y;break;case"audio":if(d.length-E<7){h=!0;break}if(y=de.aac.parseAdtsSize(d,E),y>d.length){h=!0;break}p===null&&(C=d.subarray(E,E+y),p=de.aac.parseSampleRate(C)),f++,E+=y;break;default:E++;break}if(h)return null}if(p===null||v===null)return null;var D=rr/p,P={audio:[{type:"audio",dts:v,pts:v},{type:"audio",dts:v+f*1024*D,pts:v+f*1024*D}]};return P},Np=function(d){var h={pid:null,table:null},f={};Lp(d,h);for(var p in h.table)if(h.table.hasOwnProperty(p)){var v=h.table[p];switch(v){case Oe.H264_STREAM_TYPE:f.video=[],Fp(d,h,f),f.video.length===0&&delete f.video;break;case Oe.ADTS_STREAM_TYPE:f.audio=[],ku(d,h,f),f.audio.length===0&&delete f.audio;break}}return f},Bp=function(d,h){var f=de.aac.isLikelyAacData(d),p;return f?p=Mp(d):p=Np(d),!p||!p.audio&&!p.video?null:(Rp(p,h),p)},Up={inspect:Bp,parseAudioPes_:ku},Vp=function(d,h){h.on("data",function(f){var p=f.initSegment;f.initSegment={data:p.buffer,byteOffset:p.byteOffset,byteLength:p.byteLength};var v=f.data;f.data=v.buffer,d.postMessage({action:"data",segment:f,byteOffset:v.byteOffset,byteLength:v.byteLength},[f.data])}),h.on("done",function(f){d.postMessage({action:"done"})}),h.on("gopInfo",function(f){d.postMessage({action:"gopInfo",gopInfo:f})}),h.on("videoSegmentTimingInfo",function(f){var p={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(p.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:p})}),h.on("audioSegmentTimingInfo",function(f){var p={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(p.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:p})}),h.on("id3Frame",function(f){d.postMessage({action:"id3Frame",id3Frame:f})}),h.on("caption",function(f){d.postMessage({action:"caption",caption:f})}),h.on("trackinfo",function(f){d.postMessage({action:"trackinfo",trackInfo:f})}),h.on("audioTimingInfo",function(f){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("videoTimingInfo",function(f){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("log",function(f){d.postMessage({action:"log",log:f})})},Pu=function(){function T(h,f){this.options=f||{},this.self=h,this.init()}var d=T.prototype;return d.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new np.Transmuxer(this.options),Vp(this.self,this.transmuxer)},d.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Ep,this.captionParser.init());var p=new Uint8Array(f.data,f.byteOffset,f.byteLength),v=this.captionParser.parse(p,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:p.buffer},[p.buffer])},d.probeMp4StartTime=function(f){var p=f.timescales,v=f.data,y=Du.startTime(p,v);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:v},[v.buffer])},d.probeMp4Tracks=function(f){var p=f.data,v=Du.tracks(p);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:p},[p.buffer])},d.probeTs=function(f){var p=f.data,v=f.baseStartTime,y=typeof v=="number"&&!isNaN(v)?v*se.ONE_SECOND_IN_TS:void 0,E=Up.inspect(p,y),C=null;E&&(C={hasVideo:E.video&&E.video.length===2||!1,hasAudio:E.audio&&E.audio.length===2||!1},C.hasVideo&&(C.videoStart=E.video[0].ptsTime),C.hasAudio&&(C.audioStart=E.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:p},[p.buffer])},d.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},d.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},d.push=function(f){var p=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(p)},d.reset=function(){this.transmuxer.reset()},d.setTimestampOffset=function(f){var p=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(se.secondsToVideoTs(p)))},d.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(se.secondsToVideoTs(f.appendStart)))},d.setRemux=function(f){this.transmuxer.setRemux(f.remux)},d.flush=function(f){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},d.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},d.alignGopsWith=function(f){this.transmuxer.alignGopsWith(f.gopsToAlignWith.slice())},T}();self.onmessage=function(T){if(T.data.action==="init"&&T.data.options){this.messageHandlers=new Pu(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new Pu(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}})),v_=jf(g_),y_=function(t,r,n){var e=t.data.segment,i=e.type,s=e.initSegment,o=e.captions,u=e.captionStreams,l=e.metadata,c=e.videoFrameDtsTime,g=e.videoFramePtsTime;r.buffer.push({captions:o,captionStreams:u,metadata:l});var m=t.data.segment.boxes||{data:t.data.segment.data},_={type:i,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof g<"u"&&(_.videoFramePtsTime=g),n(_)},__=function(t){var r=t.transmuxedData,n=t.callback;r.buffer=[],n(r)},T_=function(t,r){r.gopInfo=t.data.gopInfo},zf=function(t){var r=t.transmuxer,n=t.bytes,e=t.audioAppendStart,i=t.gopsToAlignWith,s=t.remux,o=t.onData,u=t.onTrackInfo,l=t.onAudioTimingInfo,c=t.onVideoTimingInfo,g=t.onVideoSegmentTimingInfo,m=t.onAudioSegmentTimingInfo,_=t.onId3,b=t.onCaptions,S=t.onDone,x=t.onEndedTimeline,w=t.onTransmuxerLog,O=t.isEndOfTimeline,H={buffer:[]},L=O,F=function(U){r.currentTransmux===t&&(U.data.action==="data"&&y_(U,H,o),U.data.action==="trackinfo"&&u(U.data.trackInfo),U.data.action==="gopInfo"&&T_(U,H),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&c(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&g(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&m(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&_([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&b(U.data.caption),U.data.action==="endedtimeline"&&(L=!1,x()),U.data.action==="log"&&w(U.data.log),U.data.type==="transmuxed"&&(L||(r.onmessage=null,__({transmuxedData:H,callback:S}),$f(r))))};if(r.onmessage=F,e&&r.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(i)&&r.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),typeof s<"u"&&r.postMessage({action:"setRemux",remux:s}),n.byteLength){var q=n instanceof ArrayBuffer?n:n.buffer,B=n instanceof ArrayBuffer?0:n.byteOffset;r.postMessage({action:"push",data:q,byteOffset:B,byteLength:n.byteLength},[q])}O&&r.postMessage({action:"endTimeline"}),r.postMessage({action:"flush"})},$f=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():zf(t.currentTransmux))},Xl=function(t,r){t.postMessage({action:r}),$f(t)},Kf=function(t,r){if(!r.currentTransmux){r.currentTransmux=t,Xl(r,t);return}r.transmuxQueue.push(Xl.bind(null,r,t))},b_=function(t){Kf("reset",t)},x_=function(t){Kf("endTimeline",t)},Xf=function(t){if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,zf(t);return}t.transmuxer.transmuxQueue.push(t)},S_=function(t){var r=new v_;r.currentTransmux=null,r.transmuxQueue=[];var n=r.terminate;return r.terminate=function(){return r.currentTransmux=null,r.transmuxQueue.length=0,n.call(r)},r.postMessage({action:"init",options:t}),r},fs={reset:b_,endTimeline:x_,transmux:Xf,createTransmuxer:S_},ra=function(t){var r=t.transmuxer,n=t.endAction||t.action,e=t.callback,i=ot({},t,{endAction:null,transmuxer:null,callback:null}),s=function l(c){c.data.action===n&&(r.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,t.byteOffset||0,t.byteLength||c.data.data.byteLength),t.data&&(t.data=c.data.data)),e(c.data))};if(r.addEventListener("message",s),t.data){var o=t.data instanceof ArrayBuffer;i.byteOffset=o?0:t.data.byteOffset,i.byteLength=t.data.byteLength;var u=[o?t.data:t.data.buffer];r.postMessage(i,u)}else r.postMessage(i)},bt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Vs=function(t){t.forEach(function(r){r.abort()})},E_=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},C_=function(t){var r=t.target,n=Date.now()-r.requestTime,e={bandwidth:1/0,bytesReceived:0,roundTripTime:n||0};return e.bytesReceived=t.loaded,e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3),e},Ko=function(t,r){return r.timedout?{status:r.status,message:"HLS request timed-out at URL: "+r.uri,code:bt.TIMEOUT,xhr:r}:r.aborted?{status:r.status,message:"HLS request aborted at URL: "+r.uri,code:bt.ABORTED,xhr:r}:t?{status:r.status,message:"HLS request errored at URL: "+r.uri,code:bt.FAILURE,xhr:r}:r.responseType==="arraybuffer"&&r.response.byteLength===0?{status:r.status,message:"Empty HLS response at URL: "+r.uri,code:bt.FAILURE,xhr:r}:null},Yl=function(t,r,n){return function(e,i){var s=i.response,o=Ko(e,i);if(o)return n(o,t);if(s.byteLength!==16)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:bt.FAILURE,xhr:i},t);for(var u=new DataView(s),l=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]),c=0;c"u"&&(r.container=uo(S)),r.container!=="ts"&&r.container!=="aac"){e(r,{hasAudio:!1,hasVideo:!1}),_(null,r,{});return}w_({segment:r,bytes:n,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})},Jf=function(t,r){var n=t.id,e=t.key,i=t.encryptedBytes,s=t.decryptionWorker,o=function l(c){if(c.data.source===n){s.removeEventListener("message",l);var g=c.data.decrypted;r(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};s.addEventListener("message",o);var u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Nf({source:n,encrypted:i,key:u,iv:e.iv}),[i.buffer,u.buffer])},k_=function(t){var r=t.decryptionWorker,n=t.segment,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog;Jf({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:r},function(S){n.bytes=S,Qf({segment:n,bytes:n.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})})},P_=function(t){var r=t.activeXhrs,n=t.decryptionWorker,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=0,x=!1;return function(w,O){if(!x){if(w)return x=!0,Vs(r),_(w,O);if(S+=1,S===r.length){var H=function(){if(O.encryptedBytes)return k_({decryptionWorker:n,segment:O,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b});Qf({segment:O,bytes:O.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})};if(O.endOfAllRequests=Date.now(),O.map&&O.map.encryptedBytes&&!O.map.bytes)return Jf({decryptionWorker:n,id:O.requestId+"-init",encryptedBytes:O.map.encryptedBytes,key:O.map.key},function(L){O.map.bytes=L,Yf(O,function(F){if(F)return Vs(r),_(F,O);H()})});H()}}}},I_=function(t){var r=t.loadendState,n=t.abortFn;return function(e){var i=e.target;i.aborted&&n&&!r.calledAbortFn&&(n(),r.calledAbortFn=!0)}},O_=function(t){var r=t.segment,n=t.progressFn;return t.trackInfoFn,t.timingInfoFn,t.videoSegmentTimingInfoFn,t.audioSegmentTimingInfoFn,t.id3Fn,t.captionsFn,t.isEndOfTimeline,t.endedTimelineFn,t.dataFn,function(e){var i=e.target;if(!i.aborted)return r.stats=I.mergeOptions(r.stats,C_(e)),!r.stats.firstBytesReceivedAt&&r.stats.bytesReceived&&(r.stats.firstBytesReceivedAt=Date.now()),n(e,r)}},L_=function(t){var r=t.xhr,n=t.xhrOptions,e=t.decryptionWorker,i=t.segment,s=t.abortFn,o=t.progressFn,u=t.trackInfoFn,l=t.timingInfoFn,c=t.videoSegmentTimingInfoFn,g=t.audioSegmentTimingInfoFn,m=t.id3Fn,_=t.captionsFn,b=t.isEndOfTimeline,S=t.endedTimelineFn,x=t.dataFn,w=t.doneFn,O=t.onTransmuxerLog,H=[],L=P_({activeXhrs:H,decryptionWorker:e,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:g,id3Fn:m,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x,doneFn:w,onTransmuxerLog:O});if(i.key&&!i.key.bytes){var F=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&F.push(i.map.key);var q=I.mergeOptions(n,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),B=Yl(i,F,L),R=r(q,B);H.push(R)}if(i.map&&!i.map.bytes){var U=i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri);if(U){var N=I.mergeOptions(n,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),X=Yl(i,[i.map.key],L),$=r(N,X);H.push($)}var J=I.mergeOptions(n,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Bs(i.map)}),oe=A_({segment:i,finishProcessingFn:L}),fe=r(J,oe);H.push(fe)}var re=I.mergeOptions(n,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Bs(i)}),ae=D_({segment:i,finishProcessingFn:L,responseType:re.responseType}),pe=r(re,ae);pe.addEventListener("progress",O_({segment:i,progressFn:o,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:g,id3Fn:m,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x})),H.push(pe);var Re={};return H.forEach(function(ue){ue.addEventListener("loadend",I_({loadendState:Re,abortFn:s}))}),function(){return Vs(H)}},F_=pt("CodecUtils"),R_=function(t){var r=t.attributes||{};if(r.CODECS)return vt(r.CODECS)},Zf=function(t,r){var n=r.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&n.AUDIO&&t.mediaGroups.AUDIO[n.AUDIO]},M_=function(t,r){if(!Zf(t,r))return!0;var n=r.attributes||{},e=t.mediaGroups.AUDIO[n.AUDIO];for(var i in e)if(!e[i].uri&&!e[i].playlists)return!0;return!1},ia=function(t){var r={};return t.forEach(function(n){var e=n.mediaType,i=n.type,s=n.details;r[e]=r[e]||[],r[e].push(yd(""+i+s))}),Object.keys(r).forEach(function(n){if(r[n].length>1){F_("multiple "+n+" codecs found as attributes: "+r[n].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),r[n]=null;return}r[n]=r[n][0]}),r},Ql=function(t){var r=0;return t.audio&&r++,t.video&&r++,r},ki=function(t,r){var n=r.attributes||{},e=ia(R_(r)||[]);if(Zf(t,r)&&!e.audio&&!M_(t,r)){var i=ia(Jm(t,n.AUDIO)||[]);i.audio&&(e.audio=i.audio)}return e},kn=pt("PlaylistSelector"),Jl=function(t){if(!(!t||!t.playlist)){var r=t.playlist;return JSON.stringify({id:r.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:r.attributes&&r.attributes.CODECS||""})}},na=function(t,r){if(!t)return"";var n=A.getComputedStyle(t);return n?n[r]:""},Mr=function(t,r){var n=t.slice();t.sort(function(e,i){var s=r(e,i);return s===0?n.indexOf(e)-n.indexOf(i):s})},Xo=function(t,r){var n,e;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||A.Number.MAX_VALUE,r.attributes.BANDWIDTH&&(e=r.attributes.BANDWIDTH),e=e||A.Number.MAX_VALUE,n-e},N_=function(t,r){var n,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||A.Number.MAX_VALUE,r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(e=r.attributes.RESOLUTION.width),e=e||A.Number.MAX_VALUE,n===e&&t.attributes.BANDWIDTH&&r.attributes.BANDWIDTH?t.attributes.BANDWIDTH-r.attributes.BANDWIDTH:n-e},eh=function(t,r,n,e,i,s){if(!!t){var o={bandwidth:r,width:n,height:e,limitRenditionByPlayerDimensions:i},u=t.playlists;Ye.isAudioOnly(t)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map(function(N){var X,$=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,J=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return X=N.attributes&&N.attributes.BANDWIDTH,X=X||A.Number.MAX_VALUE,{bandwidth:X,width:$,height:J,playlist:N}});Mr(l,function(N,X){return N.bandwidth-X.bandwidth}),l=l.filter(function(N){return!Ye.isIncompatible(N.playlist)});var c=l.filter(function(N){return Ye.isEnabled(N.playlist)});c.length||(c=l.filter(function(N){return!Ye.isDisabled(N.playlist)}));var g=c.filter(function(N){return N.bandwidth*we.BANDWIDTH_VARIANCEn||N.height>e}),L=H.filter(function(N){return N.width===H[0].width&&N.height===H[0].height}),m=L[L.length-1],F=L.filter(function(N){return N.bandwidth===m.bandwidth})[0]);var q;if(s.experimentalLeastPixelDiffSelector){var B=x.map(function(N){return N.pixelDiff=Math.abs(N.width-n)+Math.abs(N.height-e),N});Mr(B,function(N,X){return N.pixelDiff===X.pixelDiff?X.bandwidth-N.bandwidth:N.pixelDiff-X.pixelDiff}),q=B[0]}var R=q||F||O||_||c[0]||l[0];if(R&&R.playlist){var U="sortedPlaylistReps";return q?U="leastPixelDiffRep":F?U="resolutionPlusOneRep":O?U="resolutionBestRep":_?U="bandwidthBestRep":c[0]&&(U="enabledPlaylistReps"),kn("choosing "+Jl(R)+" using "+U+" with options",o),R.playlist}return kn("could not choose a playlist with options",o),null}},Zl=function(){var t=this.useDevicePixelRatio&&A.devicePixelRatio||1;return eh(this.playlists.master,this.systemBandwidth,parseInt(na(this.tech_.el(),"width"),10)*t,parseInt(na(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},B_=function(t){var r=-1,n=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&A.devicePixelRatio||1;return r<0&&(r=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(r=t*this.systemBandwidth+(1-t)*r,n=this.systemBandwidth),eh(this.playlists.master,r,parseInt(na(this.tech_.el(),"width"),10)*e,parseInt(na(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},U_=function(t){var r=t.master,n=t.currentTime,e=t.bandwidth,i=t.duration,s=t.segmentDuration,o=t.timeUntilRebuffer,u=t.currentTimeline,l=t.syncController,c=r.playlists.filter(function(S){return!Ye.isIncompatible(S)}),g=c.filter(Ye.isEnabled);g.length||(g=c.filter(function(S){return!Ye.isDisabled(S)}));var m=g.filter(Ye.hasAttribute.bind(null,"BANDWIDTH")),_=m.map(function(S){var x=l.getSyncPoint(S,i,u,n),w=x?1:2,O=Ye.estimateSegmentRequestTime(s,e,S),H=O*w-o;return{playlist:S,rebufferingImpact:H}}),b=_.filter(function(S){return S.rebufferingImpact<=0});return Mr(b,function(S,x){return Xo(x.playlist,S.playlist)}),b.length?b[0]:(Mr(_,function(S,x){return S.rebufferingImpact-x.rebufferingImpact}),_[0]||null)},V_=function(){var t=this,r=this.playlists.master.playlists.filter(Ye.isEnabled);Mr(r,function(e,i){return Xo(e,i)});var n=r.filter(function(e){return!!ki(t.playlists.master,e).video});return n[0]||null},H_=function(t){var r=0,n;return t.bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(function(e){n.set(e,r),r+=e.byteLength})),n},q_=function(t,r,n){if(!t[n]){r.trigger({type:"usage",name:"vhs-608"}),r.trigger({type:"usage",name:"hls-608"});var e=n;/^cc708_/.test(n)&&(e="SERVICE"+n.split("_")[1]);var i=r.textTracks().getTrackById(e);if(i)t[n]=i;else{var s=r.options_.vhs&&r.options_.vhs.captionServices||{},o=n,u=n,l=!1,c=s[e];c&&(o=c.label,u=c.language,l=c.default),t[n]=r.addRemoteTextTrack({kind:"captions",id:e,default:l,label:o,language:u},!1).track}}},j_=function(t){var r=t.inbandTextTracks,n=t.captionArray,e=t.timestampOffset;if(!!n){var i=A.WebKitDataCue||A.VTTCue;n.forEach(function(s){var o=s.stream;r[o].addCue(new i(s.startTime+e,s.endTime+e,s.text))})}},G_=function(t){Object.defineProperties(t.frame,{id:{get:function(){return I.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return I.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return I.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},W_=function(t){var r=t.inbandTextTracks,n=t.metadataArray,e=t.timestampOffset,i=t.videoDuration;if(!!n){var s=A.WebKitDataCue||A.VTTCue,o=r.metadataTrack_;if(!!o&&(n.forEach(function(_){var b=_.cueTime+e;typeof b!="number"||A.isNaN(b)||b<0||!(b<1/0)||_.frames.forEach(function(S){var x=new s(b,b,S.value||S.url||S.data||"");x.frame=S,x.value=S,G_(x),o.addCue(x)})}),!(!o.cues||!o.cues.length))){for(var u=o.cues,l=[],c=0;c=t&&i.endTime<=r&&n.removeCue(i)},$_=function(t){var r=t.cues;if(!!r)for(var n=0;n1&&e.push(r[s]));e.length&&e.forEach(function(o){return t.removeCue(o)})}},K_=function(t,r,n){if(typeof r>"u"||r===null||!t.length)return[];var e=Math.ceil((r-n+3)*jn.ONE_SECOND_IN_TS),i;for(i=0;ie);i++);return t.slice(i)},X_=function(t,r,n){if(!r.length)return t;if(n)return r.slice();var e=r[0].pts,i=0;for(i;i=e);i++);return t.slice(0,i).concat(r)},Y_=function(t,r,n,e){for(var i=Math.ceil((r-e)*jn.ONE_SECOND_IN_TS),s=Math.ceil((n-e)*jn.ONE_SECOND_IN_TS),o=t.slice(),u=t.length;u--&&!(t[u].pts<=s););if(u===-1)return o;for(var l=u+1;l--&&!(t[l].pts<=i););return l=Math.max(l,0),o.splice(l,u-l+1),o},Q_=function(t,r){if(!t&&!r||!t&&r||t&&!r)return!1;if(t===r)return!0;var n=Object.keys(t).sort(),e=Object.keys(r).sort();if(n.length!==e.length)return!1;for(var i=0;in))return s}return e.length===0?0:e[e.length-1]},yi=1,Z_=500,ed=function(t){return typeof t=="number"&&isFinite(t)},Pn=1/60,eT=function(t,r,n){return t!=="main"||!r||!n?null:!n.hasAudio&&!n.hasVideo?"Neither audio nor video found in segment.":r.hasVideo&&!n.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.":!r.hasVideo&&n.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},tT=function(t,r,n){var e=r-we.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var i=r-n;return Math.min(i,e)},kr=function(t){var r=t.startOfSegment,n=t.duration,e=t.segment,i=t.part,s=t.playlist,o=s.mediaSequence,u=s.id,l=s.segments,c=l===void 0?[]:l,g=t.mediaIndex,m=t.partIndex,_=t.timeline,b=c.length-1,S="mediaIndex/partIndex increment";t.getMediaInfoForTime?S="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(S="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(S+=" with independent "+t.independent);var x=typeof m=="number",w=t.segment.uri?"segment":"pre-segment",O=x?Sf({preloadSegment:e})-1:0;return w+" ["+(o+g)+"/"+(o+b)+"]"+(x?" part ["+m+"/"+O+"]":"")+(" segment start/end ["+e.start+" => "+e.end+"]")+(x?" part start/end ["+i.start+" => "+i.end+"]":"")+(" startOfSegment ["+r+"]")+(" duration ["+n+"]")+(" timeline ["+_+"]")+(" selected by ["+S+"]")+(" playlist ["+u+"]")},td=function(t){return t+"TimingInfo"},rT=function(t){var r=t.segmentTimeline,n=t.currentTimeline,e=t.startOfSegment,i=t.buffered,s=t.overrideCheck;return!s&&r===n?null:rr&&(r=o)}}),typeof r=="bigint"&&rn+Yt:!1},nT=function(t,r){if(r!=="hls")return null;var n=iT({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!n)return null;var e=t.playlist.targetDuration,i=id({segmentDuration:n,maxDuration:e*2}),s=id({segmentDuration:n,maxDuration:e}),o="Segment with index "+t.mediaIndex+" "+("from playlist "+t.playlist.id+" ")+("has a duration of "+n+" ")+("when the reported duration is "+t.duration+" ")+("and the target duration is "+e+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return i||s?{severity:i?"warn":"info",message:o}:null},Hs=function(a){W(t,a);function t(n,e){var i;if(i=a.call(this)||this,!n)throw new TypeError("Initialization settings are required");if(typeof n.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!n.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=n.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=n.hasPlayed,i.currentTime_=n.currentTime,i.seekable_=n.seekable,i.seeking_=n.seeking,i.duration_=n.duration,i.mediaSource_=n.mediaSource,i.vhs_=n.vhs,i.loaderType_=n.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=n.segmentMetadataTrack,i.goalBufferLength_=n.goalBufferLength,i.sourceType_=n.sourceType,i.sourceUpdater_=n.sourceUpdater,i.inbandTextTracks_=n.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=n.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=n.parse708captions,i.useDtsForTimestampOffset_=n.useDtsForTimestampOffset,i.captionServices_=n.captionServices,i.experimentalExactManifestTimings=n.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=I.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=n.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=n.decrypter,i.syncController_=n.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=pt("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(ee(i),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="main"&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="audio"&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}var r=t.prototype;return r.createTransmuxer_=function(){return fs.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},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,A.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e},r.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&fs.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return I.createTimeRanges();if(this.loaderType_==="main"){var i=e.hasAudio,s=e.hasVideo,o=e.isMuxed;if(s&&i&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=ta(e),o=this.initSegments_[s];return i&&!o&&e.bytes&&(this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},r.segmentKey=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=Bf(e),o=this.keyCache_[s];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[s]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var u={resolvedUri:(o||e).resolvedUri};return o&&(u.bytes=o.bytes),u},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(e,i){if(i===void 0&&(i={}),!!e){var s=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var u=null;if(s&&(s.id?u=s.id:s.uri&&(u=s.uri)),this.logger_("playlist update ["+u+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var l=e.mediaSequence-s.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var g=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=g}}o&&(o.mediaIndex-=l,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}},r.pause=function(){this.checkBufferTimeout_&&(A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&fs.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(e,i,s,o){if(s===void 0&&(s=function(){}),o===void 0&&(o=!1),i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var u=1,l=function(){u--,u===0&&s()};(o||!this.audioDisabled_)&&(u++,this.sourceUpdater_.removeAudio(e,i,l)),(o||this.loaderType_==="main")&&(this.gopBuffer_=Y_(this.gopBuffer_,e,i,this.timeMapping_),u++,this.sourceUpdater_.removeVideo(e,i,l));for(var c in this.inbandTextTracks_)Ei(e,i,this.inbandTextTracks_[c]);Ei(e,i,this.segmentMetadataTrack_),l()},r.monitorBuffer_=function(){this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),Z_)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();!e||(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},r.isEndOfStream_=function(e,i,s){if(e===void 0&&(e=this.mediaIndex),i===void 0&&(i=this.playlist_),s===void 0&&(s=this.partIndex),!i||!this.mediaSource_)return!1;var o=typeof e=="number"&&i.segments[e],u=e+1===i.segments.length,l=!o||!o.parts||s+1===o.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&u&&l},r.chooseNextRequest_=function(){var e=this.buffered_(),i=Gl(e)||0,s=jo(e,this.currentTime_()),o=!this.hasPlayed_()&&s>=1,u=s>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||o||u)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:Boolean(!this.syncPoint_)};if(c.isSyncRequest)c.mediaIndex=J_(this.currentTimeline_,l,i);else if(this.mediaIndex!==null){var g=l[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=g.end?g.end:i,g.parts&&g.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var _=Ye.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?i:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=_.segmentIndex,S=_.startTime,x=_.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+i:"currentTime "+this.currentTime_(),c.mediaIndex=b,c.startOfSegment=S,c.partIndex=x}var w=l[c.mediaIndex],O=w&&typeof c.partIndex=="number"&&w.parts&&w.parts[c.partIndex];if(!w||typeof c.partIndex=="number"&&!O)return null;if(typeof c.partIndex!="number"&&w.parts&&(c.partIndex=0,O=w.parts[0]),!s&&O&&!O.independent)if(c.partIndex===0){var H=l[c.mediaIndex-1],L=H.parts&&H.parts.length&&H.parts[H.parts.length-1];L&&L.independent&&(c.mediaIndex-=1,c.partIndex=H.parts.length-1,c.independent="previous segment")}else w.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var F=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=l.length-1&&F&&!this.seeking_()?null:this.generateSegmentInfo_(c)},r.generateSegmentInfo_=function(e){var i=e.independent,s=e.playlist,o=e.mediaIndex,u=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,g=e.forceTimestampOffset,m=e.getMediaInfoForTime,_=s.segments[o],b=typeof c=="number"&&_.parts[c],S={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||_.resolvedUri,mediaIndex:o,partIndex:b?c:null,isSyncRequest:l,startOfSegment:u,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:b&&b.duration||_.duration,segment:_,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:i},x=typeof g<"u"?g:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:u,buffered:this.buffered_(),overrideCheck:x});var w=Gl(this.sourceUpdater_.audioBuffered());return typeof w=="number"&&(S.audioAppendStart=w-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=K_(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S},r.timestampOffsetForSegment_=function(e){return rT(e)},r.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var i=this.currentTime_(),s=e.bandwidth,o=this.pendingSegment_.duration,u=Ye.estimateSegmentRequestTime(o,s,this.playlist_,e.bytesReceived),l=Cy(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(!(u<=l)){var c=U_({master:this.vhs_.playlists.master,currentTime:i,bandwidth:s,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!!c){var g=u-l,m=g-c.rebufferingImpact,_=.5;l<=Yt&&(_=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||m<_)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*we.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},r.handleAbort_=function(e){this.logger_("Aborting "+kr(e)),this.mediaRequestsAborted+=1},r.handleProgress_=function(e,i){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&this.trigger("progress")},r.handleTrackInfo_=function(e,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(i)||(i=i||{},Q_(this.currentMediaInfo_,i)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=i,this.currentMediaInfo_=i,this.logger_("trackinfo update",i),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=i,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},r.handleTimingInfo_=function(e,i,s,o){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var u=this.pendingSegment_,l=td(i);u[l]=u[l]||{},u[l][s]=o,this.logger_("timinginfo: "+i+" - "+s+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},r.handleCaptions_=function(e,i){var s=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(i.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,i));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),l={};i.forEach(function(c){l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};var g=l[c.stream];g.startTime=Math.min(g.startTime,c.startTime+u),g.endTime=Math.max(g.endTime,c.endTime+u),g.captions.push(c)}),Object.keys(l).forEach(function(c){var g=l[c],m=g.startTime,_=g.endTime,b=g.captions,S=s.inbandTextTracks_;s.logger_("adding cues from "+m+" -> "+_+" for "+c),q_(S,s.vhs_.tech_,c),Ei(m,_,S[c]),j_({captionArray:b,inbandTextTracks:S,timestampOffset:u})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},r.handleId3_=function(e,i,s){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,s));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();z_(this.inbandTextTracks_,s,this.vhs_.tech_),W_({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:u,videoDuration:this.duration_()})}},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(i){return i()})},r.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(i){return i()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!rd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},r.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},r.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed;return!(o&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!u&&!e.audioTimingInfo||rd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.handleData_=function(e,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,i));return}var s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[td(i.type)].start;else{var o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo,l;u&&(l=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:l,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,i.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==s.mediaIndex||c.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,i)}}},r.updateAppendInitSegmentStatus=function(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)},r.getInitSegmentAndUpdateState_=function(e){var i=e.type,s=e.initSegment,o=e.map,u=e.playlist;if(o){var l=ta(o);if(this.activeInitSegmentId_===l)return null;s=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=l}return s&&this.appendInitSegment_[i]?(this.playlistOfLastInitSegment_[i]=u,this.appendInitSegment_[i]=!1,this.activeInitSegmentId_=null,s):null},r.handleQuotaExceededError_=function(e,i){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes,c=this.sourceUpdater_.audioBuffered(),g=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+ur(c).join(", ")),g.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+ur(g).join(", "));var m=c.length?c.start(0):0,_=c.length?c.end(c.length-1):0,b=g.length?g.start(0):0,S=g.length?g.end(g.length-1):0;if(_-m<=yi&&S-b<=yi){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+l.byteLength+", ")+("audio buffer: "+ur(c).join(", ")+", ")+("video buffer: "+ur(g).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:u,bytes:l}));var x=this.currentTime_(),w=x-yi;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+w),this.remove(0,w,function(){s.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+yi+"s"),s.waitingOnRemove_=!1,s.quotaExceededErrorRetryTimeout_=A.setTimeout(function(){s.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),s.quotaExceededErrorRetryTimeout_=null,s.processCallQueue_()},yi*1e3)},!0)},r.handleAppendError_=function(e,i){var s=e.segmentInfo,o=e.type,u=e.bytes;if(!!i){if(i.code===th){this.handleQuotaExceededError_({segmentInfo:s,type:o,bytes:u});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(o+" append of "+u.length+"b failed for segment "+("#"+s.mediaIndex+" in playlist "+s.playlist.id)),this.trigger("appenderror")}},r.appendToSourceBuffer_=function(e){var i=e.segmentInfo,s=e.type,o=e.initSegment,u=e.data,l=e.bytes;if(!l){var c=[u],g=u.byteLength;o&&(c.unshift(o),g+=o.byteLength),l=H_({bytes:g,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:s,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:i,type:s,bytes:l}))},r.handleSegmentTimingInfo_=function(e,i,s){if(!(!this.pendingSegment_||i!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,u=e+"TimingInfo";o[u]||(o[u]={}),o[u].transmuxerPrependedSeconds=s.prependedContentDuration||0,o[u].transmuxedPresentationStart=s.start.presentation,o[u].transmuxedDecodeStart=s.start.decode,o[u].transmuxedPresentationEnd=s.end.presentation,o[u].transmuxedDecodeEnd=s.end.decode,o[u].baseMediaDecodeTime=s.baseMediaDecodeTime}},r.appendData_=function(e,i){var s=i.type,o=i.data;if(!(!o||!o.byteLength)&&!(s==="audio"&&this.audioDisabled_)){var u=this.getInitSegmentAndUpdateState_({type:s,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:u,data:o})}},r.loadSegment_=function(e){var i=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var s=ot({},e,{forceTimestampOffset:!0});ot(e,i.generateSegmentInfo_(s)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},r.updateTransmuxerAndRequestSegment_=function(e){var i=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var s=this.createSimplifiedSegmentObj_(e),o=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),u=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=o||u&&l;this.logger_("Requesting "+kr(e)),s.map&&!s.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=L_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:s,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){i.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(m){var _=m.message,b=m.level,S=m.stream;i.logger_(kr(e)+" logged from transmuxer stream "+S+" as a "+b+": "+_)}})},r.trimBackBuffer_=function(e){var i=tT(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)},r.createSimplifiedSegmentObj_=function(e){var i=e.segment,s=e.part,o={resolvedUri:s?s.resolvedUri:i.resolvedUri,byterange:s?s.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===i.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),i.key){var l=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=l}return i.map&&(o.map=this.initSegmentForMap(i.map)),o},r.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},r.saveBandwidthRelatedStats_=function(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e"u"||_.end!==u+l?u:g.start},r.waitForAppendsToComplete_=function(e){var i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed,l=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&s&&!u;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}l&&e.waitingOnAppends++,c&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},r.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(e){var i=eT(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,blacklistDuration:1/0}),this.trigger("error"),!0):!1},r.updateSourceBufferTimestampOffset_=function(e){if(!(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")){var i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var i=e.videoTimingInfo,s=e.audioTimingInfo,o=e.timingInfo;return this.useDtsForTimestampOffset_?i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:s&&typeof s.transmuxedDecodeStart=="number"?s.transmuxedDecodeStart:o.start:o.start},r.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var i=this.getMediaInfo_(),s=this.loaderType_==="main"&&i&&i.hasVideo,o=s&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!o||(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});var i=nT(e,this.sourceType_);if(i&&(i.severity==="warn"?I.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+kr(e));return}this.logger_("Appended "+kr(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var s=e.segment,o=e.part,u=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,l=o&&o.end&&this.currentTime_()-o.end>e.playlist.partTargetDuration*3;if(u||l){this.logger_("bad "+(u?"segment":"part")+" "+kr(e)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},r.recordThroughput_=function(e){if(e.duration"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},r.remove=function(e,i){Ei(e,i,this.subtitlesTrack_)},r.fillBuffer_=function(){var e=this,i=this.chooseNextRequest_();if(!!i){if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null){var s=function(){e.state="READY",e.paused()||e.monitorBuffer_()};this.syncController_.one("timestampoffset",s),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(i)}},r.timestampOffsetForSegment_=function(){return null},r.chooseNextRequest_=function(){return this.skipEmptySegments_(a.prototype.chooseNextRequest_.call(this))},r.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},r.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(e,i,s){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===bt.TIMEOUT&&this.handleTimeout_(),e.code===bt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var u=this.pendingSegment_;this.saveBandwidthRelatedStats_(u.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");var l=u.segment;if(l.map&&(l.map.bytes=i.map.bytes),u.bytes=i.bytes,typeof A.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(e,i,s)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}l.requested=!0;try{this.parseVTTCues_(u)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(u,this.syncController_.timelines[u.timeline],this.playlist_),u.cues.length?u.timingInfo={start:u.cues[0].startTime,end:u.cues[u.cues.length-1].endTime}:u.timingInfo={start:u.startOfSegment,end:u.startOfSegment+u.duration},u.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}u.byteLength=u.bytes.byteLength,this.mediaSecondsLoaded+=l.duration,u.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new A.VTTCue(c.startTime,c.endTime,c.text):c)}),$_(this.subtitlesTrack_),this.handleAppendsDone_()},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(e){var i,s=!1;if(typeof A.WebVTT!="function")throw new oT;typeof A.TextDecoder=="function"?i=new A.TextDecoder("utf8"):(i=A.WebVTT.StringDecoder(),s=!0);var o=new A.WebVTT.Parser(A,A.vttjs,i);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(c){e.timestampmap=c},o.onparsingerror=function(c){I.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){var u=e.segment.map.bytes;s&&(u=ad(u)),o.parse(u)}var l=e.bytes;s&&(l=ad(l)),o.parse(l),o.flush()},r.updateTimeMapping_=function(e,i,s){var o=e.segment;if(!!i){if(!e.cues.length){o.empty=!0;return}var u=e.timestampmap,l=u.MPEGTS/jn.ONE_SECOND_IN_TS-u.LOCAL+i.mapping;if(e.cues.forEach(function(m){m.startTime+=l,m.endTime+=l}),!s.syncInfo){var c=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(c,g-o.duration)}}}},t}(Hs),lT=function(t,r){for(var n=t.cues,e=0;e=i.adStartTime&&r<=i.adEndTime)return i}return null},dT=function(t,r,n){if(n===void 0&&(n=0),!!t.segments)for(var e=n,i,s=0;s=b)&&(o=b,s={time:_,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return s}},{name:"Discontinuity",run:function(t,r,n,e,i){var s=null;if(i=i||0,r.discontinuityStarts&&r.discontinuityStarts.length)for(var o=null,u=0;u=m)&&(o=m,s={time:g.time,segmentIndex:l,partIndex:null})}}return s}},{name:"Playlist",run:function(t,r,n,e,i){if(r.syncInfo){var s={time:r.syncInfo.time,segmentIndex:r.syncInfo.mediaSequence-r.mediaSequence,partIndex:null};return s}return null}}],fT=function(a){W(t,a);function t(n){var e;return e=a.call(this)||this,e.timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=pt("SyncController"),e}var r=t.prototype;return r.getSyncPoint=function(e,i,s,o){var u=this.runStrategies_(e,i,s,o);return u.length?this.selectSyncPoint_(u,{key:"time",value:o}):null},r.getExpiredTime=function(e,i){if(!e||!e.segments)return null;var s=this.runStrategies_(e,i,e.discontinuitySequence,0);if(!s.length)return null;var o=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+wi({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},r.runStrategies_=function(e,i,s,o){for(var u=[],l=0;lcT){I.log.warn("Not saving expired segment info. Media sequence gap "+s+" is too large.");return}for(var o=s-1;o>=0;o--){var u=e.segments[o];if(u&&typeof u.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+o,time:u.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+","+(" mediaSequence: "+i.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var i=e.segments[0],s=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-s}},r.saveSegmentTimingInfo=function(e){var i=e.segmentInfo,s=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(i,i.timingInfo,s),u=i.segment;o&&(this.saveDiscontinuitySyncInfo_(i),i.playlist.syncInfo||(i.playlist.syncInfo={mediaSequence:i.playlist.mediaSequence+i.mediaIndex,time:u.start}));var l=u.dateTimeObject;u.discontinuity&&s&&l&&(this.timelineToDatetimeMappings[u.timeline]=-(l.getTime()/1e3))},r.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},r.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,i,s){var o=e.segment,u=e.part,l=this.timelines[e.timeline],c,g;if(typeof e.timestampOffset=="number")l={time:e.startOfSegment,mapping:e.startOfSegment-i.start},s&&(this.timelines[e.timeline]=l,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+l.time+"] [mapping: "+l.mapping+"]"))),c=e.startOfSegment,g=i.end+l.mapping;else if(l)c=i.start+l.mapping,g=i.end+l.mapping;else return!1;return u&&(u.start=c,u.end=g),(!o.start||cg){var m=void 0;c<0?m=s.start-wi({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:u}):m=s.end+wi({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:u}),this.discontinuities[l]={time:m,accuracy:g}}}},r.dispose=function(){this.trigger("dispose"),this.off()},t}(I.EventTarget),hT=function(a){W(t,a);function t(){var n;return n=a.call(this)||this,n.pendingTimelineChanges_={},n.lastTimelineChanges_={},n}var r=t.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[i]={type:i,from:s,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[i]},r.lastTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[i]={type:i,from:s,to:o},delete this.pendingTimelineChanges_[i],this.trigger("timelinechange")),this.lastTimelineChanges_[i]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(I.EventTarget),pT=Gf(Wf(function(){var a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(L,F,q){return q={path:F,exports:{},require:function(R,U){return r(R,U==null?q.path:U)}},L(q,q.exports),q.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var n=t(function(L){function F(B,R){for(var U=0;U-1},F.trigger=function(B){var R=this.listeners[B];if(!!R)if(arguments.length===2)for(var U=R.length,N=0;N>7)*283)^N]=N;for(X=$=0;!R[X];X^=fe||1,$=oe[$]||1)for(pe=$^$<<1^$<<2^$<<3^$<<4,pe=pe>>8^pe&255^99,R[X]=pe,U[pe]=X,ae=J[re=J[fe=J[X]]],ue=ae*16843009^re*65537^fe*257^X*16843008,Re=J[pe]*257^pe*16843008,N=0;N<4;N++)q[N][X]=Re=Re<<24^Re>>>8,B[N][pe]=ue=ue<<24^ue>>>8;for(N=0;N<5;N++)q[N]=q[N].slice(0),B[N]=B[N].slice(0);return F},l=null,c=function(){function L(q){l||(l=u()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var B,R,U,N=this._tables[0][4],X=this._tables[1],$=q.length,J=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");var oe=q.slice(0),fe=[];for(this._key=[oe,fe],B=$;B<4*$+28;B++)U=oe[B-1],(B%$===0||$===8&&B%$===4)&&(U=N[U>>>24]<<24^N[U>>16&255]<<16^N[U>>8&255]<<8^N[U&255],B%$===0&&(U=U<<8^U>>>24^J<<24,J=J<<1^(J>>7)*283)),oe[B]=oe[B-$]^U;for(R=0;B;R++,B--)U=oe[R&3?B:B-4],B<=4||R<4?fe[R]=U:fe[R]=X[0][N[U>>>24]]^X[1][N[U>>16&255]]^X[2][N[U>>8&255]]^X[3][N[U&255]]}var F=L.prototype;return F.decrypt=function(B,R,U,N,X,$){var J=this._key[1],oe=B^J[0],fe=N^J[1],re=U^J[2],ae=R^J[3],pe,Re,ue,Qi=J.length/4-2,nt,At=4,Wt=this._tables[1],Jt=Wt[0],mt=Wt[1],gr=Wt[2],vr=Wt[3],yr=Wt[4];for(nt=0;nt>>24]^mt[fe>>16&255]^gr[re>>8&255]^vr[ae&255]^J[At],Re=Jt[fe>>>24]^mt[re>>16&255]^gr[ae>>8&255]^vr[oe&255]^J[At+1],ue=Jt[re>>>24]^mt[ae>>16&255]^gr[oe>>8&255]^vr[fe&255]^J[At+2],ae=Jt[ae>>>24]^mt[oe>>16&255]^gr[fe>>8&255]^vr[re&255]^J[At+3],At+=4,oe=pe,fe=Re,re=ue;for(nt=0;nt<4;nt++)X[(3&-nt)+$]=yr[oe>>>24]<<24^yr[fe>>16&255]<<16^yr[re>>8&255]<<8^yr[ae&255]^J[At++],pe=oe,oe=fe,fe=re,re=ae,ae=pe},L}(),g=function(L){i(F,L);function F(){var B;return B=L.call(this,s)||this,B.jobs=[],B.delay=1,B.timeout_=null,B}var q=F.prototype;return q.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},q.push=function(R){this.jobs.push(R),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},F}(s),m=function(F){return F<<24|(F&65280)<<8|(F&16711680)>>8|F>>>24},_=function(F,q,B){var R=new Int32Array(F.buffer,F.byteOffset,F.byteLength>>2),U=new c(Array.prototype.slice.call(q)),N=new Uint8Array(F.byteLength),X=new Int32Array(N.buffer),$,J,oe,fe,re,ae,pe,Re,ue;for($=B[0],J=B[1],oe=B[2],fe=B[3],ue=0;ue=0&&(r="main-desc"),r},aa=function(t,r){t.abort(),t.pause(),r&&r.activePlaylistLoader&&(r.activePlaylistLoader.pause(),r.activePlaylistLoader=null)},js=function(t,r){r.activePlaylistLoader=t,t.load()},vT=function(t,r){return function(){var n=r.segmentLoaders,e=n[t],i=n.main,s=r.mediaTypes[t],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastGroup_;if(!(u&&c&&u.id===c.id)&&(s.lastGroup_=u,s.lastTrack_=o,aa(e,s),!(!u||u.isMasterPlaylist))){if(!u.playlistLoader){l&&i.resetEverything();return}e.resyncLoader(),js(u.playlistLoader,s)}}},yT=function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];e.lastGroup_=null,n.abort(),n.pause()}},_T=function(t,r){return function(){var n=r.masterPlaylistLoader,e=r.segmentLoaders,i=e[t],s=e.main,o=r.mediaTypes[t],u=o.activeTrack(),l=o.getActiveGroup(),c=o.activePlaylistLoader,g=o.lastTrack_;if(!(g&&u&&g.id===u.id)&&(o.lastGroup_=l,o.lastTrack_=u,aa(i,o),!!l)){if(l.isMasterPlaylist){if(!u||!g||u.id===g.id)return;var m=r.vhs.masterPlaylistController_,_=m.selectPlaylist();if(m.media()===_)return;o.logger_("track change. Switching master audio from "+g.id+" to "+u.id),n.pause(),s.resetEverything(),m.fastQualityChange_(_);return}if(t==="AUDIO"){if(!l.playlistLoader){s.setAudio(!0),s.resetEverything();return}i.setAudio(!0),s.setAudio(!1)}if(c===l.playlistLoader){js(l.playlistLoader,o);return}i.track&&i.track(u),i.resetEverything(),js(l.playlistLoader,o)}}},sa={AUDIO:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t],i=r.blacklistCurrentPlaylist;aa(n,e);var s=e.activeTrack(),o=e.activeGroup(),u=(o.filter(function(g){return g.default})[0]||o[0]).id,l=e.tracks[u];if(s===l){i({message:"Problem encountered loading the default audio track."});return}I.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in e.tracks)e.tracks[c].enabled=e.tracks[c]===l;e.onTrackChanged()}},SUBTITLES:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];I.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),aa(n,e);var i=e.activeTrack();i&&(i.mode="disabled"),e.onTrackChanged()}}},ud={AUDIO:function(t,r,n){if(!!r){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t];r.on("loadedmetadata",function(){var o=r.media();s.playlist(o,i),(!e.paused()||o.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},SUBTITLES:function(t,r,n){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t],o=n.mediaTypes[t];r.on("loadedmetadata",function(){var u=r.media();s.playlist(u,i),s.track(o.activeTrack()),(!e.paused()||u.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},TT={AUDIO:function(t,r){var n=r.vhs,e=r.sourceType,i=r.segmentLoaders[t],s=r.requestOptions,o=r.master.mediaGroups,u=r.mediaTypes[t],l=u.groups,c=u.tracks,g=u.logger_,m=r.masterPlaylistLoader,_=Yi(m.master);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},_&&(o[t].main.default.playlists=m.master.playlists));for(var b in o[t]){l[b]||(l[b]=[]);for(var S in o[t][b]){var x=o[t][b][S],w=void 0;if(_?(g("AUDIO group '"+b+"' label '"+S+"' is a master playlist"),x.isMasterPlaylist=!0,w=null):e==="vhs-json"&&x.playlists?w=new Lr(x.playlists[0],n,s):x.resolvedUri?w=new Lr(x.resolvedUri,n,s):x.playlists&&e==="dash"?w=new Us(x.playlists[0],n,s,m):w=null,x=I.mergeOptions({id:S,playlistLoader:w},x),ud[t](t,x.playlistLoader,r),l[b].push(x),typeof c[S]>"u"){var O=new I.AudioTrack({id:S,kind:gT(x),enabled:!1,language:x.language,default:x.default,label:S});c[S]=O}}}i.on("error",sa[t](t,r))},SUBTITLES:function(t,r){var n=r.tech,e=r.vhs,i=r.sourceType,s=r.segmentLoaders[t],o=r.requestOptions,u=r.master.mediaGroups,l=r.mediaTypes[t],c=l.groups,g=l.tracks,m=r.masterPlaylistLoader;for(var _ in u[t]){c[_]||(c[_]=[]);for(var b in u[t][_])if(!u[t][_][b].forced){var S=u[t][_][b],x=void 0;if(i==="hls")x=new Lr(S.resolvedUri,e,o);else if(i==="dash"){var w=S.playlists.filter(function(H){return H.excludeUntil!==1/0});if(!w.length)return;x=new Us(S.playlists[0],e,o,m)}else i==="vhs-json"&&(x=new Lr(S.playlists?S.playlists[0]:S.resolvedUri,e,o));if(S=I.mergeOptions({id:b,playlistLoader:x},S),ud[t](t,S.playlistLoader,r),c[_].push(S),typeof g[b]>"u"){var O=n.addRemoteTextTrack({id:b,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:b},!1).track;g[b]=O}}}s.on("error",sa[t](t,r))},"CLOSED-CAPTIONS":function(t,r){var n=r.tech,e=r.master.mediaGroups,i=r.mediaTypes[t],s=i.groups,o=i.tracks;for(var u in e[t]){s[u]||(s[u]=[]);for(var l in e[t][u]){var c=e[t][u][l];if(!!/^(?:CC|SERVICE)/.test(c.instreamId)){var g=n.options_.vhs&&n.options_.vhs.captionServices||{},m={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(g[m.instreamId]&&(m=I.mergeOptions(m,g[m.instreamId])),m.default===void 0&&delete m.default,s[u].push(I.mergeOptions({id:l},c)),typeof o[l]>"u"){var _=n.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;o[l]=_}}}}}},bT=function a(t,r){for(var n=0;n1&&Yi(r.master))for(var l=0;l"u"?o:n===null||!o?null:o.filter(function(g){return g.id===n.id})[0]||null}},ST={AUDIO:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].enabled)return n[e];return null}},SUBTITLES:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].mode==="showing"||n[e].mode==="hidden")return n[e];return null}}},ET=function(t,r){var n=r.mediaTypes;return function(){var e=n[t].activeTrack();return e?n[t].activeGroup(e):null}},CT=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){TT[b](b,t)});var r=t.mediaTypes,n=t.masterPlaylistLoader,e=t.tech,i=t.vhs,s=t.segmentLoaders,o=s.AUDIO,u=s.main;["AUDIO","SUBTITLES"].forEach(function(b){r[b].activeGroup=xT(b,t),r[b].activeTrack=ST[b](b,t),r[b].onGroupChanged=vT(b,t),r[b].onGroupChanging=yT(b,t),r[b].onTrackChanged=_T(b,t),r[b].getActiveGroup=ET(b,t)});var l=r.AUDIO.activeGroup();if(l){var c=(l.filter(function(b){return b.default})[0]||l[0]).id;r.AUDIO.tracks[c].enabled=!0,r.AUDIO.onGroupChanged(),r.AUDIO.onTrackChanged();var g=r.AUDIO.getActiveGroup();g.playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanging()})});var m=function(){r.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};e.audioTracks().addEventListener("change",m),e.remoteTextTracks().addEventListener("change",r.SUBTITLES.onTrackChanged),i.on("dispose",function(){e.audioTracks().removeEventListener("change",m),e.remoteTextTracks().removeEventListener("change",r.SUBTITLES.onTrackChanged)}),e.clearTracks("audio");for(var _ in r.AUDIO.tracks)e.audioTracks().addTrack(r.AUDIO.tracks[_])},AT=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(r){t[r]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ot,activeTrack:Ot,getActiveGroup:Ot,onGroupChanged:Ot,onTrackChanged:Ot,lastTrack_:null,logger_:pt("MediaGroups["+r+"]")}}),t},DT=60*2,kt,wT=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],kT=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},PT=function(t){var r=t.currentPlaylist,n=t.buffered,e=t.currentTime,i=t.nextPlaylist,s=t.bufferLowWaterLine,o=t.bufferHighWaterLine,u=t.duration,l=t.experimentalBufferBasedABR,c=t.log;if(!i)return I.log.warn("We received no playlist to switch to. Please check your stream."),!1;var g="allowing switch "+(r&&r.id||"null")+" -> "+i.id;if(!r)return c(g+" as current playlist is not set"),!0;if(i.id===r.id)return!1;var m=Boolean(Or(n,e).length);if(!r.endList)return!m&&typeof r.partTargetDuration=="number"?(c("not "+g+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(g+" as current playlist is live"),!0);var _=jo(n,e),b=l?we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:we.MAX_BUFFER_LOW_WATER_LINE;if(ux)&&_>=s){var O=g+" as forwardBuffer >= bufferLowWaterLine ("+_+" >= "+s+")";return l&&(O+=" and next bandwidth > current bandwidth ("+S+" > "+x+")"),c(O),!0}return c("not "+g+" as no switching criteria met"),!1},IT=function(a){W(t,a);function t(n){var e;e=a.call(this)||this;var i=n.src,s=n.handleManifestRedirects,o=n.withCredentials,u=n.tech,l=n.bandwidth,c=n.externVhs,g=n.useCueTags,m=n.blacklistDuration,_=n.enableLowInitialPlaylist,b=n.sourceType,S=n.cacheEncryptionKeys,x=n.experimentalBufferBasedABR,w=n.experimentalLeastPixelDiffSelector,O=n.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var H=n.maxPlaylistRetries;(H===null||typeof H>"u")&&(H=1/0),kt=c,e.experimentalBufferBasedABR=Boolean(x),e.experimentalLeastPixelDiffSelector=Boolean(w),e.withCredentials=o,e.tech_=u,e.vhs_=u.vhs,e.sourceType_=b,e.useCueTags_=g,e.blacklistDuration=m,e.maxPlaylistRetries=H,e.enableLowInitialPlaylist=_,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:H,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=AT(),e.mediaSource=new A.MediaSource,e.handleDurationChange_=e.handleDurationChange_.bind(ee(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(ee(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(ee(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=I.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new fT(n),e.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new mT,e.sourceUpdater_=new nh(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new hT;var L={vhs:e.vhs_,parse708captions:n.parse708captions,useDtsForTimestampOffset:n.useDtsForTimestampOffset,captionServices:O,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.duration()},hasPlayed:function(){return e.hasPlayed_},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:l,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_,cacheEncryptionKeys:S,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:n.experimentalExactManifestTimings};e.masterPlaylistLoader_=e.sourceType_==="dash"?new Us(i,e.vhs_,e.requestOptions_):new Lr(i,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Hs(I.mergeOptions(L,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),n),e.audioSegmentLoader_=new Hs(I.mergeOptions(L,{loaderType:"audio"}),n),e.subtitleSegmentLoader_=new uT(I.mergeOptions(L,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(B,R){function U(){u.off("vttjserror",N),B()}function N(){u.off("vttjsloaded",U),R()}u.one("vttjsloaded",U),u.one("vttjserror",N),u.addWebVttScript_()})}}),n),e.setupSegmentLoaderListeners_(),e.experimentalBufferBasedABR&&(e.masterPlaylistLoader_.one("loadedplaylist",function(){return e.startABRTimer_()}),e.tech_.on("pause",function(){return e.stopABRTimer_()}),e.tech_.on("play",function(){return e.startABRTimer_()})),wT.forEach(function(q){e[q+"_"]=kT.bind(ee(e),q)}),e.logger_=pt("MPC"),e.triggeredFmp4Usage=!1,e.tech_.preload()==="none"?(e.loadOnPlay_=function(){e.loadOnPlay_=null,e.masterPlaylistLoader_.load()},e.tech_.one("play",e.loadOnPlay_)):e.masterPlaylistLoader_.load(),e.timeToLoadedData__=-1,e.mainAppendsToLoadedData__=-1,e.audioAppendsToLoadedData__=-1;var F=e.tech_.preload()==="none"?"play":"loadstart";return e.tech_.one(F,function(){var q=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-q,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}var r=t.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(e){e===void 0&&(e="abr");var i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)},r.switchMedia_=function(e,i,s){var o=this.media(),u=o&&(o.id||o.uri),l=e.id||e.uri;u&&u!==l&&(this.logger_("switch media "+u+" -> "+l+" from "+i),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+i})),this.masterPlaylistLoader_.media(e,s)},r.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.setInterval(function(){return e.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var e=this.master(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;var s=e.mediaGroups.AUDIO,o=Object.keys(s),u;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)u=this.mediaTypes_.AUDIO.activeTrack();else{var l=s.main||o.length&&s[o[0]];for(var c in l)if(l[c].default){u={label:c};break}}if(!u)return i;var g=[];for(var m in s)if(s[m][u.label]){var _=s[m][u.label];if(_.playlists&&_.playlists.length)g.push.apply(g,_.playlists);else if(_.uri)g.push(_);else if(e.playlists.length)for(var b=0;b1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(e){var i=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),o=this.bufferLowWaterLine(),u=this.bufferHighWaterLine(),l=this.tech_.buffered();return PT({buffered:l,currentTime:s,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:u,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(s){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},DT))});var i=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();!o||e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",i),this.audioSegmentLoader_.on("trackinfo",i),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},r.fastQualityChange_=function(e){var i=this;if(e===void 0&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){I.browser.IE_VERSION||I.browser.IS_EDGE?i.tech_.setCurrentTime(i.tech_.currentTime()+.04):i.tech_.setCurrentTime(i.tech_.currentTime())})},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?g=1/0:g=Date.now()+i*1e3,s.excludeUntil=g,e.reason&&(s.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var m=this.selectPlaylist();if(!m){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var _=e.internal?this.logger_:I.log.warn,b=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+s.id+"."+(b+" Switching to playlist "+m.id+".")),m.attributes.AUDIO!==s.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==s.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var S=m.targetDuration/2*1e3||5*1e3,x=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=S;return this.switchMedia_(m,"exclude",l||x)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(e,i){var s=this,o=[],u=e==="all";(u||e==="main")&&o.push(this.masterPlaylistLoader_);var l=[];(u||e==="audio")&&l.push("AUDIO"),(u||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(c){var g=s.mediaTypes_[c]&&s.mediaTypes_[c].activePlaylistLoader;g&&o.push(g)}),["main","audio","subtitle"].forEach(function(c){var g=s[c+"SegmentLoader_"];g&&(e===c||e==="all")&&o.push(g)}),o.forEach(function(c){return i.forEach(function(g){typeof c[g]=="function"&&c[g]()})})},r.setCurrentTime=function(e){var i=Or(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:kt.Playlist.duration(e):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var e;if(!!this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(!!i){var s=this.syncController_.getExpiredTime(i,this.duration());if(s!==null){var o=this.masterPlaylistLoader_.master,u=kt.Playlist.seekable(i,s,kt.Playlist.liveEdgeDelay(o,i));if(u.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(i,this.duration()),s===null||(e=kt.Playlist.seekable(i,s,kt.Playlist.liveEdgeDelay(o,i)),e.length===0)))){var l,c;this.seekable_&&this.seekable_.length&&(l=this.seekable_.end(0),c=this.seekable_.start(0)),e?e.start(0)>u.end(0)||u.start(0)>e.end(0)?this.seekable_=u:this.seekable_=I.createTimeRanges([[e.start(0)>u.start(0)?e.start(0):u.start(0),e.end(0)0&&(o=Math.max(o,s.end(s.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},r.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(i){var s=e.mediaTypes_[i].groups;for(var o in s)s[o].forEach(function(u){u.playlistLoader&&u.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!s)},r.getCodecsOrExclude_=function(){var e=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},s=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();i.video=i.main;var o=ki(this.master(),s),u={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(u.video=o.video||i.main.videoCodec||eg),i.main.isMuxed&&(u.video+=","+(o.audio||i.main.audioCodec||Wu)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||l)&&(u.audio=o.audio||i.main.audioCodec||i.audio.audioCodec||Wu,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),!u.audio&&!u.video){this.blacklistCurrentPlaylist({playlist:s,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(w,O){return w?In(O):Ka(O)},g={},m;if(["video","audio"].forEach(function(x){if(u.hasOwnProperty(x)&&!c(i[x].isFmp4,u[x])){var w=i[x].isFmp4?"browser":"muxer";g[w]=g[w]||[],g[w].push(u[x]),x==="audio"&&(m=w)}}),l&&m&&s.attributes.AUDIO){var _=s.attributes.AUDIO;this.master().playlists.forEach(function(x){var w=x.attributes&&x.attributes.AUDIO;w===_&&x!==s&&(x.excludeUntil=1/0)}),this.logger_("excluding audio group "+_+" as "+m+' does not support codec(s): "'+u.audio+'"')}if(Object.keys(g).length){var b=Object.keys(g).reduce(function(x,w){return x&&(x+=", "),x+=w+' does not support codec(s): "'+g[w].join(",")+'"',x},"")+".";this.blacklistCurrentPlaylist({playlist:s,internal:!0,message:b,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var S=[];if(["video","audio"].forEach(function(x){var w=(vt(e.sourceUpdater_.codecs[x]||"")[0]||{}).type,O=(vt(u[x]||"")[0]||{}).type;w&&O&&w.toLowerCase()!==O.toLowerCase()&&S.push('"'+e.sourceUpdater_.codecs[x]+'" -> "'+u[x]+'"')}),S.length){this.blacklistCurrentPlaylist({playlist:s,message:"Codec switching not supported: "+S.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return u},r.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&!!this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(!!e){this.sourceUpdater_.createSourceBuffers(e);var i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}}},r.excludeUnsupportedVariants_=function(){var e=this,i=this.master().playlists,s=[];Object.keys(i).forEach(function(o){var u=i[o];if(s.indexOf(u.id)===-1){s.push(u.id);var l=ki(e.master,u),c=[];l.audio&&!Ka(l.audio)&&!In(l.audio)&&c.push("audio codec "+l.audio),l.video&&!Ka(l.video)&&!In(l.video)&&c.push("video codec "+l.video),l.text&&l.text==="stpp.ttml.im1t"&&c.push("text codec "+l.text),c.length&&(u.excludeUntil=1/0,e.logger_("excluding "+u.id+" for unsupported: "+c.join(", ")))}})},r.excludeIncompatibleVariants_=function(e){var i=this,s=[],o=this.master().playlists,u=ia(vt(e)),l=Ql(u),c=u.video&&vt(u.video)[0]||null,g=u.audio&&vt(u.audio)[0]||null;Object.keys(o).forEach(function(m){var _=o[m];if(!(s.indexOf(_.id)!==-1||_.excludeUntil===1/0)){s.push(_.id);var b=[],S=ki(i.masterPlaylistLoader_.master,_),x=Ql(S);if(!(!S.audio&&!S.video)){if(x!==l&&b.push('codec count "'+x+'" !== "'+l+'"'),!i.sourceUpdater_.canChangeType()){var w=S.video&&vt(S.video)[0]||null,O=S.audio&&vt(S.audio)[0]||null;w&&c&&w.type.toLowerCase()!==c.type.toLowerCase()&&b.push('video codec "'+w.type+'" !== "'+c.type+'"'),O&&g&&O.type.toLowerCase()!==g.type.toLowerCase()&&b.push('audio codec "'+O.type+'" !== "'+g.type+'"')}b.length&&(_.excludeUntil=1/0,i.logger_("blacklisting "+_.id+": "+b.join(" && ")))}}})},r.updateAdCues_=function(e){var i=0,s=this.seekable();s.length&&(i=s.start(0)),dT(e,this.cueTagsTrack_,i)},r.goalBufferLength=function(){var e=this.tech_.currentTime(),i=we.GOAL_BUFFER_LENGTH,s=we.GOAL_BUFFER_LENGTH_RATE,o=Math.max(i,we.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*s,o)},r.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),i=we.BUFFER_LOW_WATER_LINE,s=we.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(i,we.MAX_BUFFER_LOW_WATER_LINE),u=Math.max(i,we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*s,this.experimentalBufferBasedABR?u:o)},r.bufferHighWaterLine=function(){return we.BUFFER_HIGH_WATER_LINE},t}(I.EventTarget),OT=function(t,r,n){return function(e){var i=t.master.playlists[r],s=Wo(i),o=Da(i);return typeof e>"u"?o:(e?delete i.disabled:i.disabled=!0,e!==o&&!s&&(n(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},LT=function(t,r,n){var e=t.masterPlaylistController_,i=t.options_.smoothQualityChange,s=i?"smooth":"fast",o=e[s+"QualityChange_"].bind(e);if(r.attributes){var u=r.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=r.attributes.BANDWIDTH,this.frameRate=r.attributes["FRAME-RATE"]}this.codecs=ki(e.master(),r),this.playlist=r,this.id=n,this.enabled=OT(t.playlists,r.id,o)},FT=function(t){t.representations=function(){var r=t.masterPlaylistController_.master(),n=Yi(r)?t.masterPlaylistController_.getAudioTrackPlaylists_():r.playlists;return n?n.filter(function(e){return!Wo(e)}).map(function(e,i){return new LT(t,e,e.id)}):[]}},ld=["seeking","seeked","pause","playing","error"],RT=function(){function a(r){var n=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_=pt("PlaybackWatcher"),this.logger_("initialize");var e=function(){return n.monitorCurrentTime_()},i=function(){return n.monitorCurrentTime_()},s=function(){return n.techWaiting_()},o=function(){return n.cancelTimer_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach(function(m){c[m]={reset:function(){return n.resetSegmentDownloads_(m)},updateend:function(){return n.checkSegmentDownloads_(m)}},u[m+"SegmentLoader_"].on("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].on("playlistupdate",c[m].reset),n.tech_.on(["seeked","seeking"],c[m].reset)});var g=function(_){["main","audio"].forEach(function(b){u[b+"SegmentLoader_"][_]("appended",n.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){n.fixesBadSeeks_()&&(n.consecutiveUpdates=0,n.lastRecordedTime=n.tech_.currentTime(),g("off"))},this.clearSeekingAppendCheck_=function(){return g("off")},this.watchForBadSeeking_=function(){n.clearSeekingAppendCheck_(),g("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(ld,o),this.tech_.on("canplay",i),this.tech_.one("play",e),this.dispose=function(){n.clearSeekingAppendCheck_(),n.logger_("dispose"),n.tech_.off("waiting",s),n.tech_.off(ld,o),n.tech_.off("canplay",i),n.tech_.off("play",e),n.tech_.off("seeking",n.watchForBadSeeking_),n.tech_.off("seeked",n.clearSeekingAppendCheck_),l.forEach(function(m){u[m+"SegmentLoader_"].off("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].off("playlistupdate",c[m].reset),n.tech_.off(["seeked","seeking"],c[m].reset)}),n.checkCurrentTimeTimeout_&&A.clearTimeout(n.checkCurrentTimeTimeout_),n.cancelTimer_()}}var t=a.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=A.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(n){var e=this.masterPlaylistController_[n+"SegmentLoader_"];this[n+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+n+" loader"),this[n+"StalledDownloads_"]=0,this[n+"Buffered_"]=e.buffered_()},t.checkSegmentDownloads_=function(n){var e=this.masterPlaylistController_,i=e[n+"SegmentLoader_"],s=i.buffered_(),o=Ay(this[n+"Buffered_"],s);if(this[n+"Buffered_"]=s,o){this.resetSegmentDownloads_(n);return}this[n+"StalledDownloads_"]++,this.logger_("found #"+this[n+"StalledDownloads_"]+" "+n+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:ur(s)}),!(this[n+"StalledDownloads_"]<10)&&(this.logger_(n+" loader stalled download exclusion"),this.resetSegmentDownloads_(n),this.tech_.trigger({type:"usage",name:"vhs-"+n+"-download-exclusion"}),n!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+n+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var n=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===n&&(!e.length||n+Tt>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&n===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):n===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=n)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var n=this.tech_.seeking();if(!n)return!1;var e=this.seekable(),i=this.tech_.currentTime(),s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(s){var u=e.end(e.length-1);o=u}if(this.beforeSeekableWindow_(e,i)){var l=e.start(0);o=l+(l===e.end(0)?0:Tt)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+i+" with "+("seekable range "+bf(e)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,g=this.tech_.buffered(),m=c.audioBuffer?c.audioBuffered():null,_=c.videoBuffer?c.videoBuffered():null,b=this.media(),S=b.partTargetDuration?b.partTargetDuration:(b.targetDuration-Yt)*2,x=[m,_],w=0;w "+i.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var n=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(n,e)){var i=n.end(n.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to "+("live point (seekable end) "+i)),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var s=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:e});if(u)return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var l=wn(o,e);if(l.length>0){var c=l.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+c+", seeking "+("to "+l.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,e),!0}return!1},t.afterSeekableWindow_=function(n,e,i,s){if(s===void 0&&(s=!1),!n.length)return!1;var o=n.end(n.length-1)+Tt,u=!i.endList;return u&&s&&(o=n.end(n.length-1)+i.targetDuration*3),e>o},t.beforeSeekableWindow_=function(n,e){return!!(n.length&&n.start(0)>0&&e2)return{start:o,end:u}}return null},a}(),MT={errorInterval:30,getSource:function(t){var r=this.tech({IWillNotUseThisInPlugins:!0}),n=r.currentSource_||this.currentSource();return t(n)}},NT=function a(t,r){var n=0,e=0,i=I.mergeOptions(MT,r);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){e&&t.currentTime(e)},o=function(m){m!=null&&(e=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(m),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n=m&&c>=m?c=Math.max(c,_):c=_}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),g;this.throughput>0?g=1/this.throughput:g=0;var m=Math.floor(1/(c+g));return m},set:function(){I.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 s.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return s.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return s.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return s.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return s.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return s.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return s.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return s.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return s.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return s.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return s.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ur(s.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return s.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return s.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return s.tech_.name_},enumerable:!0},duration:{get:function(){return s.tech_.duration()},enumerable:!0},master:{get:function(){return s.playlists.master},enumerable:!0},playerDimensions:{get:function(){return s.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ur(s.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return s.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){s.options_.useBandwidthFromLocalStorage&&KT({bandwidth:s.bandwidth,throughput:Math.round(s.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){FT(s)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){s.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_=A.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),zT({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(s){e.logger_("error while creating EME key session",s),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,s=$T({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var u=e.masterPlaylistController_.master();if(!(!u||!u.playlists)){var l=[];if(u.playlists.forEach(function(g){g&&g.attributes&&g.attributes.RESOLUTION&&g.attributes.RESOLUTION.height>=720&&(!g.excludeUntil||g.excludeUntil<1/0)&&(g.excludeUntil=1/0,l.push(g))}),l.length){var c;(c=I.log).warn.apply(c,['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(l)),e.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),I.browser.IE_VERSION===11||!s){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},r.setupQualityLevels_=function(){var e=this,i=I.players[this.tech_.options_.playerId];!i||!i.qualityLevels||this.qualityLevels_||(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){jT(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){oh(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":ah,"mux.js":UT,"mpd-parser":VT,"m3u8-parser":HT,"aes-decrypter":qT}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return nh.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.URL.revokeObjectURL&&(A.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),a.prototype.dispose.call(this)},r.convertToProgramTime=function(e,i){return n_({playlist:this.masterPlaylistController_.media(),time:e,callback:i})},r.seekToProgramTime=function(e,i,s,o){return s===void 0&&(s=!0),o===void 0&&(o=2),a_({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})},t}(YT),Ui={name:"videojs-http-streaming",VERSION:ah,canHandleSource:function(t,r){r===void 0&&(r={});var n=I.mergeOptions(I.options,r);return Ui.canPlayType(t.type,n)},handleSource:function(t,r,n){n===void 0&&(n={});var e=I.mergeOptions(I.options,n);return r.vhs=new Qo(t,r,e),I.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return I.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),r.vhs},configurable:!0}),r.vhs.xhr=Mf(),r.vhs.src(t.src,t.type),r.vhs},canPlayType:function(t,r){var n=Td(t);if(!n)return"";var e=Ui.getOverrideNative(r),i=Fe.supportsTypeNatively(n),s=!i||e;return s?"maybe":""},getOverrideNative:function(t){t===void 0&&(t={});var r=t,n=r.vhs,e=n===void 0?{}:n,i=r.hls,s=i===void 0?{}:i,o=!(I.browser.IS_ANY_SAFARI||I.browser.IS_IOS),u=e.overrideNative,l=u===void 0?o:u,c=s.overrideNative,g=c===void 0?!1:c;return g||l}},QT=function(){return In("avc1.4d400d,mp4a.40.2")};QT()&&I.getTech("Html5").registerSourceHandler(Ui,0);I.VhsHandler=Qo;Object.defineProperty(I,"HlsHandler",{get:function(){return I.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0});I.VhsSourceHandler=Ui;Object.defineProperty(I,"HlsSourceHandler",{get:function(){return I.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ui},configurable:!0});I.Vhs=Fe;Object.defineProperty(I,"Hls",{get:function(){return I.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Fe},configurable:!0});I.use||(I.registerComponent("Hls",Fe),I.registerComponent("Vhs",Fe));I.options.vhs=I.options.vhs||{};I.options.hls=I.options.hls||{};if(!I.getPlugin||!I.getPlugin("reloadSourceOnError")){var JT=I.registerPlugin||I.plugin;JT("reloadSourceOnError",BT)}const ZT={class:"videoPlay"},eb=["src"],tb=Hp({__name:"video",props:{videoSrc:{type:String,required:!0},autoPlay:{type:Boolean,required:!1,default:!1}},setup(a){const t=a,r=qp();let n;const e=async()=>{await Kp();const i={muted:!0,controls:!0,autoplay:!0,loop:!0,language:"zh-CN",techOrder:["html5"]};n=I(r.value,i,()=>{I.log("\u64AD\u653E\u5668\u5DF2\u7ECF\u51C6\u5907\u597D\u4E86!"),t.autoPlay&&t.videoSrc&&n.play(),n.on("ended",()=>{I.log("\u64AD\u653E\u7ED3\u675F\u4E86!")}),n.on("error",()=>{I.log("\u64AD\u653E\u5668\u89E3\u6790\u51FA\u9519!")})})};return jp(()=>{e()}),Gp(()=>t.videoSrc,()=>{n.pause(),n.src(t.videoSrc),n.load(),t.videoSrc&&n.play()}),Wp(()=>{n==null||n.dispose()}),(i,s)=>(zp(),$p("div",ZT,[Mu("video",{ref_key:"m3u8_video",ref:r,class:"video-js vjs-default-skin vjs-big-play-centered",controls:""},[Mu("source",{src:a.videoSrc},null,8,eb)],512)]))}});const ib=Xp(tb,[["__scopeId","data-v-7d285012"],["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/components/video/video.vue"]]);export{ib as V};