liveBroadcast-m3u8.593165c9.js 594 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import{aj as wn,aq as Qp,u as Jp,r as lt,ad as Zp,_ as em,P as tm,L as im,g as ki,ac as rm,Y as Vu,o as di,h as vr,i as Ot,w as Yt,m as yt,z as ju,B as Wu,j as qu,q as nm,t as Gu,Z as am,V as sm,W as om,X as um}from"./vendor.0bc3c1d4.js";import{a as lm,b as dm,c as cm}from"./index.14ca5e32.js";import{_ as fm}from"./index.fceaba64.js";var _r;typeof window!="undefined"?_r=window:typeof wn!="undefined"?_r=wn:typeof self!="undefined"?_r=self:_r={};var w=_r,hm={},pm=Object.freeze(Object.defineProperty({__proto__:null,default:hm},Symbol.toStringTag,{value:"Module"})),mm=Qp(pm),zu=typeof wn!="undefined"?wn:typeof window!="undefined"?window:{},gm=mm,yr;typeof document!="undefined"?yr=document:(yr=zu["__GLOBAL_DOCUMENT_CACHE@4"],yr||(yr=zu["__GLOBAL_DOCUMENT_CACHE@4"]=gm));var G=yr;function dt(){return dt=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=i[n])}return a},dt.apply(this,arguments)}var Ya={exports:{}};(function(a,t){function i(u){if(u&&typeof u=="object"){var l=u.which||u.keyCode||u.charCode;l&&(u=l)}if(typeof u=="number")return s[u];var c=String(u),g=n[c.toLowerCase()];if(g)return g;var g=e[c.toLowerCase()];if(g)return g;if(c.length===1)return c.charCodeAt(0)}i.isEventKey=function(l,c){if(l&&typeof l=="object"){var g=l.which||l.keyCode||l.charCode;if(g==null)return!1;if(typeof c=="string"){var p=n[c.toLowerCase()];if(p)return p===g;var p=e[c.toLowerCase()];if(p)return p===g}else if(typeof c=="number")return c===g;return!1}},t=a.exports=i;var n=t.code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},e=t.aliases={windows:91,"\u21E7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
  2. * Programatically add the following
  3. */for(r=97;r<123;r++)n[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)n[r-48]=r;for(r=1;r<13;r++)n["f"+r]=r+111;for(r=0;r<10;r++)n["numpad "+r]=r+96;var s=t.names=t.title={};for(r in n)s[n[r]]=r;for(var o in e)n[o]=e[o]})(Ya,Ya.exports);var re=Ya.exports;function ie(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Tr(a,t){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Tr(a,t)}function $(a,t){a.prototype=Object.create(t.prototype),a.prototype.constructor=a,Tr(a,t)}var vm=_m;function _m(a,t){var i,n=null;try{i=JSON.parse(a,t)}catch(e){n=e}return[n,i]}var Qa={exports:{}},$u={exports:{}};(function(a){function t(){return a.exports=t=Object.assign?Object.assign.bind():function(i){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r])}return i},a.exports.__esModule=!0,a.exports.default=a.exports,t.apply(this,arguments)}a.exports=t,a.exports.__esModule=!0,a.exports.default=a.exports})($u);var ym=bm,Tm=Object.prototype.toString;function bm(a){if(!a)return!1;var t=Tm.call(a);return t==="[object Function]"||typeof a=="function"&&t!=="[object RegExp]"||typeof window!="undefined"&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}var xm=w,Sm=function(t,i){return i===void 0&&(i=!1),function(n,e,r){if(n){t(n);return}if(e.statusCode>=400&&e.statusCode<=599){var s=r;if(i)if(xm.TextDecoder){var o=Em(e.headers&&e.headers["content-type"]);try{s=new TextDecoder(o).decode(r)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(r));t({cause:s});return}t(null,r)}};function Em(a){return a===void 0&&(a=""),a.toLowerCase().split(";").reduce(function(t,i){var n=i.split("="),e=n[0],r=n[1];return e.trim()==="charset"?r.trim():t},"utf-8")}var Cm=Sm,Ku=w,wm=$u.exports,Pm=ym;Tt.httpHandler=Cm;/**
  4. * @license
  5. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  6. * Copyright (c) 2014 David Björklund
  7. * Available under the MIT license
  8. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  9. */var km=function(t){var i={};return t&&t.trim().split(`
  10. `).forEach(function(n){var e=n.indexOf(":"),r=n.slice(0,e).trim().toLowerCase(),s=n.slice(e+1).trim();typeof i[r]=="undefined"?i[r]=s:Array.isArray(i[r])?i[r].push(s):i[r]=[i[r],s]}),i};Qa.exports=Tt;Qa.exports.default=Tt;Tt.XMLHttpRequest=Ku.XMLHttpRequest||Om;Tt.XDomainRequest="withCredentials"in new Tt.XMLHttpRequest?Tt.XMLHttpRequest:Ku.XDomainRequest;Am(["get","put","post","patch","head","delete"],function(a){Tt[a==="delete"?"del":a]=function(t,i,n){return i=Xu(t,i,n),i.method=a.toUpperCase(),Yu(i)}});function Am(a,t){for(var i=0;i<a.length;i++)t(a[i])}function Im(a){for(var t in a)if(a.hasOwnProperty(t))return!1;return!0}function Xu(a,t,i){var n=a;return Pm(t)?(i=t,typeof a=="string"&&(n={uri:a})):n=wm({},t,{uri:a}),n.callback=i,n}function Tt(a,t,i){return t=Xu(a,t,i),Yu(t)}function Yu(a){if(typeof a.callback=="undefined")throw new Error("callback argument missing");var t=!1,i=function(H,L,M){t||(t=!0,a.callback(H,L,M))};function n(){o.readyState===4&&setTimeout(s,0)}function e(){var O=void 0;if(o.response?O=o.response:O=o.responseText||Dm(o),S)try{O=JSON.parse(O)}catch{}return O}function r(O){return clearTimeout(x),O instanceof Error||(O=new Error(""+(O||"Unknown XMLHttpRequest Error"))),O.statusCode=0,i(O,A)}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=A,L=null;return O!==0?(H={body:e(),statusCode:O,method:g,headers:{},url:c,rawRequest:o},o.getAllResponseHeaders&&(H.headers=km(o.getAllResponseHeaders()))):L=new Error("Internal XMLHttpRequest Error"),i(L,H,H.body)}}var o=a.xhr||null;o||(a.cors||a.useXDR?o=new Tt.XDomainRequest:o=new Tt.XMLHttpRequest);var u,l,c=o.url=a.uri||a.url,g=o.method=a.method||"GET",p=a.body||a.data,y=o.headers=a.headers||{},b=!!a.sync,S=!1,x,A={body:void 0,headers:{},statusCode:0,method:g,url:c,rawRequest:o};if("json"in a&&a.json!==!1&&(S=!0,y.accept||y.Accept||(y.Accept="application/json"),g!=="GET"&&g!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),p=JSON.stringify(a.json===!0?p:a.json))),o.onreadystatechange=n,o.onload=s,o.onerror=r,o.onprogress=function(){},o.onabort=function(){l=!0},o.ontimeout=r,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",r(O)}},a.timeout)),o.setRequestHeader)for(u in y)y.hasOwnProperty(u)&&o.setRequestHeader(u,y[u]);else if(a.headers&&!Im(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(p||null),o}function Dm(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 Om(){}var Qu=Qa.exports,Ju={exports:{}},Zu=G,Ja=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 it(a,t){this.name="ParsingError",this.code=a.code,this.message=t||a.message}it.prototype=Ja(Error.prototype);it.prototype.constructor=it;it.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Za(a){function t(n,e,r,s){return(n|0)*3600+(e|0)*60+(r|0)+(s|0)/1e3}var i=a.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function br(){this.values=Ja(null)}br.prototype={set:function(a,t){!this.get(a)&&t!==""&&(this.values[a]=t)},get:function(a,t,i){return i?this.has(a)?this.values[a]:t[i]:this.has(a)?this.values[a]:t},has:function(a){return a in this.values},alt:function(a,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(a,t);break}},integer:function(a,t){/^-?\d+$/.test(t)&&this.set(a,parseInt(t,10))},percent:function(a,t){return t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100)?(this.set(a,t),!0):!1}};function xr(a,t,i,n){var e=n?a.split(n):[a];for(var r in e)if(typeof e[r]=="string"){var s=e[r].split(i);if(s.length===2){var o=s[0].trim(),u=s[1].trim();t(o,u)}}}function Lm(a,t,i){var n=a;function e(){var o=Za(a);if(o===null)throw new it(it.Errors.BadTimeStamp,"Malformed timestamp: "+n);return a=a.replace(/^[^\sa-zA-Z-]+/,""),o}function r(o,u){var l=new br;xr(o,function(c,g){switch(c){case"region":for(var p=i.length-1;p>=0;p--)if(i[p].id===g){l.set(c,i[p].region);break}break;case"vertical":l.alt(c,g,["rl","lr"]);break;case"line":var y=g.split(","),b=y[0];l.integer(c,b),l.percent(c,b)&&l.set("snapToLines",!1),l.alt(c,b,["auto"]),y.length===2&&l.alt("lineAlign",y[1],["start","center","end"]);break;case"position":y=g.split(","),l.percent(c,y[0]),y.length===2&&l.alt("positionAlign",y[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 it(it.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n);a=a.substr(3),s(),t.endTime=e(),s(),r(a,t)}var es=Zu.createElement&&Zu.createElement("textarea"),Mm={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},el={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)"},Rm={v:"title",lang:"lang"},tl={rt:"ruby"};function il(a,t){function i(){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 es.innerHTML=b,b=es.textContent,es.textContent="",b}function e(b,S){return!tl[S.localName]||tl[S.localName]===b.localName}function r(b,S){var x=Mm[b];if(!x)return null;var A=a.document.createElement(x),O=Rm[b];return O&&S&&(A[O]=S.trim()),A}for(var s=a.document.createElement("div"),o=s,u,l=[];(u=i())!==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=Za(u.substr(1,u.length-2)),g;if(c){g=a.document.createProcessingInstruction("timestamp",c),o.appendChild(g);continue}var p=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p||(g=r(p[1],p[3]),!g)||!e(o,g))continue;if(p[2]){var y=p[2].split(".");y.forEach(function(b){var S=/^bg_/.test(b),x=S?b.slice(3):b;if(el.hasOwnProperty(x)){var A=S?"background-color":"color",O=el[x];g.style[A]=O}}),g.className=y.join(" ")}l.push(p[1]),o.appendChild(g),o=g;continue}o.appendChild(a.document.createTextNode(n(u)))}return s}var rl=[[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 Nm(a){for(var t=0;t<rl.length;t++){var i=rl[t];if(a>=i[0]&&a<=i[1])return!0}return!1}function Fm(a){var t=[],i="",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 r(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 r(o);if(u.childNodes)return e(o,u),r(o)}for(e(t,a);i=r(t);)for(var s=0;s<i.length;s++)if(n=i.charCodeAt(s),Nm(n))return"rtl";return"ltr"}function Um(a){if(typeof a.line=="number"&&(a.snapToLines||a.line>=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var t=a.track,i=t.textTrackList,n=0,e=0;e<i.length&&i[e]!==t;e++)i[e].mode==="showing"&&n++;return++n*-1}function Pn(){}Pn.prototype.applyStyles=function(a,t){t=t||this.div;for(var i in a)a.hasOwnProperty(i)&&(t.style[i]=a[i])};Pn.prototype.formatStyle=function(a,t){return a===0?0:a+t};function kn(a,t,i){Pn.call(this),this.cue=t,this.cueDiv=il(a,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=a.document.createElement("div"),n={direction:Fm(this.cueDiv),writingMode:t.vertical===""?"horizontal-tb":t.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:t.align==="middle"?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var e=0;switch(t.positionAlign){case"start":e=t.position;break;case"center":e=t.position-t.size/2;break;case"end":e=t.position-t.size;break}t.vertical===""?this.applyStyles({left:this.formatStyle(e,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(e,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(r){this.applyStyles({top:this.formatStyle(r.top,"px"),bottom:this.formatStyle(r.bottom,"px"),left:this.formatStyle(r.left,"px"),right:this.formatStyle(r.right,"px"),height:this.formatStyle(r.height,"px"),width:this.formatStyle(r.width,"px")})}}kn.prototype=Ja(Pn.prototype);kn.prototype.constructor=kn;function We(a){var t,i,n,e;if(a.div){i=a.div.offsetHeight,n=a.div.offsetWidth,e=a.div.offsetTop;var r=(r=a.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();a=a.div.getBoundingClientRect(),t=r?Math.max(r[0]&&r[0].height||0,a.height/r.length):0}this.left=a.left,this.right=a.right,this.top=a.top||e,this.height=a.height||i,this.bottom=a.bottom||e+(a.height||i),this.width=a.width||n,this.lineHeight=t!==void 0?t:a.lineHeight}We.prototype.move=function(a,t){switch(t=t!==void 0?t:this.lineHeight,a){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}};We.prototype.overlaps=function(a){return this.left<a.right&&this.right>a.left&&this.top<a.bottom&&this.bottom>a.top};We.prototype.overlapsAny=function(a){for(var t=0;t<a.length;t++)if(this.overlaps(a[t]))return!0;return!1};We.prototype.within=function(a){return this.top>=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right};We.prototype.overlapsOppositeAxis=function(a,t){switch(t){case"+x":return this.left<a.left;case"-x":return this.right>a.right;case"+y":return this.top<a.top;case"-y":return this.bottom>a.bottom}};We.prototype.intersectPercentage=function(a){var t=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),i=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),n=t*i;return n/(this.height*this.width)};We.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}};We.getSimpleBoxPosition=function(a){var t=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,i=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||i};return e};function Bm(a,t,i,n){function e(x,A){for(var O,H=new We(x),L=1,M=0;M<A.length;M++){for(;x.overlapsOppositeAxis(i,A[M])||x.within(i)&&x.overlapsAny(n);)x.move(A[M]);if(x.within(i))return x;var j=x.intersectPercentage(i);L>j&&(O=new We(x),L=j),x=new We(H)}return O||H}var r=new We(t),s=t.cue,o=Um(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=r.lineHeight,g=c*Math.round(o),p=i[l]+c,y=u[0];Math.abs(g)>p&&(g=g<0?-1:1,g*=Math.ceil(p/c)*c),o<0&&(g+=s.vertical===""?i.height:i.width,u=u.reverse()),r.move(y,g)}else{var b=r.lineHeight/i.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"],r=new We(t)}var S=e(r,u);t.move(S.toCSSCompatValues(i))}function Ai(){}Ai.StringDecoder=function(){return{decode:function(a){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}};Ai.convertCueToDOMTree=function(a,t){return!a||!t?null:il(a,t)};var Hm=.05,Vm="sans-serif",jm="1.5%";Ai.processCues=function(a,t,i){if(!a||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.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=jm,i.appendChild(n);function e(c){for(var g=0;g<c.length;g++)if(c[g].hasBeenReset||!c[g].displayState)return!0;return!1}if(!e(t)){for(var r=0;r<t.length;r++)n.appendChild(t[r].displayState);return}var s=[],o=We.getSimpleBoxPosition(n),u=Math.round(o.height*Hm*100)/100,l={font:u+"px "+Vm};(function(){for(var c,g,p=0;p<t.length;p++)g=t[p],c=new kn(a,g,l),n.appendChild(c.div),Bm(a,c,o,s),g.displayState=c.div,s.push(We.getSimpleBoxPosition(c))})()};Ai.Parser=function(a,t,i){i||(i=t,t={}),t||(t={}),this.window=a,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]};Ai.Parser.prototype={reportOrThrowError:function(a){if(a instanceof it)this.onparsingerror&&this.onparsingerror(a);else throw a},parse:function(a){var t=this;a&&(t.buffer+=t.decoder.decode(a,{stream:!0}));function i(){for(var c=t.buffer,g=0;g<c.length&&c[g]!=="\r"&&c[g]!==`
  11. `;)++g;var p=c.substr(0,g);return c[g]==="\r"&&++g,c[g]===`
  12. `&&++g,t.buffer=c.substr(g),p}function n(c){var g=new br;if(xr(c,function(y,b){switch(y){case"id":g.set(y,b);break;case"width":g.percent(y,b);break;case"lines":g.integer(y,b);break;case"regionanchor":case"viewportanchor":var S=b.split(",");if(S.length!==2)break;var x=new br;if(x.percent("x",S[0]),x.percent("y",S[1]),!x.has("x")||!x.has("y"))break;g.set(y+"X",x.get("x")),g.set(y+"Y",x.get("y"));break;case"scroll":g.alt(y,b,["up"]);break}},/=/,/\s/),g.has("id")){var p=new(t.vttjs.VTTRegion||t.window.VTTRegion);p.width=g.get("width",100),p.lines=g.get("lines",3),p.regionAnchorX=g.get("regionanchorX",0),p.regionAnchorY=g.get("regionanchorY",100),p.viewportAnchorX=g.get("viewportanchorX",0),p.viewportAnchorY=g.get("viewportanchorY",100),p.scroll=g.get("scroll",""),t.onregion&&t.onregion(p),t.regionList.push({id:g.get("id"),region:p})}}function e(c){var g=new br;xr(c,function(p,y){switch(p){case"MPEGT":g.integer(p+"S",y);break;case"LOCA":g.set(p+"L",Za(y));break}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:g.get("MPEGTS"),LOCAL:g.get("LOCAL")})}function r(c){c.match(/X-TIMESTAMP-MAP/)?xr(c,function(g,p){switch(g){case"X-TIMESTAMP-MAP":e(p);break}},/=/):xr(c,function(g,p){switch(g){case"Region":n(p);break}},/:/)}try{var s;if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;s=i();var o=s.match(/^WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new it(it.Errors.BadSignature);t.state="HEADER"}for(var u=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(u?u=!1:s=i(),t.state){case"HEADER":/:/.test(s)?r(s):s||(t.state="ID");continue;case"NOTE":s||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){t.state="NOTE";break}if(!s)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch{t.cue.align="middle"}if(t.state="CUE",s.indexOf("-->")===-1){t.cue.id=s;continue}case"CUE":try{Lm(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+=`
  13. `),t.cue.text+=s.replace(/\u2028/g,`
  14. `).replace(/u2029/g,`
  15. `);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+=`
  16. `,a.parse()),a.state==="INITIAL")throw new it(it.Errors.BadSignature)}catch(t){a.reportOrThrowError(t)}return a.onflush&&a.onflush(),this}};var Wm=Ai,qm="auto",Gm={"":1,lr:1,rl:1},zm={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function $m(a){if(typeof a!="string")return!1;var t=Gm[a.toLowerCase()];return t?a.toLowerCase():!1}function ts(a){if(typeof a!="string")return!1;var t=zm[a.toLowerCase()];return t?a.toLowerCase():!1}function nl(a,t,i){this.hasBeenReset=!1;var n="",e=!1,r=a,s=t,o=i,u=null,l="",c=!0,g="auto",p="start",y="auto",b="auto",S=100,x="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(A){n=""+A}},pauseOnExit:{enumerable:!0,get:function(){return e},set:function(A){e=!!A}},startTime:{enumerable:!0,get:function(){return r},set:function(A){if(typeof A!="number")throw new TypeError("Start time must be set to a number.");r=A,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(A){if(typeof A!="number")throw new TypeError("End time must be set to a number.");s=A,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(A){o=""+A,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(A){u=A,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(A){var O=$m(A);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(A){c=!!A,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return g},set:function(A){if(typeof A!="number"&&A!==qm)throw new SyntaxError("Line: an invalid number or illegal string was specified.");g=A,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return p},set:function(A){var O=ts(A);O?(p=O,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return y},set:function(A){if(A<0||A>100)throw new Error("Position must be between 0 and 100.");y=A,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(A){var O=ts(A);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(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");S=A,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return x},set:function(A){var O=ts(A);if(!O)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");x=O,this.hasBeenReset=!0}}}),this.displayState=void 0}nl.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Km=nl,Xm={"":!0,up:!0};function Ym(a){if(typeof a!="string")return!1;var t=Xm[a.toLowerCase()];return t?a.toLowerCase():!1}function Sr(a){return typeof a=="number"&&a>=0&&a<=100}function Qm(){var a=100,t=3,i=0,n=100,e=0,r=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(o){if(!Sr(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(!Sr(o))throw new Error("RegionAnchorX must be between 0 and 100.");n=o}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(o){if(!Sr(o))throw new Error("RegionAnchorY must be between 0 and 100.");i=o}},viewportAnchorY:{enumerable:!0,get:function(){return r},set:function(o){if(!Sr(o))throw new Error("ViewportAnchorY must be between 0 and 100.");r=o}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(o){if(!Sr(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=Ym(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})}var Jm=Qm,Lt=w,ci=Ju.exports={WebVTT:Wm,VTTCue:Km,VTTRegion:Jm};Lt.vttjs=ci;Lt.WebVTT=ci.WebVTT;var Zm=ci.VTTCue,eg=ci.VTTRegion,tg=Lt.VTTCue,ig=Lt.VTTRegion;ci.shim=function(){Lt.VTTCue=Zm,Lt.VTTRegion=eg};ci.restore=function(){Lt.VTTCue=tg,Lt.VTTRegion=ig};Lt.VTTCue||ci.shim();var al=Ju.exports;function rg(){if(typeof Reflect=="undefined"||!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 An(a,t,i){return rg()?An=Reflect.construct.bind():An=function(e,r,s){var o=[null];o.push.apply(o,r);var u=Function.bind.apply(e,o),l=new u;return s&&Tr(l,s.prototype),l},An.apply(null,arguments)}function ng(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&&Tr(a,t)}var sl={exports:{}};(function(a,t){(function(i){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,e=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/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 p=o.parseURL(l);if(!p)throw new Error("Error trying to parse relative URL.");if(p.scheme)return c.alwaysNormalize?(p.path=o.normalizePath(p.path),o.buildURLFromParts(p)):l;var y=o.parseURL(u);if(!y)throw new Error("Error trying to parse base URL.");if(!y.netLoc&&y.path&&y.path[0]!=="/"){var b=e.exec(y.path);y.netLoc=b[1],y.path=b[2]}y.netLoc&&!y.path&&(y.path="/");var S={scheme:y.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(S.netLoc=y.netLoc,p.path[0]!=="/"))if(!p.path)S.path=y.path,p.params||(S.params=y.params,p.query||(S.query=y.query));else{var x=y.path,A=x.substring(0,x.lastIndexOf("/")+1)+p.path;S.path=o.normalizePath(A)}return S.path===null&&(S.path=c.alwaysNormalize?o.normalizePath(p.path):p.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(r,"");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})()})(sl);var ol=sl.exports,ul="http://example.com",In=function(t,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(t)&&(t=w.location&&w.location.href||"");var n=typeof w.URL=="function",e=/^\/\//.test(t),r=!w.location&&!/\/\//i.test(t);if(n?t=new w.URL(t,w.location||ul):/\/\//i.test(t)||(t=ol.buildAbsoluteURL(w.location&&w.location.href||"",t)),n){var s=new URL(i,t);return r?s.href.slice(ul.length):e?s.href.slice(s.protocol.length):s.href}return ol.buildAbsoluteURL(t,i)},is=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 r=this.listeners[n].indexOf(e);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(r,1),r>-1},t.trigger=function(n){var e=this.listeners[n];if(!!e)if(arguments.length===2)for(var r=e.length,s=0;s<r;++s)e[s].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),u=e.length,l=0;l<u;++l)e[l].apply(this,o)},t.dispose=function(){this.listeners={}},t.pipe=function(n){this.on("data",function(e){n.push(e)})},a}(),ag=function(t){return w.atob?w.atob(t):Buffer.from(t,"base64").toString("binary")};function ll(a){for(var t=ag(a),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}/*! @name m3u8-parser @version 4.7.1 @license Apache-2.0 */var sg=function(a){$(t,a);function t(){var n;return n=a.call(this)||this,n.buffer="",n}var i=t.prototype;return i.push=function(e){var r;for(this.buffer+=e,r=this.buffer.indexOf(`
  17. `);r>-1;r=this.buffer.indexOf(`
  18. `))this.trigger("data",this.buffer.substring(0,r)),this.buffer=this.buffer.substring(r+1)},t}(is),og=String.fromCharCode(9),rs=function(t){var i=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),n={};return i[1]&&(n.length=parseInt(i[1],10)),i[2]&&(n.offset=parseInt(i[2],10)),n},ug=function(){var t="[^=]*",i='"[^"]*"|[^,]*',n="(?:"+t+")=(?:"+i+")";return new RegExp("(?:^|,)("+n+")")},ct=function(t){for(var i=t.split(ug()),n={},e=i.length,r;e--;)i[e]!==""&&(r=/([^=]*)=(.*)/.exec(i[e]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),n[r[0]]=r[1]);return n},lg=function(a){$(t,a);function t(){var n;return n=a.call(this)||this,n.customParsers=[],n.tagMappers=[],n}var i=t.prototype;return i.push=function(e){var r=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;c<r.customParsers.length;c++)if(r.customParsers[c].call(r,l))return;if(l.indexOf("#EXT")!==0){r.trigger("data",{type:"comment",text:l.slice(1)});return}if(l=l.replace("\r",""),s=/^#EXTM3U/.exec(l),s){r.trigger("data",{type:"tag",tagType:"m3u"});return}if(s=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(l),s){o={type:"tag",tagType:"inf"},s[1]&&(o.duration=parseFloat(s[1])),s[2]&&(o.title=s[2]),r.trigger("data",o);return}if(s=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"targetduration"},s[1]&&(o.duration=parseInt(s[1],10)),r.trigger("data",o);return}if(s=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"version"},s[1]&&(o.version=parseInt(s[1],10)),r.trigger("data",o);return}if(s=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"media-sequence"},s[1]&&(o.number=parseInt(s[1],10)),r.trigger("data",o);return}if(s=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"discontinuity-sequence"},s[1]&&(o.number=parseInt(s[1],10)),r.trigger("data",o);return}if(s=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"playlist-type"},s[1]&&(o.playlistType=s[1]),r.trigger("data",o);return}if(s=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(l),s){o=dt(rs(s[1]),{type:"tag",tagType:"byterange"}),r.trigger("data",o);return}if(s=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(l),s){o={type:"tag",tagType:"allow-cache"},s[1]&&(o.allowed=!/NO/.test(s[1])),r.trigger("data",o);return}if(s=/^#EXT-X-MAP:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"map"},s[1]){var g=ct(s[1]);g.URI&&(o.uri=g.URI),g.BYTERANGE&&(o.byterange=rs(g.BYTERANGE))}r.trigger("data",o);return}if(s=/^#EXT-X-STREAM-INF:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"stream-inf"},s[1]){if(o.attributes=ct(s[1]),o.attributes.RESOLUTION){var p=o.attributes.RESOLUTION.split("x"),y={};p[0]&&(y.width=parseInt(p[0],10)),p[1]&&(y.height=parseInt(p[1],10)),o.attributes.RESOLUTION=y}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}r.trigger("data",o);return}if(s=/^#EXT-X-MEDIA:?(.*)$/.exec(l),s){o={type:"tag",tagType:"media"},s[1]&&(o.attributes=ct(s[1])),r.trigger("data",o);return}if(s=/^#EXT-X-ENDLIST/.exec(l),s){r.trigger("data",{type:"tag",tagType:"endlist"});return}if(s=/^#EXT-X-DISCONTINUITY/.exec(l),s){r.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(s=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(l),s){o={type:"tag",tagType:"program-date-time"},s[1]&&(o.dateTimeString=s[1],o.dateTimeObject=new Date(s[1])),r.trigger("data",o);return}if(s=/^#EXT-X-KEY:?(.*)$/.exec(l),s){o={type:"tag",tagType:"key"},s[1]&&(o.attributes=ct(s[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),r.trigger("data",o);return}if(s=/^#EXT-X-START:?(.*)$/.exec(l),s){o={type:"tag",tagType:"start"},s[1]&&(o.attributes=ct(s[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),r.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out-cont"},s[1]?o.data=s[1]:o.data="",r.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out"},s[1]?o.data=s[1]:o.data="",r.trigger("data",o);return}if(s=/^#EXT-X-CUE-IN:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-in"},s[1]?o.data=s[1]:o.data="",r.trigger("data",o);return}if(s=/^#EXT-X-SKIP:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"skip"},o.attributes=ct(s[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(og)),r.trigger("data",o);return}if(s=/^#EXT-X-PART:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part"},o.attributes=ct(s[1]),["DURATION"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["INDEPENDENT","GAP"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=rs(o.attributes.BYTERANGE)),r.trigger("data",o);return}if(s=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"server-control"},o.attributes=ct(s[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),r.trigger("data",o);return}if(s=/^#EXT-X-PART-INF:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part-inf"},o.attributes=ct(s[1]),["PART-TARGET"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),r.trigger("data",o);return}if(s=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=ct(s[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(b){if(o.attributes.hasOwnProperty(b)){o.attributes[b]=parseInt(o.attributes[b],10);var S=b==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[S]=o.attributes[b],delete o.attributes[b]}}),r.trigger("data",o);return}if(s=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=ct(s[1]),["LAST-MSN","LAST-PART"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseInt(o.attributes[b],10))}),r.trigger("data",o);return}r.trigger("data",{type:"tag",data:l.slice(4)})})}},i.addParser=function(e){var r=this,s=e.expression,o=e.customType,u=e.dataParser,l=e.segment;typeof u!="function"&&(u=function(g){return g}),this.customParsers.push(function(c){var g=s.exec(c);if(g)return r.trigger("data",{type:"custom",data:u(c),customType:o,segment:l}),!0})},i.addTagMapper=function(e){var r=e.expression,s=e.map,o=function(l){return r.test(l)?s(l):l};this.tagMappers.push(o)},t}(is),dg=function(t){return t.toLowerCase().replace(/-(\w)/g,function(i){return i[1].toUpperCase()})},Ii=function(t){var i={};return Object.keys(t).forEach(function(n){i[dg(n)]=t[n]}),i},ns=function(t){var i=t.serverControl,n=t.targetDuration,e=t.partTargetDuration;if(!!i){var r="#EXT-X-SERVER-CONTROL",s="holdBack",o="partHoldBack",u=n&&n*3,l=e&&e*2;n&&!i.hasOwnProperty(s)&&(i[s]=u,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+u+")."})),u&&i[s]<u&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+i[s]+") to targetDuration * 3 ("+u+")"}),i[s]=u),e&&!i.hasOwnProperty(o)&&(i[o]=e*3,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+i[o]+")."})),e&&i[o]<l&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+i[o]+") to partTargetDuration * 2 ("+l+")."}),i[o]=l)}},cg=function(a){$(t,a);function t(){var n;n=a.call(this)||this,n.lineStream=new sg,n.parseStream=new lg,n.lineStream.pipe(n.parseStream);var e=ie(n),r=[],s={},o,u,l=!1,c=function(){},g={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},p="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",y=0;n.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var b=0,S=0;return n.on("end",function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&o&&(s.map=o),!s.key&&u&&(s.key=u),!s.timeline&&typeof y=="number"&&(s.timeline=y),n.manifest.preloadSegment=s)}),n.parseStream.on("data",function(x){var A,O;({tag:function(){({version:function(){x.version&&(this.manifest.version=x.version)},"allow-cache":function(){this.manifest.allowCache=x.allowed,"allowed"in x||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var M={};"length"in x&&(s.byterange=M,M.length=x.length,"offset"in x||(x.offset=b)),"offset"in x&&(s.byterange=M,M.offset=x.offset),b=M.offset+M.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),x.duration>0&&(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=r},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===p){var M=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(M.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:ll(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!="undefined"&&(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,y=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=r,this.manifest.mediaGroups=this.manifest.mediaGroups||g,!x.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),dt(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 M=this.manifest.mediaGroups[x.attributes.TYPE];M[x.attributes["GROUP-ID"]]=M[x.attributes["GROUP-ID"]]||{},A=M[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)),A[x.attributes.NAME]=O},discontinuity:function(){y+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){typeof this.manifest.dateTimeString=="undefined"&&(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,ns.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=Ii(x.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",x.attributes,["SKIPPED-SEGMENTS"])},part:function(){var M=this;l=!0;var j=this.manifest.segments.length,U=Ii(x.attributes);s.parts=s.parts||[],s.parts.push(U),U.byterange&&(U.byterange.hasOwnProperty("offset")||(U.byterange.offset=S),S=U.byterange.offset+U.byterange.length);var F=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+F+" for segment #"+j,x.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(W,R){W.hasOwnProperty("lastPart")||M.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+R+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var M=this.manifest.serverControl=Ii(x.attributes);M.hasOwnProperty("canBlockReload")||(M.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ns.call(this,this.manifest),M.canSkipDateranges&&!M.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var M=this.manifest.segments.length,j=Ii(x.attributes),U=j.type&&j.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=U?S:0,U&&(S=j.byterange.offset+j.byterange.length)));var F=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+F+" for segment #"+M,x.attributes,["TYPE","URI"]),!!j.type)for(var W=0;W<s.preloadHints.length-1;W++){var R=s.preloadHints[W];!R.type||R.type===j.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+F+" for segment #"+M+" has the same TYPE "+j.type+" as preload hint #"+W})}},"rendition-report":function(){var M=Ii(x.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(M);var j=this.manifest.renditionReports.length-1,U=["LAST-MSN","URI"];l&&U.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+j,x.attributes,U)},"part-inf":function(){this.manifest.partInf=Ii(x.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",x.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ns.call(this,this.manifest)}}[x.tagType]||c).call(e)},uri:function(){s.uri=x.uri,r.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),u&&(s.key=u),s.timeline=y,o&&(s.map=o),S=0,s={}},comment:function(){},custom:function(){x.segment?(s.custom=s.custom||{},s.custom[x.customType]=x.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[x.customType]=x.data)}})[x.type].call(e)}),n}var i=t.prototype;return i.warnOnMissingAttributes_=function(e,r,s){var o=[];s.forEach(function(u){r.hasOwnProperty(u)||o.push(u)}),o.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+o.join(", ")})},i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push(`
  19. `),this.trigger("end")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(is),fi={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},fg=["video","audio","text"],dl=["Video","Audio","Text"],cl=function(t){return t&&t.replace(/avc1\.(\d+)\.(\d+)/i,function(i,n,e){var r=("00"+Number(n).toString(16)).slice(-2),s=("00"+Number(e).toString(16)).slice(-2);return"avc1."+r+"00"+s})},bt=function(t){t===void 0&&(t="");var i=t.split(","),n=[];return i.forEach(function(e){e=e.trim();var r;fg.forEach(function(s){var o=fi[s].exec(e.toLowerCase());if(!(!o||o.length<=1)){r=s;var u=e.substring(0,o[1].length),l=e.replace(u,"");n.push({type:u,details:l,mediaType:s})}}),r||n.push({type:e,details:"",mediaType:"unknown"})}),n},hg=function(t,i){if(!t.mediaGroups.AUDIO||!i)return null;var n=t.mediaGroups.AUDIO[i];if(!n)return null;for(var e in n){var r=n[e];if(r.default&&r.playlists)return bt(r.playlists[0].attributes.CODECS)}return null},fl=function(t){return t===void 0&&(t=""),fi.audio.test(t.trim().toLowerCase())},pg=function(t){return t===void 0&&(t=""),fi.text.test(t.trim().toLowerCase())},Er=function(t){if(!(!t||typeof t!="string")){var i=t.toLowerCase().split(",").map(function(r){return cl(r.trim())}),n="video";i.length===1&&fl(i[0])?n="audio":i.length===1&&pg(i[0])&&(n="application");var e="mp4";return i.every(function(r){return fi.mp4.test(r)})?e="mp4":i.every(function(r){return fi.webm.test(r)})?e="webm":i.every(function(r){return fi.ogg.test(r)})&&(e="ogg"),n+"/"+e+';codecs="'+t+'"'}},Dn=function(t){return t===void 0&&(t=""),w.MediaSource&&w.MediaSource.isTypeSupported&&w.MediaSource.isTypeSupported(Er(t))||!1},as=function(t){return t===void 0&&(t=""),t.toLowerCase().split(",").every(function(i){i=i.trim();for(var n=0;n<dl.length;n++){var e=dl[n];if(fi["muxer"+e].test(i))return!0}return!1})},hl="mp4a.40.2",mg="avc1.4d400d",gg=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,vg=/^application\/dash\+xml/i,pl=function(t){return gg.test(t)?"hls":vg.test(t)?"dash":t==="application/vnd.videojs.vhs+json"?"vhs-json":null},_g=function(t){return t.toString(2).length},yg=function(t){return Math.ceil(_g(t)/8)},ml=function(t){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},Tg=function(t){return ml(t)},J=function(t){return t instanceof Uint8Array?t:(!Array.isArray(t)&&!Tg(t)&&!(t instanceof ArrayBuffer)&&(typeof t!="number"||typeof t=="number"&&t!==t?t=0:t=[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},Me=w.BigInt||Number,ss=[Me("0x1"),Me("0x100"),Me("0x10000"),Me("0x1000000"),Me("0x100000000"),Me("0x10000000000"),Me("0x1000000000000"),Me("0x100000000000000"),Me("0x10000000000000000")];(function(){var a=new Uint16Array([65484]),t=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);return t[0]===255?"big":t[0]===204?"little":"unknown"})();var bg=function(t,i){var n=i===void 0?{}:i,e=n.signed,r=e===void 0?!1:e,s=n.le,o=s===void 0?!1:s;t=J(t);var u=o?"reduce":"reduceRight",l=t[u]?t[u]:Array.prototype[u],c=l.call(t,function(p,y,b){var S=o?b:Math.abs(b+1-t.length);return p+Me(y)*ss[S]},Me(0));if(r){var g=ss[t.length]/Me(2)-Me(1);c=Me(c),c>g&&(c-=g,c-=g,c-=Me(2))}return Number(c)},xg=function(t,i){var n=i===void 0?{}:i,e=n.le,r=e===void 0?!1:e;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!==t)&&(t=0),t=Me(t);for(var s=yg(t),o=new Uint8Array(new ArrayBuffer(s)),u=0;u<s;u++){var l=r?u:Math.abs(u+1-o.length);o[l]=Number(t/ss[u]&Me(255)),t<0&&(o[l]=Math.abs(~o[l]),o[l]-=u===0?1:2)}return o},gl=function(t,i){if(typeof t!="string"&&t&&typeof t.toString=="function"&&(t=t.toString()),typeof t!="string")return new Uint8Array;i||(t=unescape(encodeURIComponent(t)));for(var n=new Uint8Array(t.length),e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},Sg=function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];if(i=i.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),i.length<=1)return J(i[0]);var e=i.reduce(function(o,u,l){return o+(u.byteLength||u.length)},0),r=new Uint8Array(e),s=0;return i.forEach(function(o){o=J(o),r.set(o,s),s+=o.byteLength}),r},ye=function(t,i,n){var e=n===void 0?{}:n,r=e.offset,s=r===void 0?0:r,o=e.mask,u=o===void 0?[]:o;t=J(t),i=J(i);var l=i.every?i.every:Array.prototype.every;return i.length&&t.length-s>=i.length&&l.call(i,function(c,g){var p=u[g]?u[g]&t[s+g]:t[s+g];return c===p})},Eg=function(t,i,n){i.forEach(function(e){for(var r in t.mediaGroups[e])for(var s in t.mediaGroups[e][r]){var o=t.mediaGroups[e][r][s];n(o,e,r,s)}})},Qt={},Jt={};function Cg(a,t,i){if(i===void 0&&(i=Array.prototype),a&&typeof i.find=="function")return i.find.call(a,t);for(var n=0;n<a.length;n++)if(Object.prototype.hasOwnProperty.call(a,n)){var e=a[n];if(t.call(void 0,e,n,a))return e}}function os(a,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(a):a}var vl=os({HTML:"text/html",isHTML:function(a){return a===vl.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),_l=os({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(a){return a===_l.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Jt.find=Cg;Jt.freeze=os;Jt.MIME_TYPE=vl;Jt.NAMESPACE=_l;var yl=Jt,xt=yl.find,Cr=yl.NAMESPACE;function wg(a){return a!==""}function Pg(a){return a?a.split(/[\t\n\f\r ]+/).filter(wg):[]}function kg(a,t){return a.hasOwnProperty(t)||(a[t]=!0),a}function Tl(a){if(!a)return[];var t=Pg(a);return Object.keys(t.reduce(kg,{}))}function Ag(a){return function(t){return a&&a.indexOf(t)!==-1}}function wr(a,t){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}function Ye(a,t){var i=a.prototype;if(!(i instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,wr(i,n),a.prototype=i=n}i.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),i.constructor=a)}var Qe={},ft=Qe.ELEMENT_NODE=1,Di=Qe.ATTRIBUTE_NODE=2,On=Qe.TEXT_NODE=3,bl=Qe.CDATA_SECTION_NODE=4,xl=Qe.ENTITY_REFERENCE_NODE=5,Ig=Qe.ENTITY_NODE=6,Sl=Qe.PROCESSING_INSTRUCTION_NODE=7,El=Qe.COMMENT_NODE=8,Cl=Qe.DOCUMENT_NODE=9,wl=Qe.DOCUMENT_TYPE_NODE=10,Mt=Qe.DOCUMENT_FRAGMENT_NODE=11,Dg=Qe.NOTATION_NODE=12,Fe={},Ae={};Fe.INDEX_SIZE_ERR=(Ae[1]="Index size error",1);Fe.DOMSTRING_SIZE_ERR=(Ae[2]="DOMString size error",2);var Je=Fe.HIERARCHY_REQUEST_ERR=(Ae[3]="Hierarchy request error",3);Fe.WRONG_DOCUMENT_ERR=(Ae[4]="Wrong document",4);Fe.INVALID_CHARACTER_ERR=(Ae[5]="Invalid character",5);Fe.NO_DATA_ALLOWED_ERR=(Ae[6]="No data allowed",6);Fe.NO_MODIFICATION_ALLOWED_ERR=(Ae[7]="No modification allowed",7);var Pl=Fe.NOT_FOUND_ERR=(Ae[8]="Not found",8);Fe.NOT_SUPPORTED_ERR=(Ae[9]="Not supported",9);var kl=Fe.INUSE_ATTRIBUTE_ERR=(Ae[10]="Attribute in use",10);Fe.INVALID_STATE_ERR=(Ae[11]="Invalid state",11);Fe.SYNTAX_ERR=(Ae[12]="Syntax error",12);Fe.INVALID_MODIFICATION_ERR=(Ae[13]="Invalid modification",13);Fe.NAMESPACE_ERR=(Ae[14]="Invalid namespace",14);Fe.INVALID_ACCESS_ERR=(Ae[15]="Invalid access",15);function Se(a,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,Ae[a]),this.message=Ae[a],Error.captureStackTrace&&Error.captureStackTrace(this,Se);return i.code=a,t&&(this.message=this.message+": "+t),i}Se.prototype=Error.prototype;wr(Fe,Se);function Rt(){}Rt.prototype={length:0,item:function(a){return this[a]||null},toString:function(a,t){for(var i=[],n=0;n<this.length;n++)Li(this[n],i,a,t);return i.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}};function Oi(a,t){this._node=a,this._refresh=t,us(this)}function us(a){var t=a._node._inc||a._node.ownerDocument._inc;if(a._inc!=t){var i=a._refresh(a._node);Gl(a,"length",i.length),wr(i,a),a._inc=t}}Oi.prototype.item=function(a){return us(this),this[a]};Ye(Oi,Rt);function Ln(){}function Al(a,t){for(var i=a.length;i--;)if(a[i]===t)return i}function Il(a,t,i,n){if(n?t[Al(t,n)]=i:t[t.length++]=i,a){i.ownerElement=a;var e=a.ownerDocument;e&&(n&&Ml(e,a,n),Og(e,a,i))}}function Dl(a,t,i){var n=Al(t,i);if(n>=0){for(var e=t.length-1;n<e;)t[n]=t[++n];if(t.length=e,a){var r=a.ownerDocument;r&&(Ml(r,a,i),i.ownerElement=null)}}else throw new Se(Pl,new Error(a.tagName+"@"+i))}Ln.prototype={length:0,item:Rt.prototype.item,getNamedItem:function(a){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==a)return i}},setNamedItem:function(a){var t=a.ownerElement;if(t&&t!=this._ownerElement)throw new Se(kl);var i=this.getNamedItem(a.nodeName);return Il(this._ownerElement,this,a,i),i},setNamedItemNS:function(a){var t=a.ownerElement,i;if(t&&t!=this._ownerElement)throw new Se(kl);return i=this.getNamedItemNS(a.namespaceURI,a.localName),Il(this._ownerElement,this,a,i),i},removeNamedItem:function(a){var t=this.getNamedItem(a);return Dl(this._ownerElement,this,t),t},removeNamedItemNS:function(a,t){var i=this.getNamedItemNS(a,t);return Dl(this._ownerElement,this,i),i},getNamedItemNS:function(a,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==a)return n}return null}};function Ol(){}Ol.prototype={hasFeature:function(a,t){return!0},createDocument:function(a,t,i){var n=new kr;if(n.implementation=this,n.childNodes=new Rt,n.doctype=i||null,i&&n.appendChild(i),t){var e=n.createElementNS(a,t);n.appendChild(e)}return n},createDocumentType:function(a,t,i){var n=new Nn;return n.name=a,n.nodeName=a,n.publicId=t||"",n.systemId=i||"",n}};function he(){}he.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(a,t){return Mn(this,a,t)},replaceChild:function(a,t){Mn(this,a,t,Ul),t&&this.removeChild(t)},removeChild:function(a){return Rl(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return vs(this.ownerDocument||this,this,a)},normalize:function(){for(var a=this.firstChild;a;){var t=a.nextSibling;t&&t.nodeType==On&&a.nodeType==On?(this.removeChild(t),a.appendData(t.data)):(a.normalize(),a=t)}},isSupported:function(a,t){return this.ownerDocument.implementation.hasFeature(a,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(a){for(var t=this;t;){var i=t._nsMap;if(i){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===a)return n}t=t.nodeType==Di?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(a){for(var t=this;t;){var i=t._nsMap;if(i&&a in i&&Object.prototype.hasOwnProperty.call(i,a))return i[a];t=t.nodeType==Di?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(a){var t=this.lookupPrefix(a);return t==null}};function Ll(a){return a=="<"&&"&lt;"||a==">"&&"&gt;"||a=="&"&&"&amp;"||a=='"'&&"&quot;"||"&#"+a.charCodeAt()+";"}wr(Qe,he);wr(Qe,he.prototype);function Pr(a,t){if(t(a))return!0;if(a=a.firstChild)do if(Pr(a,t))return!0;while(a=a.nextSibling)}function kr(){this.ownerDocument=this}function Og(a,t,i){a&&a._inc++;var n=i.namespaceURI;n===Cr.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}function Ml(a,t,i,n){a&&a._inc++;var e=i.namespaceURI;e===Cr.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function ls(a,t,i){if(a&&a._inc){a._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var e=t.firstChild,r=0;e;)n[r++]=e,e=e.nextSibling;n.length=r,delete n[n.length]}}}function Rl(a,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:a.firstChild=n,n?n.previousSibling=i:a.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,ls(a.ownerDocument,a),t}function Lg(a){return a&&(a.nodeType===he.DOCUMENT_NODE||a.nodeType===he.DOCUMENT_FRAGMENT_NODE||a.nodeType===he.ELEMENT_NODE)}function Mg(a){return a&&(St(a)||ds(a)||Nt(a)||a.nodeType===he.DOCUMENT_FRAGMENT_NODE||a.nodeType===he.COMMENT_NODE||a.nodeType===he.PROCESSING_INSTRUCTION_NODE)}function Nt(a){return a&&a.nodeType===he.DOCUMENT_TYPE_NODE}function St(a){return a&&a.nodeType===he.ELEMENT_NODE}function ds(a){return a&&a.nodeType===he.TEXT_NODE}function Nl(a,t){var i=a.childNodes||[];if(xt(i,St)||Nt(t))return!1;var n=xt(i,Nt);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function Fl(a,t){var i=a.childNodes||[];function n(r){return St(r)&&r!==t}if(xt(i,n))return!1;var e=xt(i,Nt);return!(t&&e&&i.indexOf(e)>i.indexOf(t))}function Rg(a,t,i){if(!Lg(a))throw new Se(Je,"Unexpected parent node type "+a.nodeType);if(i&&i.parentNode!==a)throw new Se(Pl,"child not in parent");if(!Mg(t)||Nt(t)&&a.nodeType!==he.DOCUMENT_NODE)throw new Se(Je,"Unexpected node type "+t.nodeType+" for parent node type "+a.nodeType)}function Ng(a,t,i){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===he.DOCUMENT_FRAGMENT_NODE){var r=e.filter(St);if(r.length>1||xt(e,ds))throw new Se(Je,"More than one element or text in fragment");if(r.length===1&&!Nl(a,i))throw new Se(Je,"Element in fragment can not be inserted before doctype")}if(St(t)&&!Nl(a,i))throw new Se(Je,"Only one element can be added and only after doctype");if(Nt(t)){if(xt(n,Nt))throw new Se(Je,"Only one doctype is allowed");var s=xt(n,St);if(i&&n.indexOf(s)<n.indexOf(i))throw new Se(Je,"Doctype can only be inserted before an element");if(!i&&s)throw new Se(Je,"Doctype can not be appended since element is present")}}function Ul(a,t,i){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===he.DOCUMENT_FRAGMENT_NODE){var r=e.filter(St);if(r.length>1||xt(e,ds))throw new Se(Je,"More than one element or text in fragment");if(r.length===1&&!Fl(a,i))throw new Se(Je,"Element in fragment can not be inserted before doctype")}if(St(t)&&!Fl(a,i))throw new Se(Je,"Only one element can be added and only after doctype");if(Nt(t)){if(xt(n,function(u){return Nt(u)&&u!==i}))throw new Se(Je,"Only one doctype is allowed");var s=xt(n,St);if(i&&n.indexOf(s)<n.indexOf(i))throw new Se(Je,"Doctype can only be inserted before an element")}}function Mn(a,t,i,n){Rg(a,t,i),a.nodeType===he.DOCUMENT_NODE&&(n||Ng)(a,t,i);var e=t.parentNode;if(e&&e.removeChild(t),t.nodeType===Mt){var r=t.firstChild;if(r==null)return t;var s=t.lastChild}else r=s=t;var o=i?i.previousSibling:a.lastChild;r.previousSibling=o,s.nextSibling=i,o?o.nextSibling=r:a.firstChild=r,i==null?a.lastChild=s:i.previousSibling=s;do r.parentNode=a;while(r!==s&&(r=r.nextSibling));return ls(a.ownerDocument||a,a),t.nodeType==Mt&&(t.firstChild=t.lastChild=null),t}function Fg(a,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=a,t.previousSibling=a.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:a.firstChild=t,a.lastChild=t,ls(a.ownerDocument,a,t),t}kr.prototype={nodeName:"#document",nodeType:Cl,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,t){if(a.nodeType==Mt){for(var i=a.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return a}return Mn(this,a,t),a.ownerDocument=this,this.documentElement===null&&a.nodeType===ft&&(this.documentElement=a),a},removeChild:function(a){return this.documentElement==a&&(this.documentElement=null),Rl(this,a)},replaceChild:function(a,t){Mn(this,a,t,Ul),a.ownerDocument=this,t&&this.removeChild(t),St(a)&&(this.documentElement=a)},importNode:function(a,t){return ql(this,a,t)},getElementById:function(a){var t=null;return Pr(this.documentElement,function(i){if(i.nodeType==ft&&i.getAttribute("id")==a)return t=i,!0}),t},getElementsByClassName:function(a){var t=Tl(a);return new Oi(this,function(i){var n=[];return t.length>0&&Pr(i.documentElement,function(e){if(e!==i&&e.nodeType===ft){var r=e.getAttribute("class");if(r){var s=a===r;if(!s){var o=Tl(r);s=t.every(Ag(o))}s&&n.push(e)}}}),n})},createElement:function(a){var t=new hi;t.ownerDocument=this,t.nodeName=a,t.tagName=a,t.localName=a,t.childNodes=new Rt;var i=t.attributes=new Ln;return i._ownerElement=t,t},createDocumentFragment:function(){var a=new Fn;return a.ownerDocument=this,a.childNodes=new Rt,a},createTextNode:function(a){var t=new cs;return t.ownerDocument=this,t.appendData(a),t},createComment:function(a){var t=new fs;return t.ownerDocument=this,t.appendData(a),t},createCDATASection:function(a){var t=new hs;return t.ownerDocument=this,t.appendData(a),t},createProcessingInstruction:function(a,t){var i=new ms;return i.ownerDocument=this,i.tagName=i.target=a,i.nodeValue=i.data=t,i},createAttribute:function(a){var t=new Rn;return t.ownerDocument=this,t.name=a,t.nodeName=a,t.localName=a,t.specified=!0,t},createEntityReference:function(a){var t=new ps;return t.ownerDocument=this,t.nodeName=a,t},createElementNS:function(a,t){var i=new hi,n=t.split(":"),e=i.attributes=new Ln;return i.childNodes=new Rt,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=a,n.length==2?(i.prefix=n[0],i.localName=n[1]):i.localName=t,e._ownerElement=i,i},createAttributeNS:function(a,t){var i=new Rn,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=a,i.specified=!0,n.length==2?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}};Ye(kr,he);function hi(){this._nsMap={}}hi.prototype={nodeType:ft,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 i=this.ownerDocument.createAttribute(a);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(a){var t=this.getAttributeNode(a);t&&this.removeAttributeNode(t)},appendChild:function(a){return a.nodeType===Mt?this.insertBefore(a,null):Fg(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 i=this.getAttributeNodeNS(a,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(a,t){return this.getAttributeNodeNS(a,t)!=null},getAttributeNS:function(a,t){var i=this.getAttributeNodeNS(a,t);return i&&i.value||""},setAttributeNS:function(a,t,i){var n=this.ownerDocument.createAttributeNS(a,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(a,t){return this.attributes.getNamedItemNS(a,t)},getElementsByTagName:function(a){return new Oi(this,function(t){var i=[];return Pr(t,function(n){n!==t&&n.nodeType==ft&&(a==="*"||n.tagName==a)&&i.push(n)}),i})},getElementsByTagNameNS:function(a,t){return new Oi(this,function(i){var n=[];return Pr(i,function(e){e!==i&&e.nodeType===ft&&(a==="*"||e.namespaceURI===a)&&(t==="*"||e.localName==t)&&n.push(e)}),n})}};kr.prototype.getElementsByTagName=hi.prototype.getElementsByTagName;kr.prototype.getElementsByTagNameNS=hi.prototype.getElementsByTagNameNS;Ye(hi,he);function Rn(){}Rn.prototype.nodeType=Di;Ye(Rn,he);function Ar(){}Ar.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(Ae[Je])},deleteData:function(a,t){this.replaceData(a,t,"")},replaceData:function(a,t,i){var n=this.data.substring(0,a),e=this.data.substring(a+t);i=n+i+e,this.nodeValue=this.data=i,this.length=i.length}};Ye(Ar,he);function cs(){}cs.prototype={nodeName:"#text",nodeType:On,splitText:function(a){var t=this.data,i=t.substring(a);t=t.substring(0,a),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};Ye(cs,Ar);function fs(){}fs.prototype={nodeName:"#comment",nodeType:El};Ye(fs,Ar);function hs(){}hs.prototype={nodeName:"#cdata-section",nodeType:bl};Ye(hs,Ar);function Nn(){}Nn.prototype.nodeType=wl;Ye(Nn,he);function Bl(){}Bl.prototype.nodeType=Dg;Ye(Bl,he);function Hl(){}Hl.prototype.nodeType=Ig;Ye(Hl,he);function ps(){}ps.prototype.nodeType=xl;Ye(ps,he);function Fn(){}Fn.prototype.nodeName="#document-fragment";Fn.prototype.nodeType=Mt;Ye(Fn,he);function ms(){}ms.prototype.nodeType=Sl;Ye(ms,he);function Vl(){}Vl.prototype.serializeToString=function(a,t,i){return jl.call(a,t,i)};he.prototype.toString=jl;function jl(a,t){var i=[],n=this.nodeType==9&&this.documentElement||this,e=n.prefix,r=n.namespaceURI;if(r&&e==null){var e=n.lookupPrefix(r);if(e==null)var s=[{namespace:r,prefix:null}]}return Li(this,i,a,t,s),i.join("")}function Wl(a,t,i){var n=a.prefix||"",e=a.namespaceURI;if(!e||n==="xml"&&e===Cr.XML||e===Cr.XMLNS)return!1;for(var r=i.length;r--;){var s=i[r];if(s.prefix===n)return s.namespace!==e}return!0}function gs(a,t,i){a.push(" ",t,'="',i.replace(/[<&"]/g,Ll),'"')}function Li(a,t,i,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 ft:var r=a.attributes,s=r.length,o=a.firstChild,u=a.tagName;i=Cr.isHTML(a.namespaceURI)||i;var l=u;if(!i&&!a.prefix&&a.namespaceURI){for(var c,g=0;g<r.length;g++)if(r.item(g).name==="xmlns"){c=r.item(g).value;break}if(!c)for(var p=e.length-1;p>=0;p--){var y=e[p];if(y.prefix===""&&y.namespace===a.namespaceURI){c=y.namespace;break}}if(c!==a.namespaceURI)for(var p=e.length-1;p>=0;p--){var y=e[p];if(y.namespace===a.namespaceURI){y.prefix&&(l=y.prefix+":"+u);break}}}t.push("<",l);for(var b=0;b<s;b++){var S=r.item(b);S.prefix=="xmlns"?e.push({prefix:S.localName,namespace:S.value}):S.nodeName=="xmlns"&&e.push({prefix:"",namespace:S.value})}for(var b=0;b<s;b++){var S=r.item(b);if(Wl(S,i,e)){var x=S.prefix||"",A=S.namespaceURI;gs(t,x?"xmlns:"+x:"xmlns",A),e.push({prefix:x,namespace:A})}Li(S,t,i,n,e)}if(u===l&&Wl(a,i,e)){var x=a.prefix||"",A=a.namespaceURI;gs(t,x?"xmlns:"+x:"xmlns",A),e.push({prefix:x,namespace:A})}if(o||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),i&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):Li(o,t,i,n,e.slice()),o=o.nextSibling;else for(;o;)Li(o,t,i,n,e.slice()),o=o.nextSibling;t.push("</",l,">")}else t.push("/>");return;case Cl:case Mt:for(var o=a.firstChild;o;)Li(o,t,i,n,e.slice()),o=o.nextSibling;return;case Di:return gs(t,a.name,a.value);case On:return t.push(a.data.replace(/[<&]/g,Ll).replace(/]]>/g,"]]&gt;"));case bl:return t.push("<![CDATA[",a.data,"]]>");case El:return t.push("<!--",a.data,"-->");case wl:var O=a.publicId,H=a.systemId;if(t.push("<!DOCTYPE ",a.name),O)t.push(" PUBLIC ",O),H&&H!="."&&t.push(" ",H),t.push(">");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var L=a.internalSubset;L&&t.push(" [",L,"]"),t.push(">")}return;case Sl:return t.push("<?",a.target," ",a.data,"?>");case xl:return t.push("&",a.nodeName,";");default:t.push("??",a.nodeName)}}function ql(a,t,i){var n;switch(t.nodeType){case ft:n=t.cloneNode(!1),n.ownerDocument=a;case Mt:break;case Di:i=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=a,n.parentNode=null,i)for(var e=t.firstChild;e;)n.appendChild(ql(a,e,i)),e=e.nextSibling;return n}function vs(a,t,i){var n=new t.constructor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];typeof r!="object"&&r!=n[e]&&(n[e]=r)}switch(t.childNodes&&(n.childNodes=new Rt),n.ownerDocument=a,n.nodeType){case ft:var s=t.attributes,o=n.attributes=new Ln,u=s.length;o._ownerElement=n;for(var l=0;l<u;l++)n.setAttributeNode(vs(a,s.item(l),!0));break;case Di:i=!0}if(i)for(var c=t.firstChild;c;)n.appendChild(vs(a,c,i)),c=c.nextSibling;return n}function Gl(a,t,i){a[t]=i}try{if(Object.defineProperty){let a=function(t){switch(t.nodeType){case ft:case Mt:var i=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&i.push(a(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}};Object.defineProperty(Oi.prototype,"length",{get:function(){return us(this),this.$$length}}),Object.defineProperty(he.prototype,"textContent",{get:function(){return a(this)},set:function(t){switch(this.nodeType){case ft:case Mt:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Gl=function(t,i,n){t["$$"+i]=n}}}catch{}Qt.DocumentType=Nn;Qt.DOMException=Se;Qt.DOMImplementation=Ol;Qt.Element=hi;Qt.Node=he;Qt.NodeList=Rt;Qt.XMLSerializer=Vl;var Ir={},zl={};(function(a){var t=Jt.freeze;a.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),a.HTML_ENTITIES=t({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",divide:"\xF7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",euro:"\u20AC",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),a.entityMap=a.HTML_ENTITIES})(zl);var _s={},Dr=Jt.NAMESPACE,ys=/[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]/,$l=new RegExp("[\\-\\.0-9"+ys.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Kl=new RegExp("^"+ys.source+$l.source+"*(?::"+ys.source+$l.source+"*)?$"),Or=0,Zt=1,Mi=2,Lr=3,Ri=4,Ni=5,Mr=6,Un=7;function Fi(a,t){this.message=a,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Fi)}Fi.prototype=new Error;Fi.prototype.name=Fi.name;function Xl(){}Xl.prototype={parse:function(a,t,i){var n=this.domBuilder;n.startDocument(),Jl(t,t={}),Ug(a,t,i,n,this.errorHandler),n.endDocument()}};function Ug(a,t,i,n,e){function r(ee){if(ee>65535){ee-=65536;var se=55296+(ee>>10),de=56320+(ee&1023);return String.fromCharCode(se,de)}else return String.fromCharCode(ee)}function s(ee){var se=ee.slice(1,-1);return se in i?i[se]:se.charAt(0)==="#"?r(parseInt(se.substr(1).replace("x","0x"))):(e.error("entity not found:"+ee),ee)}function o(ee){if(ee>S){var se=a.substring(S,ee).replace(/&#?\w+;/g,s);p&&u(S),n.characters(se,0,ee-S),S=ee}}function u(ee,se){for(;ee>=c&&(se=g.exec(a));)l=se.index,c=l+se[0].length,p.lineNumber++;p.columnNumber=ee-l+1}for(var l=0,c=0,g=/.*(?:\r\n?|\n)|.*$/g,p=n.locator,y=[{currentNSMap:t}],b={},S=0;;){try{var x=a.indexOf("<",S);if(x<0){if(!a.substr(S).match(/^\s*$/)){var A=n.doc,O=A.createTextNode(a.substr(S));A.appendChild(O),n.currentElement=O}return}switch(x>S&&o(x),a.charAt(x+1)){case"/":var H=a.indexOf(">",x+3),L=a.substring(x+2,H).replace(/[ \t\n\r]+$/g,""),M=y.pop();H<0?(L=a.substring(x+2).replace(/[\s<].*/,""),e.error("end tag name: "+L+" is not complete:"+M.tagName),H=x+1+L.length):L.match(/\s</)&&(L=L.replace(/[\s<].*/,""),e.error("end tag name: "+L+" maybe not complete"),H=x+1+L.length);var j=M.localNSMap,U=M.tagName==L,F=U||M.tagName&&M.tagName.toLowerCase()==L.toLowerCase();if(F){if(n.endElement(M.uri,M.localName,L),j)for(var W in j)Object.prototype.hasOwnProperty.call(j,W)&&n.endPrefixMapping(W);U||e.fatalError("end tag name: "+L+" is not match the current start tagName:"+M.tagName)}else y.push(M);H++;break;case"?":p&&u(x),H=Wg(a,x,n);break;case"!":p&&u(x),H=jg(a,x,n,e);break;default:p&&u(x);var R=new Zl,Q=y[y.length-1].currentNSMap,H=Bg(a,x,R,Q,s,e),B=R.length;if(!R.closed&&Vg(a,H,R.tagName,b)&&(R.closed=!0,i.nbsp||e.warning("unclosed xml attribute")),p&&B){for(var K=Yl(p,{}),te=0;te<B;te++){var ae=R[te];u(ae.offset),ae.locator=Yl(p,{})}n.locator=K,Ql(R,n,Q)&&y.push(R),n.locator=p}else Ql(R,n,Q)&&y.push(R);Dr.isHTML(R.uri)&&!R.closed?H=Hg(a,H,R.tagName,s,n):H++}}catch(ee){if(ee instanceof Fi)throw ee;e.error("element parse error: "+ee),H=-1}H>S?S=H:o(Math.max(x,S)+1)}}function Yl(a,t){return t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber,t}function Bg(a,t,i,n,e,r){function s(p,y,b){i.attributeNames.hasOwnProperty(p)&&r.fatalError("Attribute "+p+" redefined"),i.addValue(p,y,b)}for(var o,u,l=++t,c=Or;;){var g=a.charAt(l);switch(g){case"=":if(c===Zt)o=a.slice(t,l),c=Lr;else if(c===Mi)c=Lr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===Lr||c===Zt)if(c===Zt&&(r.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).replace(/&#?\w+;/g,e),s(o,u,t-1),c=Ni;else throw new Error("attribute value no end '"+g+"' match");else if(c==Ri)u=a.slice(t,l).replace(/&#?\w+;/g,e),s(o,u,t),r.warning('attribute "'+o+'" missed start quot('+g+")!!"),t=l+1,c=Ni;else throw new Error('attribute value must after "="');break;case"/":switch(c){case Or:i.setTagName(a.slice(t,l));case Ni:case Mr:case Un:c=Un,i.closed=!0;case Ri:case Zt:case Mi:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),c==Or&&i.setTagName(a.slice(t,l)),l;case">":switch(c){case Or:i.setTagName(a.slice(t,l));case Ni:case Mr:case Un:break;case Ri:case Zt:u=a.slice(t,l),u.slice(-1)==="/"&&(i.closed=!0,u=u.slice(0,-1));case Mi:c===Mi&&(u=o),c==Ri?(r.warning('attribute "'+u+'" missed quot(")!'),s(o,u.replace(/&#?\w+;/g,e),t)):((!Dr.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&r.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case Lr:throw new Error("attribute value missed!!")}return l;case"\x80":g=" ";default:if(g<=" ")switch(c){case Or:i.setTagName(a.slice(t,l)),c=Mr;break;case Zt:o=a.slice(t,l),c=Mi;break;case Ri:var u=a.slice(t,l).replace(/&#?\w+;/g,e);r.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case Ni:c=Mr;break}else switch(c){case Mi:i.tagName,(!Dr.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=Zt;break;case Ni:r.warning('attribute space is required"'+o+'"!!');case Mr:c=Zt,t=l;break;case Lr:c=Ri,t=l;break;case Un:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function Ql(a,t,i){for(var n=a.tagName,e=null,r=a.length;r--;){var s=a[r],o=s.qName,u=s.value,p=o.indexOf(":");if(p>0)var l=s.prefix=o.slice(0,p),c=o.slice(p+1),g=l==="xmlns"&&c;else c=o,l=null,g=o==="xmlns"&&"";s.localName=c,g!==!1&&(e==null&&(e={},Jl(i,i={})),i[g]=e[g]=u,s.uri=Dr.XMLNS,t.startPrefixMapping(g,u))}for(var r=a.length;r--;){s=a[r];var l=s.prefix;l&&(l==="xml"&&(s.uri=Dr.XML),l!=="xmlns"&&(s.uri=i[l||""]))}var p=n.indexOf(":");p>0?(l=a.prefix=n.slice(0,p),c=a.localName=n.slice(p+1)):(l=null,c=a.localName=n);var y=a.uri=i[l||""];if(t.startElement(y,c,n,a),a.closed){if(t.endElement(y,c,n),e)for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.endPrefixMapping(l)}else return a.currentNSMap=i,a.localNSMap=e,!0}function Hg(a,t,i,n,e){if(/^(?:script|textarea)$/i.test(i)){var r=a.indexOf("</"+i+">",t),s=a.substring(t+1,r);if(/[&<]/.test(s))return/^script$/i.test(i)?(e.characters(s,0,s.length),r):(s=s.replace(/&#?\w+;/g,n),e.characters(s,0,s.length),r)}return t+1}function Vg(a,t,i,n){var e=n[i];return e==null&&(e=a.lastIndexOf("</"+i+">"),e<t&&(e=a.lastIndexOf("</"+i)),n[i]=e),e<t}function Jl(a,t){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}function jg(a,t,i,n){var e=a.charAt(t+2);switch(e){case"-":if(a.charAt(t+3)==="-"){var r=a.indexOf("-->",t+4);return r>t?(i.comment(a,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(a.substr(t+3,6)=="CDATA["){var r=a.indexOf("]]>",t+9);return i.startCDATA(),i.characters(a,t+9,r-t-9),i.endCDATA(),r+3}var s=qg(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 i.startDTD(u,l,c),i.endDTD(),g.index+g[0].length}}return-1}function Wg(a,t,i){var n=a.indexOf("?>",t);if(n){var e=a.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return e?(e[0].length,i.processingInstruction(e[1],e[2]),n+2):-1}return-1}function Zl(){this.attributeNames={}}Zl.prototype={setTagName:function(a){if(!Kl.test(a))throw new Error("invalid tagName:"+a);this.tagName=a},addValue:function(a,t,i){if(!Kl.test(a))throw new Error("invalid attribute:"+a);this.attributeNames[a]=this.length,this[this.length++]={qName:a,value:t,offset:i}},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 qg(a,t){var i,n=[],e=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(e.lastIndex=t,e.exec(a);i=e.exec(a);)if(n.push(i),i[1])return n}_s.XMLReader=Xl;_s.ParseError=Fi;var Gg=Jt,Ts=Qt,ed=zl,td=_s,zg=Ts.DOMImplementation,id=Gg.NAMESPACE,$g=td.ParseError,Kg=td.XMLReader;function rd(a){this.options=a||{locator:{}}}rd.prototype.parseFromString=function(a,t){var i=this.options,n=new Kg,e=i.domBuilder||new Rr,r=i.errorHandler,s=i.locator,o=i.xmlns||{},u=/\/x?html?$/.test(t),l=u?ed.HTML_ENTITIES:ed.XML_ENTITIES;return s&&e.setDocumentLocator(s),n.errorHandler=Xg(r,e,s),n.domBuilder=i.domBuilder||e,u&&(o[""]=id.HTML),o.xml=o.xml||id.XML,a&&typeof a=="string"?n.parse(a,o,l):n.errorHandler.error("invalid doc source"),e.doc};function Xg(a,t,i){if(!a){if(t instanceof Rr)return t;a=t}var n={},e=a instanceof Function;i=i||{};function r(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+bs(i))}||function(){}}return r("warning"),r("error"),r("fatalError"),n}function Rr(){this.cdata=!1}function Ui(a,t){t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber}Rr.prototype={startDocument:function(){this.doc=new zg().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(a,t,i,n){var e=this.doc,r=e.createElementNS(a,i||t),s=n.length;Bn(this,r),this.currentElement=r,this.locator&&Ui(this.locator,r);for(var o=0;o<s;o++){var a=n.getURI(o),u=n.getValue(o),i=n.getQName(o),l=e.createAttributeNS(a,i);this.locator&&Ui(n.getLocator(o),l),l.value=l.nodeValue=u,r.setAttributeNode(l)}},endElement:function(a,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(a,t){},endPrefixMapping:function(a){},processingInstruction:function(a,t){var i=this.doc.createProcessingInstruction(a,t);this.locator&&Ui(this.locator,i),Bn(this,i)},ignorableWhitespace:function(a,t,i){},characters:function(a,t,i){if(a=nd.apply(this,arguments),a){if(this.cdata)var n=this.doc.createCDATASection(a);else var n=this.doc.createTextNode(a);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(a)&&this.doc.appendChild(n),this.locator&&Ui(this.locator,n)}},skippedEntity:function(a){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(a){(this.locator=a)&&(a.lineNumber=0)},comment:function(a,t,i){a=nd.apply(this,arguments);var n=this.doc.createComment(a);this.locator&&Ui(this.locator,n),Bn(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(a,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var e=n.createDocumentType(a,t,i);this.locator&&Ui(this.locator,e),Bn(this,e),this.doc.doctype=e}},warning:function(a){console.warn("[xmldom warning] "+a,bs(this.locator))},error:function(a){console.error("[xmldom error] "+a,bs(this.locator))},fatalError:function(a){throw new $g(a,this.locator)}};function bs(a){if(a)return`
  20. @`+(a.systemId||"")+"#[line:"+a.lineNumber+",col:"+a.columnNumber+"]"}function nd(a,t,i){return typeof a=="string"?a.substr(t,i):a.length>=t+i||t?new java.lang.String(a,t,i)+"":a}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(a){Rr.prototype[a]=function(){return null}});function Bn(a,t){a.currentElement?a.currentElement.appendChild(t):a.doc.appendChild(t)}Ir.__DOMHandler=Rr;Ir.DOMParser=rd;Ir.DOMImplementation=Ts.DOMImplementation;Ir.XMLSerializer=Ts.XMLSerializer;var Yg=Ir.DOMParser;/*! @name mpd-parser @version 0.21.1 @license Apache-2.0 */var ad=function(t){return!!t&&typeof t=="object"},qe=function a(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce(function(e,r){return typeof r!="object"||Object.keys(r).forEach(function(s){Array.isArray(e[s])&&Array.isArray(r[s])?e[s]=e[s].concat(r[s]):ad(e[s])&&ad(r[s])?e[s]=a(e[s],r[s]):e[s]=r[s]}),e},{})},sd=function(t){return Object.keys(t).map(function(i){return t[i]})},Qg=function(t,i){for(var n=[],e=t;e<i;e++)n.push(e);return n},Hn=function(t){return t.reduce(function(i,n){return i.concat(n)},[])},od=function(t){if(!t.length)return[];for(var i=[],n=0;n<t.length;n++)i.push(t[n]);return i},Jg=function(t,i){return t.reduce(function(n,e,r){return e[i]&&n.push(r),n},[])},xs=function(t,i){for(var n=0;n<t.length;n++)if(i(t[n]))return n;return-1},Zg=function(t,i){return sd(t.reduce(function(n,e){return e.forEach(function(r){n[i(r)]=r}),n},{}))},Bi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Nr=function(t){var i=t.baseUrl,n=i===void 0?"":i,e=t.source,r=e===void 0?"":e,s=t.range,o=s===void 0?"":s,u=t.indexRange,l=u===void 0?"":u,c={uri:r,resolvedUri:In(n||"",r)};if(o||l){var g=o||l,p=g.split("-"),y=w.BigInt?w.BigInt(p[0]):parseInt(p[0],10),b=w.BigInt?w.BigInt(p[1]):parseInt(p[1],10);y<Number.MAX_SAFE_INTEGER&&typeof y=="bigint"&&(y=Number(y)),b<Number.MAX_SAFE_INTEGER&&typeof b=="bigint"&&(b=Number(b));var S;typeof b=="bigint"||typeof y=="bigint"?S=w.BigInt(b)-w.BigInt(y)+w.BigInt(1):S=b-y+1,typeof S=="bigint"&&S<Number.MAX_SAFE_INTEGER&&(S=Number(S)),c.byterange={length:S,offset:y}}return c},ev=function(t){var i;return typeof t.offset=="bigint"||typeof t.length=="bigint"?i=w.BigInt(t.offset)+w.BigInt(t.length)-w.BigInt(1):i=t.offset+t.length-1,t.offset+"-"+i},ud=function(t){return t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t},tv={static:function(t){var i=t.duration,n=t.timescale,e=n===void 0?1:n,r=t.sourceDuration,s=t.periodDuration,o=ud(t.endNumber),u=i/e;return typeof o=="number"?{start:0,end:o}:typeof s=="number"?{start:0,end:s/u}:{start:0,end:r/u}},dynamic:function(t){var i=t.NOW,n=t.clientOffset,e=t.availabilityStartTime,r=t.timescale,s=r===void 0?1:r,o=t.duration,u=t.periodStart,l=u===void 0?0:u,c=t.minimumUpdatePeriod,g=c===void 0?0:c,p=t.timeShiftBufferDepth,y=p===void 0?1/0:p,b=ud(t.endNumber),S=(i+n)/1e3,x=e+l,A=S+g,O=A-x,H=Math.ceil(O*s/o),L=Math.floor((S-x-y)*s/o),M=Math.floor((S-x)*s/o);return{start:Math.max(0,L),end:typeof b=="number"?b:Math.min(H,M)}}},iv=function(t){return function(i){var n=t.duration,e=t.timescale,r=e===void 0?1:e,s=t.periodStart,o=t.startNumber,u=o===void 0?1:o;return{number:u+i,duration:n/r,timeline:s,time:i*n}}},Ss=function(t){var i=t.type,n=t.duration,e=t.timescale,r=e===void 0?1:e,s=t.periodDuration,o=t.sourceDuration,u=tv[i](t),l=u.start,c=u.end,g=Qg(l,c).map(iv(t));if(i==="static"){var p=g.length-1,y=typeof s=="number"?s:o;g[p].duration=y-n/r*p}return g},ld=function(t){var i=t.baseUrl,n=t.initialization,e=n===void 0?{}:n,r=t.sourceDuration,s=t.indexRange,o=s===void 0?"":s,u=t.periodStart,l=t.presentationTime,c=t.number,g=c===void 0?0:c,p=t.duration;if(!i)throw new Error(Bi.NO_BASE_URL);var y=Nr({baseUrl:i,source:e.sourceURL,range:e.range}),b=Nr({baseUrl:i,source:i,indexRange:o});if(b.map=y,p){var S=Ss(t);S.length&&(b.duration=S[0].duration,b.timeline=S[0].timeline)}else r&&(b.duration=r,b.timeline=u);return b.presentationTime=l||u,b.number=g,[b]},Es=function(t,i,n){var e=t.sidx.map?t.sidx.map:null,r=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,u=o.offset+o.length,l=i.timescale,c=i.references.filter(function(W){return W.referenceType!==1}),g=[],p=t.endList?"static":"dynamic",y=t.sidx.timeline,b=y,S=t.mediaSequence||0,x;typeof i.firstOffset=="bigint"?x=w.BigInt(u)+i.firstOffset:x=u+i.firstOffset;for(var A=0;A<c.length;A++){var O=i.references[A],H=O.referencedSize,L=O.subsegmentDuration,M=void 0;typeof x=="bigint"?M=x+w.BigInt(H)-w.BigInt(1):M=x+H-1;var j=x+"-"+M,U={baseUrl:n,timescale:l,timeline:s,periodStart:y,presentationTime:b,number:S,duration:L,sourceDuration:r,indexRange:j,type:p},F=ld(U)[0];e&&(F.map=e),g.push(F),typeof x=="bigint"?x+=w.BigInt(H):x+=H,b+=L/l,S++}return t.segments=g,t},rv=["AUDIO","SUBTITLES"],nv=1/60,dd=function(t){return Zg(t,function(i){var n=i.timeline;return n}).sort(function(i,n){return i.timeline>n.timeline?1:-1})},av=function(t,i){for(var n=0;n<t.length;n++)if(t[n].attributes.NAME===i)return t[n];return null},cd=function(t){var i=[];return Eg(t,rv,function(n,e,r,s){i=i.concat(n.playlists||[])}),i},fd=function(t){var i=t.playlist,n=t.mediaSequence;i.mediaSequence=n,i.segments.forEach(function(e,r){e.number=i.mediaSequence+r})},sv=function(t){var i=t.oldPlaylists,n=t.newPlaylists,e=t.timelineStarts;n.forEach(function(r){r.discontinuitySequence=xs(e,function(c){var g=c.timeline;return g===r.timeline});var s=av(i,r.attributes.NAME);if(!!s&&!r.sidx){var o=r.segments[0],u=xs(s.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<nv});if(u===-1){fd({playlist:r,mediaSequence:s.mediaSequence+s.segments.length}),r.segments[0].discontinuity=!0,r.discontinuityStarts.unshift(0),(!s.segments.length&&r.timeline>s.timeline||s.segments.length&&r.timeline>s.segments[s.segments.length-1].timeline)&&r.discontinuitySequence--;return}var l=s.segments[u];l.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),fd({playlist:r,mediaSequence:s.segments[u].number})}})},ov=function(t){var i=t.oldManifest,n=t.newManifest,e=i.playlists.concat(cd(i)),r=n.playlists.concat(cd(n));return n.timelineStarts=dd([i.timelineStarts,n.timelineStarts]),sv({oldPlaylists:e,newPlaylists:r,timelineStarts:n.timelineStarts}),n},Vn=function(t){return t&&t.uri+"-"+ev(t.byterange)},Cs=function(t){var i=sd(t.reduce(function(n,e){var r=e.attributes.id+(e.attributes.lang||"");if(!n[r])n[r]=e,n[r].attributes.timelineStarts=[];else{if(e.segments){var s;e.segments[0]&&(e.segments[0].discontinuity=!0),(s=n[r].segments).push.apply(s,e.segments)}e.attributes.contentProtection&&(n[r].attributes.contentProtection=e.attributes.contentProtection)}return n[r].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),n},{}));return i.map(function(n){return n.discontinuityStarts=Jg(n.segments||[],"discontinuity"),n})},ws=function(t,i){var n=Vn(t.sidx),e=n&&i[n]&&i[n].sidx;return e&&Es(t,e,t.sidx.resolvedUri),t},uv=function(t,i){if(i===void 0&&(i={}),!Object.keys(i).length)return t;for(var n in t)t[n]=ws(t[n],i);return t},lv=function(t,i){var n,e=t.attributes,r=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:r};return e.contentProtection&&(c.contentProtection=e.contentProtection),s&&(c.sidx=s),i&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},dv=function(t){var i,n=t.attributes,e=t.segments,r=t.mediaSequence,s=t.discontinuityStarts,o=t.discontinuitySequence;typeof e=="undefined"&&(e=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var u=(i={NAME:n.id,BANDWIDTH:n.bandwidth},i["PROGRAM-ID"]=1,i);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:r,segments:e}},cv=function(t,i,n){i===void 0&&(i={}),n===void 0&&(n=!1);var e,r=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 p=l?" ("+l+")":"";g=""+u.attributes.lang+p}o[g]||(o[g]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});var y=ws(lv(u,n),i);return o[g].playlists.push(y),typeof e=="undefined"&&l==="main"&&(e=u,e.default=!0),o},{});if(!e){var s=Object.keys(r)[0];r[s].default=!0}return r},fv=function(t,i){return i===void 0&&(i={}),t.reduce(function(n,e){var r=e.attributes.lang||"text";return n[r]||(n[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),n[r].playlists.push(ws(dv(e),i)),n},{})},hv=function(t){return t.reduce(function(i,n){return n&&n.forEach(function(e){var r=e.channel,s=e.language;i[s]={autoselect:!1,default:!1,instreamId:r,language:s},e.hasOwnProperty("aspectRatio")&&(i[s].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(i[s].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(i[s]["3D"]=e["3D"])}),i},{})},pv=function(t){var i,n=t.attributes,e=t.segments,r=t.sidx,s=t.discontinuityStarts,o={attributes:(i={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:s,timelineStarts:n.timelineStarts,segments:e};return n.contentProtection&&(o.contentProtection=n.contentProtection),r&&(o.sidx=r),o},mv=function(t){var i=t.attributes;return i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video"},gv=function(t){var i=t.attributes;return i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio"},vv=function(t){var i=t.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"},_v=function(t,i){t.forEach(function(n){n.mediaSequence=0,n.discontinuitySequence=xs(i,function(e){var r=e.timeline;return r===n.timeline}),!!n.segments&&n.segments.forEach(function(e,r){e.number=r})})},hd=function(t){return t?Object.keys(t).reduce(function(i,n){var e=t[n];return i.concat(e.playlists)},[]):[]},yv=function(t){var i,n=t.dashPlaylists,e=t.locations,r=t.sidxMapping,s=r===void 0?{}:r,o=t.previousManifest;if(!n.length)return{};var u=n[0].attributes,l=u.sourceDuration,c=u.type,g=u.suggestedPresentationDelay,p=u.minimumUpdatePeriod,y=Cs(n.filter(mv)).map(pv),b=Cs(n.filter(gv)),S=Cs(n.filter(vv)),x=n.map(function(U){return U.attributes.captionServices}).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:l,playlists:uv(y,s)};p>=0&&(A.minimumUpdatePeriod=p*1e3),e&&(A.locations=e),c==="dynamic"&&(A.suggestedPresentationDelay=g);var O=A.playlists.length===0,H=b.length?cv(b,s,O):null,L=S.length?fv(S,s):null,M=y.concat(hd(H),hd(L)),j=M.map(function(U){var F=U.timelineStarts;return F});return A.timelineStarts=dd(j),_v(M,A.timelineStarts),H&&(A.mediaGroups.AUDIO.audio=H),L&&(A.mediaGroups.SUBTITLES.subs=L),x.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=hv(x)),o?ov({oldManifest:o,newManifest:A}):A},Tv=function(t,i,n){var e=t.NOW,r=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,p=g===void 0?0:g,y=(e+r)/1e3,b=s+c,S=y+p,x=S-b;return Math.ceil((x*u-i)/n)},pd=function(t,i){for(var n=t.type,e=t.minimumUpdatePeriod,r=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,p=g===void 0?1:g,y=t.periodStart,b=[],S=-1,x=0;x<i.length;x++){var A=i[x],O=A.d,H=A.r||0,L=A.t||0;S<0&&(S=L),L&&L>S&&(S=L);var M=void 0;if(H<0){var j=x+1;j===i.length?n==="dynamic"&&r>0&&o.indexOf("$Number$")>0?M=Tv(t,S,O):M=(u*c-S)/O:M=(i[j].t-S)/O}else M=H+1;for(var U=p+b.length+M,F=p+b.length;F<U;)b.push({number:F,duration:O/c,time:S,timeline:y}),S+=O,F++}return b},bv=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,xv=function(t){return function(i,n,e,r){if(i==="$$")return"$";if(typeof t[n]=="undefined")return i;var s=""+t[n];return n==="RepresentationID"||(e?r=parseInt(r,10):r=1,s.length>=r)?s:""+new Array(r-s.length+1).join("0")+s}},md=function(t,i){return t.replace(bv,xv(i))},Sv=function(t,i){return!t.duration&&!i?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?Ss(t):pd(t,i)},Ev=function(t,i){var n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,r=e===void 0?{sourceURL:"",range:""}:e,s=Nr({baseUrl:t.baseUrl,source:md(r.sourceURL,n),range:r.range}),o=Sv(t,i);return o.map(function(u){n.Number=u.number,n.Time=u.time;var l=md(t.media||"",n),c=t.timescale||1,g=t.presentationTimeOffset||0,p=t.periodStart+(u.time-g)/c,y={uri:l,timeline:u.timeline,duration:u.duration,resolvedUri:In(t.baseUrl||"",l),map:s,number:u.number,presentationTime:p};return y})},Cv=function(t,i){var n=t.baseUrl,e=t.initialization,r=e===void 0?{}:e,s=Nr({baseUrl:n,source:r.sourceURL,range:r.range}),o=Nr({baseUrl:n,source:i.media,range:i.mediaRange});return o.map=s,o},wv=function(t,i){var n=t.duration,e=t.segmentUrls,r=e===void 0?[]:e,s=t.periodStart;if(!n&&!i||n&&i)throw new Error(Bi.SEGMENT_TIME_UNSPECIFIED);var o=r.map(function(c){return Cv(t,c)}),u;n&&(u=Ss(t)),i&&(u=pd(t,i));var l=u.map(function(c,g){if(o[g]){var p=o[g],y=t.timescale||1,b=t.presentationTimeOffset||0;return p.timeline=c.timeline,p.duration=c.duration,p.number=c.number,p.presentationTime=s+(c.time-b)/y,p}}).filter(function(c){return c});return l},Pv=function(t){var i=t.attributes,n=t.segmentInfo,e,r;n.template?(r=Ev,e=qe(i,n.template)):n.base?(r=ld,e=qe(i,n.base)):n.list&&(r=wv,e=qe(i,n.list));var s={attributes:i};if(!r)return s;var o=r(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(p,y){return Math.max(p,Math.ceil(y.duration))},0):e.duration=0;return s.attributes=e,s.segments=o,n.base&&e.indexRange&&(s.sidx=o[0],s.segments=[]),s},kv=function(t){return t.map(Pv)},Ee=function(t,i){return od(t.childNodes).filter(function(n){var e=n.tagName;return e===i})},Ps=function(t){return t.textContent.trim()},Hi=function(t){var i=365*24*60*60,n=30*24*60*60,e=24*60*60,r=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],p=l[2],y=l[3],b=l[4],S=l[5];return parseFloat(c||0)*i+parseFloat(g||0)*n+parseFloat(p||0)*e+parseFloat(y||0)*r+parseFloat(b||0)*s+parseFloat(S||0)},Av=function(t){var i=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return i.test(t)&&(t+="Z"),Date.parse(t)},gd={mediaPresentationDuration:function(t){return Hi(t)},availabilityStartTime:function(t){return Av(t)/1e3},minimumUpdatePeriod:function(t){return Hi(t)},suggestedPresentationDelay:function(t){return Hi(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return Hi(t)},start:function(t){return Hi(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},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 i=parseInt(t,10);return isNaN(i)?Hi(t):i},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}},Ue=function(t){return t&&t.attributes?od(t.attributes).reduce(function(i,n){var e=gd[n.name]||gd.DEFAULT;return i[n.name]=e(n.value),i},{}):{}},Iv={"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"},jn=function(t,i){return i.length?Hn(t.map(function(n){return i.map(function(e){return In(n,Ps(e))})})):t},ks=function(t){var i=Ee(t,"SegmentTemplate")[0],n=Ee(t,"SegmentList")[0],e=n&&Ee(n,"SegmentURL").map(function(p){return qe({tag:"SegmentURL"},Ue(p))}),r=Ee(t,"SegmentBase")[0],s=n||i,o=s&&Ee(s,"SegmentTimeline")[0],u=n||r||i,l=u&&Ee(u,"Initialization")[0],c=i&&Ue(i);c&&l?c.initialization=l&&Ue(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var g={template:c,segmentTimeline:o&&Ee(o,"S").map(function(p){return Ue(p)}),list:n&&qe(Ue(n),{segmentUrls:e,initialization:Ue(l)}),base:r&&qe(Ue(r),{initialization:Ue(l)})};return Object.keys(g).forEach(function(p){g[p]||delete g[p]}),g},Dv=function(t,i,n){return function(e){var r=Ee(e,"BaseURL"),s=jn(i,r),o=qe(t,Ue(e)),u=ks(e);return s.map(function(l){return{segmentInfo:qe(n,u),attributes:qe(o,{baseUrl:l})}})}},Ov=function(t){return t.reduce(function(i,n){var e=Ue(n);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var r=Iv[e.schemeIdUri];if(r){i[r]={attributes:e};var s=Ee(n,"cenc:pssh")[0];if(s){var o=Ps(s);i[r].pssh=o&&ll(o)}}return i},{})},Lv=function(t){if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var i=typeof t.value!="string"?[]:t.value.split(";");return i.map(function(e){var r,s;if(s=e,/^CC\d=/.test(e)){var o=e.split("=");r=o[0],s=o[1]}else/^CC\d$/.test(e)&&(r=e);return{channel:r,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 r={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;r.channel=o,r.language=e,l.split(",").forEach(function(c){var g=c.split(":"),p=g[0],y=g[1];p==="lang"?r.language=y:p==="er"?r.easyReader=Number(y):p==="war"?r.aspectRatio=Number(y):p==="3D"&&(r["3D"]=Number(y))})}else r.language=e;return r.channel&&(r.channel="SERVICE"+r.channel),r})}},Mv=function(t,i,n){return function(e){var r=Ue(e),s=jn(i,Ee(e,"BaseURL")),o=Ee(e,"Role")[0],u={role:Ue(o)},l=qe(t,r,u),c=Ee(e,"Accessibility")[0],g=Lv(Ue(c));g&&(l=qe(l,{captionServices:g}));var p=Ee(e,"Label")[0];if(p&&p.childNodes.length){var y=p.childNodes[0].nodeValue.trim();l=qe(l,{label:y})}var b=Ov(Ee(e,"ContentProtection"));Object.keys(b).length&&(l=qe(l,{contentProtection:b}));var S=ks(e),x=Ee(e,"Representation"),A=qe(n,S);return Hn(x.map(Dv(l,s,A)))}},Rv=function(t,i){return function(n,e){var r=jn(i,Ee(n.node,"BaseURL")),s=qe(t,{periodStart:n.attributes.start});typeof n.attributes.duration=="number"&&(s.periodDuration=n.attributes.duration);var o=Ee(n.node,"AdaptationSet"),u=ks(n.node);return Hn(o.map(Mv(s,r,u)))}},Nv=function(t){var i=t.attributes,n=t.priorPeriodAttributes,e=t.mpdType;return typeof i.start=="number"?i.start:n&&typeof n.start=="number"&&typeof n.duration=="number"?n.start+n.duration:!n&&e==="static"?0:null},Fv=function(t,i){i===void 0&&(i={});var n=i,e=n.manifestUri,r=e===void 0?"":e,s=n.NOW,o=s===void 0?Date.now():s,u=n.clientOffset,l=u===void 0?0:u,c=Ee(t,"Period");if(!c.length)throw new Error(Bi.INVALID_NUMBER_OF_PERIOD);var g=Ee(t,"Location"),p=Ue(t),y=jn([r],Ee(t,"BaseURL"));p.type=p.type||"static",p.sourceDuration=p.mediaPresentationDuration||0,p.NOW=o,p.clientOffset=l,g.length&&(p.locations=g.map(Ps));var b=[];return c.forEach(function(S,x){var A=Ue(S),O=b[x-1];A.start=Nv({attributes:A,priorPeriodAttributes:O?O.attributes:null,mpdType:p.type}),b.push({node:S,attributes:A})}),{locations:p.locations,representationInfo:Hn(b.map(Rv(p,y)))}},vd=function(t){if(t==="")throw new Error(Bi.DASH_EMPTY_MANIFEST);var i=new Yg,n,e;try{n=i.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(Bi.DASH_INVALID_XML);return e},Uv=function(t){var i=Ee(t,"UTCTiming")[0];if(!i)return null;var n=Ue(i);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(Bi.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},Bv=function(t,i){i===void 0&&(i={});var n=Fv(vd(t),i),e=kv(n.representationInfo);return yv({dashPlaylists:e,locations:n.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest})},Hv=function(t){return Uv(vd(t))},_d=Math.pow(2,32),Vv=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),i;return t.getBigUint64?(i=t.getBigUint64(0),i<Number.MAX_SAFE_INTEGER?Number(i):i):t.getUint32(0)*_d+t.getUint32(4)},jv={getUint64:Vv,MAX_UINT32:_d},yd=jv.getUint64,Wv=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),i={version:a[0],flags:new Uint8Array(a.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;i.version===0?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=yd(a.subarray(n)),i.firstOffset=yd(a.subarray(n+8)),n+=16),n+=2;var e=t.getUint16(n);for(n+=2;e>0;n+=12,e--)i.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 i},qv=Wv,Gv=J([73,68,51]),zv=function(t,i){i===void 0&&(i=0),t=J(t);var n=t[i+5],e=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9],r=(n&16)>>4;return r?e+20:e+10},Fr=function a(t,i){return i===void 0&&(i=0),t=J(t),t.length-i<10||!ye(t,Gv,{offset:i})?i:(i+=zv(t,i),a(t,i))},Td=function(t){return typeof t=="string"?gl(t):t},$v=function(t){return Array.isArray(t)?t.map(function(i){return Td(i)}):[Td(t)]},Kv=function a(t,i,n){n===void 0&&(n=!1),i=$v(i),t=J(t);var e=[];if(!i.length)return e;for(var r=0;r<t.length;){var s=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0,o=t.subarray(r+4,r+8);if(s===0)break;var u=r+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(r+8,u);ye(o,i[0])&&(i.length===1?e.push(l):e.push.apply(e,a(l,i.slice(1),n))),r=u}return e},Wn={EBML:J([26,69,223,163]),DocType:J([66,130]),Segment:J([24,83,128,103]),SegmentInfo:J([21,73,169,102]),Tracks:J([22,84,174,107]),Track:J([174]),TrackNumber:J([215]),DefaultDuration:J([35,227,131]),TrackEntry:J([174]),TrackType:J([131]),FlagDefault:J([136]),CodecID:J([134]),CodecPrivate:J([99,162]),VideoTrack:J([224]),AudioTrack:J([225]),Cluster:J([31,67,182,117]),Timestamp:J([231]),TimestampScale:J([42,215,177]),BlockGroup:J([160]),BlockDuration:J([155]),Block:J([161]),SimpleBlock:J([163])},As=[128,64,32,16,8,4,2,1],Xv=function(t){for(var i=1,n=0;n<As.length&&!(t&As[n]);n++)i++;return i},qn=function(t,i,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var r=Xv(t[i]),s=t.subarray(i,i+r);return n&&(s=Array.prototype.slice.call(t,i,i+r),s[0]^=As[r-1]),{length:r,value:bg(s,{signed:e}),bytes:s}},bd=function a(t){return typeof t=="string"?t.match(/.{1,2}/g).map(function(i){return a(i)}):typeof t=="number"?xg(t):t},Yv=function(t){return Array.isArray(t)?t.map(function(i){return bd(i)}):[bd(t)]},Qv=function a(t,i,n){if(n>=i.length)return i.length;var e=qn(i,n,!1);if(ye(t.bytes,e.bytes))return n;var r=qn(i,n+e.length);return a(t,i,n+r.length+r.value+e.length)},xd=function a(t,i){i=Yv(i),t=J(t);var n=[];if(!i.length)return n;for(var e=0;e<t.length;){var r=qn(t,e,!1),s=qn(t,e+r.length),o=e+r.length+s.length;s.value===127&&(s.value=Qv(r,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);ye(i[0],r.bytes)&&(i.length===1?n.push(l):n=n.concat(a(l,i.slice(1))));var c=r.length+s.length+l.length;e+=c}return n},Jv=J([0,0,0,1]),Zv=J([0,0,1]),e0=J([0,0,3]),t0=function(t){for(var i=[],n=1;n<t.length-2;)ye(t.subarray(n,n+3),e0)&&(i.push(n+2),n++),n++;if(i.length===0)return t;var e=t.length-i.length,r=new Uint8Array(e),s=0;for(n=0;n<e;s++,n++)s===i[0]&&(s++,i.shift()),r[n]=t[s];return r},Sd=function(t,i,n,e){e===void 0&&(e=1/0),t=J(t),n=[].concat(n);for(var r=0,s,o=0;r<t.length&&(o<e||s);){var u=void 0;if(ye(t.subarray(r),Jv)?u=4:ye(t.subarray(r),Zv)&&(u=3),!u){r++;continue}if(o++,s)return t0(t.subarray(s,r));var l=void 0;i==="h264"?l=t[r+u]&31:i==="h265"&&(l=t[r+u]>>1&63),n.indexOf(l)!==-1&&(s=r+u),r+=u+(i==="h264"?1:2)}return t.subarray(0,0)},i0=function(t,i,n){return Sd(t,"h264",i,n)},r0=function(t,i,n){return Sd(t,"h265",i,n)},Ge={webm:J([119,101,98,109]),matroska:J([109,97,116,114,111,115,107,97]),flac:J([102,76,97,67]),ogg:J([79,103,103,83]),ac3:J([11,119]),riff:J([82,73,70,70]),avi:J([65,86,73]),wav:J([87,65,86,69]),"3gp":J([102,116,121,112,51,103]),mp4:J([102,116,121,112]),fmp4:J([115,116,121,112]),mov:J([102,116,121,112,113,116]),moov:J([109,111,111,118]),moof:J([109,111,111,102])},Vi={aac:function(t){var i=Fr(t);return ye(t,[255,16],{offset:i,mask:[255,22]})},mp3:function(t){var i=Fr(t);return ye(t,[255,2],{offset:i,mask:[255,6]})},webm:function(t){var i=xd(t,[Wn.EBML,Wn.DocType])[0];return ye(i,Ge.webm)},mkv:function(t){var i=xd(t,[Wn.EBML,Wn.DocType])[0];return ye(i,Ge.matroska)},mp4:function(t){if(Vi["3gp"](t)||Vi.mov(t))return!1;if(ye(t,Ge.mp4,{offset:4})||ye(t,Ge.fmp4,{offset:4})||ye(t,Ge.moof,{offset:4})||ye(t,Ge.moov,{offset:4}))return!0},mov:function(t){return ye(t,Ge.mov,{offset:4})},"3gp":function(t){return ye(t,Ge["3gp"],{offset:4})},ac3:function(t){var i=Fr(t);return ye(t,Ge.ac3,{offset:i})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var i=0;i+188<t.length&&i<188;){if(t[i]===71&&t[i+188]===71)return!0;i+=1}return!1},flac:function(t){var i=Fr(t);return ye(t,Ge.flac,{offset:i})},ogg:function(t){return ye(t,Ge.ogg)},avi:function(t){return ye(t,Ge.riff)&&ye(t,Ge.avi,{offset:8})},wav:function(t){return ye(t,Ge.riff)&&ye(t,Ge.wav,{offset:8})},h264:function(t){return i0(t,7,3).length},h265:function(t){return r0(t,[32,33],3).length}},Is=Object.keys(Vi).filter(function(a){return a!=="ts"&&a!=="h264"&&a!=="h265"}).concat(["ts","h264","h265"]);Is.forEach(function(a){var t=Vi[a];Vi[a]=function(i){return t(J(i))}});var n0=Vi,Ds=function(t){t=J(t);for(var i=0;i<Is.length;i++){var n=Is[i];if(n0[n](t))return n}return""},a0=function(t){return Kv(t,["moof"]).length>0},Os=9e4,Ls,Ms,Gn,Rs,Ed,Cd,wd;Ls=function(a){return a*Os};Ms=function(a,t){return a*t};Gn=function(a){return a/Os};Rs=function(a,t){return a/t};Ed=function(a,t){return Ls(Rs(a,t))};Cd=function(a,t){return Ms(Gn(a),t)};wd=function(a,t,i){return Gn(i?a:a-t)};var zn={ONE_SECOND_IN_TS:Os,secondsToVideoTs:Ls,secondsToAudioTs:Ms,videoTsToSeconds:Gn,audioTsToSeconds:Rs,audioTsToVideoTs:Ed,videoTsToAudioTs:Cd,metadataTsToSeconds:wd};/**
  21. * @license
  22. * Video.js 7.20.3 <http://videojs.com/>
  23. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  24. * Available under Apache License Version 2.0
  25. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  26. *
  27. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  28. * Available under Apache License Version 2.0
  29. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  30. */var Pd="7.20.3",Ft={},ei=function(t,i){return Ft[t]=Ft[t]||[],i&&(Ft[t]=Ft[t].concat(i)),Ft[t]},s0=function(t,i){ei(t,i)},kd=function(t,i){var n=ei(t).indexOf(i);return n<=-1?!1:(Ft[t]=Ft[t].slice(),Ft[t].splice(n,1),!0)},o0=function(t,i){ei(t,[].concat(i).map(function(n){var e=function r(){return kd(t,r),n.apply(void 0,arguments)};return e}))},$n={prefixed:!0},Kn=[["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"]],Ad=Kn[0],Ur;for(var Xn=0;Xn<Kn.length;Xn++)if(Kn[Xn][1]in G){Ur=Kn[Xn];break}if(Ur){for(var Yn=0;Yn<Ur.length;Yn++)$n[Ad[Yn]]=Ur[Yn];$n.prefixed=Ur[0]!==Ad[0]}var Ze=[],u0=function(t,i){return function(n,e,r){var s=i.levels[e],o=new RegExp("^("+s+")$");if(n!=="log"&&r.unshift(n.toUpperCase()+":"),r.unshift(t+":"),Ze){Ze.push([].concat(r));var u=Ze.length-1e3;Ze.splice(0,u>0?u:0)}if(!!w.console){var l=w.console[n];!l&&n==="debug"&&(l=w.console.info||w.console.log),!(!l||!s||!o.test(n))&&l[Array.isArray(r)?"apply":"call"](w.console,r)}}};function Id(a){var t="info",i,n=function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];i("log",t,s)};return i=u0(a,n),n.createLogger=function(e){return Id(a+": "+e)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(e){if(typeof e=="string"){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},n.history=function(){return Ze?[].concat(Ze):[]},n.history.filter=function(e){return(Ze||[]).filter(function(r){return new RegExp(".*"+e+".*").test(r[0])})},n.history.clear=function(){Ze&&(Ze.length=0)},n.history.disable=function(){Ze!==null&&(Ze.length=0,Ze=null)},n.history.enable=function(){Ze===null&&(Ze=[])},n.error=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i("error",t,r)},n.warn=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i("warn",t,r)},n.debug=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i("debug",t,r)},n}var ne=Id("VIDEOJS"),Dd=ne.createLogger,l0=Object.prototype.toString,Od=function(t){return Ut(t)?Object.keys(t):[]};function ji(a,t){Od(a).forEach(function(i){return t(a[i],i)})}function d0(a,t,i){return i===void 0&&(i=0),Od(a).reduce(function(n,e){return t(n,a[e],e)},i)}function be(a){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?dt.apply(void 0,[a].concat(i)):(i.forEach(function(e){!e||ji(e,function(r,s){a[s]=r})}),a)}function Ut(a){return!!a&&typeof a=="object"}function Br(a){return Ut(a)&&l0.call(a)==="[object Object]"&&a.constructor===Object}function Hr(a,t){if(!a||!t)return"";if(typeof w.getComputedStyle=="function"){var i;try{i=w.getComputedStyle(a)}catch{return""}return i?i.getPropertyValue(t)||i[t]:""}return""}var Ie=w.navigator&&w.navigator.userAgent||"",Ld=/AppleWebKit\/([\d.]+)/i.exec(Ie),c0=Ld?parseFloat(Ld.pop()):null,Md=/iPod/i.test(Ie),f0=function(){var a=Ie.match(/OS (\d+)_/i);return a&&a[1]?a[1]:null}(),Bt=/Android/i.test(Ie),Ns=function(){var a=Ie.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!a)return null;var t=a[1]&&parseFloat(a[1]),i=a[2]&&parseFloat(a[2]);return t&&i?parseFloat(a[1]+"."+a[2]):t||null}(),Rd=Bt&&Ns<5&&c0<537,Nd=/Firefox/i.test(Ie),Vr=/Edg/i.test(Ie),Ht=!Vr&&(/Chrome/i.test(Ie)||/CriOS/i.test(Ie)),Fd=function(){var a=Ie.match(/(Chrome|CriOS)\/(\d+)/);return a&&a[2]?parseFloat(a[2]):null}(),jr=function(){var a=/MSIE\s(\d+)\.\d/.exec(Ie),t=a&&parseFloat(a[1]);return!t&&/Trident\/7.0/i.test(Ie)&&/rv:11.0/.test(Ie)&&(t=11),t}(),Fs=/Safari/i.test(Ie)&&!Ht&&!Bt&&!Vr,Ud=/Windows/i.test(Ie),Wi=Boolean(qi()&&("ontouchstart"in w||w.navigator.maxTouchPoints||w.DocumentTouch&&w.document instanceof w.DocumentTouch)),Us=/iPad/i.test(Ie)||Fs&&Wi&&!/iPhone/i.test(Ie),Bs=/iPhone/i.test(Ie)&&!Us,ze=Bs||Us||Md,Qn=(Fs||ze)&&!Ht,h0=Object.freeze({__proto__:null,IS_IPOD:Md,IOS_VERSION:f0,IS_ANDROID:Bt,ANDROID_VERSION:Ns,IS_NATIVE_ANDROID:Rd,IS_FIREFOX:Nd,IS_EDGE:Vr,IS_CHROME:Ht,CHROME_VERSION:Fd,IE_VERSION:jr,IS_SAFARI:Fs,IS_WINDOWS:Ud,TOUCH_ENABLED:Wi,IS_IPAD:Us,IS_IPHONE:Bs,IS_IOS:ze,IS_ANY_SAFARI:Qn});function Bd(a){return typeof a=="string"&&Boolean(a.trim())}function Hd(a){if(a.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function p0(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function qi(){return G===w.document}function Gi(a){return Ut(a)&&a.nodeType===1}function Vd(){try{return w.parent!==w.self}catch{return!0}}function jd(a){return function(t,i){if(!Bd(t))return G[a](null);Bd(i)&&(i=G.querySelector(i));var n=Gi(i)?i:G;return n[a]&&n[a](t)}}function oe(a,t,i,n){a===void 0&&(a="div"),t===void 0&&(t={}),i===void 0&&(i={});var e=G.createElement(a);return Object.getOwnPropertyNames(t).forEach(function(r){var s=t[r];r.indexOf("aria-")!==-1||r==="role"||r==="type"?(ne.warn(`Setting attributes in the second argument of createEl()
  31. has been deprecated. Use the third argument instead.
  32. `+("createEl(type, properties, attributes). Attempting to set "+r+" to "+s+".")),e.setAttribute(r,s)):r==="textContent"?pi(e,s):(e[r]!==s||r==="tabIndex")&&(e[r]=s)}),Object.getOwnPropertyNames(i).forEach(function(r){e.setAttribute(r,i[r])}),n&&js(e,n),e}function pi(a,t){return typeof a.textContent=="undefined"?a.innerText=t:a.textContent=t,a}function Hs(a,t){t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)}function mi(a,t){return Hd(t),a.classList?a.classList.contains(t):p0(t).test(a.className)}function Vt(a,t){return a.classList?a.classList.add(t):mi(a,t)||(a.className=(a.className+" "+t).trim()),a}function Wr(a,t){return a?(a.classList?a.classList.remove(t):(Hd(t),a.className=a.className.split(/\s+/).filter(function(i){return i!==t}).join(" ")),a):(ne.warn("removeClass was called with an element that doesn't exist"),null)}function Wd(a,t,i){var n=mi(a,t);if(typeof i=="function"&&(i=i(a,t)),typeof i!="boolean"&&(i=!n),i!==n)return i?Vt(a,t):Wr(a,t),a}function qd(a,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];n===null||typeof n=="undefined"||n===!1?a.removeAttribute(i):a.setAttribute(i,n===!0?"":n)})}function jt(a){var t={},i=",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 r=n[e].name,s=n[e].value;(typeof a[r]=="boolean"||i.indexOf(","+r+",")!==-1)&&(s=s!==null),t[r]=s}return t}function Gd(a,t){return a.getAttribute(t)}function zi(a,t,i){a.setAttribute(t,i)}function Jn(a,t){a.removeAttribute(t)}function zd(){G.body.focus(),G.onselectstart=function(){return!1}}function $d(){G.onselectstart=function(){return!0}}function $i(a){if(a&&a.getBoundingClientRect&&a.parentNode){var t=a.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(n){t[n]!==void 0&&(i[n]=t[n])}),i.height||(i.height=parseFloat(Hr(a,"height"))),i.width||(i.width=parseFloat(Hr(a,"width"))),i}}function qr(a){if(!a||a&&!a.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=a.offsetWidth,i=a.offsetHeight,n=0,e=0;a.offsetParent&&a!==G[$n.fullscreenElement];)n+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;return{left:n,top:e,width:t,height:i}}function Zn(a,t){var i={x:0,y:0};if(ze)for(var n=a;n&&n.nodeName.toLowerCase()!=="html";){var e=Hr(n,"transform");if(/^matrix/.test(e)){var r=e.slice(7,-1).split(/,\s/).map(Number);i.x+=r[4],i.y+=r[5]}else if(/^matrix3d/.test(e)){var s=e.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}var o={},u=qr(t.target),l=qr(a),c=l.width,g=l.height,p=t.offsetY-(l.top-u.top),y=t.offsetX-(l.left-u.left);return t.changedTouches&&(y=t.changedTouches[0].pageX-l.left,p=t.changedTouches[0].pageY+l.top,ze&&(y-=i.x,p-=i.y)),o.y=1-Math.max(0,Math.min(1,p/g)),o.x=Math.max(0,Math.min(1,y/c)),o}function Kd(a){return Ut(a)&&a.nodeType===3}function Vs(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function Xd(a){return typeof a=="function"&&(a=a()),(Array.isArray(a)?a:[a]).map(function(t){if(typeof t=="function"&&(t=t()),Gi(t)||Kd(t))return t;if(typeof t=="string"&&/\S/.test(t))return G.createTextNode(t)}).filter(function(t){return t})}function js(a,t){return Xd(t).forEach(function(i){return a.appendChild(i)}),a}function Yd(a,t){return js(Vs(a),t)}function Gr(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 ti=jd("querySelector"),Qd=jd("querySelectorAll"),Jd=Object.freeze({__proto__:null,isReal:qi,isEl:Gi,isInFrame:Vd,createEl:oe,textContent:pi,prependTo:Hs,hasClass:mi,addClass:Vt,removeClass:Wr,toggleClass:Wd,setAttributes:qd,getAttributes:jt,getAttribute:Gd,setAttribute:zi,removeAttribute:Jn,blockTextSelection:zd,unblockTextSelection:$d,getBoundingClientRect:$i,findPosition:qr,getPointerPosition:Zn,isTextNode:Kd,emptyEl:Vs,normalizeContent:Xd,appendContent:js,insertContent:Yd,isSingleLeftClick:Gr,$:ti,$$:Qd}),Zd=!1,Ws,m0=function(){if(Ws.options.autoSetup!==!1){var t=Array.prototype.slice.call(G.getElementsByTagName("video")),i=Array.prototype.slice.call(G.getElementsByTagName("audio")),n=Array.prototype.slice.call(G.getElementsByTagName("video-js")),e=t.concat(i,n);if(e&&e.length>0)for(var r=0,s=e.length;r<s;r++){var o=e[r];if(o&&o.getAttribute){if(o.player===void 0){var u=o.getAttribute("data-setup");u!==null&&Ws(o)}}else{qs(1);break}}else Zd||qs(1)}};function qs(a,t){!qi()||(t&&(Ws=t),w.setTimeout(m0,a))}function Gs(){Zd=!0,w.removeEventListener("load",Gs)}qi()&&(G.readyState==="complete"?Gs():w.addEventListener("load",Gs));var ec=function(t){var i=G.createElement("style");return i.className=t,i},tc=function(t,i){t.styleSheet?t.styleSheet.cssText=i:t.textContent=i},g0=3,v0=g0;function Wt(){return v0++}var ic;w.WeakMap||(ic=function(){function a(){this.vdata="vdata"+Math.floor(w.performance&&w.performance.now()||Date.now()),this.data={}}var t=a.prototype;return t.set=function(n,e){var r=n[this.vdata]||Wt();return n[this.vdata]||(n[this.vdata]=r),this.data[r]=e,this},t.get=function(n){var e=n[this.vdata];if(e)return this.data[e];ne("We have no data for this element",n)},t.has=function(n){var e=n[this.vdata];return e in this.data},t.delete=function(n){var e=n[this.vdata];e&&(delete this.data[e],delete n[this.vdata])},a}());var $e=w.WeakMap?new WeakMap:new ic;function rc(a,t){if(!!$e.has(a)){var i=$e.get(a);i.handlers[t].length===0&&(delete i.handlers[t],a.removeEventListener?a.removeEventListener(t,i.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),Object.getOwnPropertyNames(i).length===0&&$e.delete(a)}}function zs(a,t,i,n){i.forEach(function(e){a(t,e,n)})}function ea(a){if(a.fixed_)return a;function t(){return!0}function i(){return!1}if(!a||!a.isPropagationStopped||!a.isImmediatePropagationStopped){var n=a||w.event;a={};for(var e in n)e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"&&(e==="returnValue"&&n.preventDefault||(a[e]=n[e]));if(a.target||(a.target=a.srcElement||G),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){n.preventDefault&&n.preventDefault(),a.returnValue=!1,n.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),a.cancelBubble=!0,n.cancelBubble=!0,a.isPropagationStopped=t},a.isPropagationStopped=i,a.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),a.isImmediatePropagationStopped=t,a.stopPropagation()},a.isImmediatePropagationStopped=i,a.clientX!==null&&a.clientX!==void 0){var r=G.documentElement,s=G.body;a.pageX=a.clientX+(r&&r.scrollLeft||s&&s.scrollLeft||0)-(r&&r.clientLeft||s&&s.clientLeft||0),a.pageY=a.clientY+(r&&r.scrollTop||s&&s.scrollTop||0)-(r&&r.clientTop||s&&s.clientTop||0)}a.which=a.charCode||a.keyCode,a.button!==null&&a.button!==void 0&&(a.button=a.button&1?0:a.button&4?1:a.button&2?2:0)}return a.fixed_=!0,a}var ta,_0=function(){if(typeof ta!="boolean"){ta=!1;try{var t=Object.defineProperty({},"passive",{get:function(){ta=!0}});w.addEventListener("test",null,t),w.removeEventListener("test",null,t)}catch{}}return ta},y0=["touchstart","touchmove"];function rt(a,t,i){if(Array.isArray(t))return zs(rt,a,t,i);$e.has(a)||$e.set(a,{});var n=$e.get(a);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Wt()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(r,s){if(!n.disabled){r=ea(r);var o=n.handlers[r.type];if(o)for(var u=o.slice(0),l=0,c=u.length;l<c&&!r.isImmediatePropagationStopped();l++)try{u[l].call(a,r,s)}catch(g){ne.error(g)}}}),n.handlers[t].length===1)if(a.addEventListener){var e=!1;_0()&&y0.indexOf(t)>-1&&(e={passive:!0}),a.addEventListener(t,n.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+t,n.dispatcher)}function Be(a,t,i){if(!!$e.has(a)){var n=$e.get(a);if(!!n.handlers){if(Array.isArray(t))return zs(Be,a,t,i);var e=function(l,c){n.handlers[c]=[],rc(l,c)};if(t===void 0){for(var r in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},r)&&e(a,r);return}var s=n.handlers[t];if(!!s){if(!i){e(a,t);return}if(i.guid)for(var o=0;o<s.length;o++)s[o].guid===i.guid&&s.splice(o--,1);rc(a,t)}}}}function Ki(a,t,i){var n=$e.has(a)?$e.get(a):{},e=a.parentNode||a.ownerDocument;if(typeof t=="string"?t={type:t,target:a}:t.target||(t.target=a),t=ea(t),n.dispatcher&&n.dispatcher.call(a,t,i),e&&!t.isPropagationStopped()&&t.bubbles===!0)Ki.call(null,e,t,i);else if(!e&&!t.defaultPrevented&&t.target&&t.target[t.type]){$e.has(t.target)||$e.set(t.target,{});var r=$e.get(t.target);t.target[t.type]&&(r.disabled=!0,typeof t.target[t.type]=="function"&&t.target[t.type](),r.disabled=!1)}return!t.defaultPrevented}function ia(a,t,i){if(Array.isArray(t))return zs(ia,a,t,i);var n=function e(){Be(a,t,e),i.apply(this,arguments)};n.guid=i.guid=i.guid||Wt(),rt(a,t,n)}function nc(a,t,i){var n=function e(){Be(a,t,e),i.apply(this,arguments)};n.guid=i.guid=i.guid||Wt(),rt(a,t,n)}var T0=Object.freeze({__proto__:null,fixEvent:ea,on:rt,off:Be,trigger:Ki,one:ia,any:nc}),ht=30,ve=function(t,i,n){i.guid||(i.guid=Wt());var e=i.bind(t);return e.guid=n?n+"_"+i.guid:i.guid,e},qt=function(t,i){var n=w.performance.now(),e=function(){var s=w.performance.now();s-n>=i&&(t.apply(void 0,arguments),n=s)};return e},b0=function(t,i,n,e){e===void 0&&(e=w);var r,s=function(){e.clearTimeout(r),r=null},o=function(){var l=this,c=arguments,g=function(){r=null,g=null,n||t.apply(l,c)};!r&&n&&t.apply(l,c),e.clearTimeout(r),r=e.setTimeout(g,i)};return o.cancel=s,o},De=function(){};De.prototype.allowedEvents_={};De.prototype.on=function(a,t){var i=this.addEventListener;this.addEventListener=function(){},rt(this,a,t),this.addEventListener=i};De.prototype.addEventListener=De.prototype.on;De.prototype.off=function(a,t){Be(this,a,t)};De.prototype.removeEventListener=De.prototype.off;De.prototype.one=function(a,t){var i=this.addEventListener;this.addEventListener=function(){},ia(this,a,t),this.addEventListener=i};De.prototype.any=function(a,t){var i=this.addEventListener;this.addEventListener=function(){},nc(this,a,t),this.addEventListener=i};De.prototype.trigger=function(a){var t=a.type||a;typeof a=="string"&&(a={type:t}),a=ea(a),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](a),Ki(this,a)};De.prototype.dispatchEvent=De.prototype.trigger;var zr;De.prototype.queueTrigger=function(a){var t=this;zr||(zr=new Map);var i=a.type||a,n=zr.get(this);n||(n=new Map,zr.set(this,n));var e=n.get(i);n.delete(i),w.clearTimeout(e);var r=w.setTimeout(function(){n.size===0&&(n=null,zr.delete(t)),t.trigger(a)},0);n.set(i,r)};var ra=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},Gt=function(t){return t instanceof De||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof t[i]=="function"})},x0=function(t,i){Gt(t)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))},$s=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},na=function(t,i,n){if(!t||!t.nodeName&&!Gt(t))throw new Error("Invalid target for "+ra(i)+"#"+n+"; must be a DOM node or evented object.")},ac=function(t,i,n){if(!$s(t))throw new Error("Invalid event type for "+ra(i)+"#"+n+"; must be a non-empty string or array.")},sc=function(t,i,n){if(typeof t!="function")throw new Error("Invalid listener for "+ra(i)+"#"+n+"; must be a function.")},Ks=function(t,i,n){var e=i.length<3||i[0]===t||i[0]===t.eventBusEl_,r,s,o;return e?(r=t.eventBusEl_,i.length>=3&&i.shift(),s=i[0],o=i[1]):(r=i[0],s=i[1],o=i[2]),na(r,t,n),ac(s,t,n),sc(o,t,n),o=ve(t,o),{isTargetingSelf:e,target:r,type:s,listener:o}},gi=function(t,i,n,e){na(t,t,i),t.nodeName?T0[i](t,n,e):t[i](n,e)},S0={on:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=Ks(this,n,"on"),s=r.isTargetingSelf,o=r.target,u=r.type,l=r.listener;if(gi(o,"on",u,l),!s){var c=function(){return t.off(o,u,l)};c.guid=l.guid;var g=function(){return t.off("dispose",c)};g.guid=l.guid,gi(this,"on","dispose",c),gi(o,"on","dispose",g)}},one:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=Ks(this,n,"one"),s=r.isTargetingSelf,o=r.target,u=r.type,l=r.listener;if(s)gi(o,"one",u,l);else{var c=function g(){t.off(o,u,g);for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];l.apply(null,y)};c.guid=l.guid,gi(o,"one",u,c)}},any:function(){for(var t=this,i=arguments.length,n=new Array(i),e=0;e<i;e++)n[e]=arguments[e];var r=Ks(this,n,"any"),s=r.isTargetingSelf,o=r.target,u=r.type,l=r.listener;if(s)gi(o,"any",u,l);else{var c=function g(){t.off(o,u,g);for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];l.apply(null,y)};c.guid=l.guid,gi(o,"any",u,c)}},off:function(t,i,n){if(!t||$s(t))Be(this.eventBusEl_,t,i);else{var e=t,r=i;na(e,this,"off"),ac(r,this,"off"),sc(n,this,"off"),n=ve(this,n),this.off("dispose",n),e.nodeName?(Be(e,r,n),Be(e,"dispose",n)):Gt(e)&&(e.off(r,n),e.off("dispose",n))}},trigger:function(t,i){na(this.eventBusEl_,this,"trigger");var n=t&&typeof t!="string"?t.type:t;if(!$s(n)){var e="Invalid event type for "+ra(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(t)(this.log||ne).error(e);else throw new Error(e)}return Ki(this.eventBusEl_,t,i)}};function Xs(a,t){t===void 0&&(t={});var i=t,n=i.eventBusKey;if(n){if(!a[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');a.eventBusEl_=a[n]}else a.eventBusEl_=oe("span",{className:"vjs-event-bus"});return be(a,S0),a.eventedCallbacks&&a.eventedCallbacks.forEach(function(e){e()}),a.on("dispose",function(){a.off(),[a,a.el_,a.eventBusEl_].forEach(function(e){e&&$e.has(e)&&$e.delete(e)}),w.setTimeout(function(){a.eventBusEl_=null},0)}),a}var E0={state:{},setState:function(t){var i=this;typeof t=="function"&&(t=t());var n;return ji(t,function(e,r){i.state[r]!==e&&(n=n||{},n[r]={from:i.state[r],to:e}),i.state[r]=e}),n&&Gt(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function oc(a,t){return be(a,E0),a.state=be({},a.state,t),typeof a.handleStateChanged=="function"&&Gt(a)&&a.on("statechanged",a.handleStateChanged),a}var aa=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toLowerCase()})},Ce=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toUpperCase()})},C0=function(t,i){return Ce(t)===Ce(i)};function _e(){for(var a={},t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach(function(e){!e||ji(e,function(r,s){if(!Br(r)){a[s]=r;return}Br(a[s])||(a[s]={}),a[s]=_e(a[s],r)})}),a}var w0=function(){function a(){this.map_={}}var t=a.prototype;return t.has=function(n){return n in this.map_},t.delete=function(n){var e=this.has(n);return delete this.map_[n],e},t.set=function(n,e){return this.map_[n]=e,this},t.forEach=function(n,e){for(var r in this.map_)n.call(e,this.map_[r],r,this)},a}(),P0=w.Map?w.Map:w0,k0=function(){function a(){this.set_={}}var t=a.prototype;return t.has=function(n){return n in this.set_},t.delete=function(n){var e=this.has(n);return delete this.set_[n],e},t.add=function(n){return this.set_[n]=1,this},t.forEach=function(n,e){for(var r in this.set_)n.call(e,r,r,this)},a}(),Ys=w.Set?w.Set:k0,V=function(){function a(i,n,e){var r=this;if(!i&&this.play?this.player_=i=this:this.player_=i,this.isDisposed_=!1,this.parentComponent_=null,this.options_=_e({},this.options_),n=this.options_=_e(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var s=i&&i.id&&i.id()||"no_player";this.id_=s+"_component_"+Wt()}this.name_=n.name||null,n.el?this.el_=n.el:n.createEl!==!1&&(this.el_=this.createEl()),n.className&&this.el_&&n.className.split(" ").forEach(function(o){return r.addClass(o)}),n.evented!==!1&&(Xs(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),oc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Ys,this.setIntervalIds_=new Ys,this.rafIds_=new Ys,this.namedRafs_=new P0,this.clearingTimersOnDispose_=!1,n.initChildren!==!1&&this.initChildren(),this.ready(e),n.reportTouchActivity!==!1&&this.enableTouchActivity()}var t=a.prototype;return t.dispose=function(n){if(n===void 0&&(n={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;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_=_e(this.options_,n),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(n,e,r){return oe(n,e,r)},t.localize=function(n,e,r){r===void 0&&(r=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=r;return u&&u[n]?g=u[n]:c&&c[n]&&(g=c[n]),e&&(g=g.replace(/\{(\d+)\}/g,function(p,y){var b=e[y-1],S=b;return typeof b=="undefined"&&(S=p),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),r=0;r<n;r++)e[r]=arguments[r];e=e.reduce(function(u,l){return u.concat(l)},[]);for(var s=this,o=0;o<e.length;o++)if(s=s.getChild(e[o]),!s||!s.getChild)return;return s},t.addChild=function(n,e,r){e===void 0&&(e={}),r===void 0&&(r=this.children_.length);var s,o;if(typeof n=="string"){o=Ce(n);var u=e.componentClass||o;e.name=o;var l=a.getComponent(u);if(!l)throw new Error("Component "+u+" does not exist");if(typeof l!="function")return null;s=new l(this.player_||this,e)}else s=n;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(r,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),o=o||s.name&&Ce(s.name()),o&&(this.childNameIndex_[o]=s,this.childNameIndex_[aa(o)]=s),typeof s.el=="function"&&s.el()){var c=null;this.children_[r+1]&&(this.children_[r+1].el_?c=this.children_[r+1].el_:Gi(this.children_[r+1])&&(c=this.children_[r+1])),this.contentEl().insertBefore(s.el(),c)}return s},t.removeChild=function(n){if(typeof n=="string"&&(n=this.getChild(n)),!(!n||!this.children_)){for(var e=!1,r=this.children_.length-1;r>=0;r--)if(this.children_[r]===n){e=!0,this.children_.splice(r,1);break}if(!!e){n.parentComponent_=null,this.childIndex_[n.id()]=null,this.childNameIndex_[Ce(n.name())]=null,this.childNameIndex_[aa(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 r=this.options_,s=function(c){var g=c.name,p=c.opts;if(r[g]!==void 0&&(p=r[g]),p!==!1){p===!0&&(p={}),p.playerOptions=n.options_.playerOptions;var y=n.addChild(g,p);y&&(n[g]=y)}},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||Ce(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 ti(n,e||this.contentEl())},t.$$=function(n,e){return Qd(n,e||this.contentEl())},t.hasClass=function(n){return mi(this.el_,n)},t.addClass=function(n){Vt(this.el_,n)},t.removeClass=function(n){Wr(this.el_,n)},t.toggleClass=function(n,e){Wd(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 Gd(this.el_,n)},t.setAttribute=function(n,e){zi(this.el_,n,e)},t.removeAttribute=function(n){Jn(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,r){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",r||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"+Ce(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=Hr(this.el_,n),e=parseFloat(e),e===0||isNaN(e)){var r="offset"+Ce(n);e=this.el_[r]}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_&&(re.isEventKey(n,"Tab")||n.stopPropagation(),this.player_.handleKeyDown(n))},t.handleKeyPress=function(n){this.handleKeyDown(n)},t.emitTapEvents=function(){var n=0,e=null,r=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=w.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,p=Math.sqrt(c*c+g*g);p>r&&(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=w.performance.now()-n;c<s&&(l.preventDefault(),this.trigger("tap"))}})},t.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var n=ve(this.player(),this.player().reportUserActivity),e;this.on("touchstart",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)});var r=function(o){n(),this.clearInterval(e)};this.on("touchmove",n),this.on("touchend",r),this.on("touchcancel",r)}},t.setTimeout=function(n,e){var r=this,s;return n=ve(this,n),this.clearTimersOnDispose_(),s=w.setTimeout(function(){r.setTimeoutIds_.has(s)&&r.setTimeoutIds_.delete(s),n()},e),this.setTimeoutIds_.add(s),s},t.clearTimeout=function(n){return this.setTimeoutIds_.has(n)&&(this.setTimeoutIds_.delete(n),w.clearTimeout(n)),n},t.setInterval=function(n,e){n=ve(this,n),this.clearTimersOnDispose_();var r=w.setInterval(n,e);return this.setIntervalIds_.add(r),r},t.clearInterval=function(n){return this.setIntervalIds_.has(n)&&(this.setIntervalIds_.delete(n),w.clearInterval(n)),n},t.requestAnimationFrame=function(n){var e=this;if(!this.supportsRaf_)return this.setTimeout(n,1e3/60);this.clearTimersOnDispose_();var r;return n=ve(this,n),r=w.requestAnimationFrame(function(){e.rafIds_.has(r)&&e.rafIds_.delete(r),n()}),this.rafIds_.add(r),r},t.requestNamedAnimationFrame=function(n,e){var r=this;if(!this.namedRafs_.has(n)){this.clearTimersOnDispose_(),e=ve(this,e);var s=this.requestAnimationFrame(function(){e(),r.namedRafs_.has(n)&&r.namedRafs_.delete(n)});return this.namedRafs_.set(n,s),n}},t.cancelNamedAnimationFrame=function(n){!this.namedRafs_.has(n)||(this.cancelAnimationFrame(this.namedRafs_.get(n)),this.namedRafs_.delete(n))},t.cancelAnimationFrame=function(n){return this.supportsRaf_?(this.rafIds_.has(n)&&(this.rafIds_.delete(n),w.cancelAnimationFrame(n)),n):this.clearTimeout(n)},t.clearTimersOnDispose_=function(){var n=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var r=e[0],s=e[1];n[r].forEach(function(o,u){return n[s](u)})}),n.clearingTimersOnDispose_=!1}))},a.registerComponent=function(n,e){if(typeof n!="string"||!n)throw new Error('Illegal component name, "'+n+'"; must be a non-empty string.');var r=a.getComponent("Tech"),s=r&&r.isTech(e),o=a===e||a.prototype.isPrototypeOf(e.prototype);if(s||!o){var u;throw s?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error('Illegal component, "'+n+'"; '+u+".")}n=Ce(n),a.components_||(a.components_={});var l=a.getComponent("Player");if(n==="Player"&&l&&l.players){var c=l.players,g=Object.keys(c);if(c&&g.length>0&&g.map(function(p){return c[p]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[n]=e,a.components_[aa(n)]=e,e},a.getComponent=function(n){if(!(!n||!a.components_))return a.components_[n]},a}();V.prototype.supportsRaf_=typeof w.requestAnimationFrame=="function"&&typeof w.cancelAnimationFrame=="function";V.registerComponent("Component",V);function A0(a,t,i){if(typeof t!="number"||t<0||t>i)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function uc(a,t,i,n){return A0(a,n,i.length-1),i[n][t]}function Qs(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:uc.bind(null,"start",0,a),end:uc.bind(null,"end",1,a)},w.Symbol&&w.Symbol.iterator&&(t[w.Symbol.iterator]=function(){return(a||[]).values()}),t}function vi(a,t){return Array.isArray(a)?Qs(a):a===void 0||t===void 0?Qs():Qs([[a,t]])}function lc(a,t){var i=0,n,e;if(!t)return 0;(!a||!a.length)&&(a=vi(0,0));for(var r=0;r<a.length;r++)n=a.start(r),e=a.end(r),e>t&&(e=t),i+=e-n;return i/t}function Ke(a){if(a instanceof Ke)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=Ke.defaultMessages[this.code]||"")}Ke.prototype.code=0;Ke.prototype.message="";Ke.prototype.status=null;Ke.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ke.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 Xi=0;Xi<Ke.errorTypes.length;Xi++)Ke[Ke.errorTypes[Xi]]=Xi,Ke.prototype[Ke.errorTypes[Xi]]=Xi;function $r(a){return a!=null&&typeof a.then=="function"}function Et(a){$r(a)&&a.then(null,function(t){})}var Js=function(t){var i=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(n,e,r){return t[e]&&(n[e]=t[e]),n},{cues:t.cues&&Array.prototype.map.call(t.cues,function(n){return{startTime:n.startTime,endTime:n.endTime,text:n.text,id:n.id}})});return i},I0=function(t){var i=t.$$("track"),n=Array.prototype.map.call(i,function(r){return r.track}),e=Array.prototype.map.call(i,function(r){var s=Js(r.track);return r.src&&(s.src=r.src),s});return e.concat(Array.prototype.filter.call(t.textTracks(),function(r){return n.indexOf(r)===-1}).map(Js))},D0=function(t,i){return t.forEach(function(n){var e=i.addRemoteTextTrack(n).track;!n.src&&n.cues&&n.cues.forEach(function(r){return e.addCue(r)})}),i.textTracks()},dc={textTracksToJson:I0,jsonToTextTracks:D0,trackToJson_:Js},Zs="vjs-modal-dialog",Yi=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.handleKeyDown_=function(s){return r.handleKeyDown(s)},r.close_=function(s){return r.close(s)},r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=oe("div",{className:Zs+"-content"},{role:"document"}),r.descEl_=oe("p",{className:Zs+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),pi(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,a.prototype.dispose.call(this)},i.buildCSSClass=function(){return Zs+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},i.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},i.close=function(){if(!!this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},i.closeable=function(e){if(typeof e=="boolean"){var r=this.closeable_=!!e,s=this.getChild("closeButton");if(r&&!s){var o=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(s,"close",this.close_)}!r&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var r=this.contentEl(),s=r.parentNode,o=r.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(r),this.empty(),Yd(r,e),this.trigger("modalfill"),o?s.insertBefore(r,o):s.appendChild(r);var u=this.getChild("closeButton");u&&s.appendChild(u.el_)},i.empty=function(){this.trigger("beforemodalempty"),Vs(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return typeof e!="undefined"&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=G.activeElement,r=this.player_.el_;this.previouslyActiveEl_=null,(r.contains(e)||r===e)&&(this.previouslyActiveEl_=e,this.focus())},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},i.handleKeyDown=function(e){if(e.stopPropagation(),re.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(!!re.isEventKey(e,"Tab")){for(var r=this.focusableEls_(),s=this.el_.querySelector(":focus"),o,u=0;u<r.length;u++)if(s===r[u]){o=u;break}G.activeElement===this.el_&&(o=0),e.shiftKey&&o===0?(r[r.length-1].focus(),e.preventDefault()):!e.shiftKey&&o===r.length-1&&(r[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(r){return(r instanceof w.HTMLAnchorElement||r instanceof w.HTMLAreaElement)&&r.hasAttribute("href")||(r instanceof w.HTMLInputElement||r instanceof w.HTMLSelectElement||r instanceof w.HTMLTextAreaElement||r instanceof w.HTMLButtonElement)&&!r.hasAttribute("disabled")||r instanceof w.HTMLIFrameElement||r instanceof w.HTMLObjectElement||r instanceof w.HTMLEmbedElement||r.hasAttribute("tabindex")&&r.getAttribute("tabindex")!==-1||r.hasAttribute("contenteditable")})},t}(V);Yi.prototype.options_={pauseOnOpen:!0,temporary:!0};V.registerComponent("ModalDialog",Yi);var Qi=function(a){$(t,a);function t(n){var e;n===void 0&&(n=[]),e=a.call(this)||this,e.tracks_=[],Object.defineProperty(ie(e),"length",{get:function(){return this.tracks_.length}});for(var r=0;r<n.length;r++)e.addTrack(n[r]);return e}var i=t.prototype;return i.addTrack=function(e){var r=this,s=this.tracks_.length;""+s in this||Object.defineProperty(this,s,{get:function(){return this.tracks_[s]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){r.trigger({track:e,type:"labelchange",target:r})},Gt(e)&&e.addEventListener("labelchange",e.labelchange_)},i.removeTrack=function(e){for(var r,s=0,o=this.length;s<o;s++)if(this[s]===e){r=this[s],r.off&&r.off(),this.tracks_.splice(s,1);break}!r||this.trigger({track:r,type:"removetrack",target:this})},i.getTrackById=function(e){for(var r=null,s=0,o=this.length;s<o;s++){var u=this[s];if(u.id===e){r=u;break}}return r},t}(De);Qi.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var O0 in Qi.prototype.allowedEvents_)Qi.prototype["on"+O0]=null;var eo=function(t,i){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||i.id===t[n].id||(t[n].enabled=!1)},L0=function(a){$(t,a);function t(n){var e;n===void 0&&(n=[]);for(var r=n.length-1;r>=0;r--)if(n[r].enabled){eo(n,n[r]);break}return e=a.call(this,n)||this,e.changing_=!1,e}var i=t.prototype;return i.addTrack=function(e){var r=this;e.enabled&&eo(this,e),a.prototype.addTrack.call(this,e),!!e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,eo(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},i.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},t}(Qi),to=function(t,i){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||i.id===t[n].id||(t[n].selected=!1)},M0=function(a){$(t,a);function t(n){var e;n===void 0&&(n=[]);for(var r=n.length-1;r>=0;r--)if(n[r].selected){to(n,n[r]);break}return e=a.call(this,n)||this,e.changing_=!1,Object.defineProperty(ie(e),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),e}var i=t.prototype;return i.addTrack=function(e){var r=this;e.selected&&to(this,e),a.prototype.addTrack.call(this,e),!!e.addEventListener&&(e.selectedChange_=function(){r.changing_||(r.changing_=!0,to(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},i.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},t}(Qi),cc=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.addTrack=function(e){var r=this;a.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return r.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return r.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);var s=["metadata","chapters"];s.indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},i.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(Qi),R0=function(){function a(i){i===void 0&&(i=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var n=0,e=i.length;n<e;n++)this.addTrackElement_(i[n])}var t=a.prototype;return t.addTrackElement_=function(n){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),this.trackElements_.indexOf(n)===-1&&this.trackElements_.push(n)},t.getTrackElementByTrack_=function(n){for(var e,r=0,s=this.trackElements_.length;r<s;r++)if(n===this.trackElements_[r].track){e=this.trackElements_[r];break}return e},t.removeTrackElement_=function(n){for(var e=0,r=this.trackElements_.length;e<r;e++)if(n===this.trackElements_[e]){this.trackElements_[e].track&&typeof this.trackElements_[e].track.off=="function"&&this.trackElements_[e].track.off(),typeof this.trackElements_[e].off=="function"&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},a}(),fc=function(){function a(i){a.prototype.setCues_.call(this,i),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=a.prototype;return t.setCues_=function(n){var e=this.length||0,r=0,s=n.length;this.cues_=n,this.length_=n.length;var o=function(l){""+l in this||Object.defineProperty(this,""+l,{get:function(){return this.cues_[l]}})};if(e<s)for(r=e;r<s;r++)o.call(this,r)},t.getCueById=function(n){for(var e=null,r=0,s=this.length;r<s;r++){var o=this[r];if(o.id===n){e=o;break}}return e},a}(),N0={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},F0={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},U0={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},hc={disabled:"disabled",hidden:"hidden",showing:"showing"},io=function(a){$(t,a);function t(i){var n;i===void 0&&(i={}),n=a.call(this)||this;var e={id:i.id||"vjs_track_"+Wt(),kind:i.kind||"",language:i.language||""},r=i.label||"",s=function(l){Object.defineProperty(ie(n),l,{get:function(){return e[l]},set:function(){}})};for(var o in e)s(o);return Object.defineProperty(ie(n),"label",{get:function(){return r},set:function(l){l!==r&&(r=l,this.trigger("labelchange"))}}),n}return t}(De),ro=function(t){var i=["protocol","hostname","port","pathname","search","hash","host"],n=G.createElement("a");n.href=t;for(var e={},r=0;r<i.length;r++)e[i[r]]=n[i[r]];return e.protocol==="http:"&&(e.host=e.host.replace(/:80$/,"")),e.protocol==="https:"&&(e.host=e.host.replace(/:443$/,"")),e.protocol||(e.protocol=w.location.protocol),e.host||(e.host=w.location.host),e},pc=function(t){if(!t.match(/^https?:\/\//)){var i=G.createElement("a");i.href=t,t=i.href}return t},no=function(t){if(typeof t=="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,n=i.exec(t);if(n)return n.pop().toLowerCase()}return""},sa=function(t,i){i===void 0&&(i=w.location);var n=ro(t),e=n.protocol===":"?i.protocol:n.protocol,r=e+n.host!==i.protocol+i.host;return r},B0=Object.freeze({__proto__:null,parseUrl:ro,getAbsoluteURL:pc,getFileExtension:no,isCrossOrigin:sa}),mc=function(t,i){var n=new w.WebVTT.Parser(w,w.vttjs,w.WebVTT.StringDecoder()),e=[];n.oncue=function(r){i.addCue(r)},n.onparsingerror=function(r){e.push(r)},n.onflush=function(){i.trigger({type:"loadeddata",target:i})},n.parse(t),e.length>0&&(w.console&&w.console.groupCollapsed&&w.console.groupCollapsed("Text Track parsing errors for "+i.src),e.forEach(function(r){return ne.error(r)}),w.console&&w.console.groupEnd&&w.console.groupEnd()),n.flush()},gc=function(t,i){var n={uri:t},e=sa(t);e&&(n.cors=e);var r=i.tech_.crossOrigin()==="use-credentials";r&&(n.withCredentials=r),Qu(n,ve(this,function(s,o,u){if(s)return ne.error(s,o);i.loaded_=!0,typeof w.WebVTT!="function"?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type==="vttjserror"){ne.error("vttjs failed to load, stopping trying to process "+i.src);return}return mc(u,i)}):mc(u,i)}))},Kr=function(a){$(t,a);function t(n){var e;if(n===void 0&&(n={}),!n.tech)throw new Error("A tech was not provided.");var r=_e(n,{kind:U0[n.kind]||"subtitles",language:n.language||n.srclang||""}),s=hc[r.mode]||"disabled",o=r.default;(r.kind==="metadata"||r.kind==="chapters")&&(s="hidden"),e=a.call(this,r)||this,e.tech_=r.tech,e.cues_=[],e.activeCues_=[],e.preload_=e.tech_.preloadTextTracks!==!1;var u=new fc(e.cues_),l=new fc(e.activeCues_),c=!1;e.timeupdateHandler=ve(ie(e),function(p){if(p===void 0&&(p={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),p.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(ie(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(y){!hc[y]||s!==y&&(s=y,!this.preload_&&s!=="disabled"&&this.cues.length===0&&gc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return l;for(var y=this.tech_.currentTime(),b=[],S=0,x=this.cues.length;S<x;S++){var A=this.cues[S];(A.startTime<=y&&A.endTime>=y||A.startTime===A.endTime&&A.startTime<=y&&A.startTime+.5>=y)&&b.push(A)}if(c=!1,b.length!==this.activeCues_.length)c=!0;else for(var O=0;O<b.length;O++)this.activeCues_.indexOf(b[O])===-1&&(c=!0);return this.activeCues_=b,l.setCues_(this.activeCues_),l},set:function(){}}}),r.src?(e.src=r.src,e.preload_||(e.loaded_=!0),(e.preload_||r.kind!=="subtitles"&&r.kind!=="captions")&&gc(e.src,ie(e))):e.loaded_=!0,e}var i=t.prototype;return i.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},i.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},i.addCue=function(e){var r=e;if(w.vttjs&&!(e instanceof w.vttjs.VTTCue)){r=new w.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var s in e)s in r||(r[s]=e[s]);r.id=e.id,r.originalCue_=e}for(var o=this.tech_.textTracks(),u=0;u<o.length;u++)o[u]!==this&&o[u].removeCue(r);this.cues_.push(r),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var r=this.cues_.length;r--;){var s=this.cues_[r];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(r,1),this.cues.setCues_(this.cues_);break}}},t}(io);Kr.prototype.allowedEvents_={cuechange:"cuechange"};var vc=function(a){$(t,a);function t(i){var n;i===void 0&&(i={});var e=_e(i,{kind:F0[i.kind]||""});n=a.call(this,e)||this;var r=!1;return Object.defineProperty(ie(n),"enabled",{get:function(){return r},set:function(o){typeof o!="boolean"||o===r||(r=o,this.trigger("enabledchange"))}}),e.enabled&&(n.enabled=e.enabled),n.loaded_=!0,n}return t}(io),_c=function(a){$(t,a);function t(i){var n;i===void 0&&(i={});var e=_e(i,{kind:N0[i.kind]||""});n=a.call(this,e)||this;var r=!1;return Object.defineProperty(ie(n),"selected",{get:function(){return r},set:function(o){typeof o!="boolean"||o===r||(r=o,this.trigger("selectedchange"))}}),e.selected&&(n.selected=e.selected),n}return t}(io),yc=0,H0=1,Tc=2,V0=3,Ji=function(a){$(t,a);function t(i){var n;i===void 0&&(i={}),n=a.call(this)||this;var e,r=new Kr(i);return n.kind=r.kind,n.src=r.src,n.srclang=r.language,n.label=r.label,n.default=r.default,Object.defineProperties(ie(n),{readyState:{get:function(){return e}},track:{get:function(){return r}}}),e=yc,r.addEventListener("loadeddata",function(){e=Tc,n.trigger({type:"load",target:ie(n)})}),n}return t}(De);Ji.prototype.allowedEvents_={load:"load"};Ji.NONE=yc;Ji.LOADING=H0;Ji.LOADED=Tc;Ji.ERROR=V0;var st={audio:{ListClass:L0,TrackClass:vc,capitalName:"Audio"},video:{ListClass:M0,TrackClass:_c,capitalName:"Video"},text:{ListClass:cc,TrackClass:Kr,capitalName:"Text"}};Object.keys(st).forEach(function(a){st[a].getterName=a+"Tracks",st[a].privateName=a+"Tracks_"});var Zi={remoteText:{ListClass:cc,TrackClass:Kr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:R0,TrackClass:Ji,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Xe=dt({},st,Zi);Zi.names=Object.keys(Zi);st.names=Object.keys(st);Xe.names=[].concat(Zi.names).concat(st.names);function j0(a,t,i,n,e){e===void 0&&(e={});var r=a.textTracks();e.kind=t,i&&(e.label=i),n&&(e.language=n),e.tech=a;var s=new Xe.text.TrackClass(e);return r.addTrack(s),s}var pe=function(a){$(t,a);function t(n,e){var r;return n===void 0&&(n={}),e===void 0&&(e=function(){}),n.reportTouchActivity=!1,r=a.call(this,null,n,e)||this,r.onDurationChange_=function(s){return r.onDurationChange(s)},r.trackProgress_=function(s){return r.trackProgress(s)},r.trackCurrentTime_=function(s){return r.trackCurrentTime(s)},r.stopTrackingCurrentTime_=function(s){return r.stopTrackingCurrentTime(s)},r.disposeSourceHandler_=function(s){return r.disposeSourceHandler(s)},r.queuedHanders_=new Set,r.hasStarted_=!1,r.on("playing",function(){this.hasStarted_=!0}),r.on("loadstart",function(){this.hasStarted_=!1}),Xe.names.forEach(function(s){var o=Xe[s];n&&n[o.getterName]&&(r[o.privateName]=n[o.getterName])}),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){n["native"+s+"Tracks"]===!1&&(r["featuresNative"+s+"Tracks"]=!1)}),n.nativeCaptions===!1||n.nativeTextTracks===!1?r.featuresNativeTextTracks=!1:(n.nativeCaptions===!0||n.nativeTextTracks===!0)&&(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.preloadTextTracks=n.preloadTextTracks!==!1,r.autoRemoteTextTracks_=new Xe.text.ListClass,r.initTrackListeners(),n.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}var i=t.prototype;return i.triggerSourceset=function(e){var r=this;this.isReady_||this.one("ready",function(){return r.setTimeout(function(){return r.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ve(this,function(){var r=this.bufferedPercent();this.bufferedPercent_!==r&&this.trigger("progress"),this.bufferedPercent_=r,r===1&&this.stopTrackingProgress()}),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return vi(0,0)},i.bufferedPercent=function(){return lc(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(st.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},i.clearTracks=function(e){var r=this;e=[].concat(e),e.forEach(function(s){for(var o=r[s+"Tracks"]()||[],u=o.length;u--;){var l=o[u];s==="text"&&r.removeRemoteTextTrack(l),o.removeTrack(l)}})},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],r=e.length;r--;){var s=e[r];this.removeRemoteTextTrack(s)}},i.reset=function(){},i.crossOrigin=function(){},i.setCrossOrigin=function(){},i.error=function(e){return e!==void 0&&(this.error_=new Ke(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?vi(0,0):vi()},i.play=function(){},i.setScrubbing=function(){},i.scrubbing=function(){},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;st.names.forEach(function(r){var s=st[r],o=function(){e.trigger(r+"trackchange")},u=e[s.getterName]();u.addEventListener("removetrack",o),u.addEventListener("addtrack",o),e.on("dispose",function(){u.removeEventListener("removetrack",o),u.removeEventListener("addtrack",o)})})},i.addWebVttScript_=function(){var e=this;if(!w.WebVTT)if(G.body.contains(this.el())){if(!this.options_["vtt.js"]&&Br(al)&&Object.keys(al).length>0){this.trigger("vttjsloaded");return}var r=G.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){e.trigger("vttjsloaded")},r.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){r.onload=null,r.onerror=null}),w.WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,r=this.textTracks(),s=this.remoteTextTracks(),o=function(p){return r.addTrack(p.track)},u=function(p){return r.removeTrack(p.track)};s.on("addtrack",o),s.on("removetrack",u),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var p=0;p<r.length;p++){var y=r[p];y.removeEventListener("cuechange",l),y.mode==="showing"&&y.addEventListener("cuechange",l)}};c(),r.addEventListener("change",c),r.addEventListener("addtrack",c),r.addEventListener("removetrack",c),this.on("dispose",function(){s.off("addtrack",o),s.off("removetrack",u),r.removeEventListener("change",c),r.removeEventListener("addtrack",c),r.removeEventListener("removetrack",c);for(var g=0;g<r.length;g++){var p=r[g];p.removeEventListener("cuechange",l)}})},i.addTextTrack=function(e,r,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return j0(this,e,r,s)},i.createRemoteTextTrack=function(e){var r=_e(e,{tech:this});return new Zi.remoteTextEl.TrackClass(r)},i.addRemoteTextTrack=function(e,r){var s=this;e===void 0&&(e={});var o=this.createRemoteTextTrack(e);return r!==!0&&r!==!1&&(ne.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),r=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),r!==!0&&this.ready(function(){return s.autoRemoteTextTracks_.addTrack(o.track)}),o},i.removeRemoteTextTrack=function(e){var r=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(r),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.requestPictureInPicture=function(){var e=this.options_.Promise||w.Promise;if(e)return e.reject()},i.disablePictureInPicture=function(){return!0},i.setDisablePictureInPicture=function(){},i.requestVideoFrameCallback=function(e){var r=this,s=Wt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(s),this.one("playing",function(){r.queuedHanders_.has(s)&&(r.queuedHanders_.delete(s),e())})):this.requestNamedAnimationFrame(s,e),s},i.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,r){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,r){if(t.techs_||(t.techs_={}),!t.isTech(r))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ce(e),t.techs_[e]=r,t.techs_[aa(e)]=r,e!=="Tech"&&t.defaultTechOrder_.push(e),r},t.getTech=function(e){if(!!e){if(t.techs_&&t.techs_[e])return t.techs_[e];if(e=Ce(e),w&&w.videojs&&w.videojs[e])return ne.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),w.videojs[e]}},t}(V);Xe.names.forEach(function(a){var t=Xe[a];pe.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}});pe.prototype.featuresVolumeControl=!0;pe.prototype.featuresMuteControl=!0;pe.prototype.featuresFullscreenResize=!1;pe.prototype.featuresPlaybackRate=!1;pe.prototype.featuresProgressEvents=!1;pe.prototype.featuresSourceset=!1;pe.prototype.featuresTimeupdateEvents=!1;pe.prototype.featuresNativeTextTracks=!1;pe.prototype.featuresVideoFrameCallback=!1;pe.withSourceHandlers=function(a){a.registerSourceHandler=function(i,n){var e=a.sourceHandlers;e||(e=a.sourceHandlers=[]),n===void 0&&(n=e.length),e.splice(n,0,i)},a.canPlayType=function(i){for(var n=a.sourceHandlers||[],e,r=0;r<n.length;r++)if(e=n[r].canPlayType(i),e)return e;return""},a.selectSourceHandler=function(i,n){for(var e=a.sourceHandlers||[],r,s=0;s<e.length;s++)if(r=e[s].canHandleSource(i,n),r)return e[s];return null},a.canPlaySource=function(i,n){var e=a.selectSourceHandler(i,n);return e?e.canHandleSource(i,n):""};var t=["seekable","seeking","duration"];t.forEach(function(i){var n=this[i];typeof n=="function"&&(this[i]=function(){return this.sourceHandler_&&this.sourceHandler_[i]?this.sourceHandler_[i].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},a.prototype),a.prototype.setSource=function(i){var n=a.selectSourceHandler(i,this.options_);n||(a.nativeSourceHandler?n=a.nativeSourceHandler:ne.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==a.nativeSourceHandler&&(this.currentSource_=i),this.sourceHandler_=n.handleSource(i,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},a.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};V.registerComponent("Tech",pe);pe.registerTech("Tech",pe);pe.defaultTechOrder_=[];var _i={},ao={},oa={};function W0(a,t){_i[a]=_i[a]||[],_i[a].push(t)}function q0(a,t,i){a.setTimeout(function(){return yi(t,_i[t.type],i,a)},1)}function G0(a,t){a.forEach(function(i){return i.setTech&&i.setTech(t)})}function z0(a,t,i){return a.reduceRight(so(i),t[i]())}function $0(a,t,i,n){return t[i](a.reduce(so(i),n))}function bc(a,t,i,n){n===void 0&&(n=null);var e="call"+Ce(i),r=a.reduce(so(e),n),s=r===oa,o=s?null:t[i](r);return Y0(a,i,o,s),o}var K0={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},X0={setCurrentTime:1,setMuted:1,setVolume:1},xc={play:1,pause:1};function so(a){return function(t,i){return t===oa?oa:i[a]?i[a](t):t}}function Y0(a,t,i,n){for(var e=a.length-1;e>=0;e--){var r=a[e];r[t]&&r[t](n,i)}}function Q0(a){ao[a.id()]=null}function J0(a,t){var i=ao[a.id()],n=null;if(i==null)return n=t(a),ao[a.id()]=[[t,n]],n;for(var e=0;e<i.length;e++){var r=i[e],s=r[0],o=r[1];s===t&&(n=o)}return n===null&&(n=t(a),i.push([t,n])),n}function yi(a,t,i,n,e,r){a===void 0&&(a={}),t===void 0&&(t=[]),e===void 0&&(e=[]),r===void 0&&(r=!1);var s=t,o=s[0],u=s.slice(1);if(typeof o=="string")yi(a,_i[o],i,n,e,r);else if(o){var l=J0(n,o);if(!l.setSource)return e.push(l),yi(a,u,i,n,e,r);l.setSource(be({},a),function(c,g){if(c)return yi(a,u,i,n,e,r);e.push(l),yi(g,a.type===g.type?u:_i[g.type],i,n,e,r)})}else u.length?yi(a,u,i,n,e,r):r?i(a,e):yi(a,_i["*"],i,n,e,!0)}var Z0={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},ua=function(t){t===void 0&&(t="");var i=no(t),n=Z0[i.toLowerCase()];return n||""},e_=function(t,i){if(!i)return"";if(t.cache_.source.src===i&&t.cache_.source.type)return t.cache_.source.type;var n=t.cache_.sources.filter(function(o){return o.src===i});if(n.length)return n[0].type;for(var e=t.$$("source"),r=0;r<e.length;r++){var s=e[r];if(s.type&&s.src&&s.src===i)return s.type}return ua(i)},t_=function a(t){if(Array.isArray(t)){var i=[];t.forEach(function(n){n=a(n),Array.isArray(n)?i=i.concat(n):Ut(n)&&i.push(n)}),t=i}else typeof t=="string"&&t.trim()?t=[Sc({src:t})]:Ut(t)&&typeof t.src=="string"&&t.src&&t.src.trim()?t=[Sc(t)]:t=[];return t};function Sc(a){if(!a.type){var t=ua(a.src);t&&(a.type=t)}return a}var i_=function(a){$(t,a);function t(i,n,e){var r,s=_e({createEl:!1},n);if(r=a.call(this,i,s,e)||this,!n.playerOptions.sources||n.playerOptions.sources.length===0)for(var o=0,u=n.playerOptions.techOrder;o<u.length;o++){var l=Ce(u[o]),c=pe.getTech(l);if(l||(c=V.getComponent(l)),c&&c.isSupported()){i.loadTech_(l);break}}else i.src(n.playerOptions.sources);return r}return t}(V);V.registerComponent("MediaLoader",i_);var la=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.options_.controlText&&r.controlText(r.options_.controlText),r.handleMouseOver_=function(s){return r.handleMouseOver(s)},r.handleMouseOut_=function(s){return r.handleMouseOut(s)},r.handleClick_=function(s){return r.handleClick(s)},r.handleKeyDown_=function(s){return r.handleKeyDown(s)},r.emitTapEvents(),r.enable(),r}var i=t.prototype;return i.createEl=function(e,r,s){e===void 0&&(e="div"),r===void 0&&(r={}),s===void 0&&(s={}),r=be({className:this.buildCSSClass(),tabIndex:0},r),e==="button"&&ne.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),s=be({role:"button"},s),this.tabIndex_=r.tabIndex;var o=oe(e,r,s);return o.appendChild(oe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},i.dispose=function(){this.controlTextEl_=null,a.prototype.dispose.call(this)},i.createControlTextEl=function(e){return this.controlTextEl_=oe("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},i.controlText=function(e,r){if(r===void 0&&(r=this.el()),e===void 0)return this.controlText_||"Need Text";var s=this.localize(e);this.controlText_=e,pi(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&r.setAttribute("title",s)},i.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},i.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_!="undefined"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},i.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_!="undefined"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},i.handleLanguagechange=function(){this.controlText(this.controlText_)},i.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},i.handleKeyDown=function(e){re.isEventKey(e,"Space")||re.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(V);V.registerComponent("ClickableComponent",la);var r_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update(),r.update_=function(s){return r.update(s)},n.on("posterchange",r.update_),r}var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update_),a.prototype.dispose.call(this)},i.createEl=function(){var e=oe("div",{className:"vjs-poster",tabIndex:-1});return e},i.update=function(e){var r=this.player().poster();this.setSrc(r),r?this.show():this.hide()},i.setSrc=function(e){var r="";e&&(r='url("'+e+'")'),this.el_.style.backgroundImage=r},i.handleClick=function(e){if(!!this.player_.controls()){var r=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((jr||Vr)&&r)&&this.player_.tech(!0).focus(),this.player_.paused()?Et(this.player_.play()):this.player_.pause()}},t}(la);V.registerComponent("PosterImage",r_);var ot="#222",Ec="#ccc",n_={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 oo(a,t){var i;if(a.length===4)i=a[1]+a[1]+a[2]+a[2]+a[3]+a[3];else if(a.length===7)i=a.slice(1);else throw new Error("Invalid color code provided, "+a+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function uo(a,t,i){try{a.style[t]=i}catch{return}}var a_=function(a){$(t,a);function t(n,e,r){var s;s=a.call(this,n,e,r)||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(ve(ie(s),function(){if(n.tech_&&n.tech_.featuresNativeTextTracks){this.hide();return}n.on("fullscreenchange",o),n.on("playerresize",o),w.addEventListener("orientationchange",o),n.on("dispose",function(){return w.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],l=0;l<u.length;l++)this.player_.addRemoteTextTrack(u[l],!0);this.preselectTrack()})),s}var i=t.prototype;return i.preselectTrack=function(){for(var e={captions:1,subtitles:1},r=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,o,u,l,c=0;c<r.length;c++){var g=r[c];s&&s.enabled&&s.language&&s.language===g.language&&g.kind in e?g.kind===s.kind?l=g:l||(l=g):s&&!s.enabled?(l=null,o=null,u=null):g.default&&(g.kind==="descriptions"&&!o?o=g:g.kind in e&&!u&&(u=g))}l?l.mode="showing":u?u.mode="showing":o&&(o.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){typeof w.WebVTT=="function"&&w.WebVTT.processCues(w,[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks(),r=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),r){for(var s=[],o=0;o<e.length;++o){var u=e[o];u.mode==="showing"&&s.push(u)}this.updateForTrack(s);return}for(var l=null,c=null,g=e.length;g--;){var p=e[g];p.mode==="showing"&&(p.kind==="descriptions"?l=p:c=p)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):l&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(l))},i.updateDisplayState=function(e){for(var r=this.player_.textTrackSettings.getValues(),s=e.activeCues,o=s.length;o--;){var u=s[o];if(!!u){var l=u.displayState;if(r.color&&(l.firstChild.style.color=r.color),r.textOpacity&&uo(l.firstChild,"color",oo(r.color||"#fff",r.textOpacity)),r.backgroundColor&&(l.firstChild.style.backgroundColor=r.backgroundColor),r.backgroundOpacity&&uo(l.firstChild,"backgroundColor",oo(r.backgroundColor||"#000",r.backgroundOpacity)),r.windowColor&&(r.windowOpacity?uo(l,"backgroundColor",oo(r.windowColor,r.windowOpacity)):l.style.backgroundColor=r.windowColor),r.edgeStyle&&(r.edgeStyle==="dropshadow"?l.firstChild.style.textShadow="2px 2px 3px "+ot+", 2px 2px 4px "+ot+", 2px 2px 5px "+ot:r.edgeStyle==="raised"?l.firstChild.style.textShadow="1px 1px "+ot+", 2px 2px "+ot+", 3px 3px "+ot:r.edgeStyle==="depressed"?l.firstChild.style.textShadow="1px 1px "+Ec+", 0 1px "+Ec+", -1px -1px "+ot+", 0 -1px "+ot:r.edgeStyle==="uniform"&&(l.firstChild.style.textShadow="0 0 4px "+ot+", 0 0 4px "+ot+", 0 0 4px "+ot+", 0 0 4px "+ot)),r.fontPercent&&r.fontPercent!==1){var c=w.parseFloat(l.style.fontSize);l.style.fontSize=c*r.fontPercent+"px",l.style.height="auto",l.style.top="auto"}r.fontFamily&&r.fontFamily!=="default"&&(r.fontFamily==="small-caps"?l.firstChild.style.fontVariant="small-caps":l.firstChild.style.fontFamily=n_[r.fontFamily])}}},i.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),!(typeof w.WebVTT!="function"||e.every(function(y){return!y.activeCues}))){for(var r=[],s=0;s<e.length;++s)for(var o=e[s],u=0;u<o.activeCues.length;++u)r.push(o.activeCues[u]);w.WebVTT.processCues(w,r,this.el_);for(var l=0;l<e.length;++l){for(var c=e[l],g=0;g<c.activeCues.length;++g){var p=c.activeCues[g].displayState;Vt(p,"vjs-text-track-cue"),Vt(p,"vjs-text-track-cue-"+(c.language?c.language:l)),c.language&&zi(p,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},t}(V);V.registerComponent("TextTrackDisplay",a_);var s_=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.createEl=function(){var e=this.player_.isAudio(),r=this.localize(e?"Audio Player":"Video Player"),s=oe("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[r])}),o=a.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(s),o},t}(V);V.registerComponent("LoadingSpinner",s_);var pt=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.createEl=function(e,r,s){r===void 0&&(r={}),s===void 0&&(s={}),e="button",r=be({className:this.buildCSSClass()},r),s=be({type:"button"},s);var o=oe(e,r,s);return o.appendChild(oe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},i.addChild=function(e,r){r===void 0&&(r={});var s=this.constructor.name;return ne.warn("Adding an actionable (user controllable) child to a Button ("+s+") is not supported; use a ClickableComponent instead."),V.prototype.addChild.call(this,e,r)},i.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},i.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},i.handleKeyDown=function(e){if(re.isEventKey(e,"Space")||re.isEventKey(e,"Enter")){e.stopPropagation();return}a.prototype.handleKeyDown.call(this,e)},t}(la);V.registerComponent("Button",pt);var Cc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.mouseused_=!1,r.on("mousedown",function(s){return r.handleMouseDown(s)}),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var r=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var s=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Et(r),this.player_.tech(!0)&&!((jr||Vr)&&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()};$r(r)?r.then(l,function(){}):this.setTimeout(l,1)},i.handleKeyDown=function(e){this.mouseused_=!1,a.prototype.handleKeyDown.call(this,e)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(pt);Cc.prototype.controlText_="Play Video";V.registerComponent("BigPlayButton",Cc);var o_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.controlText(e&&e.controlText||r.localize("Close")),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(e){re.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(pt);V.registerComponent("CloseButton",o_);var wc=function(a){$(t,a);function t(n,e){var r;return e===void 0&&(e={}),r=a.call(this,n,e)||this,e.replay=e.replay===void 0||e.replay,r.on(n,"play",function(s){return r.handlePlay(s)}),r.on(n,"pause",function(s){return r.handlePause(s)}),e.replay&&r.on(n,"ended",function(s){return r.handleEnded(s)}),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?Et(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var r=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(s){return r.handleSeeked(s)})},t}(pt);wc.prototype.controlText_="Play";V.registerComponent("PlayToggle",wc);var Pc=function(t,i){t=t<0?0:t;var n=Math.floor(t%60),e=Math.floor(t/60%60),r=Math.floor(t/3600),s=Math.floor(i/60%60),o=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(r=e=n="-"),r=r>0||o>0?r+":":"",e=((r||s>=10)&&e<10?"0"+e:e)+":",n=n<10?"0"+n:n,r+e+n},lo=Pc;function u_(a){lo=a}function l_(){lo=Pc}function er(a,t){return t===void 0&&(t=a),lo(a,t)}var tr=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on(n,["timeupdate","ended"],function(s){return r.updateContent(s)}),r.updateTextNode_(),r}var i=t.prototype;return i.createEl=function(){var e=this.buildCSSClass(),r=a.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),s=oe("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+"\xA0"},{role:"presentation"});return r.appendChild(s),this.contentEl_=oe("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),r.appendChild(this.contentEl_),r},i.dispose=function(){this.contentEl_=null,this.textNode_=null,a.prototype.dispose.call(this)},i.updateTextNode_=function(e){var r=this;e===void 0&&(e=0),e=er(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(!!r.contentEl_){var s=r.textNode_;s&&r.contentEl_.firstChild!==s&&(s=null,ne.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),r.textNode_=G.createTextNode(r.formattedTime_),!!r.textNode_&&(s?r.contentEl_.replaceChild(r.textNode_,s):r.contentEl_.appendChild(r.textNode_))}}))},i.updateContent=function(e){},t}(V);tr.prototype.labelText_="Time";tr.prototype.controlText_="Time";V.registerComponent("TimeDisplay",tr);var co=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var r;this.player_.ended()?r=this.player_.duration():r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(r)},t}(tr);co.prototype.labelText_="Current Time";co.prototype.controlText_="Current Time";V.registerComponent("CurrentTimeDisplay",co);var fo=function(a){$(t,a);function t(n,e){var r;r=a.call(this,n,e)||this;var s=function(u){return r.updateContent(u)};return r.on(n,"durationchange",s),r.on(n,"loadstart",s),r.on(n,"loadedmetadata",s),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var r=this.player_.duration();this.updateTextNode_(r)},t}(tr);fo.prototype.labelText_="Duration";fo.prototype.controlText_="Duration";V.registerComponent("DurationDisplay",fo);var d_=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),r=a.prototype.createEl.call(this,"div"),s=a.prototype.createEl.call(this,"span",{textContent:"/"});return r.appendChild(s),e.appendChild(r),e},t}(V);V.registerComponent("TimeDivider",d_);var ho=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on(n,"durationchange",function(s){return r.updateContent(s)}),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var e=a.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(oe("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},i.updateContent=function(e){if(typeof this.player_.duration()=="number"){var r;this.player_.ended()?r=0:this.player_.remainingTimeDisplay?r=this.player_.remainingTimeDisplay():r=this.player_.remainingTime(),this.updateTextNode_(r)}},t}(tr);ho.prototype.labelText_="Remaining Time";ho.prototype.controlText_="Remaining Time";V.registerComponent("RemainingTimeDisplay",ho);var c_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.updateShowing(),r.on(r.player(),"durationchange",function(s){return r.updateShowing(s)}),r}var i=t.prototype;return i.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=oe("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(oe("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+"\xA0"})),this.contentEl_.appendChild(G.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},i.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(V);V.registerComponent("LiveDisplay",c_);var kc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(s){return r.updateLiveEdgeStatus(s)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}var i=t.prototype;return i.createEl=function(){var e=a.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=oe("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},i.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"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,a.prototype.dispose.call(this)},t}(pt);kc.prototype.controlText_="Seek to live, currently playing live";V.registerComponent("SeekToLive",kc);var da=function(t,i,n){return t=Number(t),Math.min(n,Math.max(i,isNaN(t)?i:t))},po=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.handleMouseDown_=function(s){return r.handleMouseDown(s)},r.handleMouseUp_=function(s){return r.handleMouseUp(s)},r.handleKeyDown_=function(s){return r.handleKeyDown(s)},r.handleClick_=function(s){return r.handleClick(s)},r.handleMouseMove_=function(s){return r.handleMouseMove(s)},r.update_=function(s){return r.update(s)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}var i=t.prototype;return i.enabled=function(){return this.enabled_},i.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)},i.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}},i.createEl=function(e,r,s){return r===void 0&&(r={}),s===void 0&&(s={}),r.className=r.className+" vjs-slider",r=be({tabIndex:0},r),s=be({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},s),a.prototype.createEl.call(this,e,r,s)},i.handleMouseDown=function(e){var r=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Ht&&e.preventDefault(),zd(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(r,"mousemove",this.handleMouseMove_),this.on(r,"mouseup",this.handleMouseUp_),this.on(r,"touchmove",this.handleMouseMove_),this.on(r,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;$d(),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()},i.update=function(){var e=this;if(!(!this.el_||!this.bar)){var r=this.getProgress();return r===this.progress_||(this.progress_=r,this.requestNamedAnimationFrame("Slider#update",function(){var s=e.vertical()?"height":"width";e.bar.el().style[s]=(r*100).toFixed(2)+"%"})),r}},i.getProgress=function(){return Number(da(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var r=Zn(this.el_,e);return this.vertical()?r.y:r.x},i.handleKeyDown=function(e){re.isEventKey(e,"Left")||re.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):re.isEventKey(e,"Right")||re.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):a.prototype.handleKeyDown.call(this,e)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.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 mo=function(t,i){return da(t/i*100,0,100).toFixed(2)+"%"},f_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.partEls_=[],r.on(n,"progress",function(s){return r.update(s)}),r}var i=t.prototype;return i.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),r=oe("span",{className:"vjs-control-text"}),s=oe("span",{textContent:this.localize("Loaded")}),o=G.createTextNode(": ");return this.percentageEl_=oe("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(r),r.appendChild(s),r.appendChild(o),r.appendChild(this.percentageEl_),e},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,a.prototype.dispose.call(this)},i.update=function(e){var r=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var s=r.player_.liveTracker,o=r.player_.buffered(),u=s&&s.isLive()?s.seekableEnd():r.player_.duration(),l=r.player_.bufferedEnd(),c=r.partEls_,g=mo(l,u);r.percent_!==g&&(r.el_.style.width=g,pi(r.percentageEl_,g),r.percent_=g);for(var p=0;p<o.length;p++){var y=o.start(p),b=o.end(p),S=c[p];S||(S=r.el_.appendChild(oe()),c[p]=S),!(S.dataset.start===y&&S.dataset.end===b)&&(S.dataset.start=y,S.dataset.end=b,S.style.left=mo(y,l),S.style.width=mo(b-y,l))}for(var x=c.length;x>o.length;x--)r.el_.removeChild(c[x-1]);c.length=o.length})},t}(V);V.registerComponent("LoadProgressBar",f_);var h_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update=qt(ve(ie(r),r.update),ht),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,r,s){var o=qr(this.el_),u=$i(this.player_.el()),l=e.width*r;if(!(!u||!o)){var c=e.left-u.left+l,g=e.width-l+(u.right-e.right),p=o.width/2;c<p?p+=p-c:g<p&&(p=g),p<0?p=0:p>o.width&&(p=o.width),p=Math.round(p),this.el_.style.right="-"+p+"px",this.write(s)}},i.write=function(e){pi(this.el_,e)},i.updateTime=function(e,r,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(),p=g-r*g;l=(p<1?"":"-")+er(p,g)}else l=er(s,c);u.update(e,r,l),o&&o()})},t}(V);V.registerComponent("TimeTooltip",h_);var go=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update=qt(ve(ie(r),r.update),ht),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,r){var s=this.getChild("timeTooltip");if(!!s){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,r,o)}},t}(V);go.prototype.options_={children:[]};!ze&&!Bt&&go.prototype.options_.children.push("timeTooltip");V.registerComponent("PlayProgressBar",go);var Ac=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update=qt(ve(ie(r),r.update),ht),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,r){var s=this,o=r*this.player_.duration();this.getChild("timeTooltip").updateTime(e,r,o,function(){s.el_.style.left=e.width*r+"px"})},t}(V);Ac.prototype.options_={children:["timeTooltip"]};V.registerComponent("MouseTimeDisplay",Ac);var ca=5,Ic=12,vo=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.setEventHandlers_(),r}var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=ve(this,this.update),this.update=qt(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(r){return e.enableInterval_(r)},this.disableIntervalHandler_=function(r){return e.disableInterval_(r)},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_)},i.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())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ht))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(e){var r=this;if(G.visibilityState!=="hidden"){var s=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=r.player_.ended()?r.player_.duration():r.getCurrentTime_(),u=r.player_.liveTracker,l=r.player_.duration();u&&u.isLive()&&(l=r.player_.liveTracker.liveCurrentTime()),r.percent_!==s&&(r.el_.setAttribute("aria-valuenow",(s*100).toFixed(2)),r.percent_=s),(r.currentTime_!==o||r.duration_!==l)&&(r.el_.setAttribute("aria-valuetext",r.localize("progress bar timing: currentTime={1} duration={2}",[er(o,l),er(l,l)],"{1} of {2}")),r.currentTime_=o,r.duration_=l),r.bar&&r.bar.update($i(r.el()),r.getProgress())}),s}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e=this.getCurrentTime_(),r,s=this.player_.liveTracker;return s&&s.isLive()?(r=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(r=1)):r=e/this.player_.duration(),r},i.handleMouseDown=function(e){!Gr(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},i.handleMouseMove=function(e,r){if(r===void 0&&(r=!1),!!Gr(e)){!r&&!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)}},i.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},i.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},i.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?Et(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+ca)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-ca)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(e){var r=this.player_.liveTracker;if(re.isEventKey(e,"Space")||re.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(re.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(re.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),r&&r.isLive()?this.userSeek_(r.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(re(e))){e.preventDefault(),e.stopPropagation();var s=(re.codes[re(e)]-re.codes["0"])*10/100;r&&r.isLive()?this.userSeek_(r.seekableStart()+r.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else re.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-ca*Ic)):re.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+ca*Ic)):a.prototype.handleKeyDown.call(this,e)},i.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);vo.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ze&&!Bt&&vo.prototype.options_.children.splice(1,0,"mouseTimeDisplay");V.registerComponent("SeekBar",vo);var Dc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.handleMouseMove=qt(ve(ie(r),r.handleMouseMove),ht),r.throttledHandleMouseSeek=qt(ve(ie(r),r.handleMouseSeek),ht),r.handleMouseUpHandler_=function(s){return r.handleMouseUp(s)},r.handleMouseDownHandler_=function(s){return r.handleMouseDown(s)},r.enable(),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var r=this.getChild("seekBar");if(!!r){var s=r.getChild("playProgressBar"),o=r.getChild("mouseTimeDisplay");if(!(!s&&!o)){var u=r.el(),l=qr(u),c=Zn(u,e).x;c=da(c,0,1),o&&o.update(l,c),s&&s.update(l,r.getProgress())}}},i.handleMouseSeek=function(e){var r=this.getChild("seekBar");r&&r.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach(function(r){return r.disable&&r.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&&Et(this.player_.play())}},i.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)},i.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_)},i.handleMouseDown=function(e){var r=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(r,"mousemove",this.throttledHandleMouseSeek),this.on(r,"touchmove",this.throttledHandleMouseSeek),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var r=this.getChild("seekBar");r&&r.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(V);Dc.prototype.options_={children:["seekBar"]};V.registerComponent("ProgressControl",Dc);var Oc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on(n,["enterpictureinpicture","leavepictureinpicture"],function(s){return r.handlePictureInPictureChange(s)}),r.on(n,["disablepictureinpicturechanged","loadedmetadata"],function(s){return r.handlePictureInPictureEnabledChange(s)}),r.on(n,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var s=n.currentType().substring(0,5)==="audio";s||n.audioPosterMode()||n.audioOnlyMode()?(n.isInPictureInPicture()&&n.exitPictureInPicture(),r.hide()):r.show()}),r.disable(),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+a.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){G.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(pt);Oc.prototype.controlText_="Picture-in-Picture";V.registerComponent("PictureInPictureToggle",Oc);var Lc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on(n,"fullscreenchange",function(s){return r.handleFullscreenChange(s)}),G[n.fsApi_.fullscreenEnabled]===!1&&r.disable(),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(pt);Lc.prototype.controlText_="Fullscreen";V.registerComponent("FullscreenToggle",Lc);var p_=function(t,i){i.tech_&&!i.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},m_=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.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",m_);var g_=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update=qt(ve(ie(r),r.update),ht),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,r,s,o){if(!s){var u=$i(this.el_),l=$i(this.player_.el()),c=e.width*r;if(!l||!u)return;var g=e.left-l.left+c,p=e.width-c+(l.right-e.right),y=u.width/2;g<y?y+=y-g:p<y&&(y=p),y<0?y=0:y>u.width&&(y=u.width),this.el_.style.right="-"+y+"px"}this.write(o+"%")},i.write=function(e){pi(this.el_,e)},i.updateVolume=function(e,r,s,o,u){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,r,s,o.toFixed(0)),u&&u()})},t}(V);V.registerComponent("VolumeLevelTooltip",g_);var Mc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.update=qt(ve(ie(r),r.update),ht),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,r,s){var o=this,u=100*r;this.getChild("volumeLevelTooltip").updateVolume(e,r,s,u,function(){s?o.el_.style.bottom=e.height*r+"px":o.el_.style.left=e.width*r+"px"})},t}(V);Mc.prototype.options_={children:["volumeLevelTooltip"]};V.registerComponent("MouseVolumeLevelDisplay",Mc);var fa=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on("slideractive",function(s){return r.updateLastVolume_(s)}),r.on(n,"volumechange",function(s){return r.updateARIAAttributes(s)}),n.ready(function(){return r.updateARIAAttributes()}),r}var i=t.prototype;return i.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"})},i.handleMouseDown=function(e){!Gr(e)||a.prototype.handleMouseDown.call(this,e)},i.handleMouseMove=function(e){var r=this.getChild("mouseVolumeLevelDisplay");if(r){var s=this.el(),o=$i(s),u=this.vertical(),l=Zn(s,e);l=u?l.y:l.x,l=da(l,0,1),r.update(o,l,u)}!Gr(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var r=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",r),this.el_.setAttribute("aria-valuetext",r+"%")},i.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},i.updateLastVolume_=function(){var e=this,r=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(r)})},t}(po);fa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ze&&!Bt&&fa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");fa.prototype.playerEvent="volumechange";V.registerComponent("VolumeBar",fa);var Rc=function(a){$(t,a);function t(n,e){var r;return e===void 0&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar=="undefined"||Br(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),r=a.call(this,n,e)||this,p_(ie(r),n),r.throttledHandleMouseMove=qt(ve(ie(r),r.handleMouseMove),ht),r.handleMouseUpHandler_=function(s){return r.handleMouseUp(s)},r.on("mousedown",function(s){return r.handleMouseDown(s)}),r.on("touchstart",function(s){return r.handleMouseDown(s)}),r.on("mousemove",function(s){return r.handleMouseMove(s)}),r.on(r.volumeBar,["focus","slideractive"],function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")}),r.on(r.volumeBar,["blur","sliderinactive"],function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")}),r}var i=t.prototype;return i.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})},i.handleMouseDown=function(e){var r=this.el_.ownerDocument;this.on(r,"mousemove",this.throttledHandleMouseMove),this.on(r,"touchmove",this.throttledHandleMouseMove),this.on(r,"mouseup",this.handleMouseUpHandler_),this.on(r,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseMove),this.off(r,"touchmove",this.throttledHandleMouseMove),this.off(r,"mouseup",this.handleMouseUpHandler_),this.off(r,"touchend",this.handleMouseUpHandler_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(V);Rc.prototype.options_={children:["volumeBar"]};V.registerComponent("VolumeControl",Rc);var v_=function(t,i){i.tech_&&!i.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Nc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,v_(ie(r),n),r.on(n,["loadstart","volumechange"],function(s){return r.update(s)}),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var r=this.player_.volume(),s=this.player_.lastVolume_();if(r===0){var o=s<.1?.1:s;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),r=3;ze&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?r=0:e<.33?r=1:e<.67&&(r=2);for(var s=0;s<4;s++)Wr(this.el_,"vjs-vol-"+s);Vt(this.el_,"vjs-vol-"+r)},i.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0,r=e?"Unmute":"Mute";this.controlText()!==r&&this.controlText(r)},t}(pt);Nc.prototype.controlText_="Mute";V.registerComponent("MuteToggle",Nc);var Fc=function(a){$(t,a);function t(n,e){var r;return e===void 0&&(e={}),typeof e.inline!="undefined"?e.inline=e.inline:e.inline=!0,(typeof e.volumeControl=="undefined"||Br(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),r=a.call(this,n,e)||this,r.handleKeyPressHandler_=function(s){return r.handleKeyPress(s)},r.on(n,["loadstart"],function(s){return r.volumePanelState_(s)}),r.on(r.muteToggle,"keyup",function(s){return r.handleKeyPress(s)}),r.on(r.volumeControl,"keyup",function(s){return r.handleVolumeControlKeyUp(s)}),r.on("keydown",function(s){return r.handleKeyPress(s)}),r.on("mouseover",function(s){return r.handleMouseOver(s)}),r.on("mouseout",function(s){return r.handleMouseOut(s)}),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.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")},i.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})},i.dispose=function(){this.handleMouseOut(),a.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){re.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),rt(G,"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),Be(G,"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){re.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(V);Fc.prototype.options_={children:["muteToggle","volumeControl"]};V.registerComponent("VolumePanel",Fc);var Uc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,e&&(r.menuButton_=e.menuButton),r.focusedChild_=-1,r.on("keydown",function(s){return r.handleKeyDown(s)}),r.boundHandleBlur_=function(s){return r.handleBlur(s)},r.boundHandleTapClick_=function(s){return r.handleTapClick(s)},r}var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),a.prototype.removeChild.call(this,e)},i.addItem=function(e){var r=this.addChild(e);r&&this.addEventListenerForItem(r)},i.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=oe(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var r=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return r.appendChild(this.contentEl_),rt(r,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),r},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,a.prototype.dispose.call(this)},i.handleBlur=function(e){var r=e.relatedTarget||G.activeElement;if(!this.children().some(function(o){return o.el()===r})){var s=this.menuButton_;s&&s.buttonPressed_&&r!==s.el().firstChild&&s.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var r=this.children();if(!Array.isArray(r))return;var s=r.filter(function(o){return o.el()===e.target})[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},i.handleKeyDown=function(e){re.isEventKey(e,"Left")||re.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(re.isEventKey(e,"Right")||re.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){e===void 0&&(e=0);var r=this.children().slice(),s=r.length&&r[0].hasClass("vjs-menu-title");s&&r.shift(),r.length>0&&(e<0?e=0:e>=r.length&&(e=r.length-1),this.focusedChild_=e,r[e].el_.focus())},t}(V);V.registerComponent("Menu",Uc);var _o=function(a){$(t,a);function t(n,e){var r;e===void 0&&(e={}),r=a.call(this,n,e)||this,r.menuButton_=new pt(n,e),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var s=pt.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+s,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var o=function(l){return r.handleClick(l)};return r.handleMenuKeyUp_=function(u){return r.handleMenuKeyUp(u)},r.on(r.menuButton_,"tap",o),r.on(r.menuButton_,"click",o),r.on(r.menuButton_,"keydown",function(u){return r.handleKeyDown(u)}),r.on(r.menuButton_,"mouseenter",function(){r.addClass("vjs-hover"),r.menu.show(),rt(G,"keyup",r.handleMenuKeyUp_)}),r.on("mouseleave",function(u){return r.handleMouseLeave(u)}),r.on("keydown",function(u){return r.handleSubmenuKeyDown(u)}),r}var i=t.prototype;return i.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"))},i.createMenu=function(){var e=new Uc(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var r=oe("li",{className:"vjs-menu-title",textContent:Ce(this.options_.title),tabIndex:-1}),s=new V(this.player_,{el:r});e.addItem(s)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)e.addItem(this.items[o]);return e},i.createItems=function(){},i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";var r=pt.prototype.buildCSSClass();return"vjs-menu-button "+e+" "+r+" "+a.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+a.prototype.buildCSSClass.call(this)},i.controlText=function(e,r){return r===void 0&&(r=this.menuButton_.el()),this.menuButton_.controlText(e,r)},i.dispose=function(){this.handleMouseLeave(),a.prototype.dispose.call(this)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Be(G,"keyup",this.handleMenuKeyUp_)},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleKeyDown=function(e){re.isEventKey(e,"Esc")||re.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),re.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(re.isEventKey(e,"Up")||re.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},i.handleMenuKeyUp=function(e){(re.isEventKey(e,"Esc")||re.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},i.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},i.handleSubmenuKeyDown=function(e){(re.isEventKey(e,"Esc")||re.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),re.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},i.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ze&&Vd())return;this.menu.focus()}},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(V);V.registerComponent("MenuButton",_o);var yo=function(a){$(t,a);function t(i,n){var e,r=n.tracks;if(e=a.call(this,i,n)||this,e.items.length<=1&&e.hide(),!r)return ie(e);var s=ve(ie(e),e.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),r.addEventListener("labelchange",s),e.player_.on("ready",s),e.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s),r.removeEventListener("labelchange",s)}),e}return t}(_o);V.registerComponent("TrackButton",yo);var __=["Tab","Esc","Up","Down","Right","Left"],Xr=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.selectable=e.selectable,r.isSelected_=e.selected||!1,r.multiSelectable=e.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}var i=t.prototype;return i.createEl=function(e,r,s){this.nonIconControl=!0;var o=a.prototype.createEl.call(this,"li",be({className:"vjs-menu-item",tabIndex:-1},r),s);return o.replaceChild(oe("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},i.handleKeyDown=function(e){__.some(function(r){return re.isEventKey(e,r)})||a.prototype.handleKeyDown.call(this,e)},i.handleClick=function(e){this.selected(!0)},i.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(la);V.registerComponent("MenuItem",Xr);var Yr=function(a){$(t,a);function t(n,e){var r,s=e.track,o=n.textTracks();e.label=s.label||s.language||"Unknown",e.selected=s.mode==="showing",r=a.call(this,n,e)||this,r.track=s,r.kinds=(e.kinds||[e.kind||r.track.kind]).filter(Boolean);var u=function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];r.handleTracksChange.apply(ie(r),y)},l=function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];r.handleSelectedLanguageChange.apply(ie(r),y)};if(n.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",l),r.on("dispose",function(){n.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",l)}),o.onchange===void 0){var c;r.on(["tap","click"],function(){if(typeof w.Event!="object")try{c=new w.Event("change")}catch{}c||(c=G.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return r.handleTracksChange(),r}var i=t.prototype;return i.handleClick=function(e){var r=this.track,s=this.player_.textTracks();if(a.prototype.handleClick.call(this,e),!!s)for(var o=0;o<s.length;o++){var u=s[o];this.kinds.indexOf(u.kind)!==-1&&(u===r?u.mode!=="showing"&&(u.mode="showing"):u.mode!=="disabled"&&(u.mode="disabled"))}},i.handleTracksChange=function(e){var r=this.track.mode==="showing";r!==this.isSelected_&&this.selected(r)},i.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var r=this.player_.cache_.selectedLanguage;if(r&&r.enabled&&r.language===this.track.language&&r.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},i.dispose=function(){this.track=null,a.prototype.dispose.call(this)},t}(Xr);V.registerComponent("TextTrackMenuItem",Yr);var Bc=function(a){$(t,a);function t(n,e){return e.track={player:n,kind:e.kind,kinds:e.kinds,default:!1,mode:"disabled"},e.kinds||(e.kinds=[e.kind]),e.label?e.track.label=e.label:e.track.label=e.kinds.join(" and ")+" off",e.selectable=!0,e.multiSelectable=!1,a.call(this,n,e)||this}var i=t.prototype;return i.handleTracksChange=function(e){for(var r=this.player().textTracks(),s=!0,o=0,u=r.length;o<u;o++){var l=r[o];if(this.options_.kinds.indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)},i.handleSelectedLanguageChange=function(e){for(var r=this.player().textTracks(),s=!0,o=0,u=r.length;o<u;o++){var l=r[o];if(["captions","descriptions","subtitles"].indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Yr);V.registerComponent("OffTextTrackMenuItem",Bc);var ir=function(a){$(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.textTracks(),a.call(this,n,e)||this}var i=t.prototype;return i.createItems=function(e,r){e===void 0&&(e=[]),r===void 0&&(r=Yr);var s;this.label_&&(s=this.label_+" off"),e.push(new Bc(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<o.length;u++){var l=o[u];if(this.kinds_.indexOf(l.kind)>-1){var c=new r(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}(yo);V.registerComponent("TextTrackButton",ir);var Hc=function(a){$(t,a);function t(n,e){var r,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<o.endTime,r=a.call(this,n,e)||this,r.track=s,r.cue=o,r}var i=t.prototype;return i.handleClick=function(e){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},t}(Xr);V.registerComponent("ChaptersTrackMenuItem",Hc);var To=function(a){$(t,a);function t(n,e,r){var s;return s=a.call(this,n,e,r)||this,s.selectCurrentItem_=function(){s.items.forEach(function(o){o.selected(s.track_.activeCues[0]===o.cue)})},s}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildWrapperCSSClass.call(this)},i.update=function(e){if(!(e&&e.track&&e.track.kind!=="chapters")){var r=this.findChaptersTrack();r!==this.track_?(this.setTrack(r),a.prototype.update.call(this)):(!this.items||r&&r.cues&&r.cues.length!==this.items.length)&&a.prototype.update.call(this)}},i.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var r=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);r&&r.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var s=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);s&&s.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],r=e.length-1;r>=0;r--){var s=e[r];if(s.kind===this.kind_)return s}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ce(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var r=this.track_.cues;if(!r)return e;for(var s=0,o=r.length;s<o;s++){var u=r[s],l=new Hc(this.player_,{track:this.track_,cue:u});e.push(l)}return e},t}(ir);To.prototype.kind_="chapters";To.prototype.controlText_="Chapters";V.registerComponent("ChaptersButton",To);var bo=function(a){$(t,a);function t(n,e,r){var s;s=a.call(this,n,e,r)||this;var o=n.textTracks(),u=ve(ie(s),s.handleTracksChange);return o.addEventListener("change",u),s.on("dispose",function(){o.removeEventListener("change",u)}),s}var i=t.prototype;return i.handleTracksChange=function(e){for(var r=this.player().textTracks(),s=!1,o=0,u=r.length;o<u;o++){var l=r[o];if(l.kind!==this.kind_&&l.mode==="showing"){s=!0;break}}s?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ir);bo.prototype.kind_="descriptions";bo.prototype.controlText_="Descriptions";V.registerComponent("DescriptionsButton",bo);var xo=function(a){$(t,a);function t(n,e,r){return a.call(this,n,e,r)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ir);xo.prototype.kind_="subtitles";xo.prototype.controlText_="Subtitles";V.registerComponent("SubtitlesButton",xo);var So=function(a){$(t,a);function t(n,e){var r;return e.track={player:n,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",r=a.call(this,n,e)||this,r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+e.kind+" settings dialog"),r}var i=t.prototype;return i.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Yr);V.registerComponent("CaptionSettingsMenuItem",So);var Eo=function(a){$(t,a);function t(n,e,r){return a.call(this,n,e,r)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+a.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new So(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),a.prototype.createItems.call(this,e)},t}(ir);Eo.prototype.kind_="captions";Eo.prototype.controlText_="Captions";V.registerComponent("CaptionsButton",Eo);var Vc=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.createEl=function(e,r,s){var o=a.prototype.createEl.call(this,e,r,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(u.appendChild(oe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(oe("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},t}(Yr);V.registerComponent("SubsCapsMenuItem",Vc);var Co=function(a){$(t,a);function t(n,e){var r;return e===void 0&&(e={}),r=a.call(this,n,e)||this,r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(Ce(r.label_)),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new So(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=a.prototype.createItems.call(this,e,Vc),e},t}(ir);Co.prototype.kinds_=["captions","subtitles"];Co.prototype.controlText_="Subtitles";V.registerComponent("SubsCapsButton",Co);var jc=function(a){$(t,a);function t(n,e){var r,s=e.track,o=n.audioTracks();e.label=s.label||s.language||"Unknown",e.selected=s.enabled,r=a.call(this,n,e)||this,r.track=s,r.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,g=new Array(c),p=0;p<c;p++)g[p]=arguments[p];r.handleTracksChange.apply(ie(r),g)};return o.addEventListener("change",u),r.on("dispose",function(){o.removeEventListener("change",u)}),r}var i=t.prototype;return i.createEl=function(e,r,s){var o=a.prototype.createEl.call(this,e,r,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(u.appendChild(oe("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(oe("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},i.handleClick=function(e){if(a.prototype.handleClick.call(this,e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var r=this.player_.audioTracks(),s=0;s<r.length;s++){var o=r[s];o!==this.track&&(o.enabled=o===this.track)}},i.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Xr);V.registerComponent("AudioTrackMenuItem",jc);var Wc=function(a){$(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.audioTracks(),a.call(this,n,e)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+a.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var r=this.player_.audioTracks(),s=0;s<r.length;s++){var o=r[s];e.push(new jc(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return e},t}(yo);Wc.prototype.controlText_="Audio Track";V.registerComponent("AudioTrackButton",Wc);var wo=function(a){$(t,a);function t(n,e){var r,s=e.rate,o=parseFloat(s,10);return e.label=s,e.selected=o===n.playbackRate(),e.selectable=!0,e.multiSelectable=!1,r=a.call(this,n,e)||this,r.label=s,r.rate=o,r.on(n,"ratechange",function(u){return r.update(u)}),r}var i=t.prototype;return i.handleClick=function(e){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Xr);wo.prototype.contentElType="button";V.registerComponent("PlaybackRateMenuItem",wo);var qc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.menuButton_.el_.setAttribute("aria-describedby",r.labelElId_),r.updateVisibility(),r.updateLabel(),r.on(n,"loadstart",function(s){return r.updateVisibility(s)}),r.on(n,"ratechange",function(s){return r.updateLabel(s)}),r.on(n,"playbackrateschange",function(s){return r.handlePlaybackRateschange(s)}),r}var i=t.prototype;return i.createEl=function(){var e=a.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=oe("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e},i.dispose=function(){this.labelEl_=null,a.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){for(var e=this.playbackRates(),r=[],s=e.length-1;s>=0;s--)r.push(new wo(this.player(),{rate:e[s]+"x"}));return r},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var r=this.player().playbackRate(),s=this.playbackRates(),o=s.indexOf(r),u=(o+1)%s.length;this.player().playbackRate(s[u])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(_o);qc.prototype.controlText_="Playback Rate";V.registerComponent("PlaybackRateMenuButton",qc);var Gc=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},i.createEl=function(e,r,s){return e===void 0&&(e="div"),r===void 0&&(r={}),s===void 0&&(s={}),r.className||(r.className=this.buildCSSClass()),a.prototype.createEl.call(this,e,r,s)},t}(V);V.registerComponent("Spacer",Gc);var y_=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:"\xA0"})},t}(Gc);V.registerComponent("CustomControlSpacer",y_);var ha=function(a){$(t,a);function t(){return a.apply(this,arguments)||this}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(V);ha.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in G&&ha.prototype.options_.children.splice(ha.prototype.options_.children.length-1,0,"pictureInPictureToggle");V.registerComponent("ControlBar",ha);var zc=function(a){$(t,a);function t(n,e){var r;return r=a.call(this,n,e)||this,r.on(n,"error",function(s){return r.open(s)}),r}var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Yi);zc.prototype.options_=dt({},Yi.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});V.registerComponent("ErrorDisplay",zc);var Po="vjs-text-track-settings",$c=["#000","Black"],Kc=["#00F","Blue"],Xc=["#0FF","Cyan"],Yc=["#0F0","Green"],Qc=["#F0F","Magenta"],Jc=["#F00","Red"],Zc=["#FFF","White"],ef=["#FF0","Yellow"],ko=["1","Opaque"],Ao=["0.5","Semi-Transparent"],tf=["0","Transparent"],Ti={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[$c,Zc,Jc,Yc,Kc,ef,Qc,Xc]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ko,Ao,tf]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Zc,$c,Jc,Yc,Kc,ef,Qc,Xc]},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:[ko,Ao]},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:[tf,Ao,ko]}};Ti.windowColor.options=Ti.backgroundColor.options;function rf(a,t){if(t&&(a=t(a)),a&&a!=="none")return a}function T_(a,t){var i=a.options[a.options.selectedIndex].value;return rf(i,t)}function b_(a,t,i){if(!!t){for(var n=0;n<a.options.length;n++)if(rf(a.options[n].value,i)===t){a.selectedIndex=n;break}}}var x_=function(a){$(t,a);function t(n,e){var r;return e.temporary=!1,r=a.call(this,n,e)||this,r.updateDisplay=r.updateDisplay.bind(ie(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=oe("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),e.persistTextTrackSettings===void 0&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",function(){r.saveSettings(),r.close()}),r.on(r.$(".vjs-default-button"),"click",function(){r.setDefaults(),r.updateDisplay()}),ji(Ti,function(s){r.on(r.$(s.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}var i=t.prototype;return i.dispose=function(){this.endDialog=null,a.prototype.dispose.call(this)},i.createElSelect_=function(e,r,s){var o=this;r===void 0&&(r=""),s===void 0&&(s="label");var u=Ti[e],l=u.id.replace("%s",this.id_),c=[r,l].join(" ").trim();return["<"+s+' id="'+l+'" class="'+(s==="label"?"vjs-label":"")+'">',this.localize(u.label),"</"+s+">",'<select aria-labelledby="'+c+'">'].concat(u.options.map(function(g){var p=l+"-"+g[1].replace(/\W+/g,"");return['<option id="'+p+'" value="'+g[0]+'" ','aria-labelledby="'+c+" "+p+'">',o.localize(g[1]),"</option>"].join("")})).concat("</select>").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},i.createElColors_=function(){return oe("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return oe("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return oe("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e=this;return d0(Ti,function(r,s,o){var u=T_(e.$(s.selector),s.parser);return u!==void 0&&(r[o]=u),r},{})},i.setValues=function(e){var r=this;ji(Ti,function(s,o){b_(r.$(s.selector),e[o],s.parser)})},i.setDefaults=function(){var e=this;ji(Ti,function(r){var s=r.hasOwnProperty("default")?r.default:0;e.$(r.selector).selectedIndex=s})},i.restoreSettings=function(){var e;try{e=JSON.parse(w.localStorage.getItem(Po))}catch(r){ne.warn(r)}e&&this.setValues(e)},i.saveSettings=function(){if(!!this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?w.localStorage.setItem(Po,JSON.stringify(e)):w.localStorage.removeItem(Po)}catch(r){ne.warn(r)}}},i.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},i.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,r=e&&e.subsCapsButton,s=e&&e.captionsButton;r?r.focus():s&&s.focus()},t}(Yi);V.registerComponent("TextTrackSettings",x_);var S_=function(a){$(t,a);function t(n,e){var r,s=e.ResizeObserver||w.ResizeObserver;e.ResizeObserver===null&&(s=!1);var o=_e({createEl:!s,reportTouchActivity:!1},e);return r=a.call(this,n,o)||this,r.ResizeObserver=e.ResizeObserver||w.ResizeObserver,r.loadListener_=null,r.resizeObserver_=null,r.debouncedHandler_=b0(function(){r.resizeHandler()},100,!1,ie(r)),s?(r.resizeObserver_=new r.ResizeObserver(r.debouncedHandler_),r.resizeObserver_.observe(n.el())):(r.loadListener_=function(){if(!(!r.el_||!r.el_.contentWindow)){var u=r.debouncedHandler_,l=r.unloadListener_=function(){Be(this,"resize",u),Be(this,"unload",l),l=null};rt(r.el_.contentWindow,"unload",l),rt(r.el_.contentWindow,"resize",u)}},r.one("load",r.loadListener_)),r}var i=t.prototype;return i.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},i.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},i.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",S_);var E_={trackingThreshold:20,liveTolerance:15},C_=function(a){$(t,a);function t(n,e){var r,s=_e(E_,e,{createEl:!1});return r=a.call(this,n,s)||this,r.handleVisibilityChange_=function(o){return r.handleVisibilityChange(o)},r.trackLiveHandler_=function(){return r.trackLive_()},r.handlePlay_=function(o){return r.handlePlay(o)},r.handleFirstTimeupdate_=function(o){return r.handleFirstTimeupdate(o)},r.handleSeeked_=function(o){return r.handleSeeked(o)},r.seekToLiveEdge_=function(o){return r.seekToLiveEdge(o)},r.reset_(),r.on(r.player_,"durationchange",function(o){return r.handleDurationchange(o)}),r.on(r.player_,"canplay",function(){return r.toggleTracking()}),jr&&"hidden"in G&&"visibilityState"in G&&r.on(G,"visibilitychange",r.handleVisibilityChange_),r}var i=t.prototype;return i.handleVisibilityChange=function(){this.player_.duration()===1/0&&(G.hidden?this.stopTracking():this.startTracking())},i.trackLive_=function(){var e=this.player_.seekable();if(!(!e||!e.length)){var r=Number(w.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(r-this.lastTime_)/1e3;this.lastTime_=r,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"))}},i.handleDurationchange=function(){this.toggleTracking()},i.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())},i.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_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.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_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),r=[],s=e?e.length:0;s--;)r.push(e.end(s));return r.length?r.sort()[r.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),r=[],s=e?e.length:0;s--;)r.push(e.start(s));return r.length?r.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return typeof this.trackingInterval_=="number"},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(G,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),a.prototype.dispose.call(this)},t}(V);V.registerComponent("LiveTracker",C_);var Io=function(t){var i=t.el();if(i.hasAttribute("src"))return t.triggerSourceset(i.src),!0;var n=t.$$("source"),e=[],r="";if(!n.length)return!1;for(var s=0;s<n.length;s++){var o=n[s].src;o&&e.indexOf(o)===-1&&e.push(o)}return e.length?(e.length===1&&(r=e[0]),t.triggerSourceset(r),!0):!1},w_=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var i=G.createElement(this.nodeName.toLowerCase());i.innerHTML=t;for(var n=G.createDocumentFragment();i.childNodes.length;)n.appendChild(i.childNodes[0]);return this.innerText="",w.Element.prototype.appendChild.call(this,n),this.innerHTML}}),nf=function(t,i){for(var n={},e=0;e<t.length&&(n=Object.getOwnPropertyDescriptor(t[e],i),!(n&&n.set&&n.get));e++);return n.enumerable=!0,n.configurable=!0,n},P_=function(t){return nf([t.el(),w.HTMLMediaElement.prototype,w.Element.prototype,w_],"innerHTML")},af=function(t){var i=t.el();if(!i.resetSourceWatch_){var n={},e=P_(t),r=function(o){return function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];var g=o.apply(i,l);return Io(t),g}};["append","appendChild","insertAdjacentHTML"].forEach(function(s){!i[s]||(n[s]=i[s],i[s]=r(n[s]))}),Object.defineProperty(i,"innerHTML",_e(e,{set:r(e.set)})),i.resetSourceWatch_=function(){i.resetSourceWatch_=null,Object.keys(n).forEach(function(s){i[s]=n[s]}),Object.defineProperty(i,"innerHTML",e)},t.one("sourceset",i.resetSourceWatch_)}},k_=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?pc(w.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return w.Element.prototype.setAttribute.call(this,"src",t),t}}),A_=function(t){return nf([t.el(),w.HTMLMediaElement.prototype,k_],"src")},I_=function(t){if(!!t.featuresSourceset){var i=t.el();if(!i.resetSourceset_){var n=A_(t),e=i.setAttribute,r=i.load;Object.defineProperty(i,"src",_e(n,{set:function(o){var u=n.set.call(i,o);return t.triggerSourceset(i.src),u}})),i.setAttribute=function(s,o){var u=e.call(i,s,o);return/src/i.test(s)&&t.triggerSourceset(i.src),u},i.load=function(){var s=r.call(i);return Io(t)||(t.triggerSourceset(""),af(t)),s},i.currentSrc?t.triggerSourceset(i.currentSrc):Io(t)||af(t),i.resetSourceset_=function(){i.resetSourceset_=null,i.load=r,i.setAttribute=e,Object.defineProperty(i,"src",n),i.resetSourceWatch_&&i.resetSourceWatch_()}}}},Do=function(t,i,n,e){e===void 0&&(e=!0);var r=function(u){return Object.defineProperty(t,i,{value:u,enumerable:!0,writable:!0})},s={configurable:!0,enumerable:!0,get:function(){var u=n();return r(u),u}};return e&&(s.set=r),Object.defineProperty(t,i,s)},X=function(a){$(t,a);function t(n,e){var r;r=a.call(this,n,e)||this;var s=n.source,o=!1;if(r.featuresVideoFrameCallback=r.featuresVideoFrameCallback&&r.el_.tagName==="VIDEO",s&&(r.el_.currentSrc!==s.src||n.tag&&n.tag.initNetworkState_===3)?r.setSource(s):r.handleLateInit_(r.el_),n.enableSourceset&&r.setupSourcesetHandling_(),r.isScrubbing_=!1,r.el_.hasChildNodes()){for(var u=r.el_.childNodes,l=u.length,c=[];l--;){var g=u[l],p=g.nodeName.toLowerCase();p==="track"&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(g),r.remoteTextTracks().addTrack(g.track),r.textTracks().addTrack(g.track),!o&&!r.el_.hasAttribute("crossorigin")&&sa(g.src)&&(o=!0)):c.push(g))}for(var y=0;y<c.length;y++)r.el_.removeChild(c[y])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&o&&ne.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
  33. This may prevent text tracks from loading.`),r.restoreMetadataTracksInIOSNativePlayer_(),(Wi||Bs||Rd)&&n.nativeControlsForTouch===!0&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}var i=t.prototype;return i.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,a.prototype.dispose.call(this)},i.setupSourcesetHandling_=function(){I_(this)},i.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),r,s=function(){r=[];for(var l=0;l<e.length;l++){var c=e[l];c.kind==="metadata"&&r.push({track:c,storedMode:c.mode})}};s(),e.addEventListener("change",s),this.on("dispose",function(){return e.removeEventListener("change",s)});var o=function u(){for(var l=0;l<r.length;l++){var c=r[l];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}e.removeEventListener("change",u)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",s),e.removeEventListener("change",o),e.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",o)})},i.overrideNative_=function(e,r){var s=this;if(r===this["featuresNative"+e+"Tracks"]){var o=e.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(u){var l=s.el()[o+"Tracks"];l.removeEventListener(u,s[o+"TracksListeners_"][u])}),this["featuresNative"+e+"Tracks"]=!r,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},i.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},i.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},i.proxyNativeTracksForType_=function(e){var r=this,s=st[e],o=this.el()[s.getterName],u=this[s.getterName]();if(!(!this["featuresNative"+s.capitalName+"Tracks"]||!o||!o.addEventListener)){var l={change:function(p){var y={type:"change",target:u,currentTarget:u,srcElement:u};u.trigger(y),e==="text"&&r[Zi.remoteText.getterName]().trigger(y)},addtrack:function(p){u.addTrack(p.track)},removetrack:function(p){u.removeTrack(p.track)}},c=function(){for(var p=[],y=0;y<u.length;y++){for(var b=!1,S=0;S<o.length;S++)if(o[S]===u[y]){b=!0;break}b||p.push(u[y])}for(;p.length;)u.removeTrack(p.shift())};this[s.getterName+"Listeners_"]=l,Object.keys(l).forEach(function(g){var p=l[g];o.addEventListener(g,p),r.on("dispose",function(y){return o.removeEventListener(g,p)})}),this.on("loadstart",c),this.on("dispose",function(g){return r.off("loadstart",c)})}},i.proxyNativeTracks_=function(){var e=this;st.names.forEach(function(r){e.proxyNativeTracksForType_(r)})},i.createEl=function(){var e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){var r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),t.disposeMediaElement(e),e=r}else{e=G.createElement("video");var s=this.options_.tag&&jt(this.options_.tag),o=_e({},s);(!Wi||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,qd(e,be(o,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload!="undefined"&&zi(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var u=["loop","muted","playsinline","autoplay"],l=0;l<u.length;l++){var c=u[l],g=this.options_[c];typeof g!="undefined"&&(g?zi(e,c,c):Jn(e,c),e[c]=g)}return e},i.handleLateInit_=function(e){if(!(e.networkState===0||e.networkState===3)){if(e.readyState===0){var r=!1,s=function(){r=!0};this.on("loadstart",s);var o=function(){r||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",o),r||this.trigger("loadstart")});return}var u=["loadstart"];u.push("loadedmetadata"),e.readyState>=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)})}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Qn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(r){ne(r,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&Bt&&Ht&&this.el_.currentTime===0){var r=function s(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",s))};return this.on("timeupdate",r),NaN}return this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var r=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",r),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",s),this.on("dispose",function(){e.off("webkitbeginfullscreen",s),e.off("webkitendfullscreen",r)})}},i.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=w.navigator&&w.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Et(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},0);else try{e.webkitEnterFullScreen()}catch(r){this.trigger("fullscreenerror",r)}},i.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):a.prototype.requestVideoFrameCallback.call(this,e)},i.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):a.prototype.cancelVideoFrameCallback.call(this,e)},i.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(e,r,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,r,s):a.prototype.addTextTrack.call(this,e,r,s)},i.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,e);var r=G.createElement("track");return e.kind&&(r.kind=e.kind),e.label&&(r.label=e.label),(e.language||e.srclang)&&(r.srclang=e.language||e.srclang),e.default&&(r.default=e.default),e.id&&(r.id=e.id),e.src&&(r.src=e.src),r},i.addRemoteTextTrack=function(e,r){var s=a.prototype.addRemoteTextTrack.call(this,e,r);return this.featuresNativeTextTracks&&this.el().appendChild(s),s},i.removeRemoteTextTrack=function(e){if(a.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var r=this.$$("track"),s=r.length;s--;)(e===r[s]||e===r[s].track)&&this.el().removeChild(r[s])},i.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount!="undefined"&&typeof this.el().webkitDecodedFrameCount!="undefined"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),w.performance&&typeof w.performance.now=="function"?e.creationTime=w.performance.now():w.performance&&w.performance.timing&&typeof w.performance.timing.navigationStart=="number"&&(e.creationTime=w.Date.now()-w.performance.timing.navigationStart),e},t}(pe);Do(X,"TEST_VID",function(){if(!!qi()){var a=G.createElement("video"),t=G.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",a.appendChild(t),a}});X.isSupported=function(){try{X.TEST_VID.volume=.5}catch{return!1}return!!(X.TEST_VID&&X.TEST_VID.canPlayType)};X.canPlayType=function(a){return X.TEST_VID.canPlayType(a)};X.canPlaySource=function(a,t){return X.canPlayType(a.type)};X.canControlVolume=function(){try{var a=X.TEST_VID.volume;X.TEST_VID.volume=a/2+.1;var t=a!==X.TEST_VID.volume;return t&&ze?(w.setTimeout(function(){X&&X.prototype&&(X.prototype.featuresVolumeControl=a!==X.TEST_VID.volume)}),!1):t}catch{return!1}};X.canMuteVolume=function(){try{var a=X.TEST_VID.muted;return X.TEST_VID.muted=!a,X.TEST_VID.muted?zi(X.TEST_VID,"muted","muted"):Jn(X.TEST_VID,"muted","muted"),a!==X.TEST_VID.muted}catch{return!1}};X.canControlPlaybackRate=function(){if(Bt&&Ht&&Fd<58)return!1;try{var a=X.TEST_VID.playbackRate;return X.TEST_VID.playbackRate=a/2+.1,a!==X.TEST_VID.playbackRate}catch{return!1}};X.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};X.supportsNativeTextTracks=function(){return Qn||ze&&Ht};X.supportsNativeVideoTracks=function(){return!!(X.TEST_VID&&X.TEST_VID.videoTracks)};X.supportsNativeAudioTracks=function(){return!!(X.TEST_VID&&X.TEST_VID.audioTracks)};X.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],i=a[1];Do(X.prototype,t,function(){return X[i]()},!0)});X.prototype.featuresVolumeControl=X.canControlVolume();X.prototype.movingMediaElementInDOM=!ze;X.prototype.featuresFullscreenResize=!0;X.prototype.featuresProgressEvents=!0;X.prototype.featuresTimeupdateEvents=!0;X.prototype.featuresVideoFrameCallback=!!(X.TEST_VID&&X.TEST_VID.requestVideoFrameCallback);var pa;X.patchCanPlayType=function(){Ns>=4&&!Nd&&!Ht&&(pa=X.TEST_VID&&X.TEST_VID.constructor.prototype.canPlayType,X.TEST_VID.constructor.prototype.canPlayType=function(a){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return a&&t.test(a)?"maybe":pa.call(this,a)})};X.unpatchCanPlayType=function(){var a=X.TEST_VID.constructor.prototype.canPlayType;return pa&&(X.TEST_VID.constructor.prototype.canPlayType=pa),a};X.patchCanPlayType();X.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{}}()}};X.resetMediaElement=function(a){if(!!a){for(var t=a.querySelectorAll("source"),i=t.length;i--;)a.removeChild(t[i]);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(a){X.prototype[a]=function(){return this.el_[a]||this.el_.hasAttribute(a)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){X.prototype["set"+Ce(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){X.prototype[a]=function(){return this.el_[a]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(a){X.prototype["set"+Ce(a)]=function(t){this.el_[a]=t}});["pause","load","play"].forEach(function(a){X.prototype[a]=function(){return this.el_[a]()}});pe.withSourceHandlers(X);X.nativeSourceHandler={};X.nativeSourceHandler.canPlayType=function(a){try{return X.TEST_VID.canPlayType(a)}catch{return""}};X.nativeSourceHandler.canHandleSource=function(a,t){if(a.type)return X.nativeSourceHandler.canPlayType(a.type);if(a.src){var i=no(a.src);return X.nativeSourceHandler.canPlayType("video/"+i)}return""};X.nativeSourceHandler.handleSource=function(a,t,i){t.setSrc(a.src)};X.nativeSourceHandler.dispose=function(){};X.registerSourceHandler(X.nativeSourceHandler);pe.registerTech("Html5",X);var sf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Oo={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Lo=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};Lo.forEach(function(a){var t=a.charAt(0)==="x"?"x-"+a.substring(1):a;ma[a]="vjs-layout-"+t});var D_={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},we=function(a){$(t,a);function t(n,e,r){var s;if(n.id=n.id||e.id||"vjs_video_"+Wt(),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(jt(u).hasOwnProperty("lang")){e.language=u.getAttribute("lang");break}u=u.parentNode}if(s=a.call(this,null,e,r)||this,s.boundDocumentFullscreenChange_=function(p){return s.documentFullscreenChange_(p)},s.boundFullWindowOnEscKey_=function(p){return s.fullWindowOnEscKey(p)},s.boundUpdateStyleEl_=function(p){return s.updateStyleEl_(p)},s.boundApplyInitTime_=function(p){return s.applyInitTime_(p)},s.boundUpdateCurrentBreakpoint_=function(p){return s.updateCurrentBreakpoint_(p)},s.boundHandleTechClick_=function(p){return s.handleTechClick_(p)},s.boundHandleTechDoubleClick_=function(p){return s.handleTechDoubleClick_(p)},s.boundHandleTechTouchStart_=function(p){return s.handleTechTouchStart_(p)},s.boundHandleTechTouchMove_=function(p){return s.handleTechTouchMove_(p)},s.boundHandleTechTouchEnd_=function(p){return s.handleTechTouchEnd_(p)},s.boundHandleTechTap_=function(p){return s.handleTechTap_(p)},s.isFullscreen_=!1,s.log=Dd(s.id_),s.fsApi_=$n,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&&jt(n),s.language(s.options_.language),e.languages){var l={};Object.getOwnPropertyNames(e.languages).forEach(function(p){l[p.toLowerCase()]=e.languages[p]}),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(p){if(typeof s[p]!="function")throw new Error('plugin "'+p+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),Xs(ie(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(rt(G,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var c=_e(s.options_);e.plugins&&Object.keys(e.plugins).forEach(function(p){s[p](e.plugins[p])}),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"),Wi&&s.addClass("vjs-touch-enabled"),ze||s.addClass("vjs-workinghover"),t.players[s.id_]=ie(s);var g=Pd.split(".")[0];return s.addClass("vjs-v"+g),s.userActive(!0),s.reportUserActivity(),s.one("play",function(p){return s.listenForUserActivity_(p)}),s.on("stageclick",function(p){return s.handleStageClick_(p)}),s.on("keydown",function(p){return s.handleKeyDown(p)}),s.on("languagechange",function(p){return s.handleLanguagechange(p)}),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 i=t.prototype;return i.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Be(G,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Be(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),Q0(this),Xe.names.forEach(function(r){var s=Xe[r],o=e[s.getterName]();o&&o.off&&o.off()}),a.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},i.createEl=function(){var e=this.tag,r,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";s?r=this.el_=e.parentNode:o||(r=this.el_=a.prototype.createEl.call(this,"div"));var u=jt(e);if(o){for(r=this.el_=e,e=this.tag=G.createElement("video");r.children.length;)e.appendChild(r.firstChild);mi(r,"video-js")||Vt(r,"video-js"),r.appendChild(e),s=this.playerElIngest_=r,Object.keys(r).forEach(function(b){try{e[b]=r[b]}catch{}})}if(e.setAttribute("tabindex","-1"),u.tabindex="-1",(jr||Ht&&Ud)&&(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"||r.setAttribute(b,u[b]),o&&e.setAttribute(b,u[b])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=r.player=this,this.addClass("vjs-paused"),w.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=ec("vjs-styles-dimensions");var l=ti(".vjs-styles-defaults"),c=ti("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"),p=0;p<g.length;p++){var y=g.item(p);Vt(y,"vjs-hidden"),y.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(r,e),Hs(e,r),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=r,r},i.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");if(e!=="anonymous"&&e!=="use-credentials"){ne.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"');return}this.techCall_("setCrossOrigin",e)},i.width=function(e){return this.dimension("width",e)},i.height=function(e){return this.dimension("height",e)},i.dimension=function(e,r){var s=e+"_";if(r===void 0)return this[s]||0;if(r===""||r==="auto"){this[s]=void 0,this.updateStyleEl_();return}var o=parseFloat(r);if(isNaN(o)){ne.error('Improper value "'+r+'" supplied for for '+e);return}this[s]=o,this.updateStyleEl_()},i.fluid=function(e){var r=this;if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Gt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),x0(this,function(){r.on(["playerreset","resize"],r.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},i.fill=function(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},i.aspectRatio=function(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},i.updateStyleEl_=function(){if(w.VIDEOJS_NO_DYNAMIC_STYLE===!0){var e=typeof this.width_=="number"?this.width_:this.options_.width,r=typeof this.height_=="number"?this.height_:this.options_.height,s=this.tech_&&this.tech_.el();s&&(e>=0&&(s.width=e),r>=0&&(s.height=r));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(":"),p=g[1]/g[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/p:o=this.videoWidth()||300,this.height_!==void 0?u=this.height_:u=o*p,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),tc(this.styleEl_,`
  34. .`+c+` {
  35. width: `+o+`px;
  36. height: `+u+`px;
  37. }
  38. .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
  39. padding-top: `+p*100+`%;
  40. }
  41. `)},i.loadTech_=function(e,r){var s=this;this.tech_&&this.unloadTech_();var o=Ce(e),u=e.charAt(0).toLowerCase()+e.slice(1);o!=="Html5"&&this.tag&&(pe.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:r,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};Xe.names.forEach(function(p){var y=Xe[p];c[y.getterName]=s[y.privateName]}),be(c,this.options_[o]),be(c,this.options_[u]),be(c,this.options_[e.toLowerCase()]),this.tag&&(c.tag=this.tag),r&&r.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var g=pe.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(ve(this,this.handleTechReady_),!0),dc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),sf.forEach(function(p){s.on(s.tech_,p,function(y){return s["handleTech"+Ce(p)+"_"](y)})}),Object.keys(Oo).forEach(function(p){s.on(s.tech_,p,function(y){if(s.tech_.playbackRate()===0&&s.tech_.seeking()){s.queuedCallbacks_.push({callback:s["handleTech"+Oo[p]+"_"].bind(s),event:y});return}s["handleTech"+Oo[p]+"_"](y)})}),this.on(this.tech_,"loadstart",function(p){return s.handleTechLoadStart_(p)}),this.on(this.tech_,"sourceset",function(p){return s.handleTechSourceset_(p)}),this.on(this.tech_,"waiting",function(p){return s.handleTechWaiting_(p)}),this.on(this.tech_,"ended",function(p){return s.handleTechEnded_(p)}),this.on(this.tech_,"seeking",function(p){return s.handleTechSeeking_(p)}),this.on(this.tech_,"play",function(p){return s.handleTechPlay_(p)}),this.on(this.tech_,"firstplay",function(p){return s.handleTechFirstPlay_(p)}),this.on(this.tech_,"pause",function(p){return s.handleTechPause_(p)}),this.on(this.tech_,"durationchange",function(p){return s.handleTechDurationChange_(p)}),this.on(this.tech_,"fullscreenchange",function(p,y){return s.handleTechFullscreenChange_(p,y)}),this.on(this.tech_,"fullscreenerror",function(p,y){return s.handleTechFullscreenError_(p,y)}),this.on(this.tech_,"enterpictureinpicture",function(p){return s.handleTechEnterPictureInPicture_(p)}),this.on(this.tech_,"leavepictureinpicture",function(p){return s.handleTechLeavePictureInPicture_(p)}),this.on(this.tech_,"error",function(p){return s.handleTechError_(p)}),this.on(this.tech_,"posterchange",function(p){return s.handleTechPosterChange_(p)}),this.on(this.tech_,"textdata",function(p){return s.handleTechTextData_(p)}),this.on(this.tech_,"ratechange",function(p){return s.handleTechRateChange_(p)}),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)&&Hs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},i.unloadTech_=function(){var e=this;Xe.names.forEach(function(r){var s=Xe[r];e[s.privateName]=e[s.getterName]()}),this.textTracksJson_=dc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},i.tech=function(e){return e===void 0&&ne.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
  42. See https://github.com/videojs/video.js/issues/2617 for more info.
  43. `),this.tech_},i.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_)},i.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_)},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},i.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())},i.manualAutoplay_=function(e){var r=this;if(!(!this.tech_||typeof e!="string")){var s=function(){var l=r.muted();r.muted(!0);var c=function(){r.muted(l)};r.playTerminatedQueue_.push(c);var g=r.play();if(!!$r(g))return g.catch(function(p){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(p||""))})},o;if(e==="any"&&!this.muted()?(o=this.play(),$r(o)&&(o=o.catch(s))):e==="muted"&&!this.muted()?o=s():o=this.play(),!!$r(o))return o.then(function(){r.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){r.trigger({type:"autoplay-failure",autoplay:e})})}},i.updateSourceCaches_=function(e){e===void 0&&(e="");var r=e,s="";typeof r!="string"&&(r=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],r&&!s&&(s=e_(this,r)),this.cache_.source=_e({},e,{src:r,type:s});for(var o=this.cache_.sources.filter(function(y){return y.src&&y.src===r}),u=[],l=this.$$("source"),c=[],g=0;g<l.length;g++){var p=jt(l[g]);u.push(p),p.src&&p.src===r&&c.push(p.src)}c.length&&!o.length?this.cache_.sources=u:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=r},i.handleTechSourceset_=function(e){var r=this;if(!this.changingSrc_){var s=function(c){return r.updateSourceCaches_(c)},o=this.currentSource().src,u=e.src;o&&!/^blob:/.test(o)&&/^blob:/.test(u)&&(!this.lastSource_||this.lastSource_.tech!==u&&this.lastSource_.player!==o)&&(s=function(){}),s(u),e.src||this.tech_.any(["sourceset","loadstart"],function(l){if(l.type!=="sourceset"){var c=r.techGet("currentSrc");r.lastSource_.tech=c,r.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},i.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},i.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},i.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&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")},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var r=this.currentTime(),s=function o(){r!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))};this.on("timeupdate",s)},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},i.handleTechFirstPlay_=function(){this.options_.starttime&&(ne.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")},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},i.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")},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},i.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()?Et(this.play()):this.pause())},i.handleTechDoubleClick_=function(e){if(!!this.controls_){var r=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(s){return s.contains(e.target)});r||(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())}},i.handleTechTap_=function(){this.userActive(!this.userActive())},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},i.handleStageClick_=function(){this.reportUserActivity()},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},i.documentFullscreenChange_=function(e){var r=e.target.player;if(!(r&&r!==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)}},i.handleTechFullscreenChange_=function(e,r){var s=this;r&&(r.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){s.removeClass("vjs-ios-native-fs")})),this.isFullscreen(r.isFullscreen))},i.handleTechFullscreenError_=function(e,r){this.trigger("fullscreenerror",r)},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},i.handleTechError_=function(){var e=this.tech_.error();this.error(e)},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},i.getCache=function(){return this.cache_},i.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}},i.techCall_=function(e,r){this.ready(function(){if(e in X0)return $0(this.middleware_,this.tech_,e,r);if(e in xc)return bc(this.middleware_,this.tech_,e,r);try{this.tech_&&this.tech_[e](r)}catch(s){throw ne(s),s}},!0)},i.techGet_=function(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in K0)return z0(this.middleware_,this.tech_,e);if(e in xc)return bc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(r){throw this.tech_[e]===void 0?(ne("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",r),r):r.name==="TypeError"?(ne("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",r),this.tech_.isReady_=!1,r):(ne(r),r)}}},i.play=function(){var e=this,r=this.options_.Promise||w.Promise;return r?new r(function(s){e.play_(s)}):this.play_()},i.play_=function(e){var r=this;e===void 0&&(e=Et),this.playCallbacks_.push(e);var s=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!s){this.waitToPlay_=function(u){r.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!s&&(Qn||ze)&&this.load();return}var o=this.techGet_("play");o===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(r){r()})},i.runPlayCallbacks_=function(e){var r=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],r.forEach(function(s){s(e)})},i.pause=function(){this.techCall_("pause")},i.paused=function(){return this.techGet_("paused")!==!1},i.played=function(){return this.techGet_("played")||vi(0,0)},i.scrubbing=function(e){if(typeof e=="undefined")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},i.currentTime=function(e){if(typeof e!="undefined"){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},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},i.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"))},i.remainingTime=function(){return this.duration()-this.currentTime()},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},i.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=vi(0,0)),e},i.bufferedPercent=function(){return lc(this.buffered(),this.duration())},i.bufferedEnd=function(){var e=this.buffered(),r=this.duration(),s=e.end(e.length-1);return s>r&&(s=r),s},i.volume=function(e){var r;if(e!==void 0){r=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=r,this.techCall_("setVolume",r),r>0&&this.lastVolume_(r);return}return r=parseFloat(this.techGet_("volume")),isNaN(r)?1:r},i.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},i.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},i.lastVolume_=function(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},i.isFullscreen=function(e){if(e!==void 0){var r=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==r&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},i.requestFullscreen=function(e){var r=this.options_.Promise||w.Promise;if(r){var s=this;return new r(function(o,u){function l(){s.off("fullscreenerror",g),s.off("fullscreenchange",c)}function c(){l(),o()}function g(y,b){l(),u(b)}s.one("fullscreenchange",c),s.one("fullscreenerror",g);var p=s.requestFullscreenHelper_(e);p&&(p.then(l,l),p.then(o,u))})}return this.requestFullscreenHelper_()},i.requestFullscreenHelper_=function(e){var r=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 r.isFullscreen(!0)},function(){return r.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},i.exitFullscreen=function(){var e=this.options_.Promise||w.Promise;if(e){var r=this;return new e(function(s,o){function u(){r.off("fullscreenerror",c),r.off("fullscreenchange",l)}function l(){u(),s()}function c(p,y){u(),o(y)}r.one("fullscreenchange",l),r.one("fullscreenerror",c);var g=r.exitFullscreenHelper_();g&&(g.then(u,u),g.then(s,o))})}return this.exitFullscreenHelper_()},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var r=G[this.fsApi_.exitFullscreen]();return r&&Et(r.then(function(){return e.isFullscreen(!1)})),r}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=G.documentElement.style.overflow,rt(G,"keydown",this.boundFullWindowOnEscKey_),G.documentElement.style.overflow="hidden",Vt(G.body,"vjs-full-window"),this.trigger("enterFullWindow")},i.fullWindowOnEscKey=function(e){re.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Be(G,"keydown",this.boundFullWindowOnEscKey_),G.documentElement.style.overflow=this.docOrigOverflow,Wr(G.body,"vjs-full-window"),this.trigger("exitFullWindow")},i.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},i.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in G&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in G)return G.exitPictureInPicture()},i.handleKeyDown=function(e){var r=this.options_.userActions;if(!(!r||!r.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 r.hotkeys=="function"?r.hotkeys.call(this,e):this.handleHotkeys(e))}},i.handleHotkeys=function(e){var r=this.options_.userActions?this.options_.userActions.hotkeys:{},s=r.fullscreenKey,o=s===void 0?function(S){return re.isEventKey(S,"f")}:s,u=r.muteKey,l=u===void 0?function(S){return re.isEventKey(S,"m")}:u,c=r.playPauseKey,g=c===void 0?function(S){return re.isEventKey(S,"k")||re.isEventKey(S,"Space")}:c;if(o.call(this,e)){e.preventDefault(),e.stopPropagation();var p=V.getComponent("FullscreenToggle");G[this.fsApi_.fullscreenEnabled]!==!1&&p.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation();var y=V.getComponent("MuteToggle");y.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)}},i.canPlayType=function(e){for(var r,s=0,o=this.options_.techOrder;s<o.length;s++){var u=o[s],l=pe.getTech(u);if(l||(l=V.getComponent(u)),!l){ne.error('The "'+u+'" tech is undefined. Skipped browser support check for that tech.');continue}if(l.isSupported()&&(r=l.canPlayType(e),r))return r}return""},i.selectSource=function(e){var r=this,s=this.options_.techOrder.map(function(g){return[g,pe.getTech(g)]}).filter(function(g){var p=g[0],y=g[1];return y?y.isSupported():(ne.error('The "'+p+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(p,y,b){var S;return p.some(function(x){return y.some(function(A){if(S=b(x,A),S)return!0})}),S},u,l=function(p){return function(y,b){return p(b,y)}},c=function(p,y){var b=p[0],S=p[1];if(S.canPlaySource(y,r.options_[b.toLowerCase()]))return{source:y,tech:b}};return this.options_.sourceOrder?u=o(e,s,l(c)):u=o(s,e,c),u||!1},i.handleSrc_=function(e,r){var s=this;if(typeof e=="undefined")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=t_(e);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,r||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),q0(this,o[0],function(c,g){s.middleware_=g,r||(s.cache_.sources=o),s.updateSourceCaches_(c);var p=s.src_(c);if(p){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}G0(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)}}},i.src=function(e){return this.handleSrc_(e,!1)},i.src_=function(e){var r=this,s=this.selectSource([e]);return s?C0(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(){r.changingSrc_=!1}),!1):!0},i.load=function(){this.techCall_("load")},i.reset=function(){var e=this,r=this.options_.Promise||w.Promise;if(this.paused()||!r)this.doReset_();else{var s=this.play();Et(s.then(function(){return e.doReset_()}))}},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Gt(this)&&this.trigger("playerreset")},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},r=e.durationDisplay,s=e.remainingTimeDisplay;r&&r.updateContent(),s&&s.updateContent()},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},i.currentSources=function(){var e=this.currentSource(),r=[];return Object.keys(e).length!==0&&r.push(e),this.cache_.sources||r},i.currentSource=function(){return this.cache_.source||{}},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},i.currentType=function(){return this.currentSource()&&this.currentSource().type||""},i.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},i.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var r;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),r=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,r=typeof r=="undefined"?this.options_.autoplay:r,this.tech_&&this.techCall_("setAutoplay",r)},i.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},i.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},i.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"))},i.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"))}},i.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_()))},i.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")))},i.error=function(e){var r=this;if(e===void 0)return this.error_||null;if(ei("beforeerror").forEach(function(o){var u=o(r,e);if(!(Ut(u)&&!Array.isArray(u)||typeof u=="string"||typeof u=="number"||u===null)){r.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 Ke(e),this.addClass("vjs-error"),ne.error("(CODE:"+this.error_.code+" "+Ke.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),ei("error").forEach(function(o){return o(r,r.error_)})},i.reportUserActivity=function(e){this.userActivity_=!0},i.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(r){r.stopPropagation(),r.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},i.listenForUserActivity_=function(){var e,r,s,o=ve(this,this.reportUserActivity),u=function(b){(b.screenX!==r||b.screenY!==s)&&(r=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&&!ze&&!Bt&&(g.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),g.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var p;this.setInterval(function(){if(!!this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);var y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))}},250)},i.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},i.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},i.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_},i.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var r=this.children(),s=this.getChild("ControlBar"),o=s&&s.currentHeight();r.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")},i.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")},i.audioOnlyMode=function(e){var r=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var s=this.options_.Promise||w.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 r.enableAudioOnlyUI_()})}return s.resolve().then(function(){return r.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},i.enablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.disablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},i.audioPosterMode=function(e){var r=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var s=this.options_.Promise||w.Promise;if(s){if(e){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){r.enablePosterModeUI_()})}return s.resolve().then(function(){r.enablePosterModeUI_()})}return s.resolve().then(function(){r.disablePosterModeUI_()})}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},i.addTextTrack=function(e,r,s){if(this.tech_)return this.tech_.addTextTrack(e,r,s)},i.addRemoteTextTrack=function(e,r){if(this.tech_)return this.tech_.addRemoteTextTrack(e,r)},i.removeRemoteTextTrack=function(e){e===void 0&&(e={});var r=e,s=r.track;if(s||(s=e),this.tech_)return this.tech_.removeRemoteTextTrack(s)},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},i.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Gt(this)&&this.trigger("languagechange"))},i.languages=function(){return _e(t.prototype.options_.languages,this.languages_)},i.toJSON=function(){var e=_e(this.options_),r=e.tracks;e.tracks=[];for(var s=0;s<r.length;s++){var o=r[s];o=_e(o),o.player=void 0,e.tracks[s]=o}return e},i.createModal=function(e,r){var s=this;r=r||{},r.content=e||"";var o=new Yi(this,r);return this.addChild(o),o.on("dispose",function(){s.removeChild(o)}),o.open(),o},i.updateCurrentBreakpoint_=function(){if(!!this.responsive())for(var e=this.currentBreakpoint(),r=this.currentWidth(),s=0;s<Lo.length;s++){var o=Lo[s],u=this.breakpoints_[o];if(r<=u){if(e===o)return;e&&this.removeClass(ma[e]),this.addClass(ma[o]),this.breakpoint_=o;break}}},i.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},i.breakpoints=function(e){return e===void 0?be(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=be({},D_,e),this.updateCurrentBreakpoint_(),be(this.breakpoints_))},i.responsive=function(e){if(e===void 0)return this.responsive_;e=Boolean(e);var r=this.responsive_;if(e!==r)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e},i.currentBreakpoint=function(){return this.breakpoint_},i.currentBreakpointClass=function(){return ma[this.breakpoint_]||""},i.loadMedia=function(e,r){var s=this;if(!(!e||typeof e!="object")){this.reset(),this.cache_.media=_e(e);var o=this.cache_.media,u=o.artwork,l=o.poster,c=o.src,g=o.textTracks;!u&&l&&(this.cache_.media.artwork=[{src:l,type:ua(l)}]),c&&this.src(c),l&&this.poster(l),Array.isArray(g)&&g.forEach(function(p){return s.addRemoteTextTrack(p,!1)}),this.ready(r)}},i.getMedia=function(){if(!this.cache_.media){var e=this.poster(),r=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),function(u){return{kind:u.kind,label:u.label,language:u.language,src:u.src}}),o={src:r,textTracks:s};return e&&(o.poster=e,o.artwork=[{src:o.poster,type:ua(o.poster)}]),o}return _e(this.cache_.media)},t.getTagSettings=function(e){var r={sources:[],tracks:[]},s=jt(e),o=s["data-setup"];if(mi(e,"vjs-fill")&&(s.fill=!0),mi(e,"vjs-fluid")&&(s.fluid=!0),o!==null){var u=vm(o||"{}"),l=u[0],c=u[1];l&&ne.error(l),be(s,c)}if(be(r,s),e.hasChildNodes())for(var g=e.childNodes,p=0,y=g.length;p<y;p++){var b=g[p],S=b.nodeName.toLowerCase();S==="source"?r.sources.push(jt(b)):S==="track"&&r.tracks.push(jt(b))}return r},i.flexNotSupported_=function(){var e=G.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},i.debug=function(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},i.playbackRates=function(e){if(e===void 0)return this.cache_.playbackRates;!Array.isArray(e)||!e.every(function(r){return typeof r=="number"})||(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(V);Xe.names.forEach(function(a){var t=Xe[a];we.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}});we.prototype.crossorigin=we.prototype.crossOrigin;we.players={};var Qr=w.navigator;we.prototype.options_={techOrder:pe.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Qr&&(Qr.languages&&Qr.languages[0]||Qr.userLanguage||Qr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(a){we.prototype[a]=function(){return this.techGet_(a)}});sf.forEach(function(a){we.prototype["handleTech"+Ce(a)+"_"]=function(){return this.trigger(a)}});V.registerComponent("Player",we);var ga="plugin",rr="activePlugins_",nr={},va=function(t){return nr.hasOwnProperty(t)},_a=function(t){return va(t)?nr[t]:void 0},of=function(t,i){t[rr]=t[rr]||{},t[rr][i]=!0},ya=function(t,i,n){var e=(n?"before":"")+"pluginsetup";t.trigger(e,i),t.trigger(e+":"+i.name,i)},O_=function(t,i){var n=function(){ya(this,{name:t,plugin:i,instance:null},!0);var r=i.apply(this,arguments);return of(this,t),ya(this,{name:t,plugin:i,instance:r}),r};return Object.keys(i).forEach(function(e){n[e]=i[e]}),n},uf=function(t,i){return i.prototype.name=t,function(){ya(this,{name:t,plugin:i,instance:null},!0);for(var n=arguments.length,e=new Array(n),r=0;r<n;r++)e[r]=arguments[r];var s=An(i,[this].concat(e));return this[t]=function(){return s},ya(this,s.getEventHash()),s}},Ct=function(){function a(i){if(this.constructor===a)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=i,this.log||(this.log=this.player.log.createLogger(this.name)),Xs(this),delete this.trigger,oc(this,this.constructor.defaultState),of(i,this.name),this.dispose=this.dispose.bind(this),i.on("dispose",this.dispose)}var t=a.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(n){return n===void 0&&(n={}),n.name=this.name,n.plugin=this.constructor,n.instance=this,n},t.trigger=function(n,e){return e===void 0&&(e={}),Ki(this.eventBusEl_,n,this.getEventHash(e))},t.handleStateChanged=function(n){},t.dispose=function(){var n=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[rr][n]=!1,this.player=this.state=null,e[n]=uf(n,nr[n])},a.isBasic=function(n){var e=typeof n=="string"?_a(n):n;return typeof e=="function"&&!a.prototype.isPrototypeOf(e.prototype)},a.registerPlugin=function(n,e){if(typeof n!="string")throw new Error('Illegal plugin name, "'+n+'", must be a string, was '+typeof n+".");if(va(n))ne.warn('A plugin named "'+n+'" already exists. You may want to avoid re-registering plugins!');else if(we.prototype.hasOwnProperty(n))throw new Error('Illegal plugin name, "'+n+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+n+'", must be a function, was '+typeof e+".");return nr[n]=e,n!==ga&&(a.isBasic(e)?we.prototype[n]=O_(n,e):we.prototype[n]=uf(n,e)),e},a.deregisterPlugin=function(n){if(n===ga)throw new Error("Cannot de-register base plugin.");va(n)&&(delete nr[n],delete we.prototype[n])},a.getPlugins=function(n){n===void 0&&(n=Object.keys(nr));var e;return n.forEach(function(r){var s=_a(r);s&&(e=e||{},e[r]=s)}),e},a.getPluginVersion=function(n){var e=_a(n);return e&&e.VERSION||""},a}();Ct.getPlugin=_a;Ct.BASE_PLUGIN_NAME=ga;Ct.registerPlugin(ga,Ct);we.prototype.usingPlugin=function(a){return!!this[rr]&&this[rr][a]===!0};we.prototype.hasPlugin=function(a){return!!va(a)};var L_=function(t,i){i===void 0&&(i={});var n=function(){t.apply(this,arguments)},e={};typeof i=="object"?(i.constructor!==Object.prototype.constructor&&(n=i.constructor),e=i):typeof i=="function"&&(n=i),ng(n,t),t&&(n.super_=t);for(var r in e)e.hasOwnProperty(r)&&(n.prototype[r]=e[r]);return n},lf=function(t){return t.indexOf("#")===0?t.slice(1):t};function D(a,t,i){var n=D.getPlayer(a);if(n)return t&&ne.warn('Player "'+a+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var e=typeof a=="string"?ti("#"+lf(a)):a;if(!Gi(e))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!e.ownerDocument.defaultView||!e.ownerDocument.body.contains(e))&&ne.warn("The element supplied is not included in the DOM"),t=t||{},t.restoreEl===!0&&(t.restoreEl=(e.parentNode&&e.parentNode.hasAttribute("data-vjs-player")?e.parentNode:e).cloneNode(!0)),ei("beforesetup").forEach(function(s){var o=s(e,_e(t));if(!Ut(o)||Array.isArray(o)){ne.error("please return an object in beforesetup hooks");return}t=_e(t,o)});var r=V.getComponent("Player");return n=new r(e,t,i),ei("setup").forEach(function(s){return s(n)}),n}D.hooks_=Ft;D.hooks=ei;D.hook=s0;D.hookOnce=o0;D.removeHook=kd;if(w.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&qi()){var Ta=ti(".vjs-styles-defaults");if(!Ta){Ta=ec("vjs-styles-defaults");var Mo=ti("head");Mo&&Mo.insertBefore(Ta,Mo.firstChild),tc(Ta,`
  44. .video-js {
  45. width: 300px;
  46. height: 150px;
  47. }
  48. .vjs-fluid:not(.vjs-audio-only-mode) {
  49. padding-top: 56.25%
  50. }
  51. `)}}qs(1,D);D.VERSION=Pd;D.options=we.prototype.options_;D.getPlayers=function(){return we.players};D.getPlayer=function(a){var t=we.players,i;if(typeof a=="string"){var n=lf(a),e=t[n];if(e)return e;i=ti("#"+n)}else i=a;if(Gi(i)){var r=i,s=r.player,o=r.playerId;if(s||t[o])return s||t[o]}};D.getAllPlayers=function(){return Object.keys(we.players).map(function(a){return we.players[a]}).filter(Boolean)};D.players=we.players;D.getComponent=V.getComponent;D.registerComponent=function(a,t){pe.isTech(t)&&ne.warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),V.registerComponent.call(V,a,t)};D.getTech=pe.getTech;D.registerTech=pe.registerTech;D.use=W0;Object.defineProperty(D,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(D.middleware,"TERMINATOR",{value:oa,writeable:!1,enumerable:!0});D.browser=h0;D.TOUCH_ENABLED=Wi;D.extend=L_;D.mergeOptions=_e;D.bind=ve;D.registerPlugin=Ct.registerPlugin;D.deregisterPlugin=Ct.deregisterPlugin;D.plugin=function(a,t){return ne.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ct.registerPlugin(a,t)};D.getPlugins=Ct.getPlugins;D.getPlugin=Ct.getPlugin;D.getPluginVersion=Ct.getPluginVersion;D.addLanguage=function(a,t){var i;return a=(""+a).toLowerCase(),D.options.languages=_e(D.options.languages,(i={},i[a]=t,i)),D.options.languages[a]};D.log=ne;D.createLogger=Dd;D.createTimeRange=D.createTimeRanges=vi;D.formatTime=er;D.setFormatTime=u_;D.resetFormatTime=l_;D.parseUrl=ro;D.isCrossOrigin=sa;D.EventTarget=De;D.on=rt;D.one=ia;D.off=Be;D.trigger=Ki;D.xhr=Qu;D.TextTrack=Kr;D.AudioTrack=vc;D.VideoTrack=_c;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(a){D[a]=function(){return ne.warn("videojs."+a+"() is deprecated; use videojs.dom."+a+"() instead"),Jd[a].apply(null,arguments)}});D.computedStyle=Hr;D.dom=Jd;D.url=B0;D.defineLazyProperty=Do;D.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.14.3 @license Apache-2.0 */var mt=In,ba=function(t,i,n){return t&&n&&n.responseURL&&i!==n.responseURL?n.responseURL:i},gt=function(t){return D.log.debug?D.log.debug.bind(D,"VHS:",t+" >"):function(){}},ii=1/30,wt=ii*3,df=function(t,i){var n=[],e;if(t&&t.length)for(e=0;e<t.length;e++)i(t.start(e),t.end(e))&&n.push([t.start(e),t.end(e)]);return D.createTimeRanges(n)},ar=function(t,i){return df(t,function(n,e){return n-wt<=i&&e+wt>=i})},xa=function(t,i){return df(t,function(n){return n-ii>=i})},M_=function(t){if(t.length<2)return D.createTimeRanges();for(var i=[],n=1;n<t.length;n++){var e=t.end(n-1),r=t.start(n);i.push([e,r])}return D.createTimeRanges(i)},R_=function(t,i){var n=null,e=null,r=0,s=[],o=[];if(!t||!t.length||!i||!i.length)return D.createTimeRange();for(var u=t.length;u--;)s.push({time:t.start(u),type:"start"}),s.push({time:t.end(u),type:"end"});for(u=i.length;u--;)s.push({time:i.start(u),type:"start"}),s.push({time:i.end(u),type:"end"});for(s.sort(function(l,c){return l.time-c.time}),u=0;u<s.length;u++)s[u].type==="start"?(r++,r===2&&(n=s[u].time)):s[u].type==="end"&&(r--,r===1&&(e=s[u].time)),n!==null&&e!==null&&(o.push([n,e]),n=null,e=null);return D.createTimeRanges(o)},cf=function(t){var i=[];if(!t||!t.length)return"";for(var n=0;n<t.length;n++)i.push(t.start(n)+" => "+t.end(n));return i.join(", ")},N_=function(t,i,n){n===void 0&&(n=1);var e=t.length?t.end(t.length-1):0;return(e-i)/n},bi=function(t){for(var i=[],n=0;n<t.length;n++)i.push({start:t.start(n),end:t.end(n)});return i},F_=function(t,i){if(t===i)return!1;if(!t&&i||!i&&t||t.length!==i.length)return!0;for(var n=0;n<t.length;n++)if(t.start(n)!==i.start(n)||t.end(n)!==i.end(n))return!0;return!1},ff=function(t){if(!(!t||!t.length||!t.end))return t.end(t.length-1)},Ro=function(t,i){var n=0;if(!t||!t.length)return n;for(var e=0;e<t.length;e++){var r=t.start(e),s=t.end(e);if(!(i>s)){if(i>r&&i<=s){n+=s-i;continue}n+=s-r}}return n},hf=D.createTimeRange,No=function(t,i){if(!i.preload)return i.duration;var n=0;return(i.parts||[]).forEach(function(e){n+=e.duration}),(i.preloadHints||[]).forEach(function(e){e.type==="PART"&&(n+=t.partTargetDuration)}),n},Fo=function(t){return(t.segments||[]).reduce(function(i,n,e){return n.parts?n.parts.forEach(function(r,s){i.push({duration:r.duration,segmentIndex:e,partIndex:s,part:r,segment:n})}):i.push({duration:n.duration,segmentIndex:e,partIndex:null,segment:n,part:null}),i},[])},pf=function(t){var i=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return i&&i.parts||[]},mf=function(t){var i=t.preloadSegment;if(!!i){var n=i.parts,e=i.preloadHints,r=(e||[]).reduce(function(s,o){return s+(o.type==="PART"?1:0)},0);return r+=n&&n.length?n.length:0,r}},gf=function(t,i){if(i.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var n=pf(i).length>0;return n&&i.serverControl&&i.serverControl.partHoldBack?i.serverControl.partHoldBack:n&&i.partTargetDuration?i.partTargetDuration*3:i.serverControl&&i.serverControl.holdBack?i.serverControl.holdBack:i.targetDuration?i.targetDuration*3:0},U_=function(t,i){var n=0,e=i-t.mediaSequence,r=t.segments[e];if(r){if(typeof r.start!="undefined")return{result:r.start,precise:!0};if(typeof r.end!="undefined")return{result:r.end-r.duration,precise:!0}}for(;e--;){if(r=t.segments[e],typeof r.end!="undefined")return{result:n+r.end,precise:!0};if(n+=No(t,r),typeof r.start!="undefined")return{result:n+r.start,precise:!0}}return{result:n,precise:!1}},B_=function(t,i){for(var n=0,e,r=i-t.mediaSequence;r<t.segments.length;r++){if(e=t.segments[r],typeof e.start!="undefined")return{result:e.start-n,precise:!0};if(n+=No(t,e),typeof e.end!="undefined")return{result:e.end-n,precise:!0}}return{result:-1,precise:!1}},vf=function(t,i,n){if(typeof i=="undefined"&&(i=t.mediaSequence+t.segments.length),i<t.mediaSequence)return 0;var e=U_(t,i);if(e.precise)return e.result;var r=B_(t,i);return r.precise?r.result:e.result+n},_f=function(t,i,n){if(!t)return 0;if(typeof n!="number"&&(n=0),typeof i=="undefined"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return w.Infinity}return vf(t,i,n)},Jr=function(t){var i=t.defaultDuration,n=t.durationList,e=t.startIndex,r=t.endIndex,s=0;if(e>r){var o=[r,e];e=o[0],r=o[1]}if(e<0){for(var u=e;u<Math.min(0,r);u++)s+=i;e=0}for(var l=e;l<r;l++)s+=n[l].duration;return s},yf=function(t,i,n,e){if(!t||!t.segments)return null;if(t.endList)return _f(t);if(i===null)return null;i=i||0;var r=vf(t,t.mediaSequence+t.segments.length,i);return n&&(e=typeof e=="number"?e:gf(null,t),r-=e),Math.max(0,r)},H_=function(t,i,n){var e=!0,r=i||0,s=yf(t,i,e,n);return s===null?hf():hf(r,s)},V_=function(t){for(var i=t.playlist,n=t.currentTime,e=t.startingSegmentIndex,r=t.startingPartIndex,s=t.startTime,o=t.experimentalExactManifestTimings,u=n-s,l=Fo(i),c=0,g=0;g<l.length;g++){var p=l[g];if(e===p.segmentIndex&&!(typeof r=="number"&&typeof p.partIndex=="number"&&r!==p.partIndex)){c=g;break}}if(u<0){if(c>0)for(var y=c-1;y>=0;y--){var b=l[y];if(u+=b.duration,o){if(u<0)continue}else if(u+ii<=0)continue;return{partIndex:b.partIndex,segmentIndex:b.segmentIndex,startTime:s-Jr({defaultDuration:i.targetDuration,durationList:l,startIndex:c,endIndex:y})}}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-=i.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;x<l.length;x++){var A=l[x];if(u-=A.duration,o){if(u>0)continue}else if(u-ii>=0)continue;return{partIndex:A.partIndex,segmentIndex:A.segmentIndex,startTime:s+Jr({defaultDuration:i.targetDuration,durationList:l,startIndex:c,endIndex:x})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:n}},Tf=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},Uo=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Sa=function(t){var i=Tf(t);return!t.disabled&&!i},j_=function(t){return t.disabled},W_=function(t){for(var i=0;i<t.segments.length;i++)if(t.segments[i].key)return!0;return!1},bf=function(t,i){return i.attributes&&i.attributes[t]},q_=function(t,i,n,e){if(e===void 0&&(e=0),!bf("BANDWIDTH",n))return NaN;var r=t*n.attributes.BANDWIDTH;return(r-e*8)/i},Bo=function(t,i){if(t.playlists.length===1)return!0;var n=i.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){return Sa(e)?(e.attributes.BANDWIDTH||0)<n:!1}).length===0},Ho=function(t,i){return!t&&!i||!t&&i||t&&!i?!1:!!(t===i||t.id&&i.id&&t.id===i.id||t.resolvedUri&&i.resolvedUri&&t.resolvedUri===i.resolvedUri||t.uri&&i.uri&&t.uri===i.uri)},xf=function(t,i){var n=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{},e=!1;for(var r in n){for(var s in n[r])if(e=i(n[r][s]),e)break;if(e)break}return!!e},Zr=function(t){if(!t||!t.playlists||!t.playlists.length){var i=xf(t,function(s){return s.playlists&&s.playlists.length||s.uri});return i}for(var n=function(o){var u=t.playlists[o],l=u.attributes&&u.attributes.CODECS;if(l&&l.split(",").every(function(g){return fl(g)}))return"continue";var c=xf(t,function(g){return Ho(u,g)});return c?"continue":{v:!1}},e=0;e<t.playlists.length;e++){var r=n(e);if(r!=="continue"&&typeof r=="object")return r.v}return!0},et={liveEdgeDelay:gf,duration:_f,seekable:H_,getMediaInfoForTime:V_,isEnabled:Sa,isDisabled:j_,isBlacklisted:Tf,isIncompatible:Uo,playlistEnd:yf,isAes:W_,hasAttribute:bf,estimateSegmentRequestTime:q_,isLowestEnabledRendition:Bo,isAudioOnly:Zr,playlistMatch:Ho,segmentDurationWithParts:No},Sf=D.log,Vo=function(t,i){return t+"-"+i},G_=function(t){var i=t.onwarn,n=t.oninfo,e=t.manifestString,r=t.customTagParsers,s=r===void 0?[]:r,o=t.customTagMappers,u=o===void 0?[]:o,l=t.experimentalLLHLS,c=new cg;i&&c.on("warn",i),n&&c.on("info",n),s.forEach(function(S){return c.addParser(S)}),u.forEach(function(S){return c.addTagMapper(S)}),c.push(e),c.end();var g=c.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(S){g.hasOwnProperty(S)&&delete g[S]}),g.segments&&g.segments.forEach(function(S){["parts","preloadHints"].forEach(function(x){S.hasOwnProperty(x)&&delete S[x]})})),!g.targetDuration){var p=10;g.segments&&g.segments.length&&(p=g.segments.reduce(function(S,x){return Math.max(S,x.duration)},0)),i&&i("manifest has no targetDuration defaulting to "+p),g.targetDuration=p}var y=pf(g);if(y.length&&!g.partTargetDuration){var b=y.reduce(function(S,x){return Math.max(S,x.duration)},0);i&&(i("manifest has no partTargetDuration defaulting to "+b),Sf.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),g.partTargetDuration=b}return g},en=function(t,i){!t.mediaGroups||["AUDIO","SUBTITLES"].forEach(function(n){if(!!t.mediaGroups[n])for(var e in t.mediaGroups[n])for(var r in t.mediaGroups[n][e]){var s=t.mediaGroups[n][e][r];i(s,n,e,r)}})},Ef=function(t){var i=t.playlist,n=t.uri,e=t.id;i.id=e,i.playlistErrors_=0,n&&(i.uri=n),i.attributes=i.attributes||{}},z_=function(t){for(var i=t.playlists.length;i--;){var n=t.playlists[i];Ef({playlist:n,id:Vo(i,n.uri)}),n.resolvedUri=mt(t.uri,n.uri),t.playlists[n.id]=n,t.playlists[n.uri]=n,n.attributes.BANDWIDTH||Sf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},$_=function(t){en(t,function(i){i.uri&&(i.resolvedUri=mt(t.uri,i.uri))})},K_=function(t,i){var n=Vo(0,i),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:w.location.href,resolvedUri:w.location.href,playlists:[{uri:i,id:n,resolvedUri:i,attributes:{}}]};return e.playlists[n]=e.playlists[0],e.playlists[i]=e.playlists[0],e},Cf=function(t,i){t.uri=i;for(var n=0;n<t.playlists.length;n++)if(!t.playlists[n].uri){var e="placeholder-uri-"+n;t.playlists[n].uri=e}var r=Zr(t);en(t,function(s,o,u,l){var c="placeholder-uri-"+o+"-"+u+"-"+l;if(!s.playlists||!s.playlists.length){if(r&&o==="AUDIO"&&!s.uri)for(var g=0;g<t.playlists.length;g++){var p=t.playlists[g];if(p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===u)return}s.playlists=[dt({},s)]}s.playlists.forEach(function(y,b){var S=Vo(b,c);y.uri?y.resolvedUri=y.resolvedUri||mt(t.uri,y.uri):(y.uri=b===0?c:S,y.resolvedUri=y.uri),y.id=y.id||S,y.attributes=y.attributes||{},t.playlists[y.id]=y,t.playlists[y.uri]=y})}),z_(t),$_(t)},Ea=D.mergeOptions,X_=D.EventTarget,Y_=function(t,i){if(i.endList||!i.serverControl)return t;var n={};if(i.serverControl.canBlockReload){var e=i.preloadSegment,r=i.mediaSequence+i.segments.length;if(e){var s=e.parts||[],o=mf(i)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&r--}n._HLS_msn=r}if(i.serverControl&&i.serverControl.canSkipUntil&&(n._HLS_skip=i.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var u=new w.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},Q_=function(t,i){if(!t)return i;var n=Ea(t,i);if(t.preloadHints&&!i.preloadHints&&delete n.preloadHints,t.parts&&!i.parts)delete n.parts;else if(t.parts&&i.parts)for(var e=0;e<i.parts.length;e++)t.parts&&t.parts[e]&&(n.parts[e]=Ea(t.parts[e],i.parts[e]));return!t.skipped&&i.skipped&&(n.skipped=!1),t.preload&&!i.preload&&(n.preload=!1),n},J_=function(t,i,n){var e=t.slice(),r=i.slice();n=n||0;for(var s=[],o,u=0;u<r.length;u++){var l=e[u+n],c=r[u];l?(o=l.map||o,s.push(Q_(l,c))):(o&&!c.map&&(c.map=o),s.push(c))}return s},wf=function(t,i){!t.resolvedUri&&t.uri&&(t.resolvedUri=mt(i,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=mt(i,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=mt(i,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=mt(i,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(function(n){n.resolvedUri||(n.resolvedUri=mt(i,n.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(function(n){n.resolvedUri||(n.resolvedUri=mt(i,n.uri))})},Pf=function(t){var i=t.segments||[],n=t.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(var e=0;e<n.preloadHints.length;e++)if(n.preloadHints[e].type==="MAP")return i}n.duration=t.targetDuration,n.preload=!0,i.push(n)}return i},kf=function(t,i){return t===i||t.segments&&i.segments&&t.segments.length===i.segments.length&&t.endList===i.endList&&t.mediaSequence===i.mediaSequence&&t.preloadSegment===i.preloadSegment},jo=function(t,i,n){n===void 0&&(n=kf);var e=Ea(t,{}),r=e.playlists[i.id];if(!r||n(r,i))return null;i.segments=Pf(i);var s=Ea(r,i);if(s.preloadSegment&&!i.preloadSegment&&delete s.preloadSegment,r.segments){if(i.skip){i.segments=i.segments||[];for(var o=0;o<i.skip.skippedSegments;o++)i.segments.unshift({skipped:!0})}s.segments=J_(r.segments,i.segments,i.mediaSequence-r.mediaSequence)}s.segments.forEach(function(l){wf(l,s.resolvedUri)});for(var u=0;u<e.playlists.length;u++)e.playlists[u].id===i.id&&(e.playlists[u]=s);return e.playlists[i.id]=s,e.playlists[i.uri]=s,en(t,function(l,c,g,p){if(!!l.playlists)for(var y=0;y<l.playlists.length;y++)i.id===l.playlists[y].id&&(l.playlists[y]=s)}),e},Wo=function(t,i){var n=t.segments||[],e=n[n.length-1],r=e&&e.parts&&e.parts[e.parts.length-1],s=r&&r.duration||e&&e.duration;return i&&s?s*1e3:(t.partTargetDuration||t.targetDuration||10)*500},sr=function(a){$(t,a);function t(n,e,r){var s;if(r===void 0&&(r={}),s=a.call(this)||this,!n)throw new Error("A non-empty playlist URL or object is required");s.logger_=gt("PlaylistLoader");var o=r,u=o.withCredentials,l=u===void 0?!1:u,c=o.handleManifestRedirects,g=c===void 0?!1:c;s.src=n,s.vhs_=e,s.withCredentials=l,s.handleManifestRedirects=g;var p=e.options_;return s.customTagParsers=p&&p.customTagParsers||[],s.customTagMappers=p&&p.customTagMappers||[],s.experimentalLLHLS=p&&p.experimentalLLHLS||!1,D.browser.IE_VERSION&&(s.experimentalLLHLS=!1),s.state="HAVE_NOTHING",s.handleMediaupdatetimeout_=s.handleMediaupdatetimeout_.bind(ie(s)),s.on("mediaupdatetimeout",s.handleMediaupdatetimeout_),s}var i=t.prototype;return i.handleMediaupdatetimeout_=function(){var e=this;if(this.state==="HAVE_METADATA"){var r=this.media(),s=mt(this.master.uri,r.uri);this.experimentalLLHLS&&(s=Y_(s,r)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:s,withCredentials:this.withCredentials},function(o,u){if(!!e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},i.playlistRequestError=function(e,r,s){var o=r.uri,u=r.id;this.request=null,s&&(this.state=s),this.error={playlist:this.master.playlists[u],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var r=this,s=e.url,o=e.manifestString;return G_({onwarn:function(l){var c=l.message;return r.logger_("m3u8-parser warn for "+s+": "+c)},oninfo:function(l){var c=l.message;return r.logger_("m3u8-parser info for "+s+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var r=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:r});l.lastRequest=Date.now(),Ef({playlist:l,uri:o,id:u});var c=jo(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_(Wo(this.media(),!!c)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),w.clearTimeout(this.mediaUpdateTimeout),w.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,r){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(w.clearTimeout(this.finalRenditionTimeout),r){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=w.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_(Wo(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,p){if(!!s.request){if(e.lastRequest=Date.now(),e.resolvedUri=ba(s.handleManifestRedirects,e.resolvedUri,p),g)return s.playlistRequestError(s.request,e,u);s.haveMetadata({playlistString:p.responseText,url:e.uri,id:e.id}),u==="HAVE_MASTER"?s.trigger("loadedmetadata"):s.trigger("mediachange")}})}},i.pause=function(){this.mediaUpdateTimeout&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},i.load=function(e){var r=this;this.mediaUpdateTimeout&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var s=this.media();if(e){var o=s?(s.partTargetDuration||s.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=w.setTimeout(function(){r.mediaUpdateTimeout=null,r.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},i.updateMediaUpdateTimeout_=function(e){var r=this;this.mediaUpdateTimeout&&(w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=w.setTimeout(function(){r.mediaUpdateTimeout=null,r.trigger("mediaupdatetimeout"),r.updateMediaUpdateTimeout_(e)},e))},i.start=function(){var e=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=w.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(r,s){if(!!e.request){if(e.request=null,r)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=ba(e.handleManifestRedirects,e.src,s);var o=e.parseManifest_({manifestString:s.responseText,url:e.src});e.setupInitialPlaylist(o)}})},i.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,Cf(this.master,this.srcUri()),e.playlists.forEach(function(s){s.segments=Pf(s),s.segments.forEach(function(o){wf(o,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var r=this.srcUri()||w.location.href;this.master=K_(e,r),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(X_),Z_=D.xhr,ey=D.mergeOptions,qo=function(t,i,n,e){var r=t.responseType==="arraybuffer"?t.response:t.responseText;!i&&r&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=r.byteLength||r.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),n.headers&&(t.responseHeaders=n.headers),i&&i.code==="ETIMEDOUT"&&(t.timedout=!0),!i&&!t.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(i=new Error("XHR Failed with a response of: "+(t&&(r||t.responseText)))),e(i,t)},Af=function(){var t=function i(n,e){n=ey({timeout:45e3},n);var r=i.beforeRequest||D.Vhs.xhr.beforeRequest;if(r&&typeof r=="function"){var s=r(n);s&&(n=s)}var o=D.Vhs.xhr.original===!0?Z_:D.Vhs.xhr,u=o(n,function(c,g){return qo(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},ty=function(t){var i,n=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?i=w.BigInt(t.offset)+w.BigInt(t.length)-w.BigInt(1):i=t.offset+t.length-1,"bytes="+n+"-"+i},Go=function(t){var i={};return t.byterange&&(i.Range=ty(t.byterange)),i},iy=function(t,i){return t.start(i)+"-"+t.end(i)},ry=function(t,i){var n=t.toString(16);return"00".substring(0,2-n.length)+n+(i%2?" ":"")},ny=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},If=function(t){var i={};return Object.keys(t).forEach(function(n){var e=t[n];ml(e)?i[n]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:i[n]=e}),i},Ca=function(t){var i=t.byterange||{length:1/0,offset:0};return[i.length,i.offset,t.resolvedUri].join(",")},Df=function(t){return t.resolvedUri},Of=function(t){for(var i=Array.prototype.slice.call(t),n=16,e="",r,s,o=0;o<i.length/n;o++)r=i.slice(o*n,o*n+n).map(ry).join(""),s=i.slice(o*n,o*n+n).map(ny).join(""),e+=r+" "+s+`
  52. `;return e},ay=function(t){var i=t.bytes;return Of(i)},sy=function(t){var i="",n;for(n=0;n<t.length;n++)i+=iy(t,n)+" ";return i},oy=Object.freeze({__proto__:null,createTransferableMessage:If,initSegmentId:Ca,segmentKeyId:Df,hexDump:Of,tagDump:ay,textRanges:sy}),Lf=.25,uy=function(t,i){if(!i.dateTimeObject)return null;var n=i.videoTimingInfo.transmuxerPrependedSeconds,e=i.videoTimingInfo.transmuxedPresentationStart,r=e+n,s=t-r;return new Date(i.dateTimeObject.getTime()+s*1e3)},ly=function(t){return t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds},dy=function(t,i){var n;try{n=new Date(t)}catch{return null}if(!i||!i.segments||i.segments.length===0)return null;var e=i.segments[0];if(n<e.dateTimeObject)return null;for(var r=0;r<i.segments.length-1;r++){e=i.segments[r];var s=i.segments[r+1].dateTimeObject;if(n<s)break}var o=i.segments[i.segments.length-1],u=o.dateTimeObject,l=o.videoTimingInfo?ly(o.videoTimingInfo):o.duration+o.duration*Lf,c=new Date(u.getTime()+l*1e3);return n>c?null:(n>u&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:et.duration(i,i.mediaSequence+i.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},cy=function(t,i){if(!i||!i.segments||i.segments.length===0)return null;for(var n=0,e,r=0;r<i.segments.length&&(e=i.segments[r],n=e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationEnd:n+e.duration,!(t<=n));r++);var s=i.segments[i.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<t)return null;if(t>n){if(t>n+s.duration*Lf)return null;e=s}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:n-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}},fy=function(t,i){var n,e;try{n=new Date(t),e=new Date(i)}catch{}var r=n.getTime(),s=e.getTime();return(s-r)/1e3},hy=function(t){if(!t.segments||t.segments.length===0)return!1;for(var i=0;i<t.segments.length;i++){var n=t.segments[i];if(!n.dateTimeObject)return!1}return!0},py=function(t){var i=t.playlist,n=t.time,e=n===void 0?void 0:n,r=t.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return r({message:"getProgramTime: playlist and time must be provided"});var s=cy(e,i);if(!s)return r({message:"valid programTime was not found"});if(s.type==="estimate")return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});var o={mediaSeconds:e},u=uy(e,s.segment);return u&&(o.programDateTime=u.toISOString()),r(null,o)},my=function a(t){var i=t.programTime,n=t.playlist,e=t.retryCount,r=e===void 0?2:e,s=t.seekTo,o=t.pauseAfterSeek,u=o===void 0?!0:o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof i=="undefined"||!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(!hy(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var g=dy(i,n);if(!g)return c({message:i+" was not found in the stream"});var p=g.segment,y=fy(p.dateTimeObject,i);if(g.type==="estimate"){if(r===0)return c({message:i+" is not buffered yet. Try again"});s(g.estimatedStart+y),l.one("seeked",function(){a({programTime:i,playlist:n,retryCount:r-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})});return}var b=p.start+y,S=function(){return c(null,l.currentTime())};l.one("seeked",S),u&&l.pause(),s(b)},zo=function(t,i){if(t.readyState===4)return i()},gy=function(t,i,n){var e=[],r,s=!1,o=function(p,y,b,S){return y.abort(),s=!0,n(p,y,b,S)},u=function(p,y){if(!s){if(p)return o(p,y,"",e);var b=y.responseText.substring(e&&e.byteLength||0,y.responseText.length);if(e=Sg(e,gl(b,!0)),r=r||Fr(e),e.length<10||r&&e.length<r+2)return zo(y,function(){return o(p,y,"",e)});var S=Ds(e);return S==="ts"&&e.length<188?zo(y,function(){return o(p,y,"",e)}):!S&&e.length<376?zo(y,function(){return o(p,y,"",e)}):o(null,y,S,e)}},l={uri:t,beforeSend:function(p){p.overrideMimeType("text/plain; charset=x-user-defined"),p.addEventListener("progress",function(y){return y.total,y.loaded,qo(p,null,{statusCode:p.status},u)})}},c=i(l,function(g,p){return qo(c,g,p,u)});return c},vy=D.EventTarget,Mf=D.mergeOptions,Rf=function(t,i){if(!kf(t,i)||t.sidx&&i.sidx&&(t.sidx.offset!==i.sidx.offset||t.sidx.length!==i.sidx.length))return!1;if(!t.sidx&&i.sidx||t.sidx&&!i.sidx||t.segments&&!i.segments||!t.segments&&i.segments)return!1;if(!t.segments&&!i.segments)return!0;for(var n=0;n<t.segments.length;n++){var e=t.segments[n],r=i.segments[n];if(e.uri!==r.uri)return!1;if(!(!e.byterange&&!r.byterange)){var s=e.byterange,o=r.byterange;if(s&&!o||!s&&o||s.offset!==o.offset||s.length!==o.length)return!1}}return!0},_y=function(t){var i=t.masterXml,n=t.srcUrl,e=t.clientOffset,r=t.sidxMapping,s=t.previousManifest,o=Bv(i,{manifestUri:n,clientOffset:e,sidxMapping:r,previousManifest:s});return Cf(o,n),o},yy=function(t,i,n){for(var e=!0,r=Mf(t,{duration:i.duration,minimumUpdatePeriod:i.minimumUpdatePeriod,timelineStarts:i.timelineStarts}),s=0;s<i.playlists.length;s++){var o=i.playlists[s];if(o.sidx){var u=Vn(o.sidx);n&&n[u]&&n[u].sidx&&Es(o,n[u].sidx,o.sidx.resolvedUri)}var l=jo(r,o,Rf);l&&(r=l,e=!1)}return en(i,function(c,g,p,y){if(c.playlists&&c.playlists.length){var b=c.playlists[0].id,S=jo(r,c.playlists[0],Rf);S&&(r=S,r.mediaGroups[g][p][y].playlists[0]=r.playlists[b],e=!1)}}),i.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(e=!1),e?null:r},Ty=function(t,i){var n=Boolean(!t.map&&!i.map),e=n||Boolean(t.map&&i.map&&t.map.byterange.offset===i.map.byterange.offset&&t.map.byterange.length===i.map.byterange.length);return e&&t.uri===i.uri&&t.byterange.offset===i.byterange.offset&&t.byterange.length===i.byterange.length},Nf=function(t,i){var n={};for(var e in t){var r=t[e],s=r.sidx;if(s){var o=Vn(s);if(!i[o])break;var u=i[o].sidxInfo;Ty(u,s)&&(n[o]=i[o])}}return n},by=function(t,i){var n=Nf(t.playlists,i),e=n;return en(t,function(r,s,o,u){if(r.playlists&&r.playlists.length){var l=r.playlists;e=Mf(e,Nf(l,i))}}),e},$o=function(a){$(t,a);function t(n,e,r,s){var o;r===void 0&&(r={}),o=a.call(this)||this,o.masterPlaylistLoader_=s||ie(o),s||(o.isMaster_=!0);var u=r,l=u.withCredentials,c=l===void 0?!1:l,g=u.handleManifestRedirects,p=g===void 0?!1:g;if(o.vhs_=e,o.withCredentials=c,o.handleManifestRedirects=p,!n)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=gt("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=n,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=n,o}var i=t.prototype;return i.requestErrored_=function(e,r,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:r.status,message:"DASH request error at URL: "+r.uri,response:r.response,code:2},s&&(this.state=s),this.trigger("error"),!0},i.addSidxSegments_=function(e,r,s){var o=this,u=e.sidx&&Vn(e.sidx);if(!e.sidx||!u||this.masterPlaylistLoader_.sidxMapping_[u]){this.mediaRequest_=w.setTimeout(function(){return s(!1)},0);return}var l=ba(this.handleManifestRedirects,e.sidx.resolvedUri),c=function(p,y){if(!o.requestErrored_(p,y,r)){var b=o.masterPlaylistLoader_.sidxMapping_,S;try{S=qv(J(y.response).subarray(8))}catch(x){o.requestErrored_(x,y,r);return}return b[u]={sidxInfo:e.sidx,sidx:S},Es(e,S,e.sidx.resolvedUri),s(!0)}};this.request=gy(l,this.vhs_.xhr,function(g,p,y,b){if(g)return c(g,p);if(!y||y!=="mp4")return c({status:p.status,message:"Unsupported "+(y||"unknown")+" container type for sidx segment at URL: "+l,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},p);var S=e.sidx.byterange,x=S.offset,A=S.length;if(b.length>=A+x)return c(g,{response:b.subarray(x,x+A),status:p.status,uri:p.uri});o.request=o.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:Go({byterange:e.sidx.byterange})},c)})},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},w.clearTimeout(this.minimumUpdatePeriodTimeout_),w.clearTimeout(this.mediaRequest_),w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var r=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){r.haveMetadata({startingState:s,playlist:e})}))},i.haveMetadata=function(e){var r=e.startingState,s=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[s.id]=s,this.mediaRequest_=null,this.refreshMedia_(s.id),r==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(w.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},i.load=function(e){var r=this;w.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var s=this.media();if(e){var o=s?s.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=w.setTimeout(function(){return r.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")},i.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=w.setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(r,s){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])})},i.requestMaster_=function(e){var r=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(s,o){if(r.requestErrored_(s,o)){r.state==="HAVE_NOTHING"&&(r.started=!1);return}var u=o.responseText!==r.masterPlaylistLoader_.masterXml_;if(r.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?r.masterLoaded_=Date.parse(o.responseHeaders.date):r.masterLoaded_=Date.now(),r.masterPlaylistLoader_.srcUrl=ba(r.handleManifestRedirects,r.masterPlaylistLoader_.srcUrl,o),u){r.handleMaster_(),r.syncClientServerClock_(function(){return e(o,u)});return}return e(o,u)})},i.syncClientServerClock_=function(e){var r=this,s=Hv(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:mt(this.masterPlaylistLoader_.srcUrl,s.value),method:s.method,withCredentials:this.withCredentials},function(o,u){if(!!r.request){if(o)return r.masterPlaylistLoader_.clientOffset_=r.masterLoaded_-Date.now(),e();var l;s.method==="HEAD"?!u.responseHeaders||!u.responseHeaders.date?l=r.masterLoaded_:l=Date.parse(u.responseHeaders.date):l=Date.parse(u.responseText),r.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}})},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,r=_y({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(r=yy(e,r,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=r||e;var s=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return s&&s!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=s),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(r)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(w.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var r=e.master&&e.master.minimumUpdatePeriod;if(r===0&&(e.media()?r=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof r!="number"||r<=0){r<0&&this.logger_("found invalid minimumUpdatePeriod of "+r+", not setting a timeout");return}this.createMUPTimeout_(r)},i.createMUPTimeout_=function(e){var r=this.masterPlaylistLoader_;r.minimumUpdatePeriodTimeout_=w.setTimeout(function(){r.minimumUpdatePeriodTimeout_=null,r.trigger("minimumUpdatePeriod"),r.createMUPTimeout_(e)},e)},i.refreshXml_=function(){var e=this;this.requestMaster_(function(r,s){!s||(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=by(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(o){e.refreshMedia_(e.media().id)}))})},i.refreshMedia_=function(e){var r=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(){r.media().endList||(r.mediaUpdateTimeout=w.setTimeout(function(){r.trigger("mediaupdatetimeout"),l()},Wo(r.media(),Boolean(o))))};u()}this.trigger("loadedplaylist")},t}(vy),Oe={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},xy=function(t){for(var i=new Uint8Array(new ArrayBuffer(t.length)),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer},Ff=function(t){return t.on=t.addEventListener,t.off=t.removeEventListener,t},Sy=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch{var i=new BlobBuilder;return i.append(t),URL.createObjectURL(i.getBlob())}},Uf=function(t){return function(){var i=Sy(t),n=Ff(new Worker(i));n.objURL=i;var e=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(i),e.call(this)},n}},Bf=function(t){return"var browserWorkerPolyFill = "+Ff.toString()+`;
  53. browserWorkerPolyFill(self);
  54. `+t},Hf=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},Ey=Bf(Hf(function(){var a=function(){this.init=function(){var d={};this.on=function(h,f){d[h]||(d[h]=[]),d[h]=d[h].concat(f)},this.off=function(h,f){var m;return d[h]?(m=d[h].indexOf(f),d[h]=d[h].slice(),d[h].splice(m,1),m>-1):!1},this.trigger=function(h){var f,m,v,_;if(f=d[h],!!f)if(arguments.length===2)for(v=f.length,m=0;m<v;++m)f[m].call(this,arguments[1]);else{for(_=[],m=arguments.length,m=1;m<arguments.length;++m)_.push(arguments[m]);for(v=f.length,m=0;m<v;++m)f[m].apply(this,_)}},this.dispose=function(){d={}}}};a.prototype.pipe=function(T){return this.on("data",function(d){T.push(d)}),this.on("done",function(d){T.flush(d)}),this.on("partialdone",function(d){T.partialFlush(d)}),this.on("endedtimeline",function(d){T.endTimeline(d)}),this.on("reset",function(d){T.reset(d)}),T},a.prototype.push=function(T){this.trigger("data",T)},a.prototype.flush=function(T){this.trigger("done",T)},a.prototype.partialFlush=function(T){this.trigger("partialdone",T)},a.prototype.endTimeline=function(T){this.trigger("endedtimeline",T)},a.prototype.reset=function(T){this.trigger("reset",T)};var t=a,i=Math.pow(2,32),n=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f;return h.getBigUint64?(f=h.getBigUint64(0),f<Number.MAX_SAFE_INTEGER?Number(f):f):h.getUint32(0)*i+h.getUint32(4)},e={getUint64:n,MAX_UINT32:i},r=e.MAX_UINT32,s,o,u,l,c,g,p,y,b,S,x,A,O,H,L,M,j,U,F,W,R,Q,B,K,te,ae,ee,se,de,ke,ue,He,Ne,At,Kt,ri;(function(){var T;if(B={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array!="undefined"){for(T in B)B.hasOwnProperty(T)&&(B[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);K=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),ae=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),te=new Uint8Array([0,0,0,1]),ee=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]),se=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]),de={video:ee,audio:se},He=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]),Ne=new Uint8Array([0,0,0,0,0,0,0,0]),At=Ne,Kt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),ri=Ne,ke=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),s=function(d){var h=[],f=0,m,v,_;for(m=1;m<arguments.length;m++)h.push(arguments[m]);for(m=h.length;m--;)f+=h[m].byteLength;for(v=new Uint8Array(f+8),_=new DataView(v.buffer,v.byteOffset,v.byteLength),_.setUint32(0,v.byteLength),v.set(d,4),m=0,f=8;m<h.length;m++)v.set(h[m],f),f+=h[m].byteLength;return v},o=function(){return s(B.dinf,s(B.dref,He))},u=function(d){return s(B.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,d.audioobjecttype<<3|d.samplingfrequencyindex>>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},l=function(){return s(B.ftyp,K,te,K,ae)},M=function(d){return s(B.hdlr,de[d])},c=function(d){return s(B.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(B.mdhd,h)},H=function(d){return s(B.mdia,L(d),M(d.type),p(d))},g=function(d){return s(B.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},p=function(d){return s(B.minf,d.type==="video"?s(B.vmhd,ke):s(B.smhd,ue),o(),U(d))},y=function(d,h){for(var f=[],m=h.length;m--;)f[m]=W(h[m]);return s.apply(null,[B.moof,g(d)].concat(f))},b=function(d){for(var h=d.length,f=[];h--;)f[h]=A(d[h]);return s.apply(null,[B.moov,x(4294967295)].concat(f).concat(S(d)))},S=function(d){for(var h=d.length,f=[];h--;)f[h]=R(d[h]);return s.apply(null,[B.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(B.mvhd,h)},j=function(d){var h=d.samples||[],f=new Uint8Array(4+h.length),m,v;for(v=0;v<h.length;v++)m=h[v].flags,f[v+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return s(B.sdtp,f)},U=function(d){return s(B.stbl,F(d),s(B.stts,ri),s(B.stsc,At),s(B.stsz,Kt),s(B.stco,Ne))},function(){var T,d;F=function(f){return s(B.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),f.type==="video"?T(f):d(f))},T=function(f){var m=f.sps||[],v=f.pps||[],_=[],E=[],C,k;for(C=0;C<m.length;C++)_.push((m[C].byteLength&65280)>>>8),_.push(m[C].byteLength&255),_=_.concat(Array.prototype.slice.call(m[C]));for(C=0;C<v.length;C++)E.push((v[C].byteLength&65280)>>>8),E.push(v[C].byteLength&255),E=E.concat(Array.prototype.slice.call(v[C]));if(k=[B.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(B.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([m.length],_,[v.length],E))),s(B.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var P=f.sarRatio[0],I=f.sarRatio[1];k.push(s(B.pasp,new Uint8Array([(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255,(I&4278190080)>>24,(I&16711680)>>16,(I&65280)>>8,I&255])))}return s.apply(null,k)},d=function(f){return s(B.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(B.tkhd,h)},W=function(d){var h,f,m,v,_,E,C;return h=s(B.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/r),C=Math.floor(d.baseMediaDecodeTime%r),f=s(B.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])),_=32+20+8+16+8+8,d.type==="audio"?(m=Q(d,_),s(B.traf,h,f,m)):(v=j(d),m=Q(d,v.length+_),s(B.traf,h,f,m,v))},A=function(d){return d.duration=d.duration||4294967295,s(B.trak,O(d),H(d))},R=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(B.trex,h)},function(){var T,d,h;h=function(m,v){var _=0,E=0,C=0,k=0;return m.length&&(m[0].duration!==void 0&&(_=1),m[0].size!==void 0&&(E=2),m[0].flags!==void 0&&(C=4),m[0].compositionTimeOffset!==void 0&&(k=8)),[0,0,_|E|C|k,1,(m.length&4278190080)>>>24,(m.length&16711680)>>>16,(m.length&65280)>>>8,m.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]},d=function(m,v){var _,E,C,k,P,I;for(k=m.samples||[],v+=8+12+16*k.length,C=h(k,v),E=new Uint8Array(C.length+k.length*16),E.set(C),_=C.length,I=0;I<k.length;I++)P=k[I],E[_++]=(P.duration&4278190080)>>>24,E[_++]=(P.duration&16711680)>>>16,E[_++]=(P.duration&65280)>>>8,E[_++]=P.duration&255,E[_++]=(P.size&4278190080)>>>24,E[_++]=(P.size&16711680)>>>16,E[_++]=(P.size&65280)>>>8,E[_++]=P.size&255,E[_++]=P.flags.isLeading<<2|P.flags.dependsOn,E[_++]=P.flags.isDependedOn<<6|P.flags.hasRedundancy<<4|P.flags.paddingValue<<1|P.flags.isNonSyncSample,E[_++]=P.flags.degradationPriority&240<<8,E[_++]=P.flags.degradationPriority&15,E[_++]=(P.compositionTimeOffset&4278190080)>>>24,E[_++]=(P.compositionTimeOffset&16711680)>>>16,E[_++]=(P.compositionTimeOffset&65280)>>>8,E[_++]=P.compositionTimeOffset&255;return s(B.trun,E)},T=function(m,v){var _,E,C,k,P,I;for(k=m.samples||[],v+=8+12+8*k.length,C=h(k,v),_=new Uint8Array(C.length+k.length*8),_.set(C),E=C.length,I=0;I<k.length;I++)P=k[I],_[E++]=(P.duration&4278190080)>>>24,_[E++]=(P.duration&16711680)>>>16,_[E++]=(P.duration&65280)>>>8,_[E++]=P.duration&255,_[E++]=(P.size&4278190080)>>>24,_[E++]=(P.size&16711680)>>>16,_[E++]=(P.size&65280)>>>8,_[E++]=P.size&255;return s(B.trun,_)},Q=function(m,v){return m.type==="audio"?T(m,v):d(m,v)}}();var vt={ftyp:l,mdat:c,moof:y,moov:b,initSegment:function(d){var h=l(),f=b(d),m;return m=new Uint8Array(h.byteLength+f.byteLength),m.set(h),m.set(f,h.byteLength),m}},xi=function(d){var h,f,m=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,m.byteLength=0,h=0;h<d.length;h++)f=d[h],f.nalUnitType==="access_unit_delimiter_rbsp"?(m.length&&(m.duration=f.dts-m.dts,v.byteLength+=m.byteLength,v.nalCount+=m.length,v.duration+=m.duration,v.push(m)),m=[f],m.byteLength=f.data.byteLength,m.pts=f.pts,m.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(m.keyFrame=!0),m.duration=f.dts-m.dts,m.byteLength+=f.data.byteLength,m.push(f));return v.length&&(!m.duration||m.duration<=0)&&(m.duration=v[v.length-1].duration),v.byteLength+=m.byteLength,v.nalCount+=m.length,v.duration+=m.duration,v.push(m),v},Si=function(d){var h,f,m=[],v=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,m.pts=d[0].pts,m.dts=d[0].dts,v.byteLength=0,v.nalCount=0,v.duration=0,v.pts=d[0].pts,v.dts=d[0].dts,h=0;h<d.length;h++)f=d[h],f.keyFrame?(m.length&&(v.push(m),v.byteLength+=m.byteLength,v.nalCount+=m.nalCount,v.duration+=m.duration),m=[f],m.nalCount=f.length,m.byteLength=f.byteLength,m.pts=f.pts,m.dts=f.dts,m.duration=f.duration):(m.duration+=f.duration,m.nalCount+=f.length,m.byteLength+=f.byteLength,m.push(f));return v.length&&m.duration<=0&&(m.duration=v[v.length-1].duration),v.byteLength+=m.byteLength,v.nalCount+=m.nalCount,v.duration+=m.duration,v.push(m),v},Ei=function(d){var h;return!d[0][0].keyFrame&&d.length>1&&(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},yh=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ru=function(d,h){var f=yh();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},Th=function(d,h){var f,m,v,_,E,C=h||0,k=[];for(f=0;f<d.length;f++)for(_=d[f],m=0;m<_.length;m++)E=_[m],v=ru(E,C),C+=v.size,k.push(v);return k},bh=function(d){var h,f,m,v,_,E,C=0,k=d.byteLength,P=d.nalCount,I=k+4*P,N=new Uint8Array(I),z=new DataView(N.buffer);for(h=0;h<d.length;h++)for(v=d[h],f=0;f<v.length;f++)for(_=v[f],m=0;m<_.length;m++)E=_[m],z.setUint32(C,E.data.byteLength),C+=4,N.set(E.data,C),C+=E.data.byteLength;return N},xh=function(d,h){var f,m=h||0,v=[];return f=ru(d,m),v.push(f),v},Sh=function(d){var h,f,m=0,v=d.byteLength,_=d.length,E=v+4*_,C=new Uint8Array(E),k=new DataView(C.buffer);for(h=0;h<d.length;h++)f=d[h],k.setUint32(m,f.data.byteLength),m+=4,C.set(f.data,m),m+=f.data.byteLength;return C},lr={groupNalsIntoFrames:xi,groupFramesIntoGops:Si,extendFirstKeyFrame:Ei,generateSampleTable:Th,concatenateNalData:bh,generateSampleTableForFrame:xh,concatenateNalDataForFrame:Sh},Xt=[33,16,5,32,164,27],Ma=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ce=function(d){for(var h=[];d--;)h.push(0);return h},Eh=function(d){return Object.keys(d).reduce(function(h,f){return h[f]=new Uint8Array(d[f].reduce(function(m,v){return m.concat(v)},[])),h},{})},Ra,Ch=function(){if(!Ra){var d={96e3:[Xt,[227,64],ce(154),[56]],88200:[Xt,[231],ce(170),[56]],64e3:[Xt,[248,192],ce(240),[56]],48e3:[Xt,[255,192],ce(268),[55,148,128],ce(54),[112]],44100:[Xt,[255,192],ce(268),[55,163,128],ce(84),[112]],32e3:[Xt,[255,192],ce(268),[55,234],ce(226),[112]],24e3:[Xt,[255,192],ce(268),[55,255,128],ce(268),[111,112],ce(126),[224]],16e3:[Xt,[255,192],ce(268),[55,255,128],ce(268),[111,255],ce(269),[223,108],ce(195),[1,192]],12e3:[Ma,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,253,128],ce(259),[56]],11025:[Ma,ce(268),[3,127,248],ce(268),[6,255,240],ce(268),[13,255,224],ce(268),[27,255,192],ce(268),[55,175,128],ce(108),[112]],8e3:[Ma,ce(268),[3,121,16],ce(47),[7]]};Ra=Eh(d)}return Ra},Na=9e4,Fa,Ua,an,Ba,nu,au,su;Fa=function(d){return d*Na},Ua=function(d,h){return d*h},an=function(d){return d/Na},Ba=function(d,h){return d/h},nu=function(d,h){return Fa(Ba(d,h))},au=function(d,h){return Ua(an(d),h)},su=function(d,h,f){return an(f?d:d-h)};var le={ONE_SECOND_IN_TS:Na,secondsToVideoTs:Fa,secondsToAudioTs:Ua,videoTsToSeconds:an,audioTsToSeconds:Ba,audioTsToVideoTs:nu,videoTsToAudioTs:au,metadataTsToSeconds:su},wh=function(d){var h,f,m=0;for(h=0;h<d.length;h++)f=d[h],m+=f.data.byteLength;return m},Ph=function(d,h,f,m){var v,_=0,E=0,C=0,k=0,P,I,N;if(!!h.length&&(v=le.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),_=Math.ceil(le.ONE_SECOND_IN_TS/(d.samplerate/1024)),f&&m&&(E=v-Math.max(f,m),C=Math.floor(E/_),k=C*_),!(C<1||k>le.ONE_SECOND_IN_TS/2))){for(P=Ch()[d.samplerate],P||(P=h[0].data),I=0;I<C;I++)N=h[0],h.splice(0,0,{data:P,dts:N.dts-_,pts:N.pts-_});return d.baseMediaDecodeTime-=Math.floor(le.videoTsToAudioTs(k,d.samplerate)),k}},kh=function(d,h,f){return h.minSegmentDts>=f?d:(h.minSegmentDts=1/0,d.filter(function(m){return m.dts>=f?(h.minSegmentDts=Math.min(h.minSegmentDts,m.dts),h.minSegmentPts=h.minSegmentDts,!0):!1}))},Ah=function(d){var h,f,m=[];for(h=0;h<d.length;h++)f=d[h],m.push({size:f.data.byteLength,duration:1024});return m},Ih=function(d){var h,f,m=0,v=new Uint8Array(wh(d));for(h=0;h<d.length;h++)f=d[h],v.set(f.data,m),m+=f.data.byteLength;return v},sn={prefixWithSilence:Ph,trimAdtsFramesByEarliestDts:kh,generateSampleTable:Ah,concatenateFrameData:Ih},Dh=le.ONE_SECOND_IN_TS,Oh=function(d,h){typeof h.pts=="number"&&(d.timelineStartInfo.pts===void 0&&(d.timelineStartInfo.pts=h.pts),d.minSegmentPts===void 0?d.minSegmentPts=h.pts:d.minSegmentPts=Math.min(d.minSegmentPts,h.pts),d.maxSegmentPts===void 0?d.maxSegmentPts=h.pts:d.maxSegmentPts=Math.max(d.maxSegmentPts,h.pts)),typeof h.dts=="number"&&(d.timelineStartInfo.dts===void 0&&(d.timelineStartInfo.dts=h.dts),d.minSegmentDts===void 0?d.minSegmentDts=h.dts:d.minSegmentDts=Math.min(d.minSegmentDts,h.dts),d.maxSegmentDts===void 0?d.maxSegmentDts=h.dts:d.maxSegmentDts=Math.max(d.maxSegmentDts,h.dts))},Lh=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},Mh=function(d,h){var f,m,v=d.minSegmentDts;return h||(v-=d.timelineStartInfo.dts),f=d.timelineStartInfo.baseMediaDecodeTime,f+=v,f=Math.max(0,f),d.type==="audio"&&(m=d.samplerate/Dh,f*=m,f=Math.floor(f)),f},ut={clearDtsInfo:Lh,calculateTrackBaseMediaDecodeTime:Mh,collectDtsInfo:Oh},ou=4,Rh=128,Nh=function(d){for(var h=0,f={payloadType:-1,payloadSize:0},m=0,v=0;h<d.byteLength&&d[h]!==Rh;){for(;d[h]===255;)m+=255,h++;for(m+=d[h++];d[h]===255;)v+=255,h++;if(v+=d[h++],!f.payload&&m===ou){var _=String.fromCharCode(d[h+3],d[h+4],d[h+5],d[h+6]);if(_==="GA94"){f.payloadType=m,f.payloadSize=v,f.payload=d.subarray(h,h+v);break}else f.payload=void 0}h+=v,m=0,v=0}return f},Fh=function(d){return d.payload[0]!==181||(d.payload[1]<<8|d.payload[2])!=49||String.fromCharCode(d.payload[3],d.payload[4],d.payload[5],d.payload[6])!=="GA94"||d.payload[7]!==3?null:d.payload.subarray(8,d.payload.length-1)},Uh=function(d,h){var f=[],m,v,_,E;if(!(h[0]&64))return f;for(v=h[0]&31,m=0;m<v;m++)_=m*3,E={type:h[_+2]&3,pts:d},h[_+2]&4&&(E.ccData=h[_+3]<<8|h[_+4],f.push(E));return f},Bh=function(d){for(var h=d.byteLength,f=[],m=1,v,_;m<h-2;)d[m]===0&&d[m+1]===0&&d[m+2]===3?(f.push(m+2),m+=2):m++;if(f.length===0)return d;v=h-f.length,_=new Uint8Array(v);var E=0;for(m=0;m<v;E++,m++)E===f[0]&&(E++,f.shift()),_[m]=d[E];return _},dr={parseSei:Nh,parseUserData:Fh,parseCaptionPackets:Uh,discardEmulationPreventionBytes:Bh,USER_DATA_REGISTERED_ITU_T_T35:ou},tt=function T(d){d=d||{},T.prototype.init.call(this),this.parse708captions_=typeof d.parse708captions=="boolean"?d.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Te(0,0),new Te(0,1),new Te(1,0),new Te(1,1)],this.parse708captions_&&(this.cc708Stream_=new me({captionServices:d.captionServices})),this.reset(),this.ccStreams_.forEach(function(h){h.on("data",this.trigger.bind(this,"data")),h.on("partialdone",this.trigger.bind(this,"partialdone")),h.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};tt.prototype=new t,tt.prototype.push=function(T){var d,h,f;if(T.nalUnitType==="sei_rbsp"&&(d=dr.parseSei(T.escapedRBSP),!!d.payload&&d.payloadType===dr.USER_DATA_REGISTERED_ITU_T_T35&&(h=dr.parseUserData(d),!!h))){if(T.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(T.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}f=dr.parseCaptionPackets(T.pts,h),this.captionPackets_=this.captionPackets_.concat(f),this.latestDts_!==T.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=T.dts}},tt.prototype.flushCCStreams=function(T){this.ccStreams_.forEach(function(d){return T==="flush"?d.flush():d.partialFlush()},this)},tt.prototype.flushStream=function(T){if(!this.captionPackets_.length){this.flushCCStreams(T);return}this.captionPackets_.forEach(function(d,h){d.presortIndex=h}),this.captionPackets_.sort(function(d,h){return d.pts===h.pts?d.presortIndex-h.presortIndex:d.pts-h.pts}),this.captionPackets_.forEach(function(d){d.type<2?this.dispatchCea608Packet(d):this.dispatchCea708Packet(d)},this),this.captionPackets_.length=0,this.flushCCStreams(T)},tt.prototype.flush=function(){return this.flushStream("flush")},tt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},tt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(T){T.reset()})},tt.prototype.dispatchCea608Packet=function(T){this.setsTextOrXDSActive(T)?this.activeCea608Channel_[T.type]=null:this.setsChannel1Active(T)?this.activeCea608Channel_[T.type]=0:this.setsChannel2Active(T)&&(this.activeCea608Channel_[T.type]=1),this.activeCea608Channel_[T.type]!==null&&this.ccStreams_[(T.type<<1)+this.activeCea608Channel_[T.type]].push(T)},tt.prototype.setsChannel1Active=function(T){return(T.ccData&30720)==4096},tt.prototype.setsChannel2Active=function(T){return(T.ccData&30720)==6144},tt.prototype.setsTextOrXDSActive=function(T){return(T.ccData&28928)==256||(T.ccData&30974)==4138||(T.ccData&30974)==6186},tt.prototype.dispatchCea708Packet=function(T){this.parse708captions_&&this.cc708Stream_.push(T)};var Hh={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Vh=function(d){var h=Hh[d]||d;return d&4096&&d===h?"":String.fromCharCode(h)},on=function(d){return 32<=d&&d<=127||160<=d&&d<=255},It=function(d){this.windowNum=d,this.reset()};It.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},It.prototype.getText=function(){return this.rows.join(`
  55. `)},It.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},It.prototype.newLine=function(T){for(this.rows.length>=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--},It.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},It.prototype.addText=function(T){this.rows[this.rowIdx]+=T},It.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var un=function(d,h,f){this.serviceNum=d,this.text="",this.currentWindow=new It(-1),this.windows=[],this.stream=f,typeof h=="string"&&this.createTextDecoder(h)};un.prototype.init=function(T,d){this.startPts=T;for(var h=0;h<8;h++)this.windows[h]=new It(h),typeof d=="function"&&(this.windows[h].beforeRowOverflow=d)},un.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},un.prototype.createTextDecoder=function(T){if(typeof TextDecoder=="undefined")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||{},m={},v;Object.keys(f).forEach(function(_){v=f[_],/^SERVICE/.test(_)&&(m[_]=v.encoding)}),this.serviceEncodings=m,this.current708Packet=null,this.services={},this.push=function(_){_.type===3?(h.new708Packet(),h.add708Bytes(_)):(h.current708Packet===null&&h.new708Packet(),h.add708Bytes(_))}};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,m=0,v=d[m++];for(T.seq=v>>6,T.sizeCode=v&63;m<d.length;m++)v=d[m++],h=v>>5,f=v&31,h===7&&f>0&&(v=d[m++],h=v),this.pushServiceBlock(h,m,f),f>0&&(m+=f-1)},me.prototype.pushServiceBlock=function(T,d,h){var f,m=d,v=this.current708Packet.data,_=this.services[T];for(_||(_=this.initService(T,m));m<d+h&&m<v.length;m++)f=v[m],on(f)?m=this.handleText(m,_):f===24?m=this.multiByteCharacter(m,_):f===16?m=this.extendedCommands(m,_):128<=f&&f<=135?m=this.setCurrentWindow(m,_):152<=f&&f<=159?m=this.defineWindow(m,_):f===136?m=this.clearWindows(m,_):f===140?m=this.deleteWindows(m,_):f===137?m=this.displayWindows(m,_):f===138?m=this.hideWindows(m,_):f===139?m=this.toggleWindows(m,_):f===151?m=this.setWindowAttributes(m,_):f===144?m=this.setPenAttributes(m,_):f===145?m=this.setPenColor(m,_):f===146?m=this.setPenLocation(m,_):f===143?_=this.reset(m,_):f===8?_.currentWindow.backspace():f===12?_.currentWindow.clearText():f===13?_.currentWindow.pendingNewLine=!0:f===14?_.currentWindow.clearText():f===141&&m++},me.prototype.extendedCommands=function(T,d){var h=this.current708Packet.data,f=h[++T];return on(f)&&(T=this.handleText(T,d,{isExtended:!0})),T},me.prototype.getPts=function(T){return this.current708Packet.ptsVals[Math.floor(T/2)]},me.prototype.initService=function(T,d){var h="SERVICE"+T,f=this,h,m;return h in this.serviceEncodings&&(m=this.serviceEncodings[h]),this.services[T]=new un(T,m,f),this.services[T].init(this.getPts(d),function(v){f.flushDisplayed(v,f.services[T])}),this.services[T]},me.prototype.handleText=function(T,d,h){var f=h&&h.isExtended,m=h&&h.isMultiByte,v=this.current708Packet.data,_=f?4096:0,E=v[T],C=v[T+1],k=d.currentWindow,P,I;return d.textDecoder_&&!f?(m?(I=[E,C],T++):I=[E],P=d.textDecoder_.decode(new Uint8Array(I))):P=Vh(_|E),k.pendingNewLine&&!k.isEmpty()&&k.newLine(this.getPts(T)),k.pendingNewLine=!1,k.addText(P),T},me.prototype.multiByteCharacter=function(T,d){var h=this.current708Packet.data,f=h[T+1],m=h[T+2];return on(f)&&on(m)&&(T=this.handleText(++T,d,{isMultiByte:!0})),T},me.prototype.setCurrentWindow=function(T,d){var h=this.current708Packet.data,f=h[T],m=f&7;return d.setCurrentWindow(m),T},me.prototype.defineWindow=function(T,d){var h=this.current708Packet.data,f=h[T],m=f&7;d.setCurrentWindow(m);var v=d.currentWindow;return f=h[++T],v.visible=(f&32)>>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],m=d.currentWindow.winAttr;return f=h[++T],m.fillOpacity=(f&192)>>6,m.fillRed=(f&48)>>4,m.fillGreen=(f&12)>>2,m.fillBlue=f&3,f=h[++T],m.borderType=(f&192)>>6,m.borderRed=(f&48)>>4,m.borderGreen=(f&12)>>2,m.borderBlue=f&3,f=h[++T],m.borderType+=(f&128)>>5,m.wordWrap=(f&64)>>6,m.printDirection=(f&48)>>4,m.scrollDirection=(f&12)>>2,m.justify=f&3,f=h[++T],m.effectSpeed=(f&240)>>4,m.effectDirection=(f&12)>>2,m.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(`
  56. `),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],m=this.getPts(T);this.flushDisplayed(m,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=1);return T},me.prototype.hideWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],m=this.getPts(T);this.flushDisplayed(m,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=0);return T},me.prototype.toggleWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],m=this.getPts(T);this.flushDisplayed(m,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible^=1);return T},me.prototype.clearWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],m=this.getPts(T);this.flushDisplayed(m,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].clearText();return T},me.prototype.deleteWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],m=this.getPts(T);this.flushDisplayed(m,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].reset();return T},me.prototype.setPenAttributes=function(T,d){var h=this.current708Packet.data,f=h[T],m=d.currentWindow.penAttr;return f=h[++T],m.textTag=(f&240)>>4,m.offset=(f&12)>>2,m.penSize=f&3,f=h[++T],m.italics=(f&128)>>7,m.underline=(f&64)>>6,m.edgeType=(f&56)>>3,m.fontStyle=f&7,T},me.prototype.setPenColor=function(T,d){var h=this.current708Packet.data,f=h[T],m=d.currentWindow.penColor;return f=h[++T],m.fgOpacity=(f&192)>>6,m.fgRed=(f&48)>>4,m.fgGreen=(f&12)>>2,m.fgBlue=f&3,f=h[++T],m.bgOpacity=(f&192)>>6,m.bgRed=(f&48)>>4,m.bgGreen=(f&12)>>2,m.bgBlue=f&3,f=h[++T],m.edgeRed=(f&48)>>4,m.edgeGreen=(f&12)>>2,m.edgeBlue=f&3,T},me.prototype.setPenLocation=function(T,d){var h=this.current708Packet.data,f=h[T],m=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,f=h[++T],m.row=f&15,f=h[++T],m.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 jh={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},ln=function(d){return d===null?"":(d=jh[d]||d,String.fromCharCode(d))},dn=14,Wh=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ni=function(){for(var d=[],h=dn+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 m,v,_,E,C;if(m=f.ccData&32639,m===this.lastControlCode_){this.lastControlCode_=null;return}if((m&61440)==4096?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),_=m>>>8,E=m&255,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===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(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(m===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(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=ni();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ni();else if(m===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=ni()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(_,E))_=(_&3)<<8,C=ln(_|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isExtCharacter(_,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),_=(_&3)<<8,C=ln(_|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isMidRowCode(_,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(_,E))this.column_+=E&3;else if(this.isPAC(_,E)){var k=Wh.indexOf(m&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"]),(m&16)==16&&(this.column_=((m&14)>>1)*4),this.isColorPAC(E)&&(E&14)==14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(_)&&(E===0&&(E=null),C=ln(_),C+=ln(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(`
  57. `).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_=ni(),this.nonDisplayed_=ni(),this.lastControlCode_=null,this.column_=0,this.row_=dn,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<this.BASE_+8&&d>=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_=dn,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=ni(),this.displayed_=ni()),d!==void 0&&d!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[d-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]="";d===void 0&&(d=this.row_),this.topRow_=d-this.rollUpRows_+1},Te.prototype.addFormatting=function(T,d){this.formatting_=this.formatting_.concat(d);var h=d.reduce(function(f,m){return f+"<"+m+">"},"");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+"</"+f+">"},"");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;T<this.topRow_;T++)this.displayed_[T]="";for(T=this.row_+1;T<dn+1;T++)this.displayed_[T]="";for(T=this.topRow_;T<this.row_;T++)this.displayed_[T]=this.displayed_[T+1];this.displayed_[this.row_]=""},Te.prototype.paintOn=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h};var cn={CaptionStream:tt,Cea608Stream:Te,Cea708Stream:me},Le={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},qh=8589934592,Gh=4294967296,uu="shared",Ha=function(d,h){var f=1;for(d>h&&(f=-1);Math.abs(h-d)>Gh;)d+=f*qh;return d},lu=function T(d){var h,f;T.prototype.init.call(this),this.type_=d||uu,this.push=function(m){this.type_!==uu&&m.type!==this.type_||(f===void 0&&(f=m.dts),m.dts=Ha(m.dts,f),m.pts=Ha(m.pts,f),h=m.dts,this.trigger("data",m))},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")}};lu.prototype=new t;var du={TimestampRolloverStream:lu,handleRollover:Ha},cu=function(d,h,f){var m,v="";for(m=h;m<f;m++)v+="%"+("00"+d[m].toString(16)).slice(-2);return v},fn=function(d,h,f){return decodeURIComponent(cu(d,h,f))},zh=function(d,h,f){return unescape(cu(d,h,f))},hn=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},fu={TXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=fn(d.data,1,h),d.value=fn(d.data,h+1,d.data.length).replace(/\0*$/,"");break}d.data=d.value}},WXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=fn(d.data,1,h),d.url=fn(d.data,h+1,d.data.length);break}}},PRIV:function(d){var h;for(h=0;h<d.data.length;h++)if(d.data[h]===0){d.owner=zh(d.data,0,h);break}d.privateData=d.data.subarray(h+1),d.data=d.privateData}},pn;pn=function(d){var h={descriptor:d&&d.descriptor},f=0,m=[],v=0,_;if(pn.prototype.init.call(this),this.dispatchType=Le.METADATA_STREAM_TYPE.toString(16),h.descriptor)for(_=0;_<h.descriptor.length;_++)this.dispatchType+=("00"+h.descriptor[_].toString(16)).slice(-2);this.push=function(E){var C,k,P,I,N,z;if(E.type==="timed-metadata"){if(E.dataAlignmentIndicator&&(v=0,m.length=0),m.length===0&&(E.data.length<10||E.data[0]!=="I".charCodeAt(0)||E.data[1]!=="D".charCodeAt(0)||E.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(m.push(E),v+=E.data.byteLength,m.length===1&&(f=hn(E.data.subarray(6,10)),f+=10),!(v<f)){for(C={data:new Uint8Array(f),frames:[],pts:m[0].pts,dts:m[0].dts},N=0;N<f;)C.data.set(m[0].data.subarray(0,f-N),N),N+=m[0].data.byteLength,v-=m[0].data.byteLength,m.shift();k=10,C.data[5]&64&&(k+=4,k+=hn(C.data.subarray(10,14)),f-=hn(C.data.subarray(16,20)));do{if(P=hn(C.data.subarray(k+4,k+8)),P<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(z=String.fromCharCode(C.data[k],C.data[k+1],C.data[k+2],C.data[k+3]),I={id:z,data:C.data.subarray(k+10,k+P+10)},I.key=I.id,fu[I.id]&&(fu[I.id](I),I.owner==="com.apple.streaming.transportStreamTimestamp")){var Y=I.data,q=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;q*=4,q+=Y[7]&3,I.timeStamp=q,C.pts===void 0&&C.dts===void 0&&(C.pts=I.timeStamp,C.dts=I.timeStamp),this.trigger("timestamp",I)}C.frames.push(I),k+=10,k+=P}while(k<f);this.trigger("data",C)}}}},pn.prototype=new t;var $h=pn,Kh=du.TimestampRolloverStream,mn,cr,gn,Ci=188,Va=71;mn=function(){var d=new Uint8Array(Ci),h=0;mn.prototype.init.call(this),this.push=function(f){var m=0,v=Ci,_;for(h?(_=new Uint8Array(f.byteLength+h),_.set(d.subarray(0,h)),_.set(f,h),h=0):_=f;v<_.byteLength;){if(_[m]===Va&&_[v]===Va){this.trigger("data",_.subarray(m,v)),m+=Ci,v+=Ci;continue}m++,v++}m<_.byteLength&&(d.set(_.subarray(m),0),h=_.byteLength-m)},this.flush=function(){h===Ci&&d[0]===Va&&(this.trigger("data",d),h=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){h=0,this.trigger("reset")}},mn.prototype=new t,cr=function(){var d,h,f,m;cr.prototype.init.call(this),m=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(_,E){var C=0;E.payloadUnitStartIndicator&&(C+=_[C]+1),E.type==="pat"?h(_.subarray(C),E):f(_.subarray(C),E)},h=function(_,E){E.section_number=_[7],E.last_section_number=_[8],m.pmtPid=(_[10]&31)<<8|_[11],E.pmtPid=m.pmtPid},f=function(_,E){var C,k,P,I;if(!!(_[5]&1)){for(m.programMapTable={video:null,audio:null,"timed-metadata":{}},C=(_[1]&15)<<8|_[2],k=3+C-4,P=(_[10]&15)<<8|_[11],I=12+P;I<k;){var N=_[I],z=(_[I+1]&31)<<8|_[I+2];N===Le.H264_STREAM_TYPE&&m.programMapTable.video===null?m.programMapTable.video=z:N===Le.ADTS_STREAM_TYPE&&m.programMapTable.audio===null?m.programMapTable.audio=z:N===Le.METADATA_STREAM_TYPE&&(m.programMapTable["timed-metadata"][z]=N),I+=((_[I+3]&15)<<8|_[I+4])+5}E.programMapTable=m.programMapTable}},this.push=function(v){var _={},E=4;if(_.payloadUnitStartIndicator=!!(v[1]&64),_.pid=v[1]&31,_.pid<<=8,_.pid|=v[2],(v[3]&48)>>>4>1&&(E+=v[E]+1),_.pid===0)_.type="pat",d(v.subarray(E),_),this.trigger("data",_);else if(_.pid===this.pmtPid)for(_.type="pmt",d(v.subarray(E),_),this.trigger("data",_);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,E,_]):this.processPes_(v,E,_)},this.processPes_=function(v,_,E){E.pid===this.programMapTable.video?E.streamType=Le.H264_STREAM_TYPE:E.pid===this.programMapTable.audio?E.streamType=Le.ADTS_STREAM_TYPE:E.streamType=this.programMapTable["timed-metadata"][E.pid],E.type="pes",E.data=v.subarray(_),this.trigger("data",E)}},cr.prototype=new t,cr.STREAM_TYPES={h264:27,adts:15},gn=function(){var d=this,h=!1,f={data:[],size:0},m={data:[],size:0},v={data:[],size:0},_,E=function(P,I){var N,z=P[0]<<16|P[1]<<8|P[2];I.data=new Uint8Array,z===1&&(I.packetLength=6+(P[4]<<8|P[5]),I.dataAlignmentIndicator=(P[6]&4)!=0,N=P[7],N&192&&(I.pts=(P[9]&14)<<27|(P[10]&255)<<20|(P[11]&254)<<12|(P[12]&255)<<5|(P[13]&254)>>>3,I.pts*=4,I.pts+=(P[13]&6)>>>1,I.dts=I.pts,N&64&&(I.dts=(P[14]&14)<<27|(P[15]&255)<<20|(P[16]&254)<<12|(P[17]&255)<<5|(P[18]&254)>>>3,I.dts*=4,I.dts+=(P[18]&6)>>>1)),I.data=P.subarray(9+P[8]))},C=function(P,I,N){var z=new Uint8Array(P.size),Y={type:I},q=0,Z=0,Pe=!1,je;if(!(!P.data.length||P.size<9)){for(Y.trackId=P.data[0].pid,q=0;q<P.data.length;q++)je=P.data[q],z.set(je.data,Z),Z+=je.data.byteLength;E(z,Y),Pe=I==="video"||Y.packetLength<=P.size,(N||Pe)&&(P.size=0,P.data.length=0),Pe&&d.trigger("data",Y)}};gn.prototype.init.call(this),this.push=function(k){({pat:function(){},pes:function(){var I,N;switch(k.streamType){case Le.H264_STREAM_TYPE:I=f,N="video";break;case Le.ADTS_STREAM_TYPE:I=m,N="audio";break;case Le.METADATA_STREAM_TYPE:I=v,N="timed-metadata";break;default:return}k.payloadUnitStartIndicator&&C(I,N,!0),I.data.push(k),I.size+=k.data.byteLength},pmt:function(){var I={type:"metadata",tracks:[]};_=k.programMapTable,_.video!==null&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+_.video,codec:"avc",type:"video"}),_.audio!==null&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+_.audio,codec:"adts",type:"audio"}),h=!0,d.trigger("data",I)}})[k.type]()},this.reset=function(){f.size=0,f.data.length=0,m.size=0,m.data.length=0,this.trigger("reset")},this.flushStreams_=function(){C(f,"video"),C(m,"audio"),C(v,"timed-metadata")},this.flush=function(){if(!h&&_){var k={type:"metadata",tracks:[]};_.video!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+_.video,codec:"avc",type:"video"}),_.audio!==null&&k.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+_.audio,codec:"adts",type:"audio"}),d.trigger("data",k)}h=!1,this.flushStreams_(),this.trigger("done")}},gn.prototype=new t;var hu={PAT_PID:0,MP2T_PACKET_LENGTH:Ci,TransportPacketStream:mn,TransportParseStream:cr,ElementaryStream:gn,TimestampRolloverStream:Kh,CaptionStream:cn.CaptionStream,Cea608Stream:cn.Cea608Stream,Cea708Stream:cn.Cea708Stream,MetadataStream:$h};for(var ja in Le)Le.hasOwnProperty(ja)&&(hu[ja]=Le[ja]);var Dt=hu,Xh=le.ONE_SECOND_IN_TS,vn,pu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];vn=function(d){var h,f=0;vn.prototype.init.call(this),this.skipWarn_=function(m,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+m+" to "+v+" in frame "+f+" outside syncword"})},this.push=function(m){var v=0,_,E,C,k,P;if(d||(f=0),m.type==="audio"){h&&h.length?(C=h,h=new Uint8Array(C.byteLength+m.data.byteLength),h.set(C),h.set(m.data,C.byteLength)):h=m.data;for(var I;v+7<h.length;){if(h[v]!==255||(h[v+1]&246)!=240){typeof I!="number"&&(I=v),v++;continue}if(typeof I=="number"&&(this.skipWarn_(I,v),I=null),E=(~h[v+1]&1)*2,_=(h[v+3]&3)<<11|h[v+4]<<3|(h[v+5]&224)>>5,k=((h[v+6]&3)+1)*1024,P=k*Xh/pu[(h[v+2]&60)>>>2],h.byteLength-v<_)break;this.trigger("data",{pts:m.pts+f*P,dts:m.dts+f*P,sampleCount:k,audioobjecttype:(h[v+2]>>>6&3)+1,channelcount:(h[v+2]&1)<<2|(h[v+3]&192)>>>6,samplerate:pu[(h[v+2]&60)>>>2],samplingfrequencyindex:(h[v+2]&60)>>>2,samplesize:16,data:h.subarray(v+7+E,v+_)}),f++,v+=_}typeof I=="number"&&(this.skipWarn_(I,v),I=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")}},vn.prototype=new t;var mu=vn,gu;gu=function(d){var h=d.byteLength,f=0,m=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+m},this.loadWord=function(){var v=d.byteLength-h,_=new Uint8Array(4),E=Math.min(4,h);if(E===0)throw new Error("no bytes available");_.set(d.subarray(v,v+E)),f=new DataView(_.buffer).getUint32(0),m=E*8,h-=E},this.skipBits=function(v){var _;m>v?(f<<=v,m-=v):(v-=m,_=Math.floor(v/8),v-=_*8,h-=_,this.loadWord(),f<<=v,m-=v)},this.readBits=function(v){var _=Math.min(m,v),E=f>>>32-_;return m-=_,m>0?f<<=_:h>0&&this.loadWord(),_=v-_,_>0?E<<_|this.readBits(_):E},this.skipLeadingZeros=function(){var v;for(v=0;v<m;++v)if((f&2147483648>>>v)!=0)return f<<=v,m-=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 Yh=gu,_n,fr,vu;fr=function(){var d=0,h,f;fr.prototype.init.call(this),this.push=function(m){var v;f?(v=new Uint8Array(f.byteLength+m.data.byteLength),v.set(f),v.set(m.data,f.byteLength),f=v):f=m.data;for(var _=f.byteLength;d<_-3;d++)if(f[d+2]===1){h=d+5;break}for(;h<_;)switch(f[h]){case 0:if(f[h-1]!==0){h+=2;break}else if(f[h-2]!==0){h++;break}d+3!==h-2&&this.trigger("data",f.subarray(d+3,h-2));do h++;while(f[h]!==1&&h<_);d=h-2,h+=3;break;case 1:if(f[h-1]!==0||f[h-2]!==0){h+=3;break}this.trigger("data",f.subarray(d+3,h-2)),d=h-2,h+=3;break;default:h+=3;break}f=f.subarray(d),h-=d,d=0},this.reset=function(){f=null,d=0,this.trigger("reset")},this.flush=function(){f&&f.byteLength>3&&this.trigger("data",f.subarray(d+3)),f=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},fr.prototype=new t,vu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},_n=function(){var d=new fr,h,f,m,v,_,E,C;_n.prototype.init.call(this),h=this,this.push=function(k){k.type==="video"&&(f=k.trackId,m=k.pts,v=k.dts,d.push(k))},d.on("data",function(k){var P={trackId:f,pts:m,dts:v,data:k,nalUnitTypeCode:k[0]&31};switch(P.nalUnitTypeCode){case 5:P.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:P.nalUnitType="sei_rbsp",P.escapedRBSP=_(k.subarray(1));break;case 7:P.nalUnitType="seq_parameter_set_rbsp",P.escapedRBSP=_(k.subarray(1)),P.config=E(P.escapedRBSP);break;case 8:P.nalUnitType="pic_parameter_set_rbsp";break;case 9:P.nalUnitType="access_unit_delimiter_rbsp";break}h.trigger("data",P)}),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(P,I){var N=8,z=8,Y,q;for(Y=0;Y<P;Y++)z!==0&&(q=I.readExpGolomb(),z=(N+q+256)%256),N=z===0?N:z},_=function(P){for(var I=P.byteLength,N=[],z=1,Y,q;z<I-2;)P[z]===0&&P[z+1]===0&&P[z+2]===3?(N.push(z+2),z+=2):z++;if(N.length===0)return P;Y=I-N.length,q=new Uint8Array(Y);var Z=0;for(z=0;z<Y;Z++,z++)Z===N[0]&&(Z++,N.shift()),q[z]=P[Z];return q},E=function(P){var I=0,N=0,z=0,Y=0,q,Z,Pe,je,ui,Ka,Nu,Fu,Uu,Xa,Bu,xe=[1,1],Hu,li;if(q=new Yh(P),Z=q.readUnsignedByte(),je=q.readUnsignedByte(),Pe=q.readUnsignedByte(),q.skipUnsignedExpGolomb(),vu[Z]&&(ui=q.readUnsignedExpGolomb(),ui===3&&q.skipBits(1),q.skipUnsignedExpGolomb(),q.skipUnsignedExpGolomb(),q.skipBits(1),q.readBoolean()))for(Bu=ui!==3?8:12,li=0;li<Bu;li++)q.readBoolean()&&(li<6?C(16,q):C(64,q));if(q.skipUnsignedExpGolomb(),Ka=q.readUnsignedExpGolomb(),Ka===0)q.readUnsignedExpGolomb();else if(Ka===1)for(q.skipBits(1),q.skipExpGolomb(),q.skipExpGolomb(),Nu=q.readUnsignedExpGolomb(),li=0;li<Nu;li++)q.skipExpGolomb();if(q.skipUnsignedExpGolomb(),q.skipBits(1),Fu=q.readUnsignedExpGolomb(),Uu=q.readUnsignedExpGolomb(),Xa=q.readBits(1),Xa===0&&q.skipBits(1),q.skipBits(1),q.readBoolean()&&(I=q.readUnsignedExpGolomb(),N=q.readUnsignedExpGolomb(),z=q.readUnsignedExpGolomb(),Y=q.readUnsignedExpGolomb()),q.readBoolean()&&q.readBoolean()){switch(Hu=q.readUnsignedByte(),Hu){case 1:xe=[1,1];break;case 2:xe=[12,11];break;case 3:xe=[10,11];break;case 4:xe=[16,11];break;case 5:xe=[40,33];break;case 6:xe=[24,11];break;case 7:xe=[20,11];break;case 8:xe=[32,11];break;case 9:xe=[80,33];break;case 10:xe=[18,11];break;case 11:xe=[15,11];break;case 12:xe=[64,33];break;case 13:xe=[160,99];break;case 14:xe=[4,3];break;case 15:xe=[3,2];break;case 16:xe=[2,1];break;case 255:{xe=[q.readUnsignedByte()<<8|q.readUnsignedByte(),q.readUnsignedByte()<<8|q.readUnsignedByte()];break}}xe&&xe[0]/xe[1]}return{profileIdc:Z,levelIdc:Pe,profileCompatibility:je,width:(Fu+1)*16-I*2-N*2,height:(2-Xa)*(Uu+1)*16-z*2-Y*2,sarRatio:xe}}},_n.prototype=new t;var Qh={H264Stream:_n,NalByteStream:fr},Jh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],_u=function(d,h){var f=d[h+6]<<21|d[h+7]<<14|d[h+8]<<7|d[h+9],m=d[h+5],v=(m&16)>>4;return f=f>=0?f:0,v?f+20:f+10},Zh=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+=_u(d,h),T(d,h))},ep=function(d){var h=Zh(d,0);return d.length>=h+2&&(d[h]&255)==255&&(d[h+1]&240)==240&&(d[h+1]&22)==16},yu=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},tp=function(d,h,f){var m,v="";for(m=h;m<f;m++)v+="%"+("00"+d[m].toString(16)).slice(-2);return v},ip=function(d,h,f){return unescape(tp(d,h,f))},rp=function(d,h){var f=(d[h+5]&224)>>5,m=d[h+4]<<3,v=d[h+3]&3<<11;return v|m|f},np=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},ap=function(d){for(var h=0;h+5<d.length;){if(d[h]!==255||(d[h+1]&246)!=240){h++;continue}return Jh[(d[h+2]&60)>>>2]}return null},sp=function(d){var h,f,m,v;h=10,d[5]&64&&(h+=4,h+=yu(d.subarray(10,14)));do{if(f=yu(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"){m=d.subarray(h+10,h+f+10);for(var _=0;_<m.byteLength;_++)if(m[_]===0){var E=ip(m,0,_);if(E==="com.apple.streaming.transportStreamTimestamp"){var C=m.subarray(_+1),k=(C[3]&1)<<30|C[4]<<22|C[5]<<14|C[6]<<6|C[7]>>>2;return k*=4,k+=C[7]&3,k}break}}h+=10,h+=f}while(h<d.byteLength);return null},yn={isLikelyAacData:ep,parseId3TagSize:_u,parseAdtsSize:rp,parseType:np,parseSampleRate:ap,parseAacTimestamp:sp},Tn;Tn=function(){var d=new Uint8Array,h=0;Tn.prototype.init.call(this),this.setTimestamp=function(f){h=f},this.push=function(f){var m=0,v=0,_,E,C,k;for(d.length?(k=d.length,d=new Uint8Array(f.byteLength+k),d.set(d.subarray(0,k)),d.set(f,k)):d=f;d.length-v>=3;){if(d[v]==="I".charCodeAt(0)&&d[v+1]==="D".charCodeAt(0)&&d[v+2]==="3".charCodeAt(0)){if(d.length-v<10||(m=yn.parseId3TagSize(d,v),v+m>d.length))break;E={type:"timed-metadata",data:d.subarray(v,v+m)},this.trigger("data",E),v+=m;continue}else if((d[v]&255)==255&&(d[v+1]&240)==240){if(d.length-v<7||(m=yn.parseAdtsSize(d,v),v+m>d.length))break;C={type:"audio",data:d.subarray(v,v+m),pts:h,dts:h},this.trigger("data",C),v+=m;continue}v++}_=d.length-v,_>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")}},Tn.prototype=new t;var op=Tn,up=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Wa=up,lp=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],qa=lp,dp=Qh.H264Stream,cp=yn.isLikelyAacData,fp=le.ONE_SECOND_IN_TS,hr,wi,bn,ai,hp=function(d,h){h.stream=d,this.trigger("log",h)},Tu=function(d,h){for(var f=Object.keys(h),m=0;m<f.length;m++){var v=f[m];v==="headOfPipeline"||!h[v].on||h[v].on("log",hp.bind(d,v))}},bu=function(d,h){var f;if(d.length!==h.length)return!1;for(f=0;f<d.length;f++)if(d[f]!==h[f])return!1;return!0},Ga=function(d,h,f,m,v,_){var E=f-h,C=m-h,k=v-f;return{start:{dts:d,pts:d+E},end:{dts:d+C,pts:d+k},prependedContentDuration:_,baseMediaDecodeTime:d}};wi=function(d,h){var f=[],m,v=0,_=0,E=1/0;h=h||{},m=h.firstSequenceNumber||0,wi.prototype.init.call(this),this.push=function(C){ut.collectDtsInfo(d,C),d&&Wa.forEach(function(k){d[k]=C[k]}),f.push(C)},this.setEarliestDts=function(C){v=C},this.setVideoBaseMediaDecodeTime=function(C){E=C},this.setAudioAppendStart=function(C){_=C},this.flush=function(){var C,k,P,I,N,z,Y;if(f.length===0){this.trigger("done","AudioSegmentStream");return}C=sn.trimAdtsFramesByEarliestDts(f,d,v),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),Y=sn.prefixWithSilence(d,C,_,E),d.samples=sn.generateSampleTable(C),P=vt.mdat(sn.concatenateFrameData(C)),f=[],k=vt.moof(m,[d]),I=new Uint8Array(k.byteLength+P.byteLength),m++,I.set(k),I.set(P,k.byteLength),ut.clearDtsInfo(d),N=Math.ceil(fp*1024/d.samplerate),C.length&&(z=C.length*N,this.trigger("segmentTimingInfo",Ga(le.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),C[0].dts,C[0].pts,C[0].dts+z,C[0].pts+z,Y||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+z})),this.trigger("data",{track:d,boxes:I}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ut.clearDtsInfo(d),f=[],this.trigger("reset")}},wi.prototype=new t,hr=function(d,h){var f,m=[],v=[],_,E;h=h||{},f=h.firstSequenceNumber||0,hr.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(C){ut.collectDtsInfo(d,C),C.nalUnitType==="seq_parameter_set_rbsp"&&!_&&(_=C.config,d.sps=[C.data],qa.forEach(function(k){d[k]=_[k]},this)),C.nalUnitType==="pic_parameter_set_rbsp"&&!E&&(E=C.data,d.pps=[C.data]),m.push(C)},this.flush=function(){for(var C,k,P,I,N,z,Y=0,q,Z;m.length&&m[0].nalUnitType!=="access_unit_delimiter_rbsp";)m.shift();if(m.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(C=lr.groupNalsIntoFrames(m),P=lr.groupFramesIntoGops(C),P[0][0].keyFrame||(k=this.getGopForFusion_(m[0],d),k?(Y=k.duration,P.unshift(k),P.byteLength+=k.byteLength,P.nalCount+=k.nalCount,P.pts=k.pts,P.dts=k.dts,P.duration+=k.duration):P=lr.extendFirstKeyFrame(P)),v.length){var Pe;if(h.alignGopsAtEnd?Pe=this.alignGopsAtEnd_(P):Pe=this.alignGopsAtStart_(P),!Pe){this.gopCache_.unshift({gop:P.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ut.clearDtsInfo(d),P=Pe}ut.collectDtsInfo(d,P),d.samples=lr.generateSampleTable(P),N=vt.mdat(lr.concatenateNalData(P)),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),this.trigger("processedGopsInfo",P.map(function(je){return{pts:je.pts,dts:je.dts,byteLength:je.byteLength}})),q=P[0],Z=P[P.length-1],this.trigger("segmentTimingInfo",Ga(d.baseMediaDecodeTime,q.dts,q.pts,Z.dts+Z.duration,Z.pts+Z.duration,Y)),this.trigger("timingInfo",{start:P[0].pts,end:P[P.length-1].pts+P[P.length-1].duration}),this.gopCache_.unshift({gop:P.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),m=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),I=vt.moof(f,[d]),z=new Uint8Array(I.byteLength+N.byteLength),f++,z.set(I),z.set(N,I.byteLength),this.trigger("data",{track:d,boxes:z}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),m=[],this.gopCache_.length=0,v.length=0,this.trigger("reset")},this.resetStream_=function(){ut.clearDtsInfo(d),_=void 0,E=void 0},this.getGopForFusion_=function(C){var k=45e3,P=1e4,I=1/0,N,z,Y,q,Z;for(Z=0;Z<this.gopCache_.length;Z++)q=this.gopCache_[Z],Y=q.gop,!(!(d.pps&&bu(d.pps[0],q.pps[0]))||!(d.sps&&bu(d.sps[0],q.sps[0])))&&(Y.dts<d.timelineStartInfo.dts||(N=C.dts-Y.dts-Y.duration,N>=-P&&N<=k&&(!z||I>N)&&(z=q,I=N)));return z?z.gop:null},this.alignGopsAtStart_=function(C){var k,P,I,N,z,Y,q,Z;for(z=C.byteLength,Y=C.nalCount,q=C.duration,k=P=0;k<v.length&&P<C.length&&(I=v[k],N=C[P],I.pts!==N.pts);){if(N.pts>I.pts){k++;continue}P++,z-=N.byteLength,Y-=N.nalCount,q-=N.duration}return P===0?C:P===C.length?null:(Z=C.slice(P),Z.byteLength=z,Z.duration=q,Z.nalCount=Y,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z)},this.alignGopsAtEnd_=function(C){var k,P,I,N,z,Y;for(k=v.length-1,P=C.length-1,z=null,Y=!1;k>=0&&P>=0;){if(I=v[k],N=C[P],I.pts===N.pts){Y=!0;break}if(I.pts>N.pts){k--;continue}k===v.length-1&&(z=P),P--}if(!Y&&z===null)return null;var q;if(Y?q=P:q=z,q===0)return C;var Z=C.slice(q),Pe=Z.reduce(function(je,ui){return je.byteLength+=ui.byteLength,je.duration+=ui.duration,je.nalCount+=ui.nalCount,je},{byteLength:0,duration:0,nalCount:0});return Z.byteLength=Pe.byteLength,Z.duration=Pe.duration,Z.nalCount=Pe.nalCount,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z},this.alignGopsWith=function(C){v=C}},hr.prototype=new t,ai=function(d,h){this.numberOfTracks=0,this.metadataStream=h,d=d||{},typeof d.remux!="undefined"?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,ai.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))}},ai.prototype=new t,ai.prototype.flush=function(T){var d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},f,m,v,_=0,E;if(this.pendingTracks.length<this.numberOfTracks){if(T!=="VideoSegmentStream"&&T!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(_=this.videoTrack.timelineStartInfo.pts,qa.forEach(function(C){h.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(_=this.audioTrack.timelineStartInfo.pts,Wa.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=vt.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)h.data.set(this.pendingBoxes[E],d),d+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)f=this.pendingCaptions[E],f.startTime=le.metadataTsToSeconds(f.startPts,_,this.keepOriginalTimestamps),f.endTime=le.metadataTsToSeconds(f.endPts,_,this.keepOriginalTimestamps),h.captionStreams[f.stream]=!0,h.captions.push(f);for(E=0;E<this.pendingMetadata.length;E++)m=this.pendingMetadata[E],m.cueTime=le.metadataTsToSeconds(m.pts,_,this.keepOriginalTimestamps),h.metadata.push(m);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),E=0;E<h.captions.length;E++)f=h.captions[E],this.trigger("caption",f);for(E=0;E<h.metadata.length;E++)m=h.metadata[E],this.trigger("id3Frame",m)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ai.prototype.setRemux=function(T){this.remuxTracks=T},bn=function(d){var h=this,f=!0,m,v;bn.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var _={};this.transmuxPipeline_=_,_.type="aac",_.metadataStream=new Dt.MetadataStream,_.aacStream=new op,_.audioTimestampRolloverStream=new Dt.TimestampRolloverStream("audio"),_.timedMetadataTimestampRolloverStream=new Dt.TimestampRolloverStream("timed-metadata"),_.adtsStream=new mu,_.coalesceStream=new ai(d,_.metadataStream),_.headOfPipeline=_.aacStream,_.aacStream.pipe(_.audioTimestampRolloverStream).pipe(_.adtsStream),_.aacStream.pipe(_.timedMetadataTimestampRolloverStream).pipe(_.metadataStream).pipe(_.coalesceStream),_.metadataStream.on("timestamp",function(E){_.aacStream.setTimestamp(E.timeStamp)}),_.aacStream.on("data",function(E){E.type!=="timed-metadata"&&E.type!=="audio"||_.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},_.coalesceStream.numberOfTracks++,_.audioSegmentStream=new wi(v,d),_.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),_.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),_.adtsStream.pipe(_.audioSegmentStream).pipe(_.coalesceStream),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!m}))}),_.coalesceStream.on("data",this.trigger.bind(this,"data")),_.coalesceStream.on("done",this.trigger.bind(this,"done")),Tu(this,_)},this.setupTsPipeline=function(){var _={};this.transmuxPipeline_=_,_.type="ts",_.metadataStream=new Dt.MetadataStream,_.packetStream=new Dt.TransportPacketStream,_.parseStream=new Dt.TransportParseStream,_.elementaryStream=new Dt.ElementaryStream,_.timestampRolloverStream=new Dt.TimestampRolloverStream,_.adtsStream=new mu,_.h264Stream=new dp,_.captionStream=new Dt.CaptionStream(d),_.coalesceStream=new ai(d,_.metadataStream),_.headOfPipeline=_.packetStream,_.packetStream.pipe(_.parseStream).pipe(_.elementaryStream).pipe(_.timestampRolloverStream),_.timestampRolloverStream.pipe(_.h264Stream),_.timestampRolloverStream.pipe(_.adtsStream),_.timestampRolloverStream.pipe(_.metadataStream).pipe(_.coalesceStream),_.h264Stream.pipe(_.captionStream).pipe(_.coalesceStream),_.elementaryStream.on("data",function(E){var C;if(E.type==="metadata"){for(C=E.tracks.length;C--;)!m&&E.tracks[C].type==="video"?(m=E.tracks[C],m.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):!v&&E.tracks[C].type==="audio"&&(v=E.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime);m&&!_.videoSegmentStream&&(_.coalesceStream.numberOfTracks++,_.videoSegmentStream=new hr(m,d),_.videoSegmentStream.on("log",h.getLogTrigger_("videoSegmentStream")),_.videoSegmentStream.on("timelineStartInfo",function(k){v&&!d.keepOriginalTimestamps&&(v.timelineStartInfo=k,_.audioSegmentStream.setEarliestDts(k.dts-h.baseMediaDecodeTime))}),_.videoSegmentStream.on("processedGopsInfo",h.trigger.bind(h,"gopInfo")),_.videoSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"videoSegmentTimingInfo")),_.videoSegmentStream.on("baseMediaDecodeTime",function(k){v&&_.audioSegmentStream.setVideoBaseMediaDecodeTime(k)}),_.videoSegmentStream.on("timingInfo",h.trigger.bind(h,"videoTimingInfo")),_.h264Stream.pipe(_.videoSegmentStream).pipe(_.coalesceStream)),v&&!_.audioSegmentStream&&(_.coalesceStream.numberOfTracks++,_.audioSegmentStream=new wi(v,d),_.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),_.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),_.audioSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"audioSegmentTimingInfo")),_.adtsStream.pipe(_.audioSegmentStream).pipe(_.coalesceStream)),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!m})}}),_.coalesceStream.on("data",this.trigger.bind(this,"data")),_.coalesceStream.on("id3Frame",function(E){E.dispatchType=_.metadataStream.dispatchType,h.trigger("id3Frame",E)}),_.coalesceStream.on("caption",this.trigger.bind(this,"caption")),_.coalesceStream.on("done",this.trigger.bind(this,"done")),Tu(this,_)},this.setBaseMediaDecodeTime=function(_){var E=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=_),v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,ut.clearDtsInfo(v),E.audioTimestampRolloverStream&&E.audioTimestampRolloverStream.discontinuity()),m&&(E.videoSegmentStream&&(E.videoSegmentStream.gopCache_=[]),m.timelineStartInfo.dts=void 0,m.timelineStartInfo.pts=void 0,ut.clearDtsInfo(m),E.captionStream.reset()),E.timestampRolloverStream&&E.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(_){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(_)},this.setRemux=function(_){var E=this.transmuxPipeline_;d.remux=_,E&&E.coalesceStream&&E.coalesceStream.setRemux(_)},this.alignGopsWith=function(_){m&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(_)},this.getLogTrigger_=function(_){var E=this;return function(C){C.stream=_,E.trigger("log",C)}},this.push=function(_){if(f){var E=cp(_);E&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!E&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(_)},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()}},bn.prototype=new t;var pp={Transmuxer:bn,VideoSegmentStream:hr,AudioSegmentStream:wi,AUDIO_PROPERTIES:Wa,VIDEO_PROPERTIES:qa,generateSegmentTimingInfo:Ga},mp=function(d){return d>>>0},gp=function(d){return("00"+d.toString(16)).slice(-2)},xn={toUnsigned:mp,toHexString:gp},vp=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},si=vp,_p=xn.toUnsigned,yp=function T(d,h){var f=[],m,v,_,E,C;if(!h.length)return null;for(m=0;m<d.byteLength;)v=_p(d[m]<<24|d[m+1]<<16|d[m+2]<<8|d[m+3]),_=si(d.subarray(m+4,m+8)),E=v>1?m+v:d.byteLength,_===h[0]&&(h.length===1?f.push(d.subarray(m+8,E)):(C=T(d.subarray(m+8,E),h.slice(1)),C.length&&(f=f.concat(C)))),m=E;return f},ge=yp,Tp=xn.toUnsigned,bp=e.getUint64,xp=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=bp(d.subarray(4)):h.baseMediaDecodeTime=Tp(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),h},xu=xp,Sp=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]}},Su=Sp,Ep=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},f=new DataView(d.buffer,d.byteOffset,d.byteLength),m=h.flags[2]&1,v=h.flags[2]&4,_=h.flags[1]&1,E=h.flags[1]&2,C=h.flags[1]&4,k=h.flags[1]&8,P=f.getUint32(4),I=8,N;for(m&&(h.dataOffset=f.getInt32(I),I+=4),v&&P&&(N={flags:Su(d.subarray(I,I+4))},I+=4,_&&(N.duration=f.getUint32(I),I+=4),E&&(N.size=f.getUint32(I),I+=4),k&&(h.version===1?N.compositionTimeOffset=f.getInt32(I):N.compositionTimeOffset=f.getUint32(I),I+=4),h.samples.push(N),P--);P--;)N={},_&&(N.duration=f.getUint32(I),I+=4),E&&(N.size=f.getUint32(I),I+=4),C&&(N.flags=Su(d.subarray(I,I+4)),I+=4),k&&(h.version===1?N.compositionTimeOffset=f.getInt32(I):N.compositionTimeOffset=f.getUint32(I),I+=4),h.samples.push(N);return h},Eu=Ep,Cp=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)},m=f.flags[2]&1,v=f.flags[2]&2,_=f.flags[2]&8,E=f.flags[2]&16,C=f.flags[2]&32,k=f.flags[0]&65536,P=f.flags[0]&131072,I;return I=8,m&&(I+=4,f.baseDataOffset=h.getUint32(12),I+=4),v&&(f.sampleDescriptionIndex=h.getUint32(I),I+=4),_&&(f.defaultSampleDuration=h.getUint32(I),I+=4),E&&(f.defaultSampleSize=h.getUint32(I),I+=4),C&&(f.defaultSampleFlags=h.getUint32(I)),k&&(f.durationIsEmpty=!0),!m&&P&&(f.baseDataOffsetIsMoof=!0),f},Cu=Cp,wu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},pr;typeof window!="undefined"?pr=window:typeof wu!="undefined"?pr=wu:typeof self!="undefined"?pr=self:pr={};var mr=pr,wp=dr.discardEmulationPreventionBytes,Pp=cn.CaptionStream,kp=function(d,h){for(var f=d,m=0;m<h.length;m++){var v=h[m];if(f<v.size)return v;f-=v.size}return null},Ap=function(d,h,f){var m=new DataView(d.buffer,d.byteOffset,d.byteLength),v={logs:[],seiNals:[]},_,E,C,k;for(E=0;E+4<d.length;E+=C)if(C=m.getUint32(E),E+=4,!(C<=0))switch(d[E]&31){case 6:var P=d.subarray(E+1,E+1+C),I=kp(E,h);if(_={nalUnitType:"sei_rbsp",size:C,data:P,escapedRBSP:wp(P),trackId:f},I)_.pts=I.pts,_.dts=I.dts,k=I;else if(k)_.pts=k.pts,_.dts=k.dts;else{v.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+E+" for trackId "+f+". See mux.js#223."});break}v.seiNals.push(_);break}return v},Ip=function(d,h,f){var m=h,v=f.defaultSampleDuration||0,_=f.defaultSampleSize||0,E=f.trackId,C=[];return d.forEach(function(k){var P=Eu(k),I=P.samples;I.forEach(function(N){N.duration===void 0&&(N.duration=v),N.size===void 0&&(N.size=_),N.trackId=E,N.dts=m,N.compositionTimeOffset===void 0&&(N.compositionTimeOffset=0),typeof m=="bigint"?(N.pts=m+mr.BigInt(N.compositionTimeOffset),m+=mr.BigInt(N.duration)):(N.pts=m+N.compositionTimeOffset,m+=N.duration)}),C=C.concat(I)}),C},Dp=function(d,h){var f=ge(d,["moof","traf"]),m=ge(d,["mdat"]),v={},_=[];return m.forEach(function(E,C){var k=f[C];_.push({mdat:E,traf:k})}),_.forEach(function(E){var C=E.mdat,k=E.traf,P=ge(k,["tfhd"]),I=Cu(P[0]),N=I.trackId,z=ge(k,["tfdt"]),Y=z.length>0?xu(z[0]).baseMediaDecodeTime:0,q=ge(k,["trun"]),Z,Pe;h===N&&q.length>0&&(Z=Ip(q,Y,I),Pe=Ap(C,Z,N),v[N]||(v[N]={seiNals:[],logs:[]}),v[N].seiNals=v[N].seiNals.concat(Pe.seiNals),v[N].logs=v[N].logs.concat(Pe.logs))}),v},Op=function(d,h,f){var m;if(h===null)return null;m=Dp(d,h);var v=m[h]||{};return{seiNals:v.seiNals,logs:v.logs,timescale:f}},Lp=function(){var d=!1,h,f,m,v,_,E;this.isInitialized=function(){return d},this.init=function(C){h=new Pp,d=!0,E=C?C.isPartial:!1,h.on("data",function(k){k.startTime=k.startPts/v,k.endTime=k.endPts/v,_.captions.push(k),_.captionStreams[k.stream]=!0}),h.on("log",function(k){_.logs.push(k)})},this.isNewInit=function(C,k){return C&&C.length===0||k&&typeof k=="object"&&Object.keys(k).length===0?!1:m!==C[0]||v!==k[m]},this.parse=function(C,k,P){var I;if(this.isInitialized()){if(!k||!P)return null;if(this.isNewInit(k,P))m=k[0],v=P[m];else if(m===null||!v)return f.push(C),null}else return null;for(;f.length>0;){var N=f.shift();this.parse(N,k,P)}return I=Op(C,m,v),I&&I.logs&&(_.logs=_.logs.concat(I.logs)),I===null||!I.seiNals?_.logs.length?{logs:_.logs,captions:[],captionStreams:[]}:null:(this.pushNals(I.seiNals),this.flushStream(),_)},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(){_.captions=[],_.captionStreams={},_.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;h.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],m=null,v=null,_?this.clearParsedCaptions():_={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Mp=Lp,Sn=xn.toUnsigned,gr=xn.toHexString,Rp=e.getUint64,Pu,ku,Au,Iu,Du,za;Pu=function(d){var h={},f=ge(d,["moov","trak"]);return f.reduce(function(m,v){var _,E,C,k,P;return _=ge(v,["tkhd"])[0],!_||(E=_[0],C=E===0?12:20,k=Sn(_[C]<<24|_[C+1]<<16|_[C+2]<<8|_[C+3]),P=ge(v,["mdia","mdhd"])[0],!P)?null:(E=P[0],C=E===0?12:20,m[k]=Sn(P[C]<<24|P[C+1]<<16|P[C+2]<<8|P[C+3]),m)},h)},ku=function(d,h){var f;f=ge(h,["moof","traf"]);var m=f.reduce(function(v,_){var E=ge(_,["tfhd"])[0],C=Sn(E[4]<<24|E[5]<<16|E[6]<<8|E[7]),k=d[C]||9e4,P=ge(_,["tfdt"])[0],I=new DataView(P.buffer,P.byteOffset,P.byteLength),N;P[0]===1?N=Rp(P.subarray(4,12)):N=I.getUint32(4);var z;return typeof N=="bigint"?z=N/mr.BigInt(k):typeof N=="number"&&!isNaN(N)&&(z=N/k),z<Number.MAX_SAFE_INTEGER&&(z=Number(z)),z<v&&(v=z),v},1/0);return typeof m=="bigint"||isFinite(m)?m:0},Au=function(d,h){var f=ge(h,["moof","traf"]),m=0,v=0,_;if(f&&f.length){var E=ge(f[0],["tfhd"])[0],C=ge(f[0],["trun"])[0],k=ge(f[0],["tfdt"])[0];if(E){var P=Cu(E);_=P.trackId}if(k){var I=xu(k);m=I.baseMediaDecodeTime}if(C){var N=Eu(C);N.samples&&N.samples.length&&(v=N.samples[0].compositionTimeOffset||0)}}var z=d[_]||9e4;typeof m=="bigint"&&(v=mr.BigInt(v),z=mr.BigInt(z));var Y=(m+v)/z;return typeof Y=="bigint"&&Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y},Iu=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(m){var v=ge(m,["mdia","hdlr"]),_=ge(m,["tkhd"]);v.forEach(function(E,C){var k=si(E.subarray(8,12)),P=_[C],I,N,z;k==="vide"&&(I=new DataView(P.buffer,P.byteOffset,P.byteLength),N=I.getUint8(0),z=N===0?I.getUint32(12):I.getUint32(20),f.push(z))})}),f},za=function(d){var h=d[0],f=h===0?12:20;return Sn(d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])},Du=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(m){var v={},_=ge(m,["tkhd"])[0],E,C;_&&(E=new DataView(_.buffer,_.byteOffset,_.byteLength),C=E.getUint8(0),v.id=C===0?E.getUint32(12):E.getUint32(20));var k=ge(m,["mdia","hdlr"])[0];if(k){var P=si(k.subarray(8,12));P==="vide"?v.type="video":P==="soun"?v.type="audio":v.type=P}var I=ge(m,["mdia","minf","stbl","stsd"])[0];if(I){var N=I.subarray(8);v.codec=si(N.subarray(4,8));var z=ge(N,[v.codec])[0],Y,q;z&&(/^[asm]vc[1-9]$/i.test(v.codec)?(Y=z.subarray(78),q=si(Y.subarray(4,8)),q==="avcC"&&Y.length>11?(v.codec+=".",v.codec+=gr(Y[9]),v.codec+=gr(Y[10]),v.codec+=gr(Y[11])):v.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(v.codec)?(Y=z.subarray(28),q=si(Y.subarray(4,8)),q==="esds"&&Y.length>20&&Y[19]!==0?(v.codec+="."+gr(Y[19]),v.codec+="."+gr(Y[20]>>>2&63).replace(/^0/,"")):v.codec="mp4a.40.2"):v.codec=v.codec.toLowerCase())}var Z=ge(m,["mdia","mdhd"])[0];Z&&(v.timescale=za(Z)),f.push(v)}),f};var Ou={findBox:ge,parseType:si,timescale:Pu,startTime:ku,compositionStartTime:Au,videoTrackIds:Iu,tracks:Du,getTimescaleFromMediaHeader:za},Lu=function(d){var h=d[1]&31;return h<<=8,h|=d[2],h},En=function(d){return!!(d[1]&64)},Cn=function(d){var h=0;return(d[3]&48)>>>4>1&&(h+=d[4]+1),h},Np=function(d,h){var f=Lu(d);return f===0?"pat":f===h?"pmt":h?"pes":null},Fp=function(d){var h=En(d),f=4+Cn(d);return h&&(f+=d[f]+1),(d[f+10]&31)<<8|d[f+11]},Up=function(d){var h={},f=En(d),m=4+Cn(d);if(f&&(m+=d[m]+1),!!(d[m+5]&1)){var v,_,E;v=(d[m+1]&15)<<8|d[m+2],_=3+v-4,E=(d[m+10]&15)<<8|d[m+11];for(var C=12+E;C<_;){var k=m+C;h[(d[k+1]&31)<<8|d[k+2]]=d[k],C+=((d[k+3]&15)<<8|d[k+4])+5}return h}},Bp=function(d,h){var f=Lu(d),m=h[f];switch(m){case Le.H264_STREAM_TYPE:return"video";case Le.ADTS_STREAM_TYPE:return"audio";case Le.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Hp=function(d){var h=En(d);if(!h)return null;var f=4+Cn(d);if(f>=d.byteLength)return null;var m=null,v;return v=d[f+7],v&192&&(m={},m.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,m.pts*=4,m.pts+=(d[f+13]&6)>>>1,m.dts=m.pts,v&64&&(m.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,m.dts*=4,m.dts+=(d[f+18]&6)>>>1)),m},$a=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}},Vp=function(d){for(var h=4+Cn(d),f=d.subarray(h),m=0,v=0,_=!1,E;v<f.byteLength-3;v++)if(f[v+2]===1){m=v+5;break}for(;m<f.byteLength;)switch(f[m]){case 0:if(f[m-1]!==0){m+=2;break}else if(f[m-2]!==0){m++;break}v+3!==m-2&&(E=$a(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(_=!0));do m++;while(f[m]!==1&&m<f.length);v=m-2,m+=3;break;case 1:if(f[m-1]!==0||f[m-2]!==0){m+=3;break}E=$a(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(_=!0),v=m-2,m+=3;break;default:m+=3;break}return f=f.subarray(v),m-=v,v=0,f&&f.byteLength>3&&(E=$a(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(_=!0)),_},jp={parseType:Np,parsePat:Fp,parsePmt:Up,parsePayloadUnitStartIndicator:En,parsePesType:Bp,parsePesTime:Hp,videoPacketContainsKeyFrame:Vp},Pi=du.handleRollover,fe={};fe.ts=jp,fe.aac=yn;var oi=le.ONE_SECOND_IN_TS,Ve=188,_t=71,Wp=function(d,h){for(var f=0,m=Ve,v,_;m<d.byteLength;){if(d[f]===_t&&d[m]===_t){switch(v=d.subarray(f,m),_=fe.ts.parseType(v,h.pid),_){case"pat":h.pid=fe.ts.parsePat(v);break;case"pmt":var E=fe.ts.parsePmt(v);h.table=h.table||{},Object.keys(E).forEach(function(C){h.table[C]=E[C]});break}f+=Ve,m+=Ve;continue}f++,m++}},Mu=function(d,h,f){for(var m=0,v=Ve,_,E,C,k,P,I=!1;v<=d.byteLength;){if(d[m]===_t&&(d[v]===_t||v===d.byteLength)){switch(_=d.subarray(m,v),E=fe.ts.parseType(_,h.pid),E){case"pes":C=fe.ts.parsePesType(_,h.table),k=fe.ts.parsePayloadUnitStartIndicator(_),C==="audio"&&k&&(P=fe.ts.parsePesTime(_),P&&(P.type="audio",f.audio.push(P),I=!0));break}if(I)break;m+=Ve,v+=Ve;continue}m++,v++}for(v=d.byteLength,m=v-Ve,I=!1;m>=0;){if(d[m]===_t&&(d[v]===_t||v===d.byteLength)){switch(_=d.subarray(m,v),E=fe.ts.parseType(_,h.pid),E){case"pes":C=fe.ts.parsePesType(_,h.table),k=fe.ts.parsePayloadUnitStartIndicator(_),C==="audio"&&k&&(P=fe.ts.parsePesTime(_),P&&(P.type="audio",f.audio.push(P),I=!0));break}if(I)break;m-=Ve,v-=Ve;continue}m--,v--}},qp=function(d,h,f){for(var m=0,v=Ve,_,E,C,k,P,I,N,z,Y=!1,q={data:[],size:0};v<d.byteLength;){if(d[m]===_t&&d[v]===_t){switch(_=d.subarray(m,v),E=fe.ts.parseType(_,h.pid),E){case"pes":if(C=fe.ts.parsePesType(_,h.table),k=fe.ts.parsePayloadUnitStartIndicator(_),C==="video"&&(k&&!Y&&(P=fe.ts.parsePesTime(_),P&&(P.type="video",f.video.push(P),Y=!0)),!f.firstKeyFrame)){if(k&&q.size!==0){for(I=new Uint8Array(q.size),N=0;q.data.length;)z=q.data.shift(),I.set(z,N),N+=z.byteLength;if(fe.ts.videoPacketContainsKeyFrame(I)){var Z=fe.ts.parsePesTime(I);Z?(f.firstKeyFrame=Z,f.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}q.size=0}q.data.push(_),q.size+=_.byteLength}break}if(Y&&f.firstKeyFrame)break;m+=Ve,v+=Ve;continue}m++,v++}for(v=d.byteLength,m=v-Ve,Y=!1;m>=0;){if(d[m]===_t&&d[v]===_t){switch(_=d.subarray(m,v),E=fe.ts.parseType(_,h.pid),E){case"pes":C=fe.ts.parsePesType(_,h.table),k=fe.ts.parsePayloadUnitStartIndicator(_),C==="video"&&k&&(P=fe.ts.parsePesTime(_),P&&(P.type="video",f.video.push(P),Y=!0));break}if(Y)break;m-=Ve,v-=Ve;continue}m--,v--}},Gp=function(d,h){if(d.audio&&d.audio.length){var f=h;(typeof f=="undefined"||isNaN(f))&&(f=d.audio[0].dts),d.audio.forEach(function(_){_.dts=Pi(_.dts,f),_.pts=Pi(_.pts,f),_.dtsTime=_.dts/oi,_.ptsTime=_.pts/oi})}if(d.video&&d.video.length){var m=h;if((typeof m=="undefined"||isNaN(m))&&(m=d.video[0].dts),d.video.forEach(function(_){_.dts=Pi(_.dts,m),_.pts=Pi(_.pts,m),_.dtsTime=_.dts/oi,_.ptsTime=_.pts/oi}),d.firstKeyFrame){var v=d.firstKeyFrame;v.dts=Pi(v.dts,m),v.pts=Pi(v.pts,m),v.dtsTime=v.dts/oi,v.ptsTime=v.pts/oi}}},zp=function(d){for(var h=!1,f=0,m=null,v=null,_=0,E=0,C;d.length-E>=3;){var k=fe.aac.parseType(d,E);switch(k){case"timed-metadata":if(d.length-E<10){h=!0;break}if(_=fe.aac.parseId3TagSize(d,E),_>d.length){h=!0;break}v===null&&(C=d.subarray(E,E+_),v=fe.aac.parseAacTimestamp(C)),E+=_;break;case"audio":if(d.length-E<7){h=!0;break}if(_=fe.aac.parseAdtsSize(d,E),_>d.length){h=!0;break}m===null&&(C=d.subarray(E,E+_),m=fe.aac.parseSampleRate(C)),f++,E+=_;break;default:E++;break}if(h)return null}if(m===null||v===null)return null;var P=oi/m,I={audio:[{type:"audio",dts:v,pts:v},{type:"audio",dts:v+f*1024*P,pts:v+f*1024*P}]};return I},$p=function(d){var h={pid:null,table:null},f={};Wp(d,h);for(var m in h.table)if(h.table.hasOwnProperty(m)){var v=h.table[m];switch(v){case Le.H264_STREAM_TYPE:f.video=[],qp(d,h,f),f.video.length===0&&delete f.video;break;case Le.ADTS_STREAM_TYPE:f.audio=[],Mu(d,h,f),f.audio.length===0&&delete f.audio;break}}return f},Kp=function(d,h){var f=fe.aac.isLikelyAacData(d),m;return f?m=zp(d):m=$p(d),!m||!m.audio&&!m.video?null:(Gp(m,h),m)},Xp={inspect:Kp,parseAudioPes_:Mu},Yp=function(d,h){h.on("data",function(f){var m=f.initSegment;f.initSegment={data:m.buffer,byteOffset:m.byteOffset,byteLength:m.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 m={start:{decode:le.videoTsToSeconds(f.start.dts),presentation:le.videoTsToSeconds(f.start.pts)},end:{decode:le.videoTsToSeconds(f.end.dts),presentation:le.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(m.prependedContentDuration=le.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:m})}),h.on("audioSegmentTimingInfo",function(f){var m={start:{decode:le.videoTsToSeconds(f.start.dts),presentation:le.videoTsToSeconds(f.start.pts)},end:{decode:le.videoTsToSeconds(f.end.dts),presentation:le.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(m.prependedContentDuration=le.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:m})}),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:le.videoTsToSeconds(f.start),end:le.videoTsToSeconds(f.end)}})}),h.on("videoTimingInfo",function(f){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le.videoTsToSeconds(f.start),end:le.videoTsToSeconds(f.end)}})}),h.on("log",function(f){d.postMessage({action:"log",log:f})})},Ru=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 pp.Transmuxer(this.options),Yp(this.self,this.transmuxer)},d.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Mp,this.captionParser.init());var m=new Uint8Array(f.data,f.byteOffset,f.byteLength),v=this.captionParser.parse(m,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:m.buffer},[m.buffer])},d.probeMp4StartTime=function(f){var m=f.timescales,v=f.data,_=Ou.startTime(m,v);this.self.postMessage({action:"probeMp4StartTime",startTime:_,data:v},[v.buffer])},d.probeMp4Tracks=function(f){var m=f.data,v=Ou.tracks(m);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:m},[m.buffer])},d.probeTs=function(f){var m=f.data,v=f.baseStartTime,_=typeof v=="number"&&!isNaN(v)?v*le.ONE_SECOND_IN_TS:void 0,E=Xp.inspect(m,_),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:m},[m.buffer])},d.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},d.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},d.push=function(f){var m=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(m)},d.reset=function(){this.transmuxer.reset()},d.setTimestampOffset=function(f){var m=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(le.secondsToVideoTs(m)))},d.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(le.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 Ru(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new Ru(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}})),Cy=Uf(Ey),wy=function(t,i,n){var e=t.data.segment,r=e.type,s=e.initSegment,o=e.captions,u=e.captionStreams,l=e.metadata,c=e.videoFrameDtsTime,g=e.videoFramePtsTime;i.buffer.push({captions:o,captionStreams:u,metadata:l});var p=t.data.segment.boxes||{data:t.data.segment.data},y={type:r,data:new Uint8Array(p.data,p.data.byteOffset,p.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof c!="undefined"&&(y.videoFrameDtsTime=c),typeof g!="undefined"&&(y.videoFramePtsTime=g),n(y)},Py=function(t){var i=t.transmuxedData,n=t.callback;i.buffer=[],n(i)},ky=function(t,i){i.gopInfo=t.data.gopInfo},Vf=function(t){var i=t.transmuxer,n=t.bytes,e=t.audioAppendStart,r=t.gopsToAlignWith,s=t.remux,o=t.onData,u=t.onTrackInfo,l=t.onAudioTimingInfo,c=t.onVideoTimingInfo,g=t.onVideoSegmentTimingInfo,p=t.onAudioSegmentTimingInfo,y=t.onId3,b=t.onCaptions,S=t.onDone,x=t.onEndedTimeline,A=t.onTransmuxerLog,O=t.isEndOfTimeline,H={buffer:[]},L=O,M=function(W){i.currentTransmux===t&&(W.data.action==="data"&&wy(W,H,o),W.data.action==="trackinfo"&&u(W.data.trackInfo),W.data.action==="gopInfo"&&ky(W,H),W.data.action==="audioTimingInfo"&&l(W.data.audioTimingInfo),W.data.action==="videoTimingInfo"&&c(W.data.videoTimingInfo),W.data.action==="videoSegmentTimingInfo"&&g(W.data.videoSegmentTimingInfo),W.data.action==="audioSegmentTimingInfo"&&p(W.data.audioSegmentTimingInfo),W.data.action==="id3Frame"&&y([W.data.id3Frame],W.data.id3Frame.dispatchType),W.data.action==="caption"&&b(W.data.caption),W.data.action==="endedtimeline"&&(L=!1,x()),W.data.action==="log"&&A(W.data.log),W.data.type==="transmuxed"&&(L||(i.onmessage=null,Py({transmuxedData:H,callback:S}),jf(i))))};if(i.onmessage=M,e&&i.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(r)&&i.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof s!="undefined"&&i.postMessage({action:"setRemux",remux:s}),n.byteLength){var j=n instanceof ArrayBuffer?n:n.buffer,U=n instanceof ArrayBuffer?0:n.byteOffset;i.postMessage({action:"push",data:j,byteOffset:U,byteLength:n.byteLength},[j])}O&&i.postMessage({action:"endTimeline"}),i.postMessage({action:"flush"})},jf=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():Vf(t.currentTransmux))},Wf=function(t,i){t.postMessage({action:i}),jf(t)},qf=function(t,i){if(!i.currentTransmux){i.currentTransmux=t,Wf(i,t);return}i.transmuxQueue.push(Wf.bind(null,i,t))},Ay=function(t){qf("reset",t)},Iy=function(t){qf("endTimeline",t)},Gf=function(t){if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,Vf(t);return}t.transmuxer.transmuxQueue.push(t)},Dy=function(t){var i=new Cy;i.currentTransmux=null,i.transmuxQueue=[];var n=i.terminate;return i.terminate=function(){return i.currentTransmux=null,i.transmuxQueue.length=0,n.call(i)},i.postMessage({action:"init",options:t}),i},Ko={reset:Ay,endTimeline:Iy,transmux:Gf,createTransmuxer:Dy},wa=function(t){var i=t.transmuxer,n=t.endAction||t.action,e=t.callback,r=dt({},t,{endAction:null,transmuxer:null,callback:null}),s=function l(c){c.data.action===n&&(i.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(i.addEventListener("message",s),t.data){var o=t.data instanceof ArrayBuffer;r.byteOffset=o?0:t.data.byteOffset,r.byteLength=t.data.byteLength;var u=[o?t.data:t.data.buffer];i.postMessage(r,u)}else i.postMessage(r)},Pt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Xo=function(t){t.forEach(function(i){i.abort()})},Oy=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},Ly=function(t){var i=t.target,n=Date.now()-i.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},Yo=function(t,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:Pt.TIMEOUT,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:Pt.ABORTED,xhr:i}:t?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Pt.FAILURE,xhr:i}:i.responseType==="arraybuffer"&&i.response.byteLength===0?{status:i.status,message:"Empty HLS response at URL: "+i.uri,code:Pt.FAILURE,xhr:i}:null},zf=function(t,i,n){return function(e,r){var s=r.response,o=Yo(e,r);if(o)return n(o,t);if(s.byteLength!==16)return n({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Pt.FAILURE,xhr:r},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<i.length;c++)i[c].bytes=l;return n(null,t)}},$f=function(t,i){var n=Ds(t.map.bytes);if(n!=="mp4"){var e=t.map.resolvedUri||t.map.uri;return i({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+e,code:Pt.FAILURE})}wa({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:function(s){var o=s.tracks,u=s.data;return t.map.bytes=u,o.forEach(function(l){t.map.tracks=t.map.tracks||{},!t.map.tracks[l.type]&&(t.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[l.id]=l.timescale))}),i(null)}})},My=function(t){var i=t.segment,n=t.finishProcessingFn;return function(e,r){var s=Yo(e,r);if(s)return n(s,i);var o=new Uint8Array(r.response);if(i.map.key)return i.map.encryptedBytes=o,n(null,i);i.map.bytes=o,$f(i,function(u){if(u)return u.xhr=r,u.status=r.status,n(u,i);n(null,i)})}},Ry=function(t){var i=t.segment,n=t.finishProcessingFn,e=t.responseType;return function(r,s){var o=Yo(r,s);if(o)return n(o,i);var u=e==="arraybuffer"||!s.responseText?s.response:xy(s.responseText.substring(i.lastReachedChar||0));return i.stats=Oy(s),i.key?i.encryptedBytes=new Uint8Array(u):i.bytes=new Uint8Array(u),n(null,i)}},Ny=function(t){var i=t.segment,n=t.bytes,e=t.trackInfoFn,r=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,p=t.dataFn,y=t.doneFn,b=t.onTransmuxerLog,S=i.map&&i.map.tracks||{},x=Boolean(S.audio&&S.video),A=r.bind(null,i,"audio","start"),O=r.bind(null,i,"audio","end"),H=r.bind(null,i,"video","start"),L=r.bind(null,i,"video","end"),M=function(){return Gf({bytes:n,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:x,onData:function(F){F.type=F.type==="combined"?"video":F.type,p(i,F)},onTrackInfo:function(F){e&&(x&&(F.isMuxed=!0),e(i,F))},onAudioTimingInfo:function(F){A&&typeof F.start!="undefined"&&(A(F.start),A=null),O&&typeof F.end!="undefined"&&O(F.end)},onVideoTimingInfo:function(F){H&&typeof F.start!="undefined"&&(H(F.start),H=null),L&&typeof F.end!="undefined"&&L(F.end)},onVideoSegmentTimingInfo:function(F){s(F)},onAudioSegmentTimingInfo:function(F){o(F)},onId3:function(F,W){u(i,F,W)},onCaptions:function(F){l(i,[F])},isEndOfTimeline:c,onEndedTimeline:function(){g()},onTransmuxerLog:b,onDone:function(F){!y||(F.type=F.type==="combined"?"video":F.type,y(null,i,F))}})};wa({action:"probeTs",transmuxer:i.transmuxer,data:n,baseStartTime:i.baseStartTime,callback:function(U){i.bytes=n=U.data;var F=U.result;F&&(e(i,{hasAudio:F.hasAudio,hasVideo:F.hasVideo,isMuxed:x}),e=null,F.hasAudio&&!x&&A(F.audioStart),F.hasVideo&&H(F.videoStart),A=null,H=null),M()}})},Kf=function(t){var i=t.segment,n=t.bytes,e=t.trackInfoFn,r=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,p=t.dataFn,y=t.doneFn,b=t.onTransmuxerLog,S=new Uint8Array(n);if(a0(S)){i.isFmp4=!0;var x=i.map.tracks,A={isFmp4:!0,hasVideo:!!x.video,hasAudio:!!x.audio};x.audio&&x.audio.codec&&x.audio.codec!=="enca"&&(A.audioCodec=x.audio.codec),x.video&&x.video.codec&&x.video.codec!=="encv"&&(A.videoCodec=x.video.codec),x.video&&x.audio&&(A.isMuxed=!0),e(i,A);var O=function(L){p(i,{data:S,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),L&&L.length&&l(i,L),y(null,i,{})};wa({action:"probeMp4StartTime",timescales:i.map.timescales,data:S,transmuxer:i.transmuxer,callback:function(L){var M=L.data,j=L.startTime;if(n=M.buffer,i.bytes=S=M,A.hasAudio&&!A.isMuxed&&r(i,"audio","start",j),A.hasVideo&&r(i,"video","start",j),!x.video||!M.byteLength||!i.transmuxer){O();return}wa({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:S,timescales:i.map.timescales,trackIds:[x.video.id],callback:function(F){n=F.data.buffer,i.bytes=S=F.data,F.logs.forEach(function(W){b(D.mergeOptions(W,{stream:"mp4CaptionParser"}))}),O(F.captions)}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container=="undefined"&&(i.container=Ds(S)),i.container!=="ts"&&i.container!=="aac"){e(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}Ny({segment:i,bytes:n,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:p,doneFn:y,onTransmuxerLog:b})},Xf=function(t,i){var n=t.id,e=t.key,r=t.encryptedBytes,s=t.decryptionWorker,o=function l(c){if(c.data.source===n){s.removeEventListener("message",l);var g=c.data.decrypted;i(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(If({source:n,encrypted:r,key:u,iv:e.iv}),[r.buffer,u.buffer])},Fy=function(t){var i=t.decryptionWorker,n=t.segment,e=t.trackInfoFn,r=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,p=t.dataFn,y=t.doneFn,b=t.onTransmuxerLog;Xf({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:i},function(S){n.bytes=S,Kf({segment:n,bytes:n.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:p,doneFn:y,onTransmuxerLog:b})})},Uy=function(t){var i=t.activeXhrs,n=t.decryptionWorker,e=t.trackInfoFn,r=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,g=t.endedTimelineFn,p=t.dataFn,y=t.doneFn,b=t.onTransmuxerLog,S=0,x=!1;return function(A,O){if(!x){if(A)return x=!0,Xo(i),y(A,O);if(S+=1,S===i.length){var H=function(){if(O.encryptedBytes)return Fy({decryptionWorker:n,segment:O,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:p,doneFn:y,onTransmuxerLog:b});Kf({segment:O,bytes:O.bytes,trackInfoFn:e,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:p,doneFn:y,onTransmuxerLog:b})};if(O.endOfAllRequests=Date.now(),O.map&&O.map.encryptedBytes&&!O.map.bytes)return Xf({decryptionWorker:n,id:O.requestId+"-init",encryptedBytes:O.map.encryptedBytes,key:O.map.key},function(L){O.map.bytes=L,$f(O,function(M){if(M)return Xo(i),y(M,O);H()})});H()}}}},By=function(t){var i=t.loadendState,n=t.abortFn;return function(e){var r=e.target;r.aborted&&n&&!i.calledAbortFn&&(n(),i.calledAbortFn=!0)}},Hy=function(t){var i=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 r=e.target;if(!r.aborted)return i.stats=D.mergeOptions(i.stats,Ly(e)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),n(e,i)}},Vy=function(t){var i=t.xhr,n=t.xhrOptions,e=t.decryptionWorker,r=t.segment,s=t.abortFn,o=t.progressFn,u=t.trackInfoFn,l=t.timingInfoFn,c=t.videoSegmentTimingInfoFn,g=t.audioSegmentTimingInfoFn,p=t.id3Fn,y=t.captionsFn,b=t.isEndOfTimeline,S=t.endedTimelineFn,x=t.dataFn,A=t.doneFn,O=t.onTransmuxerLog,H=[],L=Uy({activeXhrs:H,decryptionWorker:e,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:g,id3Fn:p,captionsFn:y,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x,doneFn:A,onTransmuxerLog:O});if(r.key&&!r.key.bytes){var M=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&M.push(r.map.key);var j=D.mergeOptions(n,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),U=zf(r,M,L),F=i(j,U);H.push(F)}if(r.map&&!r.map.bytes){var W=r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri);if(W){var R=D.mergeOptions(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),Q=zf(r,[r.map.key],L),B=i(R,Q);H.push(B)}var K=D.mergeOptions(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Go(r.map)}),te=My({segment:r,finishProcessingFn:L}),ae=i(K,te);H.push(ae)}var ee=D.mergeOptions(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Go(r)}),se=Ry({segment:r,finishProcessingFn:L,responseType:ee.responseType}),de=i(ee,se);de.addEventListener("progress",Hy({segment:r,progressFn:o,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:g,id3Fn:p,captionsFn:y,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x})),H.push(de);var ke={};return H.forEach(function(ue){ue.addEventListener("loadend",By({loadendState:ke,abortFn:s}))}),function(){return Xo(H)}},jy=gt("CodecUtils"),Wy=function(t){var i=t.attributes||{};if(i.CODECS)return bt(i.CODECS)},Yf=function(t,i){var n=i.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&n.AUDIO&&t.mediaGroups.AUDIO[n.AUDIO]},qy=function(t,i){if(!Yf(t,i))return!0;var n=i.attributes||{},e=t.mediaGroups.AUDIO[n.AUDIO];for(var r in e)if(!e[r].uri&&!e[r].playlists)return!0;return!1},Pa=function(t){var i={};return t.forEach(function(n){var e=n.mediaType,r=n.type,s=n.details;i[e]=i[e]||[],i[e].push(cl(""+r+s))}),Object.keys(i).forEach(function(n){if(i[n].length>1){jy("multiple "+n+" codecs found as attributes: "+i[n].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),i[n]=null;return}i[n]=i[n][0]}),i},Qf=function(t){var i=0;return t.audio&&i++,t.video&&i++,i},tn=function(t,i){var n=i.attributes||{},e=Pa(Wy(i)||[]);if(Yf(t,i)&&!e.audio&&!qy(t,i)){var r=Pa(hg(t,n.AUDIO)||[]);r.audio&&(e.audio=r.audio)}return e},ka=gt("PlaylistSelector"),Jf=function(t){if(!(!t||!t.playlist)){var i=t.playlist;return JSON.stringify({id:i.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:i.attributes&&i.attributes.CODECS||""})}},Aa=function(t,i){if(!t)return"";var n=w.getComputedStyle(t);return n?n[i]:""},or=function(t,i){var n=t.slice();t.sort(function(e,r){var s=i(e,r);return s===0?n.indexOf(e)-n.indexOf(r):s})},Qo=function(t,i){var n,e;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||w.Number.MAX_VALUE,i.attributes.BANDWIDTH&&(e=i.attributes.BANDWIDTH),e=e||w.Number.MAX_VALUE,n-e},Gy=function(t,i){var n,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||w.Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(e=i.attributes.RESOLUTION.width),e=e||w.Number.MAX_VALUE,n===e&&t.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?t.attributes.BANDWIDTH-i.attributes.BANDWIDTH:n-e},Zf=function(t,i,n,e,r,s){if(!!t){var o={bandwidth:i,width:n,height:e,limitRenditionByPlayerDimensions:r},u=t.playlists;et.isAudioOnly(t)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map(function(R){var Q,B=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,K=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return Q=R.attributes&&R.attributes.BANDWIDTH,Q=Q||w.Number.MAX_VALUE,{bandwidth:Q,width:B,height:K,playlist:R}});or(l,function(R,Q){return R.bandwidth-Q.bandwidth}),l=l.filter(function(R){return!et.isIncompatible(R.playlist)});var c=l.filter(function(R){return et.isEnabled(R.playlist)});c.length||(c=l.filter(function(R){return!et.isDisabled(R.playlist)}));var g=c.filter(function(R){return R.bandwidth*Oe.BANDWIDTH_VARIANCE<i}),p=g[g.length-1],y=g.filter(function(R){return R.bandwidth===p.bandwidth})[0];if(r===!1){var b=y||c[0]||l[0];if(b&&b.playlist){var S="sortedPlaylistReps";return y&&(S="bandwidthBestRep"),c[0]&&(S="enabledPlaylistReps"),ka("choosing "+Jf(b)+" using "+S+" with options",o),b.playlist}return ka("could not choose a playlist with options",o),null}var x=g.filter(function(R){return R.width&&R.height});or(x,function(R,Q){return R.width-Q.width});var A=x.filter(function(R){return R.width===n&&R.height===e});p=A[A.length-1];var O=A.filter(function(R){return R.bandwidth===p.bandwidth})[0],H,L,M;O||(H=x.filter(function(R){return R.width>n||R.height>e}),L=H.filter(function(R){return R.width===H[0].width&&R.height===H[0].height}),p=L[L.length-1],M=L.filter(function(R){return R.bandwidth===p.bandwidth})[0]);var j;if(s.experimentalLeastPixelDiffSelector){var U=x.map(function(R){return R.pixelDiff=Math.abs(R.width-n)+Math.abs(R.height-e),R});or(U,function(R,Q){return R.pixelDiff===Q.pixelDiff?Q.bandwidth-R.bandwidth:R.pixelDiff-Q.pixelDiff}),j=U[0]}var F=j||M||O||y||c[0]||l[0];if(F&&F.playlist){var W="sortedPlaylistReps";return j?W="leastPixelDiffRep":M?W="resolutionPlusOneRep":O?W="resolutionBestRep":y?W="bandwidthBestRep":c[0]&&(W="enabledPlaylistReps"),ka("choosing "+Jf(F)+" using "+W+" with options",o),F.playlist}return ka("could not choose a playlist with options",o),null}},eh=function(){var t=this.useDevicePixelRatio&&w.devicePixelRatio||1;return Zf(this.playlists.master,this.systemBandwidth,parseInt(Aa(this.tech_.el(),"width"),10)*t,parseInt(Aa(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},zy=function(t){var i=-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&&w.devicePixelRatio||1;return i<0&&(i=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(i=t*this.systemBandwidth+(1-t)*i,n=this.systemBandwidth),Zf(this.playlists.master,i,parseInt(Aa(this.tech_.el(),"width"),10)*e,parseInt(Aa(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},$y=function(t){var i=t.master,n=t.currentTime,e=t.bandwidth,r=t.duration,s=t.segmentDuration,o=t.timeUntilRebuffer,u=t.currentTimeline,l=t.syncController,c=i.playlists.filter(function(S){return!et.isIncompatible(S)}),g=c.filter(et.isEnabled);g.length||(g=c.filter(function(S){return!et.isDisabled(S)}));var p=g.filter(et.hasAttribute.bind(null,"BANDWIDTH")),y=p.map(function(S){var x=l.getSyncPoint(S,r,u,n),A=x?1:2,O=et.estimateSegmentRequestTime(s,e,S),H=O*A-o;return{playlist:S,rebufferingImpact:H}}),b=y.filter(function(S){return S.rebufferingImpact<=0});return or(b,function(S,x){return Qo(x.playlist,S.playlist)}),b.length?b[0]:(or(y,function(S,x){return S.rebufferingImpact-x.rebufferingImpact}),y[0]||null)},Ky=function(){var t=this,i=this.playlists.master.playlists.filter(et.isEnabled);or(i,function(e,r){return Qo(e,r)});var n=i.filter(function(e){return!!tn(t.playlists.master,e).video});return n[0]||null},Xy=function(t){var i=0,n;return t.bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(function(e){n.set(e,i),i+=e.byteLength})),n},Yy=function(t,i,n){if(!t[n]){i.trigger({type:"usage",name:"vhs-608"}),i.trigger({type:"usage",name:"hls-608"});var e=n;/^cc708_/.test(n)&&(e="SERVICE"+n.split("_")[1]);var r=i.textTracks().getTrackById(e);if(r)t[n]=r;else{var s=i.options_.vhs&&i.options_.vhs.captionServices||{},o=n,u=n,l=!1,c=s[e];c&&(o=c.label,u=c.language,l=c.default),t[n]=i.addRemoteTextTrack({kind:"captions",id:e,default:l,label:o,language:u},!1).track}}},Qy=function(t){var i=t.inbandTextTracks,n=t.captionArray,e=t.timestampOffset;if(!!n){var r=w.WebKitDataCue||w.VTTCue;n.forEach(function(s){var o=s.stream;i[o].addCue(new r(s.startTime+e,s.endTime+e,s.text))})}},Jy=function(t){Object.defineProperties(t.frame,{id:{get:function(){return D.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return D.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return D.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},Zy=function(t){var i=t.inbandTextTracks,n=t.metadataArray,e=t.timestampOffset,r=t.videoDuration;if(!!n){var s=w.WebKitDataCue||w.VTTCue,o=i.metadataTrack_;if(!!o&&(n.forEach(function(y){var b=y.cueTime+e;typeof b!="number"||w.isNaN(b)||b<0||!(b<1/0)||y.frames.forEach(function(S){var x=new s(b,b,S.value||S.url||S.data||"");x.frame=S,x.value=S,Jy(x),o.addCue(x)})}),!(!o.cues||!o.cues.length))){for(var u=o.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var g=l.reduce(function(y,b){var S=y[b.startTime]||[];return S.push(b),y[b.startTime]=S,y},{}),p=Object.keys(g).sort(function(y,b){return Number(y)-Number(b)});p.forEach(function(y,b){var S=g[y],x=Number(p[b+1])||r;S.forEach(function(A){A.endTime=x})})}}},eT=function(t,i,n){t.metadataTrack_||(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=i)},rn=function(t,i,n){var e,r;if(!!n&&!!n.cues)for(e=n.cues.length;e--;)r=n.cues[e],r.startTime>=t&&r.endTime<=i&&n.removeCue(r)},tT=function(t){var i=t.cues;if(!!i)for(var n=0;n<i.length;n++){for(var e=[],r=0,s=0;s<i.length;s++)i[n].startTime===i[s].startTime&&i[n].endTime===i[s].endTime&&i[n].text===i[s].text&&(r++,r>1&&e.push(i[s]));e.length&&e.forEach(function(o){return t.removeCue(o)})}},iT=function(t,i,n){if(typeof i=="undefined"||i===null||!t.length)return[];var e=Math.ceil((i-n+3)*zn.ONE_SECOND_IN_TS),r;for(r=0;r<t.length&&!(t[r].pts>e);r++);return t.slice(r)},rT=function(t,i,n){if(!i.length)return t;if(n)return i.slice();var e=i[0].pts,r=0;for(r;r<t.length&&!(t[r].pts>=e);r++);return t.slice(0,r).concat(i)},nT=function(t,i,n,e){for(var r=Math.ceil((i-e)*zn.ONE_SECOND_IN_TS),s=Math.ceil((n-e)*zn.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<=r););return l=Math.max(l,0),o.splice(l,u-l+1),o},aT=function(t,i){if(!t&&!i||!t&&i||t&&!i)return!1;if(t===i)return!0;var n=Object.keys(t).sort(),e=Object.keys(i).sort();if(n.length!==e.length)return!1;for(var r=0;r<n.length;r++){var s=n[r];if(s!==e[r]||t[s]!==i[s])return!1}return!0},th=22,sT=function(t,i,n){i=i||[];for(var e=[],r=0,s=0;s<i.length;s++){var o=i[s];if(t===o.timeline&&(e.push(s),r+=o.duration,r>n))return s}return e.length===0?0:e[e.length-1]},nn=1,oT=500,ih=function(t){return typeof t=="number"&&isFinite(t)},Ia=1/60,uT=function(t,i,n){return t!=="main"||!i||!n?null:!n.hasAudio&&!n.hasVideo?"Neither audio nor video found in segment.":i.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.":!i.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},lT=function(t,i,n){var e=i-Oe.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var r=i-n;return Math.min(r,e)},ur=function(t){var i=t.startOfSegment,n=t.duration,e=t.segment,r=t.part,s=t.playlist,o=s.mediaSequence,u=s.id,l=s.segments,c=l===void 0?[]:l,g=t.mediaIndex,p=t.partIndex,y=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 p=="number",A=t.segment.uri?"segment":"pre-segment",O=x?mf({preloadSegment:e})-1:0;return A+" ["+(o+g)+"/"+(o+b)+"]"+(x?" part ["+p+"/"+O+"]":"")+(" segment start/end ["+e.start+" => "+e.end+"]")+(x?" part start/end ["+r.start+" => "+r.end+"]":"")+(" startOfSegment ["+i+"]")+(" duration ["+n+"]")+(" timeline ["+y+"]")+(" selected by ["+S+"]")+(" playlist ["+u+"]")},rh=function(t){return t+"TimingInfo"},dT=function(t){var i=t.segmentTimeline,n=t.currentTimeline,e=t.startOfSegment,r=t.buffered,s=t.overrideCheck;return!s&&i===n?null:i<n?e:r.length?r.end(r.length-1):e},nh=function(t){var i=t.timelineChangeController,n=t.currentTimeline,e=t.segmentTimeline,r=t.loaderType,s=t.audioDisabled;if(n===e)return!1;if(r==="audio"){var o=i.lastTimelineChange({type:"main"});return!o||o.to!==e}if(r==="main"&&s){var u=i.pendingTimelineChange({type:"audio"});return!(u&&u.to===e)}return!1},cT=function(t){var i=0;return["video","audio"].forEach(function(n){var e=t[n+"TimingInfo"];if(!!e){var r=e.start,s=e.end,o;typeof r=="bigint"||typeof s=="bigint"?o=w.BigInt(s)-w.BigInt(r):typeof r=="number"&&typeof s=="number"&&(o=s-r),typeof o!="undefined"&&o>i&&(i=o)}}),typeof i=="bigint"&&i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),i},ah=function(t){var i=t.segmentDuration,n=t.maxDuration;return i?Math.round(i)>n+ii:!1},fT=function(t,i){if(i!=="hls")return null;var n=cT({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!n)return null;var e=t.playlist.targetDuration,r=ah({segmentDuration:n,maxDuration:e*2}),s=ah({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 r||s?{severity:r?"warn":"info",message:o}:null},Jo=function(a){$(t,a);function t(n,e){var r;if(r=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 r.bandwidth=n.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=n.hasPlayed,r.currentTime_=n.currentTime,r.seekable_=n.seekable,r.seeking_=n.seeking,r.duration_=n.duration,r.mediaSource_=n.mediaSource,r.vhs_=n.vhs,r.loaderType_=n.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=n.segmentMetadataTrack,r.goalBufferLength_=n.goalBufferLength,r.sourceType_=n.sourceType,r.sourceUpdater_=n.sourceUpdater,r.inbandTextTracks_=n.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=n.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=n.parse708captions,r.useDtsForTimestampOffset_=n.useDtsForTimestampOffset,r.captionServices_=n.captionServices,r.experimentalExactManifestTimings=n.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=D.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=n.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=n.decrypter,r.syncController_=n.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",function(){r.isEndOfStream_()||(r.ended_=!1)}),r.fetchAtBuffer_=!1,r.logger_=gt("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(ie(r),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r.loaderType_==="main"&&r.timelineChangeController_.on("pendingtimelinechange",function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r.loaderType_==="audio"&&r.timelineChangeController_.on("timelinechange",function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()}),r}var i=t.prototype;return i.createTransmuxer_=function(){return Ko.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.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},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},i.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,w.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e},i.error=function(e){return typeof e!="undefined"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&Ko.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return D.createTimeRanges();if(this.loaderType_==="main"){var r=e.hasAudio,s=e.hasVideo,o=e.isMuxed;if(s&&r&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,r){if(r===void 0&&(r=!1),!e)return null;var s=Ca(e),o=this.initSegments_[s];return r&&!o&&e.bytes&&(this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},i.segmentKey=function(e,r){if(r===void 0&&(r=!1),!e)return null;var s=Df(e),o=this.keyCache_[s];this.cacheEncryptionKeys_&&r&&!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},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.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")}},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,r){if(r===void 0&&(r={}),!!e){var s=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=r,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)}},i.pause=function(){this.checkBufferTimeout_&&(w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return this.checkBufferTimeout_===null},i.resetEverything=function(e){this.ended_=!1,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"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&Ko.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"})},i.remove=function(e,r,s,o){if(s===void 0&&(s=function(){}),o===void 0&&(o=!1),r===1/0&&(r=this.duration_()),r<=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,r,l)),(o||this.loaderType_==="main")&&(this.gopBuffer_=nT(this.gopBuffer_,e,r,this.timeMapping_),u++,this.sourceUpdater_.removeVideo(e,r,l));for(var c in this.inbandTextTracks_)rn(e,r,this.inbandTextTracks_[c]);rn(e,r,this.segmentMetadataTrack_),l()},i.monitorBuffer_=function(){this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&w.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=w.setTimeout(this.monitorBufferTick_.bind(this),oT)},i.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))}},i.isEndOfStream_=function(e,r,s){if(e===void 0&&(e=this.mediaIndex),r===void 0&&(r=this.playlist_),s===void 0&&(s=this.partIndex),!r||!this.mediaSource_)return!1;var o=typeof e=="number"&&r.segments[e],u=e+1===r.segments.length,l=!o||!o.parts||s+1===o.parts.length;return r.endList&&this.mediaSource_.readyState==="open"&&u&&l},i.chooseNextRequest_=function(){var e=this.buffered_(),r=ff(e)||0,s=Ro(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=sT(this.currentTimeline_,l,r);else if(this.mediaIndex!==null){var g=l[this.mediaIndex],p=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=g.end?g.end:r,g.parts&&g.parts[p+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=p+1):c.mediaIndex=this.mediaIndex+1}else{var y=et.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?r:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=y.segmentIndex,S=y.startTime,x=y.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+r:"currentTime "+this.currentTime_(),c.mediaIndex=b,c.startOfSegment=S,c.partIndex=x}var A=l[c.mediaIndex],O=A&&typeof c.partIndex=="number"&&A.parts&&A.parts[c.partIndex];if(!A||typeof c.partIndex=="number"&&!O)return null;if(typeof c.partIndex!="number"&&A.parts&&(c.partIndex=0,O=A.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 A.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var M=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=l.length-1&&M&&!this.seeking_()?null:this.generateSegmentInfo_(c)},i.generateSegmentInfo_=function(e){var r=e.independent,s=e.playlist,o=e.mediaIndex,u=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,g=e.forceTimestampOffset,p=e.getMediaInfoForTime,y=s.segments[o],b=typeof c=="number"&&y.parts[c],S={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||y.resolvedUri,mediaIndex:o,partIndex:b?c:null,isSyncRequest:l,startOfSegment:u,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:y.timeline,duration:b&&b.duration||y.duration,segment:y,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:r},x=typeof g!="undefined"?g:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:y.timeline,currentTimeline:this.currentTimeline_,startOfSegment:u,buffered:this.buffered_(),overrideCheck:x});var A=ff(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(S.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=iT(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S},i.timestampOffsetForSegment_=function(e){return dT(e)},i.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var r=this.currentTime_(),s=e.bandwidth,o=this.pendingSegment_.duration,u=et.estimateSegmentRequestTime(o,s,this.playlist_,e.bytesReceived),l=N_(this.buffered_(),r,this.vhs_.tech_.playbackRate())-1;if(!(u<=l)){var c=$y({master:this.vhs_.playlists.master,currentTime:r,bandwidth:s,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!!c){var g=u-l,p=g-c.rebufferingImpact,y=.5;l<=ii&&(y=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||p<y)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*Oe.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},i.handleAbort_=function(e){this.logger_("Aborting "+ur(e)),this.mediaRequestsAborted+=1},i.handleProgress_=function(e,r){this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)&&this.trigger("progress")},i.handleTrackInfo_=function(e,r){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(r)||(r=r||{},aT(this.currentMediaInfo_,r)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=r,this.currentMediaInfo_=r,this.logger_("trackinfo update",r),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=r,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},i.handleTimingInfo_=function(e,r,s,o){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var u=this.pendingSegment_,l=rh(r);u[l]=u[l]||{},u[l][s]=o,this.logger_("timinginfo: "+r+" - "+s+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},i.handleCaptions_=function(e,r){var s=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(r.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,r));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),l={};r.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],p=g.startTime,y=g.endTime,b=g.captions,S=s.inbandTextTracks_;s.logger_("adding cues from "+p+" -> "+y+" for "+c),Yy(S,s.vhs_.tech_,c),rn(p,y,S[c]),Qy({captionArray:b,inbandTextTracks:S,timestampOffset:u})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},i.handleId3_=function(e,r,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,r,s));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();eT(this.inbandTextTracks_,s,this.vhs_.tech_),Zy({inbandTextTracks:this.inbandTextTracks_,metadataArray:r,timestampOffset:u,videoDuration:this.duration_()})}},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(r){return r()})},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(r){return r()})},i.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!nh({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},i.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,r=this.getCurrentMediaInfo_();if(!e||!r)return!1;var s=r.hasAudio,o=r.hasVideo,u=r.isMuxed;return!(o&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!u&&!e.audioTimingInfo||nh({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,r){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,r));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[rh(r.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,r.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,r)}}},i.updateAppendInitSegmentStatus=function(e,r){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[r]!==e.playlist&&(this.appendInitSegment_[r]=!0)},i.getInitSegmentAndUpdateState_=function(e){var r=e.type,s=e.initSegment,o=e.map,u=e.playlist;if(o){var l=Ca(o);if(this.activeInitSegmentId_===l)return null;s=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=l}return s&&this.appendInitSegment_[r]?(this.playlistOfLastInitSegment_[r]=u,this.appendInitSegment_[r]=!1,this.activeInitSegmentId_=null,s):null},i.handleQuotaExceededError_=function(e,r){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: "+bi(c).join(", ")),g.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+bi(g).join(", "));var p=c.length?c.start(0):0,y=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(y-p<=nn&&S-b<=nn){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+l.byteLength+", ")+("audio buffer: "+bi(c).join(", ")+", ")+("video buffer: "+bi(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_(),A=x-nn;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+A),this.remove(0,A,function(){s.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+nn+"s"),s.waitingOnRemove_=!1,s.quotaExceededErrorRetryTimeout_=w.setTimeout(function(){s.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),s.quotaExceededErrorRetryTimeout_=null,s.processCallQueue_()},nn*1e3)},!0)},i.handleAppendError_=function(e,r){var s=e.segmentInfo,o=e.type,u=e.bytes;if(!!r){if(r.code===th){this.handleQuotaExceededError_({segmentInfo:s,type:o,bytes:u});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(o+" append of "+u.length+"b failed for segment "+("#"+s.mediaIndex+" in playlist "+s.playlist.id)),this.trigger("appenderror")}},i.appendToSourceBuffer_=function(e){var r=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=Xy({bytes:g,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:s,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:r,type:s,bytes:l}))},i.handleSegmentTimingInfo_=function(e,r,s){if(!(!this.pendingSegment_||r!==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}},i.appendData_=function(e,r){var s=r.type,o=r.data;if(!(!o||!o.byteLength)&&!(s==="audio"&&this.audioDisabled_)){var u=this.getInitSegmentAndUpdateState_({type:s,initSegment:r.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:u,data:o})}},i.loadSegment_=function(e){var r=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=dt({},e,{forceTimestampOffset:!0});dt(e,r.generateSegmentInfo_(s)),r.isPendingTimestampOffset_=!1,r.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},i.updateTransmuxerAndRequestSegment_=function(e){var r=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 "+ur(e)),s.map&&!s.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Vy({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(){r.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(p){var y=p.message,b=p.level,S=p.stream;r.logger_(ur(e)+" logged from transmuxer stream "+S+" as a "+b+": "+y)}})},i.trimBackBuffer_=function(e){var r=lT(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);r>0&&this.remove(0,r)},i.createSimplifiedSegmentObj_=function(e){var r=e.segment,s=e.part,o={resolvedUri:s?s.resolvedUri:r.resolvedUri,byterange:s?s.byterange:r.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===r.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),r.key){var l=r.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(r.key),o.key.iv=l}return r.map&&(o.map=this.initSegmentForMap(r.map)),o},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,r){if(this.pendingSegment_.byteLength=r.bytesReceived,e<Ia){this.logger_("Ignoring segment's bandwidth because its duration of "+e+(" is less than the min to record "+Ia));return}this.bandwidth=r.bandwidth,this.roundTrip=r.roundTripTime},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,r,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,r,s));return}if(this.saveTransferStats_(r.stats),!!this.pendingSegment_&&r.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Pt.ABORTED)return;if(this.pause(),e.code===Pt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,r.stats),o.endOfAllRequests=r.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=rT(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},i.setTimeMapping_=function(e){var r=this.syncController_.mappingForTimeline(e);r!==null&&(this.timeMapping_=r)},i.updateMediaSecondsLoaded_=function(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()},i.trueSegmentStart_=function(e){var r=e.currentStart,s=e.playlist,o=e.mediaIndex,u=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,c=e.useVideoTimingInfo,g=e.videoTimingInfo,p=e.audioTimingInfo;if(typeof r!="undefined")return r;if(!c)return p.start;var y=s.segments[o-1];return o===0||!y||typeof y.start=="undefined"||y.end!==u+l?u:g.start},i.waitForAppendsToComplete_=function(e){var r=this.getCurrentMediaInfo_(e);if(!r){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var s=r.hasAudio,o=r.hasVideo,u=r.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))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var r=uT(this.loaderType_,this.getCurrentMediaInfo_(),e);return r?(this.error({message:r,blacklistDuration:1/0}),this.trigger("error"),!0):!1},i.updateSourceBufferTimestampOffset_=function(e){if(!(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")){var r=!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),r=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),r=!0),r&&this.trigger("timestampoffset")}},i.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var r=e.videoTimingInfo,s=e.audioTimingInfo,o=e.timingInfo;return this.useDtsForTimestampOffset_?r&&typeof r.transmuxedDecodeStart=="number"?r.transmuxedDecodeStart:s&&typeof s.transmuxedDecodeStart=="number"?s.transmuxedDecodeStart:o.start:o.start},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var r=this.getMediaInfo_(),s=this.loaderType_==="main"&&r&&r.hasVideo,o=s&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;!o||(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)},i.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 r=fT(e,this.sourceType_);if(r&&(r.severity==="warn"?D.log.warn(r.message):this.logger_(r.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 "+ur(e));return}this.logger_("Appended "+ur(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")+" "+ur(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_()},i.recordThroughput_=function(e){if(e.duration<Ia){this.logger_("Ignoring segment's throughput because its duration of "+e.duration+(" is less than the min to record "+Ia));return}var r=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,o=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(o-r)/++this.throughput.count},i.addSegmentMetadataCue_=function(e){if(!!this.segmentMetadataTrack_){var r=e.segment,s=r.start,o=r.end;if(!(!ih(s)||!ih(o))){rn(s,o,this.segmentMetadataTrack_);var u=w.WebKitDataCue||w.VTTCue,l={custom:r.custom,dateTimeObject:r.dateTimeObject,dateTimeString:r.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:o},c=JSON.stringify(l),g=new u(s,o,c);g.value=l,this.segmentMetadataTrack_.addCue(g)}}},t}(D.EventTarget);function zt(){}var sh=function(t){return typeof t!="string"?t:t.replace(/./,function(i){return i.toUpperCase()})},hT=["video","audio"],Zo=function(t,i){var n=i[t+"Buffer"];return n&&n.updating||i.queuePending[t]},pT=function(t,i){for(var n=0;n<i.length;n++){var e=i[n];if(e.type==="mediaSource")return null;if(e.type===t)return n}return null},eu=function a(t,i){if(i.queue.length!==0){var n=0,e=i.queue[n];if(e.type==="mediaSource"){!i.updating()&&i.mediaSource.readyState!=="closed"&&(i.queue.shift(),e.action(i),e.doneFn&&e.doneFn(),a("audio",i),a("video",i));return}if(t!=="mediaSource"&&!(!i.ready()||i.mediaSource.readyState==="closed"||Zo(t,i))){if(e.type!==t){if(n=pT(t,i.queue),n===null)return;e=i.queue[n]}if(i.queue.splice(n,1),i.queuePending[t]=e,e.action(t,i),!e.doneFn){i.queuePending[t]=null,a(t,i);return}}}},oh=function(t,i){var n=i[t+"Buffer"],e=sh(t);!n||(n.removeEventListener("updateend",i["on"+e+"UpdateEnd_"]),n.removeEventListener("error",i["on"+e+"Error_"]),i.codecs[t]=null,i[t+"Buffer"]=null)},kt=function(t,i){return t&&i&&Array.prototype.indexOf.call(t.sourceBuffers,i)!==-1},nt={appendBuffer:function(t,i,n){return function(e,r){var s=r[e+"Buffer"];if(!!kt(r.mediaSource,s)){r.logger_("Appending segment "+i.mediaIndex+"'s "+t.length+" bytes to "+e+"Buffer");try{s.appendBuffer(t)}catch(o){r.logger_("Error with code "+o.code+" "+(o.code===th?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+i.mediaIndex+" to "+e+"Buffer")),r.queuePending[e]=null,n(o)}}}},remove:function(t,i){return function(n,e){var r=e[n+"Buffer"];if(!!kt(e.mediaSource,r)){e.logger_("Removing "+t+" to "+i+" from "+n+"Buffer");try{r.remove(t,i)}catch{e.logger_("Remove "+t+" to "+i+" from "+n+"Buffer failed")}}}},timestampOffset:function(t){return function(i,n){var e=n[i+"Buffer"];!kt(n.mediaSource,e)||(n.logger_("Setting "+i+"timestampOffset to "+t),e.timestampOffset=t)}},callback:function(t){return function(i,n){t()}},endOfStream:function(t){return function(i){if(i.mediaSource.readyState==="open"){i.logger_("Calling mediaSource endOfStream("+(t||"")+")");try{i.mediaSource.endOfStream(t)}catch(n){D.log.warn("Failed to call media source endOfStream",n)}}}},duration:function(t){return function(i){i.logger_("Setting mediaSource duration to "+t);try{i.mediaSource.duration=t}catch(n){D.log.warn("Failed to set media source duration",n)}}},abort:function(){return function(t,i){if(i.mediaSource.readyState==="open"){var n=i[t+"Buffer"];if(!!kt(i.mediaSource,n)){i.logger_("calling abort on "+t+"Buffer");try{n.abort()}catch(e){D.log.warn("Failed to abort on "+t+"Buffer",e)}}}}},addSourceBuffer:function(t,i){return function(n){var e=sh(t),r=Er(i);n.logger_("Adding "+t+"Buffer with codec "+i+" to mediaSource");var s=n.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",n["on"+e+"UpdateEnd_"]),s.addEventListener("error",n["on"+e+"Error_"]),n.codecs[t]=i,n[t+"Buffer"]=s}},removeSourceBuffer:function(t){return function(i){var n=i[t+"Buffer"];if(oh(t,i),!!kt(i.mediaSource,n)){i.logger_("Removing "+t+"Buffer with codec "+i.codecs[t]+" from mediaSource");try{i.mediaSource.removeSourceBuffer(n)}catch(e){D.log.warn("Failed to removeSourceBuffer "+t+"Buffer",e)}}}},changeType:function(t){return function(i,n){var e=n[i+"Buffer"],r=Er(t);!kt(n.mediaSource,e)||n.codecs[i]!==t&&(n.logger_("changing "+i+"Buffer codec from "+n.codecs[i]+" to "+t),e.changeType(r),n.codecs[i]=t)}}},at=function(t){var i=t.type,n=t.sourceUpdater,e=t.action,r=t.doneFn,s=t.name;n.queue.push({type:i,action:e,doneFn:r,name:s}),eu(i,n)},uh=function(t,i){return function(n){if(i.queuePending[t]){var e=i.queuePending[t].doneFn;i.queuePending[t]=null,e&&e(i[t+"Error_"])}eu(t,i)}},lh=function(a){$(t,a);function t(n){var e;return e=a.call(this)||this,e.mediaSource=n,e.sourceopenListener_=function(){return eu("mediaSource",ie(e))},e.mediaSource.addEventListener("sourceopen",e.sourceopenListener_),e.logger_=gt("SourceUpdater"),e.audioTimestampOffset_=0,e.videoTimestampOffset_=0,e.queue=[],e.queuePending={audio:null,video:null},e.delayedAudioAppendQueue_=[],e.videoAppendQueued_=!1,e.codecs={},e.onVideoUpdateEnd_=uh("video",ie(e)),e.onAudioUpdateEnd_=uh("audio",ie(e)),e.onVideoError_=function(r){e.videoError_=r},e.onAudioError_=function(r){e.audioError_=r},e.createdSourceBuffers_=!1,e.initializedEme_=!1,e.triggeredReady_=!1,e}var i=t.prototype;return i.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},i.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},i.hasInitializedAnyEme=function(){return this.initializedEme_},i.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},i.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},i.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},i.addSourceBuffer=function(e,r){at({type:"mediaSource",sourceUpdater:this,action:nt.addSourceBuffer(e,r),name:"addSourceBuffer"})},i.abort=function(e){at({type:e,sourceUpdater:this,action:nt.abort(e),name:"abort"})},i.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer()){D.log.error("removeSourceBuffer is not supported!");return}at({type:"mediaSource",sourceUpdater:this,action:nt.removeSourceBuffer(e),name:"removeSourceBuffer"})},i.canRemoveSourceBuffer=function(){return!D.browser.IE_VERSION&&!D.browser.IS_FIREFOX&&w.MediaSource&&w.MediaSource.prototype&&typeof w.MediaSource.prototype.removeSourceBuffer=="function"},t.canChangeType=function(){return w.SourceBuffer&&w.SourceBuffer.prototype&&typeof w.SourceBuffer.prototype.changeType=="function"},i.canChangeType=function(){return this.constructor.canChangeType()},i.changeType=function(e,r){if(!this.canChangeType()){D.log.error("changeType is not supported!");return}at({type:e,sourceUpdater:this,action:nt.changeType(r),name:"changeType"})},i.addOrChangeSourceBuffers=function(e){var r=this;if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(s){var o=e[s];if(!r.hasCreatedSourceBuffers())return r.addSourceBuffer(s,o);r.canChangeType()&&r.changeType(s,o)})},i.appendBuffer=function(e,r){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes;if(this.processedAppend_=!0,u==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,r]),this.logger_("delayed audio append of "+l.length+" until video append");return}var c=r;if(at({type:u,sourceUpdater:this,action:nt.appendBuffer(l,o||{mediaIndex:-1},c),doneFn:r,name:"appendBuffer"}),u==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var g=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+g.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,g.forEach(function(p){s.appendBuffer.apply(s,p)})}},i.audioBuffered=function(){return kt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:D.createTimeRange()},i.videoBuffered=function(){return kt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:D.createTimeRange()},i.buffered=function(){var e=kt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,r=kt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return r&&!e?this.audioBuffered():e&&!r?this.videoBuffered():R_(this.audioBuffered(),this.videoBuffered())},i.setDuration=function(e,r){r===void 0&&(r=zt),at({type:"mediaSource",sourceUpdater:this,action:nt.duration(e),name:"duration",doneFn:r})},i.endOfStream=function(e,r){e===void 0&&(e=null),r===void 0&&(r=zt),typeof e!="string"&&(e=void 0),at({type:"mediaSource",sourceUpdater:this,action:nt.endOfStream(e),name:"endOfStream",doneFn:r})},i.removeAudio=function(e,r,s){if(s===void 0&&(s=zt),!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}at({type:"audio",sourceUpdater:this,action:nt.remove(e,r),doneFn:s,name:"remove"})},i.removeVideo=function(e,r,s){if(s===void 0&&(s=zt),!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}at({type:"video",sourceUpdater:this,action:nt.remove(e,r),doneFn:s,name:"remove"})},i.updating=function(){return!!(Zo("audio",this)||Zo("video",this))},i.audioTimestampOffset=function(e){return typeof e!="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(at({type:"audio",sourceUpdater:this,action:nt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},i.videoTimestampOffset=function(e){return typeof e!="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(at({type:"video",sourceUpdater:this,action:nt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},i.audioQueueCallback=function(e){!this.audioBuffer||at({type:"audio",sourceUpdater:this,action:nt.callback(e),name:"callback"})},i.videoQueueCallback=function(e){!this.videoBuffer||at({type:"video",sourceUpdater:this,action:nt.callback(e),name:"callback"})},i.dispose=function(){var e=this;this.trigger("dispose"),hT.forEach(function(r){e.abort(r),e.canRemoveSourceBuffer()?e.removeSourceBuffer(r):e[r+"QueueCallback"](function(){return oh(r,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(D.EventTarget),dh=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},ch=new Uint8Array(`
  58. `.split("").map(function(a){return a.charCodeAt(0)})),mT=function(a){$(t,a);function t(n,e){var r;return e===void 0&&(e={}),r=a.call(this,n,e)||this,r.mediaSource_=null,r.subtitlesTrack_=null,r.loaderType_="subtitle",r.featuresNativeTextTracks_=n.featuresNativeTextTracks,r.shouldSaveSegmentTimingInfo_=!1,r}var i=t.prototype;return i.createTransmuxer_=function(){return null},i.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return D.createTimeRanges();var e=this.subtitlesTrack_.cues,r=e[0].startTime,s=e[e.length-1].startTime;return D.createTimeRanges([[r,s]])},i.initSegmentForMap=function(e,r){if(r===void 0&&(r=!1),!e)return null;var s=Ca(e),o=this.initSegments_[s];if(r&&!o&&e.bytes){var u=ch.byteLength+e.bytes.byteLength,l=new Uint8Array(u);l.set(e.bytes),l.set(ch,e.bytes.byteLength),this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:l}}return o||e},i.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.track=function(e){return typeof e=="undefined"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},i.remove=function(e,r){rn(e,r,this.subtitlesTrack_)},i.fillBuffer_=function(){var e=this,r=this.chooseNextRequest_();if(!!r){if(this.syncController_.timestampOffsetForTimeline(r.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_(r)}},i.timestampOffsetForSegment_=function(){return null},i.chooseNextRequest_=function(){return this.skipEmptySegments_(a.prototype.chooseNextRequest_.call(this))},i.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},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,r,s){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(r.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Pt.TIMEOUT&&this.handleTimeout_(),e.code===Pt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var u=this.pendingSegment_;this.saveBandwidthRelatedStats_(u.duration,r.stats),r.key&&this.segmentKey(r.key,!0),this.state="APPENDING",this.trigger("appending");var l=u.segment;if(l.map&&(l.map.bytes=r.map.bytes),u.bytes=r.bytes,typeof w.WebVTT!="function"&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var c,g=function(){o.subtitlesTrack_.tech_.off("vttjsloaded",c),o.stopForError({message:"Error loading vtt.js"})};c=function(){o.subtitlesTrack_.tech_.off("vttjserror",g),o.segmentRequestFinished_(e,r,s)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",c),this.subtitlesTrack_.tech_.one("vttjserror",g);return}l.requested=!0;try{this.parseVTTCues_(u)}catch(p){this.stopForError({message:p.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(p){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new w.VTTCue(p.startTime,p.endTime,p.text):p)}),tT(this.subtitlesTrack_),this.handleAppendsDone_()},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var r,s=!1;typeof w.TextDecoder=="function"?r=new w.TextDecoder("utf8"):(r=w.WebVTT.StringDecoder(),s=!0);var o=new w.WebVTT.Parser(w,w.vttjs,r);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){D.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){var u=e.segment.map.bytes;s&&(u=dh(u)),o.parse(u)}var l=e.bytes;s&&(l=dh(l)),o.parse(l),o.flush()},i.updateTimeMapping_=function(e,r,s){var o=e.segment;if(!!r){if(!e.cues.length){o.empty=!0;return}var u=e.timestampmap,l=u.MPEGTS/zn.ONE_SECOND_IN_TS-u.LOCAL+r.mapping;if(e.cues.forEach(function(p){p.startTime+=l,p.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}(Jo),gT=function(t,i){for(var n=t.cues,e=0;e<n.length;e++){var r=n[e];if(i>=r.adStartTime&&i<=r.adEndTime)return r}return null},vT=function(t,i,n){if(n===void 0&&(n=0),!!t.segments)for(var e=n,r,s=0;s<t.segments.length;s++){var o=t.segments[s];if(r||(r=gT(i,e+o.duration/2)),r){if("cueIn"in o){r.endTime=e,r.adEndTime=e,e+=o.duration,r=null;continue}if(e<r.endTime){e+=o.duration;continue}r.endTime+=o.duration}else if("cueOut"in o&&(r=new w.VTTCue(e,e+o.duration,o.cueOut),r.adStartTime=e,r.adEndTime=e+parseFloat(o.cueOut),i.addCue(r)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];r=new w.VTTCue(e,e+o.duration,""),r.adStartTime=e-l,r.adEndTime=r.adStartTime+c,i.addCue(r)}e+=o.duration}},_T=86400,fh=[{name:"VOD",run:function(t,i,n,e,r){if(n!==1/0){var s={time:0,segmentIndex:0,partIndex:null};return s}return null}},{name:"ProgramDateTime",run:function(t,i,n,e,r){if(!Object.keys(t.timelineToDatetimeMappings).length)return null;var s=null,o=null,u=Fo(i);r=r||0;for(var l=0;l<u.length;l++){var c=i.endList||r===0?l:u.length-(l+1),g=u[c],p=g.segment,y=t.timelineToDatetimeMappings[p.timeline];if(!(!y||!p.dateTimeObject)){var b=p.dateTimeObject.getTime()/1e3,S=b+y;if(p.parts&&typeof g.partIndex=="number")for(var x=0;x<g.partIndex;x++)S+=p.parts[x].duration;var A=Math.abs(r-S);if(o!==null&&(A===0||o<A))break;o=A,s={time:S,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}}return s}},{name:"Segment",run:function(t,i,n,e,r){var s=null,o=null;r=r||0;for(var u=Fo(i),l=0;l<u.length;l++){var c=i.endList||r===0?l:u.length-(l+1),g=u[c],p=g.segment,y=g.part&&g.part.start||p&&p.start;if(p.timeline===e&&typeof y!="undefined"){var b=Math.abs(r-y);if(o!==null&&o<b)break;(!s||o===null||o>=b)&&(o=b,s={time:y,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return s}},{name:"Discontinuity",run:function(t,i,n,e,r){var s=null;if(r=r||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var o=null,u=0;u<i.discontinuityStarts.length;u++){var l=i.discontinuityStarts[u],c=i.discontinuitySequence+u+1,g=t.discontinuities[c];if(g){var p=Math.abs(r-g.time);if(o!==null&&o<p)break;(!s||o===null||o>=p)&&(o=p,s={time:g.time,segmentIndex:l,partIndex:null})}}return s}},{name:"Playlist",run:function(t,i,n,e,r){if(i.syncInfo){var s={time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence,partIndex:null};return s}return null}}],yT=function(a){$(t,a);function t(n){var e;return e=a.call(this)||this,e.timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=gt("SyncController"),e}var i=t.prototype;return i.getSyncPoint=function(e,r,s,o){var u=this.runStrategies_(e,r,s,o);return u.length?this.selectSyncPoint_(u,{key:"time",value:o}):null},i.getExpiredTime=function(e,r){if(!e||!e.segments)return null;var s=this.runStrategies_(e,r,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+Jr({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,r,s,o){for(var u=[],l=0;l<fh.length;l++){var c=fh[l],g=c.run(this,e,r,s,o);g&&(g.strategy=c.name,u.push({strategy:c.name,syncPoint:g}))}return u},i.selectSyncPoint_=function(e,r){for(var s=e[0].syncPoint,o=Math.abs(e[0].syncPoint[r.key]-r.value),u=e[0].strategy,l=1;l<e.length;l++){var c=Math.abs(e[l].syncPoint[r.key]-r.value);c<o&&(o=c,s=e[l].syncPoint,u=e[l].strategy)}return this.logger_("syncPoint for ["+r.key+": "+r.value+"] chosen with strategy"+(" ["+u+"]: [time:"+s.time+",")+(" segmentIndex:"+s.segmentIndex)+(typeof s.partIndex=="number"?",partIndex:"+s.partIndex:"")+"]"),s},i.saveExpiredSegmentInfo=function(e,r){var s=r.mediaSequence-e.mediaSequence;if(s>_T){D.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!="undefined"){r.syncInfo={mediaSequence:e.mediaSequence+o,time:u.start},this.logger_("playlist refresh sync: [time:"+r.syncInfo.time+","+(" mediaSequence: "+r.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var r=e.segments[0],s=r.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[r.timeline]=-s}},i.saveSegmentTimingInfo=function(e){var r=e.segmentInfo,s=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(r,r.timingInfo,s),u=r.segment;o&&(this.saveDiscontinuitySyncInfo_(r),r.playlist.syncInfo||(r.playlist.syncInfo={mediaSequence:r.playlist.mediaSequence+r.mediaIndex,time:u.start}));var l=u.dateTimeObject;u.discontinuity&&s&&l&&(this.timelineToDatetimeMappings[u.timeline]=-(l.getTime()/1e3))},i.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]=="undefined"?null:this.timelines[e].time},i.mappingForTimeline=function(e){return typeof this.timelines[e]=="undefined"?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,r,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-r.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=r.end+l.mapping;else if(l)c=r.start+l.mapping,g=r.end+l.mapping;else return!1;return u&&(u.start=c,u.end=g),(!o.start||c<o.start)&&(o.start=c),o.end=g,!0},i.saveDiscontinuitySyncInfo_=function(e){var r=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(r.discontinuityStarts&&r.discontinuityStarts.length)for(var o=0;o<r.discontinuityStarts.length;o++){var u=r.discontinuityStarts[o],l=r.discontinuitySequence+o+1,c=u-e.mediaIndex,g=Math.abs(c);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>g){var p=void 0;c<0?p=s.start-Jr({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex,endIndex:u}):p=s.end+Jr({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:e.mediaIndex+1,endIndex:u}),this.discontinuities[l]={time:p,accuracy:g}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(D.EventTarget),TT=function(a){$(t,a);function t(){var n;return n=a.call(this)||this,n.pendingTimelineChanges_={},n.lastTimelineChanges_={},n}var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var r=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[r]={type:r,from:s,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[r]},i.lastTimelineChange=function(e){var r=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[r]={type:r,from:s,to:o},delete this.pendingTimelineChanges_[r],this.trigger("timelinechange")),this.lastTimelineChanges_[r]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(D.EventTarget),bT=Bf(Hf(function(){var a=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function t(L,M,j){return j={path:M,exports:{},require:function(F,W){return i(F,W==null?j.path:W)}},L(j,j.exports),j.exports}function i(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var n=t(function(L){function M(U,F){for(var W=0;W<F.length;W++){var R=F[W];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(U,R.key,R)}}function j(U,F,W){return F&&M(U.prototype,F),W&&M(U,W),U}L.exports=j,L.exports.default=L.exports,L.exports.__esModule=!0}),e=t(function(L){function M(j,U){return L.exports=M=Object.setPrototypeOf||function(W,R){return W.__proto__=R,W},L.exports.default=L.exports,L.exports.__esModule=!0,M(j,U)}L.exports=M,L.exports.default=L.exports,L.exports.__esModule=!0}),r=t(function(L){function M(j,U){j.prototype=Object.create(U.prototype),j.prototype.constructor=j,e(j,U)}L.exports=M,L.exports.default=L.exports,L.exports.__esModule=!0}),s=function(){function L(){this.listeners={}}var M=L.prototype;return M.on=function(U,F){this.listeners[U]||(this.listeners[U]=[]),this.listeners[U].push(F)},M.off=function(U,F){if(!this.listeners[U])return!1;var W=this.listeners[U].indexOf(F);return this.listeners[U]=this.listeners[U].slice(0),this.listeners[U].splice(W,1),W>-1},M.trigger=function(U){var F=this.listeners[U];if(!!F)if(arguments.length===2)for(var W=F.length,R=0;R<W;++R)F[R].call(this,arguments[1]);else for(var Q=Array.prototype.slice.call(arguments,1),B=F.length,K=0;K<B;++K)F[K].apply(this,Q)},M.dispose=function(){this.listeners={}},M.pipe=function(U){this.on("data",function(F){U.push(F)})},L}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(L){return L.subarray(0,L.byteLength-L[L.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var u=function(){var M=[[[],[],[],[],[]],[[],[],[],[],[]]],j=M[0],U=M[1],F=j[4],W=U[4],R,Q,B,K=[],te=[],ae,ee,se,de,ke,ue;for(R=0;R<256;R++)te[(K[R]=R<<1^(R>>7)*283)^R]=R;for(Q=B=0;!F[Q];Q^=ae||1,B=te[B]||1)for(de=B^B<<1^B<<2^B<<3^B<<4,de=de>>8^de&255^99,F[Q]=de,W[de]=Q,se=K[ee=K[ae=K[Q]]],ue=se*16843009^ee*65537^ae*257^Q*16843008,ke=K[de]*257^de*16843008,R=0;R<4;R++)j[R][Q]=ke=ke<<24^ke>>>8,U[R][de]=ue=ue<<24^ue>>>8;for(R=0;R<5;R++)j[R]=j[R].slice(0),U[R]=U[R].slice(0);return M},l=null,c=function(){function L(j){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 U,F,W,R=this._tables[0][4],Q=this._tables[1],B=j.length,K=1;if(B!==4&&B!==6&&B!==8)throw new Error("Invalid aes key size");var te=j.slice(0),ae=[];for(this._key=[te,ae],U=B;U<4*B+28;U++)W=te[U-1],(U%B==0||B===8&&U%B==4)&&(W=R[W>>>24]<<24^R[W>>16&255]<<16^R[W>>8&255]<<8^R[W&255],U%B==0&&(W=W<<8^W>>>24^K<<24,K=K<<1^(K>>7)*283)),te[U]=te[U-B]^W;for(F=0;U;F++,U--)W=te[F&3?U:U-4],U<=4||F<4?ae[F]=W:ae[F]=Q[0][R[W>>>24]]^Q[1][R[W>>16&255]]^Q[2][R[W>>8&255]]^Q[3][R[W&255]]}var M=L.prototype;return M.decrypt=function(U,F,W,R,Q,B){var K=this._key[1],te=U^K[0],ae=R^K[1],ee=W^K[2],se=F^K[3],de,ke,ue,He=K.length/4-2,Ne,At=4,Kt=this._tables[1],ri=Kt[0],vt=Kt[1],xi=Kt[2],Si=Kt[3],Ei=Kt[4];for(Ne=0;Ne<He;Ne++)de=ri[te>>>24]^vt[ae>>16&255]^xi[ee>>8&255]^Si[se&255]^K[At],ke=ri[ae>>>24]^vt[ee>>16&255]^xi[se>>8&255]^Si[te&255]^K[At+1],ue=ri[ee>>>24]^vt[se>>16&255]^xi[te>>8&255]^Si[ae&255]^K[At+2],se=ri[se>>>24]^vt[te>>16&255]^xi[ae>>8&255]^Si[ee&255]^K[At+3],At+=4,te=de,ae=ke,ee=ue;for(Ne=0;Ne<4;Ne++)Q[(3&-Ne)+B]=Ei[te>>>24]<<24^Ei[ae>>16&255]<<16^Ei[ee>>8&255]<<8^Ei[se&255]^K[At++],de=te,te=ae,ae=ee,ee=se,se=de},L}(),g=function(L){r(M,L);function M(){var U;return U=L.call(this,s)||this,U.jobs=[],U.delay=1,U.timeout_=null,U}var j=M.prototype;return j.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},j.push=function(F){this.jobs.push(F),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},M}(s),p=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},y=function(M,j,U){var F=new Int32Array(M.buffer,M.byteOffset,M.byteLength>>2),W=new c(Array.prototype.slice.call(j)),R=new Uint8Array(M.byteLength),Q=new Int32Array(R.buffer),B,K,te,ae,ee,se,de,ke,ue;for(B=U[0],K=U[1],te=U[2],ae=U[3],ue=0;ue<F.length;ue+=4)ee=p(F[ue]),se=p(F[ue+1]),de=p(F[ue+2]),ke=p(F[ue+3]),W.decrypt(ee,se,de,ke,Q,ue),Q[ue]=p(Q[ue]^B),Q[ue+1]=p(Q[ue+1]^K),Q[ue+2]=p(Q[ue+2]^te),Q[ue+3]=p(Q[ue+3]^ae),B=ee,K=se,te=de,ae=ke;return R},b=function(){function L(j,U,F,W){var R=L.STEP,Q=new Int32Array(j.buffer),B=new Uint8Array(j.byteLength),K=0;for(this.asyncStream_=new g,this.asyncStream_.push(this.decryptChunk_(Q.subarray(K,K+R),U,F,B)),K=R;K<Q.length;K+=R)F=new Uint32Array([p(Q[K-4]),p(Q[K-3]),p(Q[K-2]),p(Q[K-1])]),this.asyncStream_.push(this.decryptChunk_(Q.subarray(K,K+R),U,F,B));this.asyncStream_.push(function(){W(null,o(B))})}var M=L.prototype;return M.decryptChunk_=function(U,F,W,R){return function(){var Q=y(U,F,W);R.set(Q,U.byteOffset)}},n(L,null,[{key:"STEP",get:function(){return 32e3}}]),L}(),S;typeof window!="undefined"?S=window:typeof a!="undefined"?S=a:typeof self!="undefined"?S=self:S={};var x=S,A=function(M){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(M):M&&M.buffer instanceof ArrayBuffer},O=x.BigInt||Number;O("0x1"),O("0x100"),O("0x10000"),O("0x1000000"),O("0x100000000"),O("0x10000000000"),O("0x1000000000000"),O("0x100000000000000"),O("0x10000000000000000");var H=function(M){var j={};return Object.keys(M).forEach(function(U){var F=M[U];A(F)?j[U]={bytes:F.buffer,byteOffset:F.byteOffset,byteLength:F.byteLength}:j[U]=F}),j};self.onmessage=function(L){var M=L.data,j=new Uint8Array(M.encrypted.bytes,M.encrypted.byteOffset,M.encrypted.byteLength),U=new Uint32Array(M.key.bytes,M.key.byteOffset,M.key.byteLength/4),F=new Uint32Array(M.iv.bytes,M.iv.byteOffset,M.iv.byteLength/4);new b(j,U,F,function(W,R){self.postMessage(H({source:M.source,decrypted:R}),[R.buffer])})}})),xT=Uf(bT),ST=function(t){var i=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(i="main-desc"),i},Da=function(t,i){t.abort(),t.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)},tu=function(t,i){i.activePlaylistLoader=t,t.load()},ET=function(t,i){return function(){var n=i.segmentLoaders,e=n[t],r=n.main,s=i.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,Da(e,s),!(!u||u.isMasterPlaylist))){if(!u.playlistLoader){l&&r.resetEverything();return}e.resyncLoader(),tu(u.playlistLoader,s)}}},CT=function(t,i){return function(){var n=i.segmentLoaders[t],e=i.mediaTypes[t];e.lastGroup_=null,n.abort(),n.pause()}},wT=function(t,i){return function(){var n=i.masterPlaylistLoader,e=i.segmentLoaders,r=e[t],s=e.main,o=i.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,Da(r,o),!!l)){if(l.isMasterPlaylist){if(!u||!g||u.id===g.id)return;var p=i.vhs.masterPlaylistController_,y=p.selectPlaylist();if(p.media()===y)return;o.logger_("track change. Switching master audio from "+g.id+" to "+u.id),n.pause(),s.resetEverything(),p.fastQualityChange_(y);return}if(t==="AUDIO"){if(!l.playlistLoader){s.setAudio(!0),s.resetEverything();return}r.setAudio(!0),s.setAudio(!1)}if(c===l.playlistLoader){tu(l.playlistLoader,o);return}r.track&&r.track(u),r.resetEverything(),tu(l.playlistLoader,o)}}},Oa={AUDIO:function(t,i){return function(){var n=i.segmentLoaders[t],e=i.mediaTypes[t],r=i.blacklistCurrentPlaylist;Da(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){r({message:"Problem encountered loading the default audio track."});return}D.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,i){return function(){var n=i.segmentLoaders[t],e=i.mediaTypes[t];D.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Da(n,e);var r=e.activeTrack();r&&(r.mode="disabled"),e.onTrackChanged()}}},hh={AUDIO:function(t,i,n){if(!!i){var e=n.tech,r=n.requestOptions,s=n.segmentLoaders[t];i.on("loadedmetadata",function(){var o=i.media();s.playlist(o,r),(!e.paused()||o.endList&&e.preload()!=="none")&&s.load()}),i.on("loadedplaylist",function(){s.playlist(i.media(),r),e.paused()||s.load()}),i.on("error",Oa[t](t,n))}},SUBTITLES:function(t,i,n){var e=n.tech,r=n.requestOptions,s=n.segmentLoaders[t],o=n.mediaTypes[t];i.on("loadedmetadata",function(){var u=i.media();s.playlist(u,r),s.track(o.activeTrack()),(!e.paused()||u.endList&&e.preload()!=="none")&&s.load()}),i.on("loadedplaylist",function(){s.playlist(i.media(),r),e.paused()||s.load()}),i.on("error",Oa[t](t,n))}},PT={AUDIO:function(t,i){var n=i.vhs,e=i.sourceType,r=i.segmentLoaders[t],s=i.requestOptions,o=i.master.mediaGroups,u=i.mediaTypes[t],l=u.groups,c=u.tracks,g=u.logger_,p=i.masterPlaylistLoader,y=Zr(p.master);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},y&&(o[t].main.default.playlists=p.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],A=void 0;if(y?(g("AUDIO group '"+b+"' label '"+S+"' is a master playlist"),x.isMasterPlaylist=!0,A=null):e==="vhs-json"&&x.playlists?A=new sr(x.playlists[0],n,s):x.resolvedUri?A=new sr(x.resolvedUri,n,s):x.playlists&&e==="dash"?A=new $o(x.playlists[0],n,s,p):A=null,x=D.mergeOptions({id:S,playlistLoader:A},x),hh[t](t,x.playlistLoader,i),l[b].push(x),typeof c[S]=="undefined"){var O=new D.AudioTrack({id:S,kind:ST(x),enabled:!1,language:x.language,default:x.default,label:S});c[S]=O}}}r.on("error",Oa[t](t,i))},SUBTITLES:function(t,i){var n=i.tech,e=i.vhs,r=i.sourceType,s=i.segmentLoaders[t],o=i.requestOptions,u=i.master.mediaGroups,l=i.mediaTypes[t],c=l.groups,g=l.tracks,p=i.masterPlaylistLoader;for(var y in u[t]){c[y]||(c[y]=[]);for(var b in u[t][y])if(!u[t][y][b].forced){var S=u[t][y][b],x=void 0;if(r==="hls")x=new sr(S.resolvedUri,e,o);else if(r==="dash"){var A=S.playlists.filter(function(H){return H.excludeUntil!==1/0});if(!A.length)return;x=new $o(S.playlists[0],e,o,p)}else r==="vhs-json"&&(x=new sr(S.playlists?S.playlists[0]:S.resolvedUri,e,o));if(S=D.mergeOptions({id:b,playlistLoader:x},S),hh[t](t,S.playlistLoader,i),c[y].push(S),typeof g[b]=="undefined"){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",Oa[t](t,i))},"CLOSED-CAPTIONS":function(t,i){var n=i.tech,e=i.master.mediaGroups,r=i.mediaTypes[t],s=r.groups,o=r.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||{},p={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(g[p.instreamId]&&(p=D.mergeOptions(p,g[p.instreamId])),p.default===void 0&&delete p.default,s[u].push(D.mergeOptions({id:l},c)),typeof o[l]=="undefined"){var y=n.addRemoteTextTrack({id:p.instreamId,kind:"captions",default:p.default,language:p.language,label:p.label},!1).track;o[l]=y}}}}}},kT=function a(t,i){for(var n=0;n<t.length;n++)if(Ho(i,t[n])||t[n].playlists&&a(t[n].playlists,i))return!0;return!1},AT=function(t,i){return function(n){var e=i.masterPlaylistLoader,r=i.mediaTypes[t].groups,s=e.media();if(!s)return null;var o=null;s.attributes[t]&&(o=r[s.attributes[t]]);var u=Object.keys(r);if(!o)if(t==="AUDIO"&&u.length>1&&Zr(i.master))for(var l=0;l<u.length;l++){var c=r[u[l]];if(kT(c,s)){o=c;break}}else r.main?o=r.main:u.length===1&&(o=r[u[0]]);return typeof n=="undefined"?o:n===null||!o?null:o.filter(function(g){return g.id===n.id})[0]||null}},IT={AUDIO:function(t,i){return function(){var n=i.mediaTypes[t].tracks;for(var e in n)if(n[e].enabled)return n[e];return null}},SUBTITLES:function(t,i){return function(){var n=i.mediaTypes[t].tracks;for(var e in n)if(n[e].mode==="showing"||n[e].mode==="hidden")return n[e];return null}}},DT=function(t,i){var n=i.mediaTypes;return function(){var e=n[t].activeTrack();return e?n[t].activeGroup(e):null}},OT=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){PT[b](b,t)});var i=t.mediaTypes,n=t.masterPlaylistLoader,e=t.tech,r=t.vhs,s=t.segmentLoaders,o=s.AUDIO,u=s.main;["AUDIO","SUBTITLES"].forEach(function(b){i[b].activeGroup=AT(b,t),i[b].activeTrack=IT[b](b,t),i[b].onGroupChanged=ET(b,t),i[b].onGroupChanging=CT(b,t),i[b].onTrackChanged=wT(b,t),i[b].getActiveGroup=DT(b,t)});var l=i.AUDIO.activeGroup();if(l){var c=(l.filter(function(b){return b.default})[0]||l[0]).id;i.AUDIO.tracks[c].enabled=!0,i.AUDIO.onGroupChanged(),i.AUDIO.onTrackChanged();var g=i.AUDIO.getActiveGroup();g.playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(b){return i[b].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(b){return i[b].onGroupChanging()})});var p=function(){i.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};e.audioTracks().addEventListener("change",p),e.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged),r.on("dispose",function(){e.audioTracks().removeEventListener("change",p),e.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)}),e.clearTracks("audio");for(var y in i.AUDIO.tracks)e.audioTracks().addTrack(i.AUDIO.tracks[y])},LT=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(i){t[i]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:zt,activeTrack:zt,getActiveGroup:zt,onGroupChanged:zt,onTrackChanged:zt,lastTrack_:null,logger_:gt("MediaGroups["+i+"]")}}),t},MT=60*2,$t,RT=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],NT=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},FT=function(t){var i=t.currentPlaylist,n=t.buffered,e=t.currentTime,r=t.nextPlaylist,s=t.bufferLowWaterLine,o=t.bufferHighWaterLine,u=t.duration,l=t.experimentalBufferBasedABR,c=t.log;if(!r)return D.log.warn("We received no playlist to switch to. Please check your stream."),!1;var g="allowing switch "+(i&&i.id||"null")+" -> "+r.id;if(!i)return c(g+" as current playlist is not set"),!0;if(r.id===i.id)return!1;var p=Boolean(ar(n,e).length);if(!i.endList)return!p&&typeof i.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 y=Ro(n,e),b=l?Oe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Oe.MAX_BUFFER_LOW_WATER_LINE;if(u<b)return c(g+" as duration < max low water line ("+u+" < "+b+")"),!0;var S=r.attributes.BANDWIDTH,x=i.attributes.BANDWIDTH;if(S<x&&(!l||y<o)){var A=g+" as next bandwidth < current bandwidth ("+S+" < "+x+")";return l&&(A+=" and forwardBuffer < bufferHighWaterLine ("+y+" < "+o+")"),c(A),!0}if((!l||S>x)&&y>=s){var O=g+" as forwardBuffer >= bufferLowWaterLine ("+y+" >= "+s+")";return l&&(O+=" and next bandwidth > current bandwidth ("+S+" > "+x+")"),c(O),!0}return c("not "+g+" as no switching criteria met"),!1},UT=function(a){$(t,a);function t(n){var e;e=a.call(this)||this;var r=n.src,s=n.handleManifestRedirects,o=n.withCredentials,u=n.tech,l=n.bandwidth,c=n.externVhs,g=n.useCueTags,p=n.blacklistDuration,y=n.enableLowInitialPlaylist,b=n.sourceType,S=n.cacheEncryptionKeys,x=n.experimentalBufferBasedABR,A=n.experimentalLeastPixelDiffSelector,O=n.captionServices;if(!r)throw new Error("A non-empty playlist URL or JSON manifest string is required");var H=n.maxPlaylistRetries;(H===null||typeof H=="undefined")&&(H=1/0),$t=c,e.experimentalBufferBasedABR=Boolean(x),e.experimentalLeastPixelDiffSelector=Boolean(A),e.withCredentials=o,e.tech_=u,e.vhs_=u.vhs,e.sourceType_=b,e.useCueTags_=g,e.blacklistDuration=p,e.maxPlaylistRetries=H,e.enableLowInitialPlaylist=y,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_=LT(),e.mediaSource=new w.MediaSource,e.handleDurationChange_=e.handleDurationChange_.bind(ie(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(ie(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(ie(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=D.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new yT(n),e.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new xT,e.sourceUpdater_=new lh(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new TT;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 $o(r,e.vhs_,e.requestOptions_):new sr(r,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Jo(D.mergeOptions(L,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),n),e.audioSegmentLoader_=new Jo(D.mergeOptions(L,{loaderType:"audio"}),n),e.subtitleSegmentLoader_=new mT(D.mergeOptions(L,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks}),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_()})),RT.forEach(function(j){e[j+"_"]=NT.bind(ie(e),j)}),e.logger_=gt("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 M=e.tech_.preload()==="none"?"play":"loadstart";return e.tech_.one(M,function(){var j=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-j,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),r=this.audioAppendsToLoadedData_();return e===-1||r===-1?-1:e+r},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,r,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 "+r),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+r})),this.masterPlaylistLoader_.media(e,s)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=w.setInterval(function(){return e.checkABR_()},250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(w.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),r=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return r;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 r;var g=[];for(var p in s)if(s[p][u.label]){var y=s[p][u.label];if(y.playlists&&y.playlists.length)g.push.apply(g,y.playlists);else if(y.uri)g.push(y);else if(e.playlists.length)for(var b=0;b<e.playlists.length;b++){var S=e.playlists[b];S.attributes&&S.attributes.AUDIO&&S.attributes.AUDIO===p&&g.push(S)}}return g.length?g:r},i.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var r=e.masterPlaylistLoader_.media(),s=r.targetDuration*1.5*1e3;Bo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,r.endList&&e.tech_.preload()!=="none"&&(e.mainSegmentLoader_.playlist(r,e.requestOptions_),e.mainSegmentLoader_.load()),OT({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),r),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var r=e.masterPlaylistLoader_.media();if(!r){e.excludeUnsupportedVariants_();var s;if(e.enableLowInitialPlaylist&&(s=e.selectInitialPlaylist()),s||(s=e.selectPlaylist()),!s||!e.shouldSwitchToMedia_(s))return;e.initialMedia_=s,e.switchMedia_(e.initialMedia_,"initial");var o=e.sourceType_==="vhs-json"&&e.initialMedia_.segments;if(!o)return;r=e.initialMedia_}e.handleUpdatedMediaPlaylist(r)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var r=e.masterPlaylistLoader_.media(),s=r.targetDuration*1.5*1e3;Bo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,e.mainSegmentLoader_.playlist(r,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var r=e.masterPlaylistLoader_.media();if(r.lastExcludeReason_!=="playlist-unchanged"){var s=e.stuckAtPlaylistEnd_(r);s&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},i.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},i.triggerPresenceUsage_=function(e,r){var s=e.mediaGroups||{},o=!0,u=Object.keys(s.AUDIO);for(var l in s.AUDIO)for(var c in s.AUDIO[l]){var g=s.AUDIO[l][c];g.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(s.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),$t.Playlist.isAes(r)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),u.length&&Object.keys(s.AUDIO[u[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var r=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),o=this.bufferLowWaterLine(),u=this.bufferHighWaterLine(),l=this.tech_.buffered();return FT({buffered:l,currentTime:s,currentPlaylist:r,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:u,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var s=e.selectPlaylist();e.shouldSwitchToMedia_(s)&&e.switchMedia_(s,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),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."},MT))});var r=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();!o||e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",r),this.audioSegmentLoader_.on("trackinfo",r),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()})},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var r=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(){D.browser.IE_VERSION||D.browser.IS_EDGE?r.tech_.setCurrentTime(r.tech_.currentTime()+.04):r.tech_.setCurrentTime(r.tech_.currentTime())})},i.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()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},i.setupFirstPlay=function(){var e=this,r=this.masterPlaylistLoader_.media();if(!r||this.tech_.paused()||this.hasPlayed_)return!1;if(!r.endList){var s=this.seekable();if(!s.length)return!1;if(D.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(s.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(s.end(0))}return this.hasPlayed_=!0,this.load(),!0},i.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();typeof e!="undefined"&&typeof e.then=="function"&&e.then(null,function(r){})}this.trigger("sourceopen")},i.handleSourceEnded_=function(){if(!!this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(!(!e||!e.length)){var r=this.duration();e[e.length-1].endTime=isNaN(r)||Math.abs(r)===1/0?Number.MAX_VALUE:r}}},i.handleDurationChange_=function(){this.tech_.trigger("durationchange")},i.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var r=this.mainSegmentLoader_.getCurrentMediaInfo_();!r||r.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}!e||(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},i.stuckAtPlaylistEnd_=function(e){var r=this.seekable();if(!r.length)return!1;var s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;var o=$t.Playlist.playlistEnd(e,s),u=this.tech_.currentTime(),l=this.tech_.buffered();if(!l.length)return o-u<=wt;var c=l.end(l.length-1);return c-u<=wt&&o-c<=wt},i.blacklistCurrentPlaylist=function(e,r){e===void 0&&(e={});var s=e.playlist||this.masterPlaylistLoader_.media();if(r=r||e.blacklistDuration||this.blacklistDuration,!s){this.error=e,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}s.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,u=o.filter(Sa),l=u.length===1&&u[0]===s;if(o.length===1&&r!==1/0)return D.log.warn("Problem encountered with playlist "+s.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(l);if(l){var c=!1;o.forEach(function(A){if(A!==s){var O=A.excludeUntil;typeof O!="undefined"&&O!==1/0&&(c=!0,delete A.excludeUntil)}}),c&&(D.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var g;s.playlistErrors_>this.maxPlaylistRetries?g=1/0:g=Date.now()+r*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 p=this.selectPlaylist();if(!p){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var y=e.internal?this.logger_:D.log.warn,b=e.message?" "+e.message:"";y((e.internal?"Internal problem":"Problem")+" encountered with playlist "+s.id+"."+(b+" Switching to playlist "+p.id+".")),p.attributes.AUDIO!==s.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),p.attributes.SUBTITLES!==s.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var S=p.targetDuration/2*1e3||5*1e3,x=typeof p.lastRequest=="number"&&Date.now()-p.lastRequest<=S;return this.switchMedia_(p,"exclude",l||x)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,r){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 r.forEach(function(g){typeof c[g]=="function"&&c[g]()})})},i.setCurrentTime=function(e){var r=ar(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(r&&r.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()},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:$t.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(!!this.masterPlaylistLoader_){var r=this.masterPlaylistLoader_.media();if(!!r){var s=this.syncController_.getExpiredTime(r,this.duration());if(s!==null){var o=this.masterPlaylistLoader_.master,u=$t.Playlist.seekable(r,s,$t.Playlist.liveEdgeDelay(o,r));if(u.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(r=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(r,this.duration()),s===null||(e=$t.Playlist.seekable(r,s,$t.Playlist.liveEdgeDelay(o,r)),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_=D.createTimeRanges([[e.start(0)>u.start(0)?e.start(0):u.start(0),e.end(0)<u.end(0)?e.end(0):u.end(0)]]):this.seekable_=u,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===l&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+cf(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},i.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){var r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}var s=this.tech_.buffered(),o=$t.Playlist.duration(this.masterPlaylistLoader_.media());s.length>0&&(o=Math.max(o,s.end(s.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},i.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(r){var s=e.mediaTypes_[r].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()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,r=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!r||!s)},i.getCodecsOrExclude_=function(){var e=this,r={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};r.video=r.main;var s=tn(this.master(),this.media()),o={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(r.main.hasVideo&&(o.video=s.video||r.main.videoCodec||mg),r.main.isMuxed&&(o.video+=","+(s.audio||r.main.audioCodec||hl)),(r.main.hasAudio&&!r.main.isMuxed||r.audio.hasAudio||u)&&(o.audio=s.audio||r.main.audioCodec||r.audio.audioCodec||hl,r.audio.isFmp4=r.main.hasAudio&&!r.main.isMuxed?r.main.isFmp4:r.audio.isFmp4),!o.audio&&!o.video){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var l=function(x,A){return x?Dn(A):as(A)},c={},g;if(["video","audio"].forEach(function(S){if(o.hasOwnProperty(S)&&!l(r[S].isFmp4,o[S])){var x=r[S].isFmp4?"browser":"muxer";c[x]=c[x]||[],c[x].push(o[S]),S==="audio"&&(g=x)}}),u&&g&&this.media().attributes.AUDIO){var p=this.media().attributes.AUDIO;this.master().playlists.forEach(function(S){var x=S.attributes&&S.attributes.AUDIO;x===p&&S!==e.media()&&(S.excludeUntil=1/0)}),this.logger_("excluding audio group "+p+" as "+g+' does not support codec(s): "'+o.audio+'"')}if(Object.keys(c).length){var y=Object.keys(c).reduce(function(S,x){return S&&(S+=", "),S+=x+' does not support codec(s): "'+c[x].join(",")+'"',S},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:y,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var b=[];if(["video","audio"].forEach(function(S){var x=(bt(e.sourceUpdater_.codecs[S]||"")[0]||{}).type,A=(bt(o[S]||"")[0]||{}).type;x&&A&&x.toLowerCase()!==A.toLowerCase()&&b.push('"'+e.sourceUpdater_.codecs[S]+'" -> "'+o[S]+'"')}),b.length){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+b.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return o},i.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&!!this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(!!e){this.sourceUpdater_.createSourceBuffers(e);var r=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(r)}}},i.excludeUnsupportedVariants_=function(){var e=this,r=this.master().playlists,s=[];Object.keys(r).forEach(function(o){var u=r[o];if(s.indexOf(u.id)===-1){s.push(u.id);var l=tn(e.master,u),c=[];l.audio&&!as(l.audio)&&!Dn(l.audio)&&c.push("audio codec "+l.audio),l.video&&!as(l.video)&&!Dn(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(", ")))}})},i.excludeIncompatibleVariants_=function(e){var r=this,s=[],o=this.master().playlists,u=Pa(bt(e)),l=Qf(u),c=u.video&&bt(u.video)[0]||null,g=u.audio&&bt(u.audio)[0]||null;Object.keys(o).forEach(function(p){var y=o[p];if(!(s.indexOf(y.id)!==-1||y.excludeUntil===1/0)){s.push(y.id);var b=[],S=tn(r.masterPlaylistLoader_.master,y),x=Qf(S);if(!(!S.audio&&!S.video)){if(x!==l&&b.push('codec count "'+x+'" !== "'+l+'"'),!r.sourceUpdater_.canChangeType()){var A=S.video&&bt(S.video)[0]||null,O=S.audio&&bt(S.audio)[0]||null;A&&c&&A.type.toLowerCase()!==c.type.toLowerCase()&&b.push('video codec "'+A.type+'" !== "'+c.type+'"'),O&&g&&O.type.toLowerCase()!==g.type.toLowerCase()&&b.push('audio codec "'+O.type+'" !== "'+g.type+'"')}b.length&&(y.excludeUntil=1/0,r.logger_("blacklisting "+y.id+": "+b.join(" && ")))}}})},i.updateAdCues_=function(e){var r=0,s=this.seekable();s.length&&(r=s.start(0)),vT(e,this.cueTagsTrack_,r)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),r=Oe.GOAL_BUFFER_LENGTH,s=Oe.GOAL_BUFFER_LENGTH_RATE,o=Math.max(r,Oe.MAX_GOAL_BUFFER_LENGTH);return Math.min(r+e*s,o)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),r=Oe.BUFFER_LOW_WATER_LINE,s=Oe.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(r,Oe.MAX_BUFFER_LOW_WATER_LINE),u=Math.max(r,Oe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(r+e*s,this.experimentalBufferBasedABR?u:o)},i.bufferHighWaterLine=function(){return Oe.BUFFER_HIGH_WATER_LINE},t}(D.EventTarget),BT=function(t,i,n){return function(e){var r=t.master.playlists[i],s=Uo(r),o=Sa(r);return typeof e=="undefined"?o:(e?delete r.disabled:r.disabled=!0,e!==o&&!s&&(n(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},HT=function(t,i,n){var e=t.masterPlaylistController_,r=t.options_.smoothQualityChange,s=r?"smooth":"fast",o=e[s+"QualityChange_"].bind(e);if(i.attributes){var u=i.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=i.attributes.BANDWIDTH}this.codecs=tn(e.master(),i),this.playlist=i,this.id=n,this.enabled=BT(t.playlists,i.id,o)},VT=function(t){t.representations=function(){var i=t.masterPlaylistController_.master(),n=Zr(i)?t.masterPlaylistController_.getAudioTrackPlaylists_():i.playlists;return n?n.filter(function(e){return!Uo(e)}).map(function(e,r){return new HT(t,e,e.id)}):[]}},ph=["seeking","seeked","pause","playing","error"],jT=function(){function a(i){var n=this;this.masterPlaylistController_=i.masterPlaylistController,this.tech_=i.tech,this.seekable=i.seekable,this.allowSeeksWithinUnsafeLiveWindow=i.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=i.liveRangeSafeTimeDelta,this.media=i.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=gt("PlaybackWatcher"),this.logger_("initialize");var e=function(){return n.monitorCurrentTime_()},r=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(p){c[p]={reset:function(){return n.resetSegmentDownloads_(p)},updateend:function(){return n.checkSegmentDownloads_(p)}},u[p+"SegmentLoader_"].on("appendsdone",c[p].updateend),u[p+"SegmentLoader_"].on("playlistupdate",c[p].reset),n.tech_.on(["seeked","seeking"],c[p].reset)});var g=function(y){["main","audio"].forEach(function(b){u[b+"SegmentLoader_"][y]("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(ph,o),this.tech_.on("canplay",r),this.tech_.one("play",e),this.dispose=function(){n.clearSeekingAppendCheck_(),n.logger_("dispose"),n.tech_.off("waiting",s),n.tech_.off(ph,o),n.tech_.off("canplay",r),n.tech_.off("play",e),n.tech_.off("seeking",n.watchForBadSeeking_),n.tech_.off("seeked",n.clearSeekingAppendCheck_),l.forEach(function(p){u[p+"SegmentLoader_"].off("appendsdone",c[p].updateend),u[p+"SegmentLoader_"].off("playlistupdate",c[p].reset),n.tech_.off(["seeked","seeking"],c[p].reset)}),n.checkCurrentTimeTimeout_&&w.clearTimeout(n.checkCurrentTimeTimeout_),n.cancelTimer_()}}var t=a.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&w.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=w.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_,r=e[n+"SegmentLoader_"],s=r.buffered_(),o=F_(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:r.playlist_&&r.playlist_.id,buffered:bi(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+wt>=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(),r=this.tech_.currentTime(),s=this.afterSeekableWindow_(e,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(s){var u=e.end(e.length-1);o=u}if(this.beforeSeekableWindow_(e,r)){var l=e.start(0);o=l+(l===e.end(0)?0:wt)}if(typeof o!="undefined")return this.logger_("Trying to seek outside of seekable at time "+r+" with "+("seekable range "+cf(e)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,g=this.tech_.buffered(),p=c.audioBuffer?c.audioBuffered():null,y=c.videoBuffer?c.videoBuffered():null,b=this.media(),S=b.partTargetDuration?b.partTargetDuration:(b.targetDuration-ii)*2,x=[p,y],A=0;A<x.length;A++)if(!!x[A]){var O=Ro(x[A],r);if(O<S)return!1}var H=xa(g,r);return H.length===0?!1:(o=H.start(0)+wt,this.logger_("Buffered region starts ("+H.start(0)+") "+(" just beyond seek point ("+r+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},t.waiting_=function(){if(!this.techWaiting_()){var n=this.tech_.currentTime(),e=this.tech_.buffered(),r=ar(e,n);if(r.length&&n+3<=r.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(n),this.logger_("Stopped at "+n+" while inside a buffered region "+("["+r.start(0)+" -> "+r.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 r=n.end(n.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to "+("live point (seekable end) "+r)),this.cancelTimer_(),this.tech_.setCurrentTime(r),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=xa(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,r,s){if(s===void 0&&(s=!1),!n.length)return!1;var o=n.end(n.length-1)+wt,u=!r.endList;return u&&s&&(o=n.end(n.length-1)+r.targetDuration*3),e>o},t.beforeSeekableWindow_=function(n,e){return!!(n.length&&n.start(0)>0&&e<n.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(n){var e=n.videoBuffered,r=n.audioBuffered,s=n.currentTime;if(!!e){var o;if(e.length&&r.length){var u=ar(e,s-3),l=ar(e,s),c=ar(r,s);c.length&&!l.length&&u.length&&(o={start:u.end(0),end:c.end(0)})}else{var g=xa(e,s);g.length||(o=this.gapFromVideoUnderflow_(e,s))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+s)),!0):!1}},t.skipTheGap_=function(n){var e=this.tech_.buffered(),r=this.tech_.currentTime(),s=xa(e,r);this.cancelTimer_(),!(s.length===0||r!==n)&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",n,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+ii),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(n,e){for(var r=M_(n),s=0;s<r.length;s++){var o=r.start(s),u=r.end(s);if(e-o<4&&e-o>2)return{start:o,end:u}}return null},a}(),WT={errorInterval:30,getSource:function(t){var i=this.tech({IWillNotUseThisInPlugins:!0}),n=i.currentSource_||this.currentSource();return t(n)}},qT=function a(t,i){var n=0,e=0,r=D.mergeOptions(WT,i);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(p){p!=null&&(e=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(p),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<r.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){D.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),r.getSource.call(t,o)},l=function g(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",g)},c=function(p){l(),a(t,p)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},GT=function(t){qT(this,t)},mh="2.14.3",zT="6.0.1",$T="0.21.1",KT="4.7.1",XT="3.1.3",Re={PlaylistLoader:sr,Playlist:et,utils:oy,STANDARD_PLAYLIST_SELECTOR:eh,INITIAL_PLAYLIST_SELECTOR:Ky,lastBandwidthSelector:eh,movingAverageBandwidthSelector:zy,comparePlaylistBandwidth:Qo,comparePlaylistResolution:Gy,xhr:Af()};Object.keys(Oe).forEach(function(a){Object.defineProperty(Re,a,{get:function(){return D.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),Oe[a]},set:function(i){if(D.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0){D.log.warn("value of Vhs."+a+" must be greater than or equal to 0");return}Oe[a]=i}})});var gh="videojs-vhs",vh=function(t,i){for(var n=i.media(),e=-1,r=0;r<t.length;r++)if(t[r].id===n.id){e=r;break}t.selectedIndex_=e,t.trigger({selectedIndex:e,type:"change"})},YT=function(t,i){i.representations().forEach(function(n){t.addQualityLevel(n)}),vh(t,i.playlists)};Re.canPlaySource=function(){return D.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var QT=function(t,i,n){if(!t)return t;var e={};i&&i.attributes&&i.attributes.CODECS&&(e=Pa(bt(i.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(e.audio=n.attributes.CODECS);var r=Er(e.video),s=Er(e.audio),o={};for(var u in t)o[u]={},s&&(o[u].audioContentType=s),r&&(o[u].videoContentType=r),i.contentProtection&&i.contentProtection[u]&&i.contentProtection[u].pssh&&(o[u].pssh=i.contentProtection[u].pssh),typeof t[u]=="string"&&(o[u].url=t[u]);return D.mergeOptions(t,o)},JT=function(t,i){return t.reduce(function(n,e){if(!e.contentProtection)return n;var r=i.reduce(function(s,o){var u=e.contentProtection[o];return u&&u.pssh&&(s[o]={pssh:u.pssh}),s},{});return Object.keys(r).length&&n.push(r),n},[])},ZT=function(t){var i=t.player,n=t.sourceKeySystems,e=t.audioMedia,r=t.mainPlaylists;if(!i.eme.initializeMediaKeys)return Promise.resolve();var s=e?r.concat([e]):r,o=JT(s,Object.keys(n)),u=[],l=[];return o.forEach(function(c){l.push(new Promise(function(g,p){i.tech_.one("keysessioncreated",g)})),u.push(new Promise(function(g,p){i.eme.initializeMediaKeys({keySystems:c},function(y){if(y){p(y);return}g()})}))}),Promise.race([Promise.all(u),Promise.race(l)])},eb=function(t){var i=t.player,n=t.sourceKeySystems,e=t.media,r=t.audioMedia,s=QT(n,e,r);return s?(i.currentSource().keySystems=s,s&&!i.eme?(D.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},_h=function(){if(!w.localStorage)return null;var t=w.localStorage.getItem(gh);if(!t)return null;try{return JSON.parse(t)}catch{return null}},tb=function(t){if(!w.localStorage)return!1;var i=_h();i=i?D.mergeOptions(i,t):t;try{w.localStorage.setItem(gh,JSON.stringify(i))}catch{return!1}return i},ib=function(t){return t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t};Re.supportsNativeHls=function(){if(!G||!G.createElement)return!1;var a=G.createElement("video");if(!D.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(i){return/maybe|probably/i.test(a.canPlayType(i))})}();Re.supportsNativeDash=function(){return!G||!G.createElement||!D.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(G.createElement("video").canPlayType("application/dash+xml"))}();Re.supportsTypeNatively=function(a){return a==="hls"?Re.supportsNativeHls:a==="dash"?Re.supportsNativeDash:!1};Re.isSupported=function(){return D.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var rb=D.getComponent("Component"),iu=function(a){$(t,a);function t(n,e,r){var s;if(s=a.call(this,e,D.mergeOptions(r.hls,r.vhs))||this,r.hls&&Object.keys(r.hls).length&&D.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof r.initialBandwidth=="number"&&(s.options_.bandwidth=r.initialBandwidth),s.logger_=gt("VhsHandler"),e.options_&&e.options_.playerId){var o=D(e.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return D.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"hls-player-access"}),ie(s)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return D.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"vhs-player-access"}),ie(s)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return D.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),ie(s)},configurable:!0}),s.player_=o}if(s.tech_=e,s.source_=n,s.stats={},s.ignoreNextSeekingEvent_=!1,s.setOptions_(),s.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);else if(s.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return s.on(G,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(u){var l=G.fullscreenElement||G.webkitFullscreenElement||G.mozFullScreenElement||G.msFullscreenElement;l&&l.contains(s.tech_.el())?s.masterPlaylistController_.fastQualityChange_():s.masterPlaylistController_.checkABR_()}),s.on(s.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),s.on(s.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),s.on(s.tech_,"play",s.play),s}var i=t.prototype;return i.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var r=_h();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Oe.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Oe.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(s){typeof e.source_[s]!="undefined"&&(e.options_[s]=e.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},i.src=function(e,r){var s=this;if(!!e){this.setOptions_(),this.options_.src=ib(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Re,this.options_.sourceType=pl(r),this.options_.seekTo=function(l){s.tech_.setCurrentTime(l)},this.options_.smoothQualityChange&&D.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new UT(this.options_);var o=D.mergeOptions({liveRangeSafeTimeDelta:wt},this.options_,{seekable:function(){return s.seekable()},media:function(){return s.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new jT(o),this.masterPlaylistController_.on("error",function(){var l=D.players[s.tech_.options_.playerId],c=s.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),l.error(c)});var u=this.options_.experimentalBufferBasedABR?Re.movingAverageBandwidthSelector(.55):Re.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):u.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Re.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,g=w.navigator.connection||w.navigator.mozConnection||w.navigator.webkitConnection,p=1e7;if(this.options_.useNetworkInformationApi&&g){var y=g.downlink*1e3*1e3;y>=p&&c>=p?c=Math.max(c,y):c=y}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 p=Math.floor(1/(c+g));return p},set:function(){D.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 bi(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 bi(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&&tb({bandwidth:s.bandwidth,throughput:Math.round(s.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){VT(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_=w.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),ZT({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:r&&r.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})})},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,s=eb({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:r&&r.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=D.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_),D.browser.IE_VERSION===11||!s){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},i.setupQualityLevels_=function(){var e=this,r=D.players[this.tech_.options_.playerId];!r||!r.qualityLevels||this.qualityLevels_||(this.qualityLevels_=r.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){YT(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){vh(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":mh,"mux.js":zT,"mpd-parser":$T,"m3u8-parser":KT,"aes-decrypter":XT}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return lh.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.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_&&w.URL.revokeObjectURL&&(w.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),a.prototype.dispose.call(this)},i.convertToProgramTime=function(e,r){return py({playlist:this.masterPlaylistController_.media(),time:e,callback:r})},i.seekToProgramTime=function(e,r,s,o){return s===void 0&&(s=!0),o===void 0&&(o=2),my({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:r})},t}(rb),La={name:"videojs-http-streaming",VERSION:mh,canHandleSource:function(t,i){i===void 0&&(i={});var n=D.mergeOptions(D.options,i);return La.canPlayType(t.type,n)},handleSource:function(t,i,n){n===void 0&&(n={});var e=D.mergeOptions(D.options,n);return i.vhs=new iu(t,i,e),D.hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return D.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),i.vhs},configurable:!0}),i.vhs.xhr=Af(),i.vhs.src(t.src,t.type),i.vhs},canPlayType:function(t,i){i===void 0&&(i={});var n=D.mergeOptions(D.options,i),e=n.vhs;e=e===void 0?{}:e;var r=e.overrideNative,s=r===void 0?!D.browser.IS_ANY_SAFARI:r,o=n.hls;o=o===void 0?{}:o;var u=o.overrideNative,l=u===void 0?!1:u,c=pl(t),g=c&&(!Re.supportsTypeNatively(c)||l||s);return g?"maybe":""}},nb=function(){return Dn("avc1.4d400d,mp4a.40.2")};nb()&&D.getTech("Html5").registerSourceHandler(La,0);D.VhsHandler=iu;Object.defineProperty(D,"HlsHandler",{get:function(){return D.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),iu},configurable:!0});D.VhsSourceHandler=La;Object.defineProperty(D,"HlsSourceHandler",{get:function(){return D.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),La},configurable:!0});D.Vhs=Re;Object.defineProperty(D,"Hls",{get:function(){return D.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Re},configurable:!0});D.use||(D.registerComponent("Hls",Re),D.registerComponent("Vhs",Re));D.options.vhs=D.options.vhs||{};D.options.hls=D.options.hls||{};if(!D.getPlugin||!D.getPlugin("reloadSourceOnError")){var ab=D.registerPlugin||D.plugin;ab("reloadSourceOnError",GT)}const sb=a=>(sm("data-v-24f8d54a"),a=a(),om(),a),ob={class:"padding-lr-sm",style:{height:"calc(100vh - 84px)"}},ub={class:"head-container"},lb={class:"head-container",style:{height:"calc(100vh - 126px)","overflow-y":"auto"}},db=sb(()=>yt("div",{class:"padding-tb-xs text-sm margin-top-sm"},"\u6444\u50CF\u5934\u5217\u8868",-1)),cb={class:"head-container",style:{height:"calc(100vh - 126px)","overflow-y":"auto"}},fb={key:0},hb={key:1,class:"padding-tb text-center text-grey text-sm"},pb={style:{height:"calc(100vh - 84px)",width:"100%",padding:"5px 0"}},mb={class:"noBg"},gb={setup(a){const t=Jp(),{proxy:i}=um(),n=lt(!1),e=lt(!1),r=lt(!0);var s=null,o=[];const u=lt(""),l=lt(null),c=lt([]),g=lt([]),p=lt({}),y=lt({}),b=lt(""),S=lt(""),x=Zp({videoOption:{autoplay:!0,controls:!0,sources:[{src:"http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8",type:"application/x-mpegURL"}]}}),{videoOption:A}=em(x),O=function(B){if(B=="")g.value=o;else{let K=[];o.forEach(te=>{JSON.stringify(te).indexOf(B)!=-1&&K.push(te)}),g.value=K}},H=function(B){let K=new Date().getTime()-parseInt(B),te=!0;return K>5*60*1e3&&(te=!1),te},L=function(B){g.value.forEach(K=>{K.mmsi==B&&(b.value=K.mmsi,y.value={},K.status?U():(c.value=[],i.$modal.msgError("\u8BBE\u5907\u79BB\u7EBF\uFF01\uFF01\uFF01")))})},M=function(B){c.value.forEach(K=>{K.cameraid==B&&(K.alive==0?i.$modal.msgError("\u6444\u50CF\u5934\u79BB\u7EBF\uFF01\uFF01\uFF01"):(y.value=K,F()))})},j=function(){c.value=[],o=[],lm().then(B=>{if(B.code==200){let K=B.data;K=B.data.sort(function(te,ae){return parseInt(te.dev_name)-parseInt(ae.dev_name)}),K.forEach(te=>{te.status=H(te.online==null?163944959e4:te.online.time+"">10?parseInt(te.online.time):parseInt(te.online.time)*1e3)}),g.value=K}else g.value=[];o=g,U()})},U=function(){if(g.value.length){let B=g.value.filter(K=>K.mmsi==b.value);n.value=!0,B.length?(p.value=B[0],B[0].status?dm(B[0].sn).then(K=>{if(K.result=="ok"&&K.data.info.length){let te=K.data.info,ae=[];te.forEach(ee=>{ee.name!="none"&&ae.push(ee)}),c.value=ae}else c.value=[];n.value=!1}):(c.value=[],n.value=!1)):(c.value=[],n.value=!1)}};function F(){cm({sn:p.value.sn,carem:y.value.cameraid}).then(B=>{if(B.result=="ok"){let K="https://www.enstation.com:8090/hls/"+p.value.sn+"_"+y.value.cameraid+".m3u8";R(K)}else i.$modal.msgError("\u89C6\u9891\u64AD\u653E\u5931\u8D25\uFF01\uFF01\uFF01"),Q()})}var W=0;const R=function(B){A.value.sources[0].src=B,s==null?(s=D(u.value,A.value),s.play(),s.on("play",function(){e.value=!0,console.log("\u89C6\u9891\u5F00\u59CB\u64AD\u653E")}),s.on("error",function(){W+=1,W<6?R(B):(i.$modal.msgError("\u89C6\u9891\u64AD\u653E\u5931\u8D25\uFF01\uFF01\uFF01"),Q())})):(s.src(B),s.play())},Q=function(){s!=null&&(s.dispose(),s=null,e.value=!1),W=0,r.value=!0,p.value={},y.value={}};return tm(()=>t.state.data.curShipMMsi,B=>{b.value=B,U()}),b.value=t.state.data.curShipMMsi,j(),im(()=>{}),(B,K)=>{const te=ki("el-input"),ae=ki("svg-icon"),ee=ki("el-menu-item"),se=ki("el-menu"),de=ki("el-col"),ke=ki("el-row"),ue=rm("loading");return Vu((di(),vr("div",ob,[Ot(ke,{gutter:10},{default:Yt(()=>[Ot(de,{span:3,xs:24},{default:Yt(()=>[yt("div",ub,[Ot(te,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD",onInput:O,modelValue:S.value,"onUpdate:modelValue":K[0]||(K[0]=He=>S.value=He),clearable:"","prefix-icon":"Search",style:{"margin-top":"10px"}},null,8,["modelValue"])]),yt("div",lb,[Ot(se,{"default-active":""+b.value,onSelect:L},{default:Yt(()=>[(di(!0),vr(ju,null,Wu(g.value,(He,Ne)=>(di(),qu(ee,{index:""+He.mmsi,key:Ne},{title:Yt(()=>[Ot(ae,{"icon-class":"ship",class:"margin-right-xs text-blue"}),yt("span",{class:nm(b.value==He.mmsi?"text-blue":He.status==0?"text-grey":"")},Gu(He.dev_name),3)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])]),_:1}),Ot(de,{span:2,xs:24,style:{"background-color":"rgba(255,255,255,0.1)"}},{default:Yt(()=>[db,yt("div",cb,[c.value.length?(di(),vr("div",fb,[Ot(se,{"default-active":y.value.cameraid,onSelect:M},{default:Yt(()=>[(di(!0),vr(ju,null,Wu(c.value,(He,Ne)=>(di(),qu(ee,{index:""+He.cameraid,key:Ne},{title:Yt(()=>[Ot(ae,{"icon-class":He.alive==1?"shexiangtou":"shexiangtounot",class:"margin-right-xs text-bold text-lg",style:{color:"#409eff"}},null,8,["icon-class"]),yt("span",null,Gu(He.name),1)]),_:2},1032,["index"]))),128))]),_:1},8,["default-active"])])):(di(),vr("div",hb," \u6682\u65E0\u6444\u50CF\u5934 "))])]),_:1}),Ot(de,{span:19,xs:24},{default:Yt(()=>[yt("div",pb,[yt("div",{class:"videobox",ref_key:"videoRef",ref:l},[Vu(yt("div",mb,null,512),[[am,!e.value]]),yt("video",{style:{width:"100%",height:"100%"},ref_key:"rVideoPlayer",ref:u,autoplay:"",class:"video-js vjs-default-skin"},null,512)],512)])]),_:1})]),_:1})])),[[ue,n.value]])}}};var Tb=fm(gb,[["__scopeId","data-v-24f8d54a"]]);export{Tb as default};