From edd33c847d33f6a481bda47ee6e90c573d220946 Mon Sep 17 00:00:00 2001 From: jboix Date: Thu, 31 Oct 2024 14:17:52 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=2036=20=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pr-preview/pr-36/index.html | 79 +++++++ .../assets/index-CZYLnWs4.js | 219 ++++++++++++++++++ .../assets/index-DhtRFMaS.css | 1 + .../packages/pillarbox-debug-panel/index.html | 25 ++ .../assets/index-BGSA8Lbi.js | 219 ++++++++++++++++++ .../assets/index-BmuOoaPc.css | 1 + .../packages/pillarbox-playlist/index.html | 26 +++ .../skip-button/assets/index-B9KY0Yw8.js | 219 ++++++++++++++++++ .../skip-button/assets/index-BdVXP4qA.css | 1 + .../pr-36/packages/skip-button/index.html | 26 +++ 10 files changed, 816 insertions(+) create mode 100644 pr-preview/pr-36/index.html create mode 100644 pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-CZYLnWs4.js create mode 100644 pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-DhtRFMaS.css create mode 100644 pr-preview/pr-36/packages/pillarbox-debug-panel/index.html create mode 100644 pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BGSA8Lbi.js create mode 100644 pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BmuOoaPc.css create mode 100644 pr-preview/pr-36/packages/pillarbox-playlist/index.html create mode 100644 pr-preview/pr-36/packages/skip-button/assets/index-B9KY0Yw8.js create mode 100644 pr-preview/pr-36/packages/skip-button/assets/index-BdVXP4qA.css create mode 100644 pr-preview/pr-36/packages/skip-button/index.html diff --git a/pr-preview/pr-36/index.html b/pr-preview/pr-36/index.html new file mode 100644 index 0000000..bf7d125 --- /dev/null +++ b/pr-preview/pr-36/index.html @@ -0,0 +1,79 @@ + + + + Package Showcase + + + + +
+

Pillarbox Extensions

+
+ + + diff --git a/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-CZYLnWs4.js b/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-CZYLnWs4.js new file mode 100644 index 0000000..f6e0094 --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-CZYLnWs4.js @@ -0,0 +1,219 @@ +var IT=Object.defineProperty;var PT=(i,e,t)=>e in i?IT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Nl=(i,e,t)=>PT(i,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ur(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Ad(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Us;typeof window<"u"?Us=window:typeof un<"u"?Us=un:typeof self<"u"?Us=self:Us={};var Bn=Us;const x=ur(Bn),LT={},OT=Object.freeze(Object.defineProperty({__proto__:null,default:LT},Symbol.toStringTag,{value:"Module"})),RT=Ad(OT);var Bl=typeof un<"u"?un:typeof window<"u"?window:{},MT=RT,$s;typeof document<"u"?$s=document:($s=Bl["__GLOBAL_DOCUMENT_CACHE@4"],$s||($s=Bl["__GLOBAL_DOCUMENT_CACHE@4"]=MT));var wd=$s;const U=ur(wd);var Mo={exports:{}};function ve(){return ve=Object.assign?Object.assign.bind():function(i){for(var e=1;e=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jT(i,e){if(i){if(typeof i=="string")return Fl(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fl(i,e)}}function Fl(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t=400&&r.statusCode<=599){var a=n;if(t)if(KT.TextDecoder){var o=YT(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function YT(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var QT=XT,kd=Bn,JT=BT,ZT=FT,Id=HT,eb=WT;xe.httpHandler=QT;xe.requestInterceptorsStorage=new Id;xe.responseInterceptorsStorage=new Id;xe.retryManager=new eb;/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */var tb=function(e){var t={};return e&&e.trim().split(` +`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Mo.exports=xe;Mo.exports.default=xe;xe.XMLHttpRequest=kd.XMLHttpRequest||nb;xe.XDomainRequest="withCredentials"in new xe.XMLHttpRequest?xe.XMLHttpRequest:kd.XDomainRequest;ib(["get","put","post","patch","head","delete"],function(i){xe[i==="delete"?"del":i]=function(e,t,s){return t=Pd(e,t,s),t.method=i.toUpperCase(),No(t)}});function ib(i,e){for(var t=0;t"u")throw new Error("callback argument missing");if(i.requestType&&xe.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=xe.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(I,N,V){s||(s=!0,i.callback(I,N,V))};function n(){d.readyState===4&&!xe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(l,0)}function a(){var R=void 0;if(d.response?R=d.response:R=d.responseText||rb(d),w)try{R=JSON.parse(R)}catch{}return R}function o(R){if(clearTimeout(O),clearTimeout(i.retryTimeout),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,!y&&xe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=d,No(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var I={headers:L.headers||{},body:L.body,responseUrl:d.responseURL,responseType:d.responseType},N=xe.responseInterceptorsStorage.execute(i.requestType,I);L.body=N.body,L.headers=N.headers}return r(R,L)}function l(){if(!y){var R;clearTimeout(O),clearTimeout(i.retryTimeout),i.useXDR&&d.status===void 0?R=200:R=d.status===1223?204:d.status;var I=L,N=null;if(R!==0?(I={body:a(),statusCode:R,method:E,headers:{},url:T,rawRequest:d},d.getAllResponseHeaders&&(I.headers=tb(d.getAllResponseHeaders()))):N=new Error("Internal XMLHttpRequest Error"),i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var V={headers:I.headers||{},body:I.body,responseUrl:d.responseURL,responseType:d.responseType},q=xe.responseInterceptorsStorage.execute(i.requestType,V);I.body=q.body,I.headers=q.headers}return r(N,I,I.body)}}var d=i.xhr||null;d||(i.cors||i.useXDR?d=new xe.XDomainRequest:d=new xe.XMLHttpRequest);var m,y,T=d.url=i.uri||i.url,E=d.method=i.method||"GET",D=i.body||i.data,_=d.headers=i.headers||{},A=!!i.sync,w=!1,O,L={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:d};if("json"in i&&i.json!==!1&&(w=!0,_.accept||_.Accept||(_.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),D=JSON.stringify(i.json===!0?D:i.json))),d.onreadystatechange=n,d.onload=l,d.onerror=o,d.onprogress=function(){},d.onabort=function(){y=!0,clearTimeout(i.retryTimeout)},d.ontimeout=o,d.open(E,T,!A,i.username,i.password),A||(d.withCredentials=!!i.withCredentials),!A&&i.timeout>0&&(O=setTimeout(function(){if(!y){y=!0,d.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",o(R)}},i.timeout)),d.setRequestHeader)for(m in _)_.hasOwnProperty(m)&&d.setRequestHeader(m,_[m]);else if(i.headers&&!sb(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(d.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(d),d.send(D||null),d}function rb(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function nb(){}var ab=Mo.exports;const Ld=ur(ab);var Od={exports:{}},Ul=wd,Bo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function st(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}st.prototype=Bo(Error.prototype);st.prototype.constructor=st;st.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Fo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Gs(){this.values=Bo(null)}Gs.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function qs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function ob(i,e,t){var s=i;function r(){var o=Fo(i);if(o===null)throw new st(st.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var d=new Gs;qs(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){d.set(m,t[T].region);break}break;case"vertical":d.alt(m,y,["rl","lr"]);break;case"line":var E=y.split(","),D=E[0];d.integer(m,D),d.percent(m,D)&&d.set("snapToLines",!1),d.alt(m,D,["auto"]),E.length===2&&d.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=y.split(","),d.percent(m,E[0]),E.length===2&&d.alt("positionAlign",E[1],["start","center","end"]);break;case"size":d.percent(m,y);break;case"align":d.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=d.get("region",null),l.vertical=d.get("vertical","");try{l.line=d.get("line","auto")}catch{}l.lineAlign=d.get("lineAlign","start"),l.snapToLines=d.get("snapToLines",!0),l.size=d.get("size",100);try{l.align=d.get("align","center")}catch{l.align=d.get("align","middle")}try{l.position=d.get("position","auto")}catch{l.position=d.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=d.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new st(st.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Ra=Ul.createElement&&Ul.createElement("textarea"),ub={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},$l={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)"},lb={v:"title",lang:"lang"},ql={rt:"ruby"};function Rd(i,e){function t(){if(!e)return null;function D(A){return e=e.substr(A.length),A}var _=e.match(/^([^<]*)(<[^>]*>?)?/);return D(_[1]?_[1]:_[2])}function s(D){return Ra.innerHTML=D,D=Ra.textContent,Ra.textContent="",D}function r(D,_){return!ql[_.localName]||ql[_.localName]===D.localName}function n(D,_){var A=ub[D];if(!A)return null;var w=i.document.createElement(A),O=lb[D];return O&&_&&(w[O]=_.trim()),w}for(var a=i.document.createElement("div"),o=a,l,d=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){d.length&&d[d.length-1]===l.substr(2).replace(">","")&&(d.pop(),o=o.parentNode);continue}var m=Fo(l.substr(1,l.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(D){var _=/^bg_/.test(D),A=_?D.slice(3):D;if($l.hasOwnProperty(A)){var w=_?"background-color":"color",O=$l[A];y.style[w]=O}}),y.className=E.join(" ")}d.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(l)))}return a}var jl=[[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 cb(i){for(var e=0;e=t[0]&&i<=t[1])return!0}return!1}function db(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,l){for(var d=l.childNodes.length-1;d>=0;d--)o.push(l.childNodes[d])}function n(o){if(!o||!o.length)return null;var l=o.pop(),d=l.textContent||l.innerText;if(d){var m=d.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):d}if(l.tagName==="ruby")return n(o);if(l.childNodes)return r(o,l),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Ve.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ve.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Ve.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Ve.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Ve.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function fb(i,e,t,s){function r(A,w){for(var O,L=new Ve(A),R=1,I=0;IN&&(O=new Ve(A),R=N),A=new Ve(L)}return O||L}var n=new Ve(e),a=e.cue,o=hb(a),l=[];if(a.snapToLines){var d;switch(a.vertical){case"":l=["+y","-y"],d="height";break;case"rl":l=["+x","-x"],d="width";break;case"lr":l=["-x","+x"],d="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[d]+m,E=l[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(E,y)}else{var D=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=D/2;break;case"end":o-=D;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new Ve(e)}var _=r(n,l);e.move(_.toCSSCompatValues(t))}function hs(){}hs.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};hs.convertCueToDOMTree=function(i,e){return!i||!e?null:Rd(i,e)};var pb=.05,mb="sans-serif",gb="1.5%";hs.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=gb,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{ob(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var d=a.indexOf("-->")!==-1;if(!a||d&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` +`),e.cue.text+=a.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` + +`,i.parse()),i.state==="INITIAL")throw new st(st.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var yb=hs,_b="auto",vb={"":1,lr:1,rl:1},Tb={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function bb(i){if(typeof i!="string")return!1;var e=vb[i.toLowerCase()];return e?i.toLowerCase():!1}function Ma(i){if(typeof i!="string")return!1;var e=Tb[i.toLowerCase()];return e?i.toLowerCase():!1}function Md(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,l=null,d="",m=!0,y="auto",T="start",E="auto",D="auto",_=100,A="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(w){l=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(w){var O=bb(w);if(O===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=O,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(w){if(typeof w!="number"&&w!==_b)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var O=Ma(w);O?(T=O,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");E=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return D},set:function(w){var O=Ma(w);O?(D=O,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return _},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");_=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return A},set:function(w){var O=Ma(w);if(!O)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");A=O,this.hasBeenReset=!0}}}),this.displayState=void 0}Md.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Sb=Md,xb={"":!0,up:!0};function Eb(i){if(typeof i!="string")return!1;var e=xb[i.toLowerCase()];return e?i.toLowerCase():!1}function Ls(i){return typeof i=="number"&&i>=0&&i<=100}function Cb(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Ls(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Ls(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Ls(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Ls(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Ls(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=Eb(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var Db=Cb,Ut=Bn,Ci=Od.exports={WebVTT:yb,VTTCue:Sb,VTTRegion:Db};Ut.vttjs=Ci;Ut.WebVTT=Ci.WebVTT;var Ab=Ci.VTTCue,wb=Ci.VTTRegion,kb=Ut.VTTCue,Ib=Ut.VTTRegion;Ci.shim=function(){Ut.VTTCue=Ab,Ut.VTTRegion=wb};Ci.restore=function(){Ut.VTTCue=kb,Ut.VTTRegion=Ib};Ut.VTTCue||Ci.shim();var Pb=Od.exports;const Vl=ur(Pb);var Hl="https://example.com",Un=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||"");var s=/^\/\//.test(e),r=!x.location&&!/\/\//i.test(e);e=new x.URL(e,x.location||Hl);var n=new URL(t,e);return r?n.href.slice(Hl.length):s?n.href.slice(n.protocol.length):n.href},Uo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Rb=" ",Na=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Mb=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},$e=function(i){const e={};if(!i)return e;const t=i.split(Mb());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},zl=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Nb extends Uo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const Bb=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Gt=function(i){const e={};return Object.keys(i).forEach(function(t){e[Bb(t)]=i[t]}),e},Ba=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(_){let A,w;if(t.manifest.definitions){for(const O in t.manifest.definitions)if(_.uri&&(_.uri=_.uri.replace(`{$${O}}`,t.manifest.definitions[O])),_.attributes)for(const L in _.attributes)typeof _.attributes[L]=="string"&&(_.attributes[L]=_.attributes[L].replace(`{$${O}}`,t.manifest.definitions[O]))}({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const O={};"length"in _&&(r.byterange=O,O.length=_.length,"offset"in _||(_.offset=T)),"offset"in _&&(r.byterange=O,O.offset=_.offset),T=O.offset+O.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(r.title=_.title),_.duration>0&&(r.duration=_.duration),_.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){a=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.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:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:Nd(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(a.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,y=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){n={},_.uri&&(n.uri=_.uri),_.byterange&&(n.byterange=_.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||d,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),ve(r.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const O=this.manifest.mediaGroups[_.attributes.TYPE];O[_.attributes["GROUP-ID"]]=O[_.attributes["GROUP-ID"]]||{},A=O[_.attributes["GROUP-ID"]],w={default:/yes/i.test(_.attributes.DEFAULT)},w.default?w.autoselect=!0:w.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(w.language=_.attributes.LANGUAGE),_.attributes.URI&&(w.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(w.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(w.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(w.forced=/yes/i.test(_.attributes.FORCED)),A[_.attributes.NAME]=w},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),r.dateTimeString=_.dateTimeString,r.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:O}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),O===null&&this.manifest.segments.reduceRight((L,R)=>(R.programDateTime=L-R.duration*1e3,R.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Ba.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){r.cueOut=_.data},"cue-out-cont"(){r.cueOutCont=_.data},"cue-in"(){r.cueIn=_.data},skip(){this.manifest.skip=Gt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const O=this.manifest.segments.length,L=Gt(_.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=E),E=L.byterange.offset+L.byterange.length);const R=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${R} for segment #${O}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((I,N)=>{I.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${N} lacks required attribute(s): LAST-PART`})})},"server-control"(){const O=this.manifest.serverControl=Gt(_.attributes);O.hasOwnProperty("canBlockReload")||(O.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ba.call(this,this.manifest),O.canSkipDateranges&&!O.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const O=this.manifest.segments.length,L=Gt(_.attributes),R=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=R?E:0,R&&(E=L.byterange.offset+L.byterange.length)));const I=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${I} for segment #${O}`,_.attributes,["TYPE","URI"]),!!L.type)for(let N=0;NN.id===L.id);this.manifest.dateRanges[I]=ve(this.manifest.dateRanges[I],L),D[L.id]=ve(D[L.id],L),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Gt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const O=(L,R)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=R};if("QUERYPARAM"in _.attributes){if("NAME"in _.attributes||"IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const L=this.params.get(_.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${_.attributes.QUERYPARAM}`});return}O(_.attributes.QUERYPARAM,decodeURIComponent(L));return}if("NAME"in _.attributes){if("IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in _.attributes)||typeof _.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${_.attributes.NAME}`});return}O(_.attributes.NAME,_.attributes.VALUE);return}if("IMPORT"in _.attributes){if(!this.mainDefinitions[_.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${_.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}O(_.attributes.IMPORT,this.mainDefinitions[_.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:_.attributes,uri:_.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",_.attributes,["BANDWIDTH","URI"])}}[_.tagType]||l).call(t)},uri(){r.uri=_.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=y,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){_.segment?(r.custom=r.custom||{},r.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(t)})}requiredCompatibilityversion(e,t){(ey&&(m-=y,m-=y,m-=Oe(2))}return Number(m)},Xb=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Oe(e);for(var a=Gb(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l=t.length&&d.call(t,function(m,y){var T=l[y]?l[y]&e[a+y]:e[a+y];return m===T})},Qb=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},ei={},Vt={};function Jb(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Zi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Zi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function eh(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}lr(et,ne);lr(et,ne.prototype);function tr(i,e){if(e(i))return!0;if(i=i.firstChild)do if(tr(i,e))return!0;while(i=i.nextSibling)}function cr(){this.ownerDocument=this}function a2(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===er.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function th(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===er.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function jo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function ih(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,jo(i.ownerDocument,i),e}function o2(i){return i&&(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.ELEMENT_NODE)}function u2(i){return i&&(Dt(i)||Vo(i)||qt(i)||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.COMMENT_NODE||i.nodeType===ne.PROCESSING_INSTRUCTION_NODE)}function qt(i){return i&&i.nodeType===ne.DOCUMENT_TYPE_NODE}function Dt(i){return i&&i.nodeType===ne.ELEMENT_NODE}function Vo(i){return i&&i.nodeType===ne.TEXT_NODE}function Jl(i,e){var t=i.childNodes||[];if(Ct(t,Dt)||qt(e))return!1;var s=Ct(t,qt);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Zl(i,e){var t=i.childNodes||[];function s(n){return Dt(n)&&n!==e}if(Ct(t,s))return!1;var r=Ct(t,qt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function l2(i,e,t){if(!o2(i))throw new Ee(Xe,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Ee(Qd,"child not in parent");if(!u2(e)||qt(e)&&i.nodeType!==ne.DOCUMENT_NODE)throw new Ee(Xe,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function c2(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Dt);if(n.length>1||Ct(r,Vo))throw new Ee(Xe,"More than one element or text in fragment");if(n.length===1&&!Jl(i,t))throw new Ee(Xe,"Element in fragment can not be inserted before doctype")}if(Dt(e)&&!Jl(i,t))throw new Ee(Xe,"Only one element can be added and only after doctype");if(qt(e)){if(Ct(s,qt))throw new Ee(Xe,"Only one doctype is allowed");var a=Ct(s,Dt);if(t&&s.indexOf(a)1||Ct(r,Vo))throw new Ee(Xe,"More than one element or text in fragment");if(n.length===1&&!Zl(i,t))throw new Ee(Xe,"Element in fragment can not be inserted before doctype")}if(Dt(e)&&!Zl(i,t))throw new Ee(Xe,"Only one element can be added and only after doctype");if(qt(e)){let l=function(d){return qt(d)&&d!==t};var o=l;if(Ct(s,l))throw new Ee(Xe,"Only one doctype is allowed");var a=Ct(s,Dt);if(t&&s.indexOf(a)0&&tr(t.documentElement,function(r){if(r!==t&&r.nodeType===pt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=Kl(n);a=e.every(s2(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new xi;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Bt;var t=e.attributes=new dn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new qn;return i.ownerDocument=this,i.childNodes=new Bt,i},createTextNode:function(i){var e=new Ho;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new zo;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Go;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Ko;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new fn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Wo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new xi,s=e.split(":"),r=t.attributes=new dn;return t.childNodes=new Bt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new fn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Ze(cr,ne);function xi(){this._nsMap={}}xi.prototype={nodeType:pt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===$t?this.insertBefore(i,null):d2(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new es(this,function(e){var t=[];return tr(e,function(s){s!==e&&s.nodeType==pt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new es(this,function(t){var s=[];return tr(t,function(r){r!==t&&r.nodeType===pt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};cr.prototype.getElementsByTagName=xi.prototype.getElementsByTagName;cr.prototype.getElementsByTagNameNS=xi.prototype.getElementsByTagNameNS;Ze(xi,ne);function fn(){}fn.prototype.nodeType=Zi;Ze(fn,ne);function dr(){}dr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(Le[Xe])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Ze(dr,ne);function Ho(){}Ho.prototype={nodeName:"#text",nodeType:cn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Ze(Ho,dr);function zo(){}zo.prototype={nodeName:"#comment",nodeType:Kd};Ze(zo,dr);function Go(){}Go.prototype={nodeName:"#cdata-section",nodeType:zd};Ze(Go,dr);function $n(){}$n.prototype.nodeType=Yd;Ze($n,ne);function rh(){}rh.prototype.nodeType=n2;Ze(rh,ne);function nh(){}nh.prototype.nodeType=r2;Ze(nh,ne);function Wo(){}Wo.prototype.nodeType=Gd;Ze(Wo,ne);function qn(){}qn.prototype.nodeName="#document-fragment";qn.prototype.nodeType=$t;Ze(qn,ne);function Ko(){}Ko.prototype.nodeType=Wd;Ze(Ko,ne);function ah(){}ah.prototype.serializeToString=function(i,e,t){return oh.call(i,e,t)};ne.prototype.toString=oh;function oh(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return $i(this,t,i,e,a),t.join("")}function ec(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===er.XML||r===er.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Ua(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,eh),'"')}function $i(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case pt:var n=i.attributes,a=n.length,w=i.firstChild,o=i.tagName;t=er.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var d,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){d=T.namespace;break}}if(d!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(l=T.prefix+":"+o);break}}}e.push("<",l);for(var E=0;E"),t&&/^script$/i.test(o))for(;w;)w.data?e.push(w.data):$i(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)$i(w,e,t,s,r.slice()),w=w.nextSibling;e.push("")}else e.push("/>");return;case Xd:case $t:for(var w=i.firstChild;w;)$i(w,e,t,s,r.slice()),w=w.nextSibling;return;case Zi:return Ua(e,i.name,i.value);case cn:return e.push(i.data.replace(/[<&>]/g,eh));case zd:return e.push("");case Kd:return e.push("");case Yd:var O=i.publicId,L=i.systemId;if(e.push("");else if(L&&L!=".")e.push(" SYSTEM ",L,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case Wd:return e.push("");case Gd:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function uh(i,e,t){var s;switch(e.nodeType){case pt:s=e.cloneNode(!1),s.ownerDocument=i;case $t:break;case Zi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(uh(i,r,t)),r=r.nextSibling;return s}function ao(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Bt),s.ownerDocument=i,s.nodeType){case pt:var a=e.attributes,o=s.attributes=new dn,l=a.length;o._ownerElement=s;for(var d=0;d",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(ch);var Xo={},ir=Vt.NAMESPACE,oo=/[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]/,tc=new RegExp("[\\-\\.0-9"+oo.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),ic=new RegExp("^"+oo.source+tc.source+"*(?::"+oo.source+tc.source+"*)?$"),Os=0,Wt=1,Ii=2,Rs=3,Pi=4,Li=5,Ms=6,zr=7;function ts(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,ts)}ts.prototype=new Error;ts.prototype.name=ts.name;function dh(){}dh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),hh(e,e={}),h2(i,e,t,s,this.errorHandler),s.endDocument()}};function h2(i,e,t,s,r){function n(te){if(te>65535){te-=65536;var Te=55296+(te>>10),Pt=56320+(te&1023);return String.fromCharCode(Te,Pt)}else return String.fromCharCode(te)}function a(te){var Te=te.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+te),te)}function o(te){if(te>_){var Te=i.substring(_,te).replace(/&#?\w+;/g,a);T&&l(_),s.characters(Te,0,te-_),_=te}}function l(te,Te){for(;te>=m&&(Te=y.exec(i));)d=Te.index,m=d+Te[0].length,T.lineNumber++;T.columnNumber=te-d+1}for(var d=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],D={},_=0;;){try{var A=i.indexOf("<",_);if(A<0){if(!i.substr(_).match(/^\s*$/)){var w=s.doc,O=w.createTextNode(i.substr(_));w.appendChild(O),s.currentElement=O}return}switch(A>_&&o(A),i.charAt(A+1)){case"/":var Z=i.indexOf(">",A+3),L=i.substring(A+2,Z).replace(/[ \t\n\r]+$/g,""),R=E.pop();Z<0?(L=i.substring(A+2).replace(/[\s<].*/,""),r.error("end tag name: "+L+" is not complete:"+R.tagName),Z=A+1+L.length):L.match(/\s_?_=Z:o(Math.max(A,_)+1)}}function sc(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function f2(i,e,t,s,r,n){function a(T,E,D){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),D)}for(var o,l,d=++e,m=Os;;){var y=i.charAt(d);switch(y){case"=":if(m===Wt)o=i.slice(e,d),m=Rs;else if(m===Ii)m=Rs;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Rs||m===Wt)if(m===Wt&&(n.warning('attribute value must after "="'),o=i.slice(e,d)),e=d+1,d=i.indexOf(y,e),d>0)l=i.slice(e,d),a(o,l,e-1),m=Li;else throw new Error("attribute value no end '"+y+"' match");else if(m==Pi)l=i.slice(e,d),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=d+1,m=Li;else throw new Error('attribute value must after "="');break;case"/":switch(m){case Os:t.setTagName(i.slice(e,d));case Li:case Ms:case zr:m=zr,t.closed=!0;case Pi:case Wt:break;case Ii:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==Os&&t.setTagName(i.slice(e,d)),d;case">":switch(m){case Os:t.setTagName(i.slice(e,d));case Li:case Ms:case zr:break;case Pi:case Wt:l=i.slice(e,d),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Ii:m===Ii&&(l=o),m==Pi?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!ir.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Rs:throw new Error("attribute value missed!!")}return d;case"€":y=" ";default:if(y<=" ")switch(m){case Os:t.setTagName(i.slice(e,d)),m=Ms;break;case Wt:o=i.slice(e,d),m=Ii;break;case Pi:var l=i.slice(e,d);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Li:m=Ms;break}else switch(m){case Ii:t.tagName,(!ir.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=d,m=Wt;break;case Li:n.warning('attribute space is required"'+o+'"!!');case Ms:m=Wt,e=d;break;case Rs:m=Pi,e=d;break;case zr:throw new Error("elements closed character '/' and '>' must be connected to")}}d++}}function rc(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var l=n.prefix=a.slice(0,T),d=a.slice(T+1),m=l==="xmlns"&&d;else d=a,l=null,m=a==="xmlns"&&"";n.localName=d,m!==!1&&(r==null&&(r={},hh(t,t={})),t[m]=r[m]=o,n.uri=ir.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var l=n.prefix;l&&(l==="xml"&&(n.uri=ir.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var T=s.indexOf(":");T>0?(l=i.prefix=s.slice(0,T),d=i.localName=s.slice(T+1)):(l=null,d=i.localName=s);var E=i.uri=t[l||""];if(e.startElement(E,d,s,i),i.closed){if(e.endElement(E,d,s),r)for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=r,!0}function p2(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function m2(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=_2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],d=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(d=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(l,d,m),t.endDTD(),y.index+y[0].length}}return-1}function y2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function fh(){this.attributeNames={}}fh.prototype={setTagName:function(i){if(!ic.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!ic.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function _2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Xo.XMLReader=dh;Xo.ParseError=ts;var v2=Vt,T2=ei,nc=ch,ph=Xo,b2=T2.DOMImplementation,ac=v2.NAMESPACE,S2=ph.ParseError,x2=ph.XMLReader;function mh(i){return i.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function gh(i){this.options=i||{locator:{}}}gh.prototype.parseFromString=function(i,e){var t=this.options,s=new x2,r=t.domBuilder||new hr,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),d=l?nc.HTML_ENTITIES:nc.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=E2(n,r,a),s.domBuilder=t.domBuilder||r,l&&(o[""]=ac.HTML),o.xml=o.xml||ac.XML;var m=t.normalizeLineEndings||mh;return i&&typeof i=="string"?s.parse(m(i),o,d):s.errorHandler.error("invalid doc source"),r.doc};function E2(i,e,t){if(!i){if(e instanceof hr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(l){i(a,l)}:i),s[a]=o&&function(l){o("[xmldom "+a+"] "+l+uo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function hr(){this.cdata=!1}function Oi(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}hr.prototype={startDocument:function(){this.doc=new b2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;Gr(this,n),this.currentElement=n,this.locator&&Oi(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){hr.prototype[i]=function(){return null}});function Gr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}jn.__DOMHandler=hr;jn.normalizeLineEndings=mh;jn.DOMParser=gh;var C2=jn.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const uc=i=>!!i&&typeof i=="object",Pe=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):uc(e[s])&&uc(t[s])?e[s]=Pe(e[s],t[s]):e[s]=t[s]}),e),{}),yh=i=>Object.keys(i).map(e=>i[e]),D2=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),_h=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),w2=(i,e)=>yh(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var ss={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",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"};const sr=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:Un(i||"",e)};if(t||s){const a=(t||s).split("-");let o=x.BigInt?x.BigInt(a[0]):parseInt(a[0],10),l=x.BigInt?x.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},lc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),I2={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=lc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,d=lc(i.endNumber),m=(e+t)/1e3,y=s+a,E=m+o-y,D=Math.ceil(E*r/n),_=Math.floor((m-y-l)*r/n),A=Math.floor((m-y)*r/n);return{start:Math.max(0,_),end:typeof d=="number"?d:Math.min(D,A)}}},P2=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Yo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=I2[e](i),l=D2(a,o).map(P2(i));if(e==="static"){const d=l.length-1,m=typeof r=="number"?r:n;l[d].duration=m-t/s*d}return l},vh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(ss.NO_BASE_URL);const d=sr({baseUrl:e,source:t.sourceURL,range:t.range}),m=sr({baseUrl:e,source:e,indexRange:r});if(m.map=d,l){const y=Yo(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Qo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,d=e.references.filter(A=>A.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,D=i.mediaSequence||0,_;typeof e.firstOffset=="bigint"?_=x.BigInt(o)+e.firstOffset:_=o+e.firstOffset;for(let A=0;Aw2(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),R2=(i,e)=>{for(let t=0;t{let e=[];return Qb(i,L2,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},dc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},M2=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:l}){return l===s.timeline});const r=R2(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),dc({playlist:s,mediaSequence:r.segments[a].number})})},N2=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(cc(i)),s=e.playlists.concat(cc(e));return e.timelineStarts=Th([i.timelineStarts,e.timelineStarts]),M2({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Vn=i=>i&&i.uri+"-"+k2(i.byterange),$a=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=yh(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=A2(s.segments||[],"discontinuity"),s))},Jo=(i,e)=>{const t=Vn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Qo(i,s,i.sidx.resolvedUri),i},B2=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Jo(i[t],e);return i},F2=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},U2=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},$2=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let d=a.attributes.label||"main";if(l&&!a.attributes.label){const y=o?` (${o})`:"";d=`${a.attributes.lang}${y}`}n[d]||(n[d]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=Jo(F2(a,t),e);return n[d].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},q2=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Jo(U2(s),e)),t},{}),j2=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),V2=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},H2=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",z2=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",G2=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",W2=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},hc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],K2=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:d}=i[0].attributes,m=$a(i.filter(H2)).map(V2),y=$a(i.filter(z2)),T=$a(i.filter(G2)),E=i.map(R=>R.attributes.captionServices).filter(Boolean),D={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:B2(m,s)};d>=0&&(D.minimumUpdatePeriod=d*1e3),e&&(D.locations=e),t&&(D.contentSteering=t),o==="dynamic"&&(D.suggestedPresentationDelay=l),n&&n.length>0&&(D.eventStream=n);const _=D.playlists.length===0,A=y.length?$2(y,s,_):null,w=T.length?q2(T,s):null,O=m.concat(hc(A),hc(w)),L=O.map(({timelineStarts:R})=>R);return D.timelineStarts=Th(L),W2(O,D.timelineStarts),A&&(D.mediaGroups.AUDIO.audio=A),w&&(D.mediaGroups.SUBTITLES.subs=w),E.length&&(D.mediaGroups["CLOSED-CAPTIONS"].cc=j2(E)),r?N2({oldManifest:r,newManifest:D}):D},X2=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,d=(s+r)/1e3,m=n+o,T=d+l-m;return Math.ceil((T*a-e)/t)},bh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,d=[];let m=-1;for(let y=0;ym&&(m=_);let A;if(D<0){const L=y+1;L===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?A=X2(i,m,E):A=(n*a-m)/E:A=(e[L].t-m)/E}else A=D+1;const w=o+d.length+A;let O=o+d.length;for(;O(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},fc=(i,e)=>i.replace(Y2,Q2(e)),J2=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Yo(i):bh(i,e),Z2=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=sr({baseUrl:i.baseUrl,source:fc(s.sourceURL,t),range:s.range});return J2(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=fc(i.media||"",t),l=i.timescale||1,d=i.presentationTimeOffset||0,m=i.periodStart+(a.time-d)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Un(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},e1=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=sr({baseUrl:t,source:s.sourceURL,range:s.range}),n=sr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},t1=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(ss.SEGMENT_TIME_UNSPECIFIED);const n=s.map(l=>e1(i,l));let a;return t&&(a=Yo(i)),e&&(a=bh(i,e)),a.map((l,d)=>{if(n[d]){const m=n[d],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=l.timeline,m.duration=l.duration,m.number=l.number,m.presentationTime=r+(l.time-T)/y,m}}).filter(l=>l)},i1=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=Z2,t=Pe(i,e.template)):e.base?(s=vh,t=Pe(i,e.base)):e.list&&(s=t1,t=Pe(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},s1=i=>i.map(i1),me=(i,e)=>_h(i.childNodes).filter(({tagName:t})=>t===e),fr=i=>i.textContent.trim(),r1=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Ri=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,d,m,y,T,E]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(d||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},n1=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),pc={mediaPresentationDuration(i){return Ri(i)},availabilityStartTime(i){return n1(i)/1e3},minimumUpdatePeriod(i){return Ri(i)},suggestedPresentationDelay(i){return Ri(i)},type(i){return i},timeShiftBufferDepth(i){return Ri(i)},start(i){return Ri(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return r1(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Ri(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},De=i=>i&&i.attributes?_h(i.attributes).reduce((e,t)=>{const s=pc[t.name]||pc.DEFAULT;return e[t.name]=s(t.value),e},{}):{},a1={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Hn=(i,e)=>e.length?is(i.map(function(t){return e.map(function(s){const r=fr(s),n=Un(t.baseUrl,r),a=Pe(De(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Zo=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(y=>Pe({tag:"SegmentURL"},De(y))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],o=t||r||e,l=o&&me(o,"Initialization")[0],d=e&&De(e);d&&l?d.initialization=l&&De(l):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});const m={template:d,segmentTimeline:a&&me(a,"S").map(y=>De(y)),list:t&&Pe(De(t),{segmentUrls:s,initialization:De(l)}),base:r&&Pe(De(r),{initialization:De(l)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},o1=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=Hn(e,r),a=Pe(i,De(s)),o=Zo(s);return n.map(l=>({segmentInfo:Pe(t,o),attributes:Pe(a,l)}))},u1=i=>i.reduce((e,t)=>{const s=De(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=a1[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=fr(n);e[r].pssh=a&&Nd(a)}}return e},{}),l1=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?s.language=l:o==="er"?s.easyReader=Number(l):o==="war"?s.aspectRatio=Number(l):o==="3D"&&(s["3D"]=Number(l))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},c1=i=>is(me(i.node,"EventStream").map(e=>{const t=De(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=De(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,d=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:d,end:d+l/o,messageData:fr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),d1=(i,e,t)=>s=>{const r=De(s),n=Hn(e,me(s,"BaseURL")),a=me(s,"Role")[0],o={role:De(a)};let l=Pe(i,r,o);const d=me(s,"Accessibility")[0],m=l1(De(d));m&&(l=Pe(l,{captionServices:m}));const y=me(s,"Label")[0];if(y&&y.childNodes.length){const A=y.childNodes[0].nodeValue.trim();l=Pe(l,{label:A})}const T=u1(me(s,"ContentProtection"));Object.keys(T).length&&(l=Pe(l,{contentProtection:T}));const E=Zo(s),D=me(s,"Representation"),_=Pe(t,E);return is(D.map(o1(l,n,_)))},h1=(i,e)=>(t,s)=>{const r=Hn(e,me(t.node,"BaseURL")),n=Pe(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),o=Zo(t.node);return is(a.map(d1(n,r,o)))},f1=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=Pe({serverURL:fr(i[0])},De(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},p1=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,m1=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(ss.INVALID_NUMBER_OF_PERIOD);const o=me(i,"Location"),l=De(i),d=Hn([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=r,o.length&&(l.locations=o.map(fr));const y=[];return a.forEach((T,E)=>{const D=De(T),_=y[E-1];D.start=p1({attributes:D,priorPeriodAttributes:_?_.attributes:null,mpdType:l.type}),y.push({node:T,attributes:D})}),{locations:l.locations,contentSteeringInfo:f1(m,n),representationInfo:is(y.map(h1(l,d))),eventStream:is(y.map(c1))}},Sh=i=>{if(i==="")throw new Error(ss.DASH_EMPTY_MANIFEST);const e=new C2;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(ss.DASH_INVALID_XML);return s},g1=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=De(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ss.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},y1=(i,e={})=>{const t=m1(Sh(i),e),s=s1(t.representationInfo);return K2({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},_1=i=>g1(Sh(i));var xh=Math.pow(2,32),v1=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},S1=b1;const x1=ur(S1);var E1=z([73,68,51]),C1=function(e,t){t===void 0&&(t=0),e=z(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},js=function i(e,t){return t===void 0&&(t=0),e=z(e),e.length-t<10||!pe(e,E1,{offset:t})?t:(t+=C1(e,t),i(e,t))},gc=function(e){return typeof e=="string"?qd(e):e},D1=function(e){return Array.isArray(e)?e.map(function(t){return gc(t)}):[gc(e)]},A1=function i(e,t,s){s===void 0&&(s=!1),t=D1(t),e=z(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(s)break;l=e.length}var d=e.subarray(n+8,l);pe(o,t[0])&&(t.length===1?r.push(d):r.push.apply(r,i(d,t.slice(1),s))),n=l}return r},Wr={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},lo=[128,64,32,16,8,4,2,1],w1=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=pn(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=pn(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},_c=function i(e,t){t=k1(t),e=z(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,d=e.subarray(o,l);pe(t[0],n.bytes)&&(t.length===1?s.push(d):s=s.concat(i(d,t.slice(1))));var m=n.length+a.length+d.length;r+=m}return s},P1=z([0,0,0,1]),L1=z([0,0,1]),O1=z([0,0,3]),R1=function(e){for(var t=[],s=1;s>1&63),s.indexOf(d)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},M1=function(e,t,s){return Eh(e,"h264",t,s)},N1=function(e,t,s){return Eh(e,"h265",t,s)},qe={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102])},rs={aac:function(e){var t=js(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=js(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=_c(e,[Wr.EBML,Wr.DocType])[0];return pe(t,qe.webm)},mkv:function(e){var t=_c(e,[Wr.EBML,Wr.DocType])[0];return pe(t,qe.matroska)},mp4:function(e){if(rs["3gp"](e)||rs.mov(e))return!1;if(pe(e,qe.mp4,{offset:4})||pe(e,qe.fmp4,{offset:4})||pe(e,qe.moof,{offset:4})||pe(e,qe.moov,{offset:4}))return!0},mov:function(e){return pe(e,qe.mov,{offset:4})},"3gp":function(e){return pe(e,qe["3gp"],{offset:4})},ac3:function(e){var t=js(e);return pe(e,qe.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},tu=9e4,iu,su,zn,ru,Ch,Dh,Ah;iu=function(i){return i*tu};su=function(i,e){return i*e};zn=function(i){return i/tu};ru=function(i,e){return i/e};Ch=function(i,e){return iu(ru(i,e))};Dh=function(i,e){return su(zn(i),e)};Ah=function(i,e,t){return zn(t?i:i-e)};var mi={ONE_SECOND_IN_TS:tu,secondsToVideoTs:iu,secondsToAudioTs:su,videoTsToSeconds:zn,audioTsToSeconds:ru,audioTsToVideoTs:Ch,videoTsToAudioTs:Dh,metadataTsToSeconds:Ah};/** + * @license + * Video.js 8.18.1 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */var ho="8.18.1";const Mt={},Jt=function(i,e){return Mt[i]=Mt[i]||[],e&&(Mt[i]=Mt[i].concat(e)),Mt[i]},U1=function(i,e){Jt(i,e)},wh=function(i,e){const t=Jt(i).indexOf(e);return t<=-1?!1:(Mt[i]=Mt[i].slice(),Mt[i].splice(t,1),!0)},$1=function(i,e){Jt(i,[].concat(e).map(t=>{const s=(...r)=>(wh(i,s),t(...r));return s}))},mn={prefixed:!0},rn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],vc=rn[0];let Vs;for(let i=0;i(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(l=`%c${i}`,n.unshift(t)),n.unshift(l+":"),Ke){Ke.push([].concat(n));const m=Ke.length-1e3;Ke.splice(0,m>0?m:0)}if(!x.console)return;let d=x.console[s];!d&&s==="debug"&&(d=x.console.info||x.console.log),!(!d||!a||!o.test(s))&&d[Array.isArray(n)?"apply":"call"](x.console,n)};function fo(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=q1(i,n,t),n.createLogger=(a,o,l)=>{const d=o!==void 0?o:e,m=l!==void 0?l:t,y=`${i} ${d} ${a}`;return fo(y,d,m)},n.createNewLogger=(a,o,l)=>fo(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>Ke?[].concat(Ke):[],n.history.filter=a=>(Ke||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ke&&(Ke.length=0)},n.history.disable=()=>{Ke!==null&&(Ke.length=0,Ke=null)},n.history.enable=()=>{Ke===null&&(Ke=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const J=fo("VIDEOJS"),kh=J.createLogger,j1=Object.prototype.toString,Ih=function(i){return At(i)?Object.keys(i):[]};function zi(i,e){Ih(i).forEach(t=>e(i[t],t))}function Ph(i,e,t=0){return Ih(i).reduce((s,r)=>e(s,i[r],r),t)}function At(i){return!!i&&typeof i=="object"}function ns(i){return At(i)&&j1.call(i)==="[object Object]"&&i.constructor===Object}function le(...i){const e={};return i.forEach(t=>{t&&zi(t,(s,r)=>{if(!ns(s)){e[r]=s;return}ns(e[r])||(e[r]={}),e[r]=le(e[r],s)})}),e}function Lh(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Gn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var V1=Object.freeze({__proto__:null,each:zi,reduce:Ph,isObject:At,isPlain:ns,merge:le,values:Lh,defineLazyProperty:Gn});let nu=!1,Oh=null,wt=!1,Rh,Mh=!1,Gi=!1,Wi=!1,kt=!1,au=null,Wn=null;const H1=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let Nh=null,gn=!1,Kn=!1,yn=!1,Xn=!1,_n=!1,vn=!1,Tn=!1;const rr=!!(fs()&&("ontouchstart"in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),Kt=x.navigator&&x.navigator.userAgentData;Kt&&Kt.platform&&Kt.brands&&(wt=Kt.platform==="Android",Gi=!!Kt.brands.find(i=>i.brand==="Microsoft Edge"),Wi=!!Kt.brands.find(i=>i.brand==="Chromium"),kt=!Gi&&Wi,au=Wn=(Kt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Kn=Kt.platform==="Windows");if(!Wi){const i=x.navigator&&x.navigator.userAgent||"";nu=/iPod/i.test(i),Oh=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),wt=/Android/i.test(i),Rh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Mh=/Firefox/i.test(i),Gi=/Edg/i.test(i),Wi=/Chrome/i.test(i)||/CriOS/i.test(i),kt=!Gi&&Wi,au=Wn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Nh=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),_n=/Tizen/i.test(i),vn=/Web0S/i.test(i),Tn=_n||vn,gn=/Safari/i.test(i)&&!kt&&!wt&&!Gi&&!Tn,Kn=/Windows/i.test(i),yn=/iPad/i.test(i)||gn&&rr&&!/iPhone/i.test(i),Xn=/iPhone/i.test(i)&&!yn}const ze=Xn||yn||nu,Yn=(gn||ze)&&!kt;var Bh=Object.freeze({__proto__:null,get IS_IPOD(){return nu},get IOS_VERSION(){return Oh},get IS_ANDROID(){return wt},get ANDROID_VERSION(){return Rh},get IS_FIREFOX(){return Mh},get IS_EDGE(){return Gi},get IS_CHROMIUM(){return Wi},get IS_CHROME(){return kt},get CHROMIUM_VERSION(){return au},get CHROME_VERSION(){return Wn},IS_CHROMECAST_RECEIVER:H1,get IE_VERSION(){return Nh},get IS_SAFARI(){return gn},get IS_WINDOWS(){return Kn},get IS_IPAD(){return yn},get IS_IPHONE(){return Xn},get IS_TIZEN(){return _n},get IS_WEBOS(){return vn},get IS_SMART_TV(){return Tn},TOUCH_ENABLED:rr,IS_IOS:ze,IS_ANY_SAFARI:Yn});function Tc(i){return typeof i=="string"&&!!i.trim()}function z1(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function fs(){return U===x.document}function ps(i){return At(i)&&i.nodeType===1}function Fh(){try{return x.parent!==x.self}catch{return!0}}function Uh(i){return function(e,t){if(!Tc(e))return U[i](null);Tc(t)&&(t=U.querySelector(t));const s=ps(t)?t:U;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=U.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ti(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&ou(r,s),r}function ti(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function po(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function Ks(i,e){return z1(e),i.classList.contains(e)}function _i(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Qn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(J.warn("removeClass was called with an element that doesn't exist"),null)}function $h(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function qh(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Yt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function jh(i,e){return i.getAttribute(e)}function as(i,e,t){i.setAttribute(e,t)}function Jn(i,e){i.removeAttribute(e)}function Vh(){U.body.focus(),U.onselectstart=function(){return!1}}function Hh(){U.onselectstart=function(){return!0}}function os(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(us(i,"height"))),t.width||(t.width=parseFloat(us(i,"width"))),t}}function nr(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==U[mn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Zn(i,e){const t={x:0,y:0};if(ze){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=us(m,"transform");if(/^matrix/.test(y)){const T=y.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(y)){const T=y.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&x.WebKitCSSMatrix){const T=x.getComputedStyle(m.assignedSlot.parentElement).transform,E=new x.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=nr(e.target),n=nr(i),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),d=e.offsetX-(n.left-r.left);return e.changedTouches&&(d=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,ze&&(d-=t.x,l-=t.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,d/a)),s}function zh(i){return At(i)&&i.nodeType===3}function ea(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function Gh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),ps(e)||zh(e))return e;if(typeof e=="string"&&/\S/.test(e))return U.createTextNode(e)}).filter(e=>e)}function ou(i,e){return Gh(e).forEach(t=>i.appendChild(t)),i}function Wh(i,e){return ou(ea(i),e)}function ar(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Zt=Uh("querySelector"),Kh=Uh("querySelectorAll");function us(i,e){if(!i||!e)return"";if(typeof x.getComputedStyle=="function"){let t;try{t=x.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Xh(i){[...U.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=U.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=U.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Yh=Object.freeze({__proto__:null,isReal:fs,isEl:ps,isInFrame:Fh,createEl:W,textContent:ti,prependTo:po,hasClass:Ks,addClass:_i,removeClass:Qn,toggleClass:$h,setAttributes:qh,getAttributes:Yt,getAttribute:jh,setAttribute:as,removeAttribute:Jn,blockTextSelection:Vh,unblockTextSelection:Hh,getBoundingClientRect:os,findPosition:nr,getPointerPosition:Zn,isTextNode:zh,emptyEl:ea,normalizeContent:Gh,appendContent:ou,insertContent:Wh,isSingleLeftClick:ar,$:Zt,$$:Kh,computedStyle:us,copyStyleSheetsToWindow:Xh});let Qh=!1,mo;const G1=function(){if(mo.options.autoSetup===!1)return;const i=Array.prototype.slice.call(U.getElementsByTagName("video")),e=Array.prototype.slice.call(U.getElementsByTagName("audio")),t=Array.prototype.slice.call(U.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Me(i,e,t){if(!He.has(i))return;const s=He.get(i);if(!s.handlers)return;if(Array.isArray(e))return uu(Me,i,e,t);const r=function(a,o){s.handlers[o]=[],bc(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a=e&&(i(...r),t=n)}},ef=function(i,e,t,s=x){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let d=function(){r=null,d=null,t||i.apply(o,l)};!r&&t&&i.apply(o,l),s.clearTimeout(r),r=s.setTimeout(d,e)};return a.cancel=n,a};var J1=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ct,bind_:de,throttle:It,debounce:ef});let Ns;class nt{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},rt(this,e,t),this.addEventListener=s}off(e,t){Me(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},ia(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},lu(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=ta(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ms(this,e)}queueTrigger(e){Ns||(Ns=new Map);const t=e.type||e;let s=Ns.get(this);s||(s=new Map,Ns.set(this,s));const r=s.get(t);s.delete(t),x.clearTimeout(r);const n=x.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ns.delete(this)),this.trigger(e)},0);s.set(t,n)}}nt.prototype.allowedEvents_={};nt.prototype.addEventListener=nt.prototype.on;nt.prototype.removeEventListener=nt.prototype.off;nt.prototype.dispatchEvent=nt.prototype.trigger;const sa=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ft=i=>i instanceof nt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),Z1=(i,e)=>{Ft(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},_o=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,bn=(i,e,t)=>{if(!i||!i.nodeName&&!Ft(i))throw new Error(`Invalid target for ${sa(e)}#${t}; must be a DOM node or evented object.`)},tf=(i,e,t)=>{if(!_o(i))throw new Error(`Invalid event type for ${sa(e)}#${t}; must be a non-empty string or array.`)},sf=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${sa(e)}#${t}; must be a function.`)},qa=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),bn(r,i,t),tf(n,i,t),sf(a,i,t),a=de(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},di=(i,e,t,s)=>{bn(i,i,e),i.nodeName?Q1[e](i,t,s):i[e](t,s)},eS={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=qa(this,i,"on");if(di(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,di(this,"on","dispose",n),di(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=qa(this,i,"one");if(e)di(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,di(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=qa(this,i,"any");if(e)di(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,di(t,"any",s,n)}},off(i,e,t){if(!i||_o(i))Me(this.eventBusEl_,i,e);else{const s=i,r=e;bn(s,this,"off"),tf(r,this,"off"),sf(t,this,"off"),t=de(this,t),this.off("dispose",t),s.nodeName?(Me(s,r,t),Me(s,"dispose",t)):Ft(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){bn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!_o(t))throw new Error(`Invalid event type for ${sa(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ms(this.eventBusEl_,i,e)}};function cu(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,eS),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&He.has(s)&&He.delete(s)}),x.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const tS={state:{},setState(i){typeof i=="function"&&(i=i());let e;return zi(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Ft(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function rf(i,e){return Object.assign(i,tS),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ft(i)&&i.on("statechanged",i.handleStateChanged),i}const Xs=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},_e=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},nf=function(i,e){return _e(i)===_e(e)};var iS=Object.freeze({__proto__:null,toLowerCase:Xs,toTitleCase:_e,titleCaseEquals:nf});let B=class We{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=le({},this.options_),t=this.options_=le(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${lt()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(cu(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),rf(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=le(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let d=s;return a&&a[e]?d=a[e]:l&&l[e]&&(d=l[e]),t&&(d=d.replace(/\{(\d+)\}/g,function(m,y){const T=t[y-1];let E=T;return typeof T>"u"&&(E=m),E})),d}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[_e(e.name())]=null,this.childNameIndex_[Xs(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const d=this.addChild(o,l);d&&(this[o]=d)};let r;const n=We.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=We.getComponent(a.opts.componentClass||_e(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Zt(e,t||this.contentEl())}$$(e,t){return Kh(e,t||this.contentEl())}hasClass(e){return Ks(this.el_,e)}addClass(...e){_i(this.el_,...e)}removeClass(...e){Qn(this.el_,...e)}toggleClass(e,t){$h(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return jh(this.el_,e)}setAttribute(e,t){as(this.el_,e,t)}removeAttribute(e){Jn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+_e(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=us(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${_e(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,d=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+d*d)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&x.performance.now()-e{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=de(this,e),this.clearTimersOnDispose_();const s=x.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=de(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=de(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=x.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||x.getComputedStyle(n).height==="0px"||x.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(U.documentElement.clientWidth||x.innerWidth)||a.y<0||a.y>(U.documentElement.clientHeight||x.innerHeight))return!1;let o=U.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=We.getComponent("Tech"),r=s&&s.isTech(t),n=We===t||We.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=_e(e),We.components_||(We.components_={});const a=We.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(d=>o[d]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return We.components_[e]=t,We.components_[Xs(e)]=t,t}static getComponent(e){if(!(!e||!We.components_))return We.components_[e]}};B.registerComponent("Component",B);function sS(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Sc(i,e,t,s){return sS(i,s,t.length-1),t[s][e]}function ja(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:Sc.bind(null,"start",0,i),end:Sc.bind(null,"end",1,i)},x.Symbol&&x.Symbol.iterator&&(e[x.Symbol.iterator]=()=>(i||[]).values()),e}function mt(i,e){return Array.isArray(i)?ja(i):i===void 0||e===void 0?ja():ja([[i,e]])}const af=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let du=af;function of(i){du=i}function uf(){du=af}function Ei(i,e=i){return du(i,e)}var rS=Object.freeze({__proto__:null,createTimeRanges:mt,createTimeRange:mt,setFormatTime:of,resetFormatTime:uf,formatTime:Ei});function lf(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=mt(0,0));for(let n=0;ne&&(r=e),t+=r-s;return t/e}function ye(i){if(i instanceof ye)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:At(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=ye.defaultMessages[this.code]||"")}ye.prototype.code=0;ye.prototype.message="";ye.prototype.status=null;ye.prototype.metadata=null;ye.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ye.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."};ye.MEDIA_ERR_CUSTOM=0;ye.prototype.MEDIA_ERR_CUSTOM=0;ye.MEDIA_ERR_ABORTED=1;ye.prototype.MEDIA_ERR_ABORTED=1;ye.MEDIA_ERR_NETWORK=2;ye.prototype.MEDIA_ERR_NETWORK=2;ye.MEDIA_ERR_DECODE=3;ye.prototype.MEDIA_ERR_DECODE=3;ye.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.MEDIA_ERR_ENCRYPTED=5;ye.prototype.MEDIA_ERR_ENCRYPTED=5;function Ys(i){return i!=null&&typeof i.then=="function"}function bt(i){Ys(i)&&i.then(null,e=>{})}const vo=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},nS=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=vo(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(vo))},aS=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var xc={textTracksToJson:nS,jsonToTextTracks:aS,trackToJson_:vo};const Va="vjs-modal-dialog";class gs extends B{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Va}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Va}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ti(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Va} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),Wh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),ea(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=U.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof x.HTMLAnchorElement||t instanceof x.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof x.HTMLInputElement||t instanceof x.HTMLSelectElement||t instanceof x.HTMLTextAreaElement||t instanceof x.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof x.HTMLIFrameElement||t instanceof x.HTMLObjectElement||t instanceof x.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}gs.prototype.options_={pauseOnOpen:!0,temporary:!0};B.registerComponent("ModalDialog",gs);class ls extends nt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},Ft(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s=0;t--)if(e[t].enabled){Ha(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ha(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ha(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const za=function(i,e){for(let t=0;t=0;t--)if(e[t].selected){za(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,za(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class cf extends ls{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class lS{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>J.error(r)),x.console&&x.console.groupEnd&&x.console.groupEnd()),t.flush()},Dc=function(i,e){const t={uri:i},s=ra(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Ld(t,de(this,function(n,a,o){if(n)return J.error(n,a);e.loaded_=!0,typeof x.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){J.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Cc(o,e)}):Cc(o,e)}))};class pr extends hu{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=le(e,{kind:hS[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=Ec[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new Sn(this.cues_),a=new Sn(this.activeCues_);let o=!1;this.timeupdateHandler=de(this,function(d={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(d){Ec[d]&&s!==d&&(s=d,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Dc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const d=this.tech_.currentTime(),m=[];for(let y=0,T=this.cues.length;y=d&&m.push(E)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let y=0;y{t=jt.LOADED,this.trigger({type:"load",target:this})})}}jt.prototype.allowedEvents_={load:"load"};jt.NONE=0;jt.LOADING=1;jt.LOADED=2;jt.ERROR=3;const ut={audio:{ListClass:oS,TrackClass:hf,capitalName:"Audio"},video:{ListClass:uS,TrackClass:ff,capitalName:"Video"},text:{ListClass:cf,TrackClass:pr,capitalName:"Text"}};Object.keys(ut).forEach(function(i){ut[i].getterName=`${i}Tracks`,ut[i].privateName=`${i}Tracks_`});const cs={remoteText:{ListClass:cf,TrackClass:pr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:lS,TrackClass:jt,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},je=Object.assign({},ut,cs);cs.names=Object.keys(cs);ut.names=Object.keys(ut);je.names=[].concat(cs.names).concat(ut.names);function pS(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new je.text.TrackClass(r);return n.addTrack(a),a}class Y extends B{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),je.names.forEach(s=>{const r=je[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new je.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(de(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return mt(0,0)}bufferedPercent(){return lf(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(ut.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ye(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?mt(0,0):mt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){ut.names.forEach(e=>{const t=ut[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!x.WebVTT)if(U.body.contains(this.el())){if(!this.options_["vtt.js"]&&ns(Vl)&&Object.keys(Vl).length>0){this.trigger("vttjsloaded");return}const e=U.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;othis.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=lt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=_e(e),Y.techs_[e]=t,Y.techs_[Xs(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=_e(e),x&&x.videojs&&x.videojs[e])return J.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}je.names.forEach(function(i){const e=je[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;nhi(e,vi[e.type],t,i),1)}function yS(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function _S(i,e,t){return i.reduceRight(mu(t),e[t]())}function vS(i,e,t,s){return e[t](i.reduce(mu(t),s))}function Ac(i,e,t,s=null){const r="call"+_e(t),n=i.reduce(mu(r),s),a=n===En,o=a?null:e[t](n);return SS(i,t,o,a),o}const TS={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},bS={setCurrentTime:1,setMuted:1,setVolume:1},wc={play:1,pause:1};function mu(i){return(e,t)=>e===En?En:t[i]?t[i](e):e}function SS(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function xS(i){xn.hasOwnProperty(i.id())&&delete xn[i.id()]}function ES(i,e){const t=xn[i.id()];let s=null;if(t==null)return s=e(i),xn[i.id()]=[[e,s]],s;for(let r=0;r{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;const Ic=_n?10009:vn?461:8,Mi={codes:{play:415,pause:19,ff:417,rw:412,back:Ic},names:{415:"play",19:"pause",417:"ff",412:"rw",[Ic]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},Pc=5;class wS extends nt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Mi.isEventKey(t,"play")||Mi.isEventKey(t,"pause")||Mi.isEventKey(t,"ff")||Mi.isEventKey(t,"rw")){t.preventDefault();const s=Mi.getEventName(t);this.performMediaAction_(s)}else Mi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Pc);break;case"rw":this.userSeek_(this.player_.currentTime()-Pc);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const d=o.getBoundingClientRect(),m={x:d.x,y:d.y,width:d.width,height:d.height,top:d.top,right:d.right,bottom:d.bottom,left:d.left},y={x:d.left+d.width/2,y:d.top+d.height/2,width:0,height:0,top:d.top+d.height/2,right:d.left+d.width/2,bottom:d.top+d.height/2,left:d.left+d.width/2};return{boundingClientRect:m,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:d=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,s);l=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&J.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,ti(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("ClickableComponent",na);class To extends na{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?bt(this.player_.play()):this.player_.pause())}}To.prototype.crossorigin=To.prototype.crossOrigin;B.registerComponent("PosterImage",To);const ot="#222",Lc="#ccc",IS={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 Ga(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function _t(i,e,t){try{i.style[e]=t}catch{return}}function Oc(i){return i?`${i}px`:""}class PS extends B{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(de(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=x.screen.orientation||x,o=x.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let d=0;d0&&o.forEach(m=>{if(m.style.inset){const y=m.style.inset.split(" ");y.length===3&&Object.assign(m.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!x.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),_t(this.el_,"insetInline",Oc(n)),_t(this.el_,"insetBlock",Oc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&_t(a.firstChild,"color",Ga(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&_t(a.firstChild,"backgroundColor",Ga(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?_t(a,"backgroundColor",Ga(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${ot}, 2px 2px 4px ${ot}, 2px 2px 5px ${ot}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${ot}, 2px 2px ${ot}, 3px 3px ${ot}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Lc}, 0 1px ${Lc}, -1px -1px ${ot}, 0 -1px ${ot}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${ot}, 0 0 4px ${ot}, 0 0 4px ${ot}, 0 0 4px ${ot}`)),t.fontPercent&&t.fontPercent!==1){const o=x.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=IS[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;sthis.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){bt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Ys(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}mf.prototype.controlText_="Play Video";B.registerComponent("BigPlayButton",mf);class OS extends Ne{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("CloseButton",OS);class gf extends Ne{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?bt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}gf.prototype.controlText_="Play";B.registerComponent("PlayToggle",gf);class ys extends B{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Ei(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,J.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=U.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}ys.prototype.labelText_="Time";ys.prototype.controlText_="Time";B.registerComponent("TimeDisplay",ys);class gu extends ys{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}gu.prototype.labelText_="Current Time";gu.prototype.controlText_="Current Time";B.registerComponent("CurrentTimeDisplay",gu);class yu extends ys{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}yu.prototype.labelText_="Duration";yu.prototype.controlText_="Duration";B.registerComponent("DurationDisplay",yu);class RS extends B{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}B.registerComponent("TimeDivider",RS);class _u extends ys{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}_u.prototype.labelText_="Remaining Time";_u.prototype.controlText_="Remaining Time";B.registerComponent("RemainingTimeDisplay",_u);class MS extends B{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(U.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}B.registerComponent("LiveDisplay",MS);class yf extends Ne{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}yf.prototype.controlText_="Seek to live, currently playing live";B.registerComponent("SeekToLive",yf);function mr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var NS=Object.freeze({__proto__:null,clamp:mr});class vu extends B{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!kt&&e.preventDefault(),Vh(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Hh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(mr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Zn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}B.registerComponent("Slider",vu);const Wa=(i,e)=>mr(i/e*100,0,100).toFixed(2)+"%";class BS extends B{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=U.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Wa(n,r);this.percent_!==o&&(this.el_.style.width=o,ti(this.percentageEl_,o),this.percent_=o);for(let l=0;ls.length;l--)this.el_.removeChild(a[l-1]);a.length=s.length})}}B.registerComponent("LoadProgressBar",BS);class FS extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=nr(this.el_),n=os(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let d=r.width/2;or.width&&(d=r.width),d=Math.round(d),this.el_.style.right=`-${d}px`,this.write(s)}write(e){ti(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+Ei(l,o)}else n=Ei(s,a);this.update(e,t,n),r&&r()})}}B.registerComponent("TimeTooltip",FS);class Tu extends B{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}Tu.prototype.options_={children:[]};!ze&&!wt&&Tu.prototype.options_.children.push("timeTooltip");B.registerComponent("PlayProgressBar",Tu);class _f extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}_f.prototype.options_={children:["timeTooltip"]};B.registerComponent("MouseTimeDisplay",_f);const Xr=5,Rc=12;class bu extends vu{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=de(this,this.update),this.update=It(this.update_,ct),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.on(U,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){U.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ct))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(U.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ei(s,n),Ei(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(os(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){ar(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!ar(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?bt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Rc)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Rc)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.off(U,"visibilitychange",this.toggleVisibility_),super.dispose()}}bu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ze&&!wt&&bu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");B.registerComponent("SeekBar",bu);class vf extends B{constructor(e,t){super(e,t),this.handleMouseMove=It(de(this,this.handleMouseMove),ct),this.throttledHandleMouseSeek=It(de(this,this.handleMouseSeek),ct),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=nr(n);let o=Zn(n,e).x;o=mr(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&bt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}vf.prototype.options_={children:["seekBar"]};B.registerComponent("ProgressControl",vf);class Tf extends Ne{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){U.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof U.exitPictureInPicture=="function"&&super.show()}}Tf.prototype.controlText_="Picture-in-Picture";B.registerComponent("PictureInPictureToggle",Tf);class bf extends Ne{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),U[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}bf.prototype.controlText_="Fullscreen";B.registerComponent("FullscreenToggle",bf);const US=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class $S extends B{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}B.registerComponent("VolumeLevel",$S);class qS extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=os(this.el_),a=os(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,d=e.width-o+(a.right-e.right);let m=n.width/2;ln.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){ti(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}B.registerComponent("VolumeLevelTooltip",qS);class Sf extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Sf.prototype.options_={children:["volumeLevelTooltip"]};B.registerComponent("MouseVolumeLevelDisplay",Sf);class aa extends vu{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){ar(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=os(s),n=this.vertical();let a=Zn(s,e);a=n?a.y:a.x,a=mr(a,0,1),t.update(r,a,n)}ar(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}aa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ze&&!wt&&aa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");aa.prototype.playerEvent="volumechange";B.registerComponent("VolumeBar",aa);class xf extends B{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||ns(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),US(this,e),this.throttledHandleMouseMove=It(de(this,this.handleMouseMove),ct),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}xf.prototype.options_={children:["volumeBar"]};B.registerComponent("VolumeControl",xf);const jS=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Ef extends Ne{constructor(e,t){super(e,t),jS(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ze&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Qn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),_i(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Ef.prototype.controlText_="Mute";B.registerComponent("MuteToggle",Ef);class Cf extends B{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||ns(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),rt(U,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Me(U,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Cf.prototype.options_={children:["muteToggle","volumeControl"]};B.registerComponent("VolumePanel",Cf);class Df extends Ne{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Df.prototype.controlText_="Skip Forward";B.registerComponent("SkipForward",Df);class Af extends Ne{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Af.prototype.controlText_="Skip Backward";B.registerComponent("SkipBackward",Af);class wf extends B{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof B&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof B&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),rt(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||U.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}B.registerComponent("Menu",wf);class Su extends B{constructor(e,t={}){super(e,t),this.menuButton_=new Ne(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Ne.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),rt(U,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new wf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:_e(this.options_.title),tabIndex:-1}),s=new B(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof x.Event!="object")try{o=new x.Event("change")}catch{}o||(o=U.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}B.registerComponent("OffTextTrackMenuItem",kf);class _s extends xu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=yr){let s;this.label_&&(s=`${this.label_} off`),e.push(new kf(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}B.registerComponent("TextTrackButton",_s);class If extends gr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(_e(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(_e(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Au(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Pf),e}}ku.prototype.kinds_=["captions","subtitles"];ku.prototype.controlText_="Subtitles";B.registerComponent("SubsCapsButton",ku);class Lf extends gr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;sthis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Iu.prototype.contentElType="button";B.registerComponent("PlaybackRateMenuItem",Iu);class Rf extends Su{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new Iu(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Rf.prototype.controlText_="Playback Rate";B.registerComponent("PlaybackRateMenuButton",Rf);class Mf extends B{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}B.registerComponent("Spacer",Mf);class VS extends Mf{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}B.registerComponent("CustomControlSpacer",VS);class Nf extends B{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Nf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};B.registerComponent("ControlBar",Nf);class Bf extends gs{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Bf.prototype.options_=Object.assign({},gs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});B.registerComponent("ErrorDisplay",Bf);class Ff extends B{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${lt()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:t[1]});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}B.registerComponent("TextTrackSelect",Ff);class Ti extends B{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let d=null;const m=`vjs_select_${lt()}`;if(this.options_.type==="colors"){d=W("span",{className:o});const T=W("label",{id:l,className:"vjs-label",textContent:a.label});T.setAttribute("for",m),d.appendChild(T)}const y=new Ff(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:l});this.addChild(y),this.options_.type==="colors"&&(d.appendChild(y.el()),this.el().appendChild(d))}}createEl(){return W("fieldset",{className:this.options_.className})}}B.registerComponent("TextTrackFieldset",Ti);class Uf extends B{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Ti(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Ti(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Ti(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}B.registerComponent("TextTrackSettingsColors",Uf);class $f extends B{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Ti(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Ti(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Ti(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}B.registerComponent("TextTrackSettingsFont",$f);class qf extends B{constructor(e,t={}){super(e,t);const s=this.localize("restore all settings to the default values"),r=new Ne(e,{controlText:s,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new Ne(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}B.registerComponent("TrackSettingsControls",qf);const Ka="vjs-text-track-settings",Mc=["#000","Black"],Nc=["#00F","Blue"],Bc=["#0FF","Cyan"],Fc=["#0F0","Green"],Uc=["#F0F","Magenta"],$c=["#F00","Red"],qc=["#FFF","White"],jc=["#FF0","Yellow"],Xa=["1","Opaque"],Ya=["0.5","Semi-Transparent"],Vc=["0","Transparent"],Qt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Mc,qc,$c,Fc,Nc,jc,Uc,Bc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Xa,Ya,Vc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[qc,Mc,$c,Fc,Nc,jc,Uc,Bc],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Xa,Ya],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Vc,Ya,Xa],className:"vjs-window-opacity vjs-opacity"}};Qt.windowColor.options=Qt.backgroundColor.options;function jf(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function HS(i,e){const t=i.options[i.options.selectedIndex].value;return jf(t,e)}function zS(i,e,t){if(e){for(let s=0;s{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),zi(Qt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return Ph(Qt,(e,t,s)=>{const r=HS(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){zi(Qt,(t,s)=>{zS(this.$(t.selector),e[s],t.parser)})}setDefaults(){zi(Qt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem(Ka))}catch(t){J.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem(Ka,JSON.stringify(e)):x.localStorage.removeItem(Ka)}catch(t){J.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}B.registerComponent("TextTrackSettings",GS);class WS extends B{constructor(e,t){let s=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=le({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ef(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Me(this,"resize",n),Me(this,"unload",a),a=null};rt(this.el_.contentWindow,"unload",a),rt(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}B.registerComponent("ResizeManager",WS);const KS={trackingThreshold:20,liveTolerance:15};class XS extends B{constructor(e,t){const s=le(KS,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(x.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ct),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}B.registerComponent("LiveTracker",XS);class YS extends B{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${lt()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${lt()}`})},W("div",{className:"vjs-title-bar"},{},Lh(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];ea(a),n&&ti(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}B.registerComponent("TitleBar",YS);const QS={initialDisplay:4e3,position:[],takeFocus:!1};class JS extends Ne{constructor(e,t){t=le(QS,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}B.registerComponent("TransientButton",JS);const bo=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let s=0;sVf([i.el(),x.HTMLMediaElement.prototype,x.Element.prototype,ZS],"innerHTML"),Hc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=ex(i),r=n=>(...a)=>{const o=n.apply(e,a);return bo(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",le(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},tx=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?df(x.Element.prototype.getAttribute.call(this,"src")):""},set(i){return x.Element.prototype.setAttribute.call(this,"src",i),i}}),ix=i=>Vf([i.el(),x.HTMLMediaElement.prototype,tx],"src"),sx=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=ix(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",le(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return bo(i)||(i.triggerSourceset(""),Hc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):bo(i)||Hc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class j extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&ra(l.src)&&(r=!0)):o.push(l))}for(let l=0;l{t=[];for(let n=0;ne.removeEventListener("change",s));const r=()=>{for(let n=0;n{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=ut[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[cs.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l{const l=n[o];s.addEventListener(o,l),this.on("dispose",d=>s.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){ut.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),j.disposeMediaElement(e),e=s}else{e=U.createElement("video");const s=this.options_.tag&&Yt(this.options_.tag),r=le({},s);(!rr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,qh(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&as(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Yn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){J(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&wt&&kt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)bt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){j.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=U.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}Gn(j,"TEST_VID",function(){if(!fs())return;const i=U.createElement("video"),e=U.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});j.isSupported=function(){try{j.TEST_VID.volume=.5}catch{return!1}return!!(j.TEST_VID&&j.TEST_VID.canPlayType)};j.canPlayType=function(i){return j.TEST_VID.canPlayType(i)};j.canPlaySource=function(i,e){return j.canPlayType(i.type)};j.canControlVolume=function(){try{const i=j.TEST_VID.volume;j.TEST_VID.volume=i/2+.1;const e=i!==j.TEST_VID.volume;return e&&ze?(x.setTimeout(()=>{j&&j.prototype&&(j.prototype.featuresVolumeControl=i!==j.TEST_VID.volume)}),!1):e}catch{return!1}};j.canMuteVolume=function(){try{const i=j.TEST_VID.muted;return j.TEST_VID.muted=!i,j.TEST_VID.muted?as(j.TEST_VID,"muted","muted"):Jn(j.TEST_VID,"muted","muted"),i!==j.TEST_VID.muted}catch{return!1}};j.canControlPlaybackRate=function(){if(wt&&kt&&Wn<58)return!1;try{const i=j.TEST_VID.playbackRate;return j.TEST_VID.playbackRate=i/2+.1,i!==j.TEST_VID.playbackRate}catch{return!1}};j.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(U.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};j.supportsNativeTextTracks=function(){return Yn||ze&&kt};j.supportsNativeVideoTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.videoTracks)};j.supportsNativeAudioTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.audioTracks)};j.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([i,e]){Gn(j.prototype,i,()=>j[e](),!0)});j.prototype.featuresVolumeControl=j.canControlVolume();j.prototype.movingMediaElementInDOM=!ze;j.prototype.featuresFullscreenResize=!0;j.prototype.featuresProgressEvents=!0;j.prototype.featuresTimeupdateEvents=!0;j.prototype.featuresVideoFrameCallback=!!(j.TEST_VID&&j.TEST_VID.requestVideoFrameCallback);j.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};j.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(j);j.nativeSourceHandler={};j.nativeSourceHandler.canPlayType=function(i){try{return j.TEST_VID.canPlayType(i)}catch{return""}};j.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return j.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=pu(i.src);return j.nativeSourceHandler.canPlayType(`video/${t}`)}return""};j.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};j.nativeSourceHandler.dispose=function(){};j.registerSourceHandler(j.nativeSourceHandler);Y.registerTech("Html5",j);const Hf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Qa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},So=["tiny","xsmall","small","medium","large","xlarge","huge"],nn={};So.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;nn[i]=`vjs-layout-${e}`});const rx={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let ke=class Fi extends B{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${lt()}`,t=Object.assign(Fi.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=kh(this.id_),this.fsApi_=mn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Yt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Fi.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),cu(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(rt(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=le(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new x.DOMParser().parseFromString(AS,"image/svg+xml");if(o.querySelector("parsererror"))J.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const d=o.documentElement;d.style.display="none",this.el_.appendChild(d),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new wS(this),this.addClass("vjs-spatial-navigation-enabled")),rr&&this.addClass("vjs-touch-enabled"),ze||this.addClass("vjs-workinghover"),Fi.players[this.id_]=this;const n=ho.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Me(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Me(U,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Fi.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),xS(this),je.names.forEach(e=>{const t=je[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Yt(e);if(r){for(t=this.el_=e,e=this.tag=U.createElement("video");t.children.length;)e.appendChild(t.firstChild);Ks(t,"video-js")||_i(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",kt&&Kn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(l=>Bh[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Jh("vjs-styles-dimensions");const l=Zt(".vjs-styles-defaults"),d=Zt("head");d.insertBefore(this.styleEl_,l?l.nextSibling:d.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){J.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){J.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ft(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Z1(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(o>=0&&(d.width=o),l>=0&&(d.height=l));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),Zh(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${a*100}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=_e(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};je.names.forEach(l=>{const d=je[l];a[d.getterName]=this[d.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=Y.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(de(this,this.handleTechReady_),!0),xc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Hf.forEach(l=>{this.on(this.tech_,l,d=>this[`handleTech${_e(l)}_`](d))}),Object.keys(Qa).forEach(l=>{this.on(this.tech_,l,d=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Qa[l]}_`].bind(this),event:d});return}this[`handleTech${Qa[l]}_`](d)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,d)=>this.handleTechFullscreenChange_(l,d)),this.on(this.tech_,"fullscreenerror",(l,d)=>this.handleTechFullscreenError_(l,d)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&po(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){je.names.forEach(e=>{const t=je[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=xc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&J.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":ho}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Ys(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Ys(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Ys(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=DS(this,t)),this.cache_.source=le({},e,{src:t,type:s});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;lthis.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?bt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=U[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in bS)return vS(this.middleware_,this.tech_,e,t);if(e in wc)return Ac(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw J(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in TS)return _S(this.middleware_,this.tech_,e);if(e in wc)return Ac(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(J(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(J(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(J(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=bt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Yn||ze);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||mt(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=mt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=mt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return lf(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(d,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,d){r(),s(d)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=U[this.fsApi_.exitFullscreen]();return e&&bt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=U.documentElement.style.overflow,rt(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow="hidden",_i(U.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Me(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow=this.docOrigOverflow,Qn(U.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){const e=U.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Xh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in U&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in U)return U.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=B.getComponent("FullscreenToggle");U[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),B.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),B.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s[o,Y.getTech(o)]).filter(([o,l])=>l?l.isSupported():(J.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,l,d){let m;return o.some(y=>l.some(T=>{if(m=d(y,T),m)return!0})),m};let r;const n=o=>(l,d)=>o(d,l),a=([o,l],d)=>{if(l.canPlaySource(d,this.options_[o.toLowerCase()]))return{source:d,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=pf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),gS(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}yS(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?nf(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();bt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ft(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Jt("beforeerror").forEach(t=>{const s=t(this,e);if(!(At(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ye(e),this.addClass("vjs-error"),J.error(`(CODE:${this.error_.code} ${ye.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Jt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=de(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==s)&&(t=y.screenX,s=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!ze&&!wt&&(l.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let d;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(d);const y=this.options_.inactivityTimeout;y<=0||(d=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ft(this)&&this.trigger("languagechange"))}languages(){return le(Fi.prototype.options_.languages,this.languages_)}toJSON(){const e=le(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;sthis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Cn(r.poster)}]),r}return le(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Yt(e),r=s["data-setup"];if(Ks(e,"vjs-fill")&&(s.fill=!0),Ks(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){J.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};je.names.forEach(function(i){const e=je[i];ke.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});ke.prototype.crossorigin=ke.prototype.crossOrigin;ke.players={};const Bs=x.navigator;ke.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Bs&&(Bs.languages&&Bs.languages[0]||Bs.userLanguage||Bs.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};Hf.forEach(function(i){ke.prototype[`handleTech${_e(i)}_`]=function(){return this.trigger(i)}});B.registerComponent("Player",ke);const Dn="plugin",Ki="activePlugins_",qi={},An=i=>qi.hasOwnProperty(i),an=i=>An(i)?qi[i]:void 0,zf=(i,e)=>{i[Ki]=i[Ki]||{},i[Ki][e]=!0},wn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},nx=function(i,e){const t=function(){wn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return zf(this,i),wn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},zc=(i,e)=>(e.prototype.name=i,function(...t){wn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,wn(this,s.getEventHash()),s});class Je{constructor(e){if(this.constructor===Je)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),cu(this),delete this.trigger,rf(this,this.constructor.defaultState),zf(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ms(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ki][e]=!1,this.player=this.state=null,t[e]=zc(e,qi[e])}static isBasic(e){const t=typeof e=="string"?an(e):e;return typeof t=="function"&&!Je.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(An(e))J.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ke.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return qi[e]=t,e!==Dn&&(Je.isBasic(t)?ke.prototype[e]=nx(e,t):ke.prototype[e]=zc(e,t)),t}static deregisterPlugin(e){if(e===Dn)throw new Error("Cannot de-register base plugin.");An(e)&&(delete qi[e],delete ke.prototype[e])}static getPlugins(e=Object.keys(qi)){let t;return e.forEach(s=>{const r=an(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=an(e);return t&&t.VERSION||""}}Je.getPlugin=an;Je.BASE_PLUGIN_NAME=Dn;Je.registerPlugin(Dn,Je);ke.prototype.usingPlugin=function(i){return!!this[Ki]&&this[Ki][i]===!0};ke.prototype.hasPlugin=function(i){return!!An(i)};function ax(i,e){let t=!1;return function(...s){return t||J.warn(i),t=!0,e.apply(this,s)}}function gt(i,e,t,s){return ax(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var ox={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Gf=i=>i.indexOf("#")===0?i.slice(1):i;function k(i,e,t){let s=k.getPlayer(i);if(s)return e&&J.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Zt("#"+Gf(i)):i;if(!ps(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof x.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&J.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Jt("beforesetup").forEach(l=>{const d=l(r,le(e));if(!At(d)||Array.isArray(d)){J.error("please return an object in beforesetup hooks");return}e=le(e,d)});const o=B.getComponent("Player");return s=new o(r,e,t),Jt("setup").forEach(l=>l(s)),s}k.hooks_=Mt;k.hooks=Jt;k.hook=U1;k.hookOnce=$1;k.removeHook=wh;if(x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&fs()){let i=Zt(".vjs-styles-defaults");if(!i){i=Jh("vjs-styles-defaults");const e=Zt("head");e&&e.insertBefore(i,e.firstChild),Zh(i,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}go(1,k);k.VERSION=ho;k.options=ke.prototype.options_;k.getPlayers=()=>ke.players;k.getPlayer=i=>{const e=ke.players;let t;if(typeof i=="string"){const s=Gf(i),r=e[s];if(r)return r;t=Zt("#"+s)}else t=i;if(ps(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};k.getAllPlayers=()=>Object.keys(ke.players).map(i=>ke.players[i]).filter(Boolean);k.players=ke.players;k.getComponent=B.getComponent;k.registerComponent=(i,e)=>(Y.isTech(e)&&J.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),B.registerComponent.call(B,i,e));k.getTech=Y.getTech;k.registerTech=Y.registerTech;k.use=mS;Object.defineProperty(k,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(k.middleware,"TERMINATOR",{value:En,writeable:!1,enumerable:!0});k.browser=Bh;k.obj=V1;k.mergeOptions=gt(9,"videojs.mergeOptions","videojs.obj.merge",le);k.defineLazyProperty=gt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Gn);k.bind=gt(9,"videojs.bind","native Function.prototype.bind",de);k.registerPlugin=Je.registerPlugin;k.deregisterPlugin=Je.deregisterPlugin;k.plugin=(i,e)=>(J.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Je.registerPlugin(i,e));k.getPlugins=Je.getPlugins;k.getPlugin=Je.getPlugin;k.getPluginVersion=Je.getPluginVersion;k.addLanguage=function(i,e){return i=(""+i).toLowerCase(),k.options.languages=le(k.options.languages,{[i]:e}),k.options.languages[i]};k.log=J;k.createLogger=kh;k.time=rS;k.createTimeRange=gt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",mt);k.createTimeRanges=gt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",mt);k.formatTime=gt(9,"videojs.formatTime","videojs.time.formatTime",Ei);k.setFormatTime=gt(9,"videojs.setFormatTime","videojs.time.setFormatTime",of);k.resetFormatTime=gt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",uf);k.parseUrl=gt(9,"videojs.parseUrl","videojs.url.parseUrl",fu);k.isCrossOrigin=gt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ra);k.EventTarget=nt;k.any=lu;k.on=rt;k.one=ia;k.off=Me;k.trigger=ms;k.xhr=Ld;k.TextTrack=pr;k.AudioTrack=hf;k.VideoTrack=ff;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{k[i]=function(){return J.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Yh[i].apply(null,arguments)}});k.computedStyle=gt(9,"videojs.computedStyle","videojs.dom.computedStyle",us);k.dom=Yh;k.fn=J1;k.num=NS;k.str=iS;k.url=fS;k.Error=ox;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class ux{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class kn extends k.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new ux(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;ss&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;ts,i.qualityLevels.VERSION=Wf,s},Kf=function(i){return lx(this,k.obj.merge({},i))};k.registerPlugin("qualityLevels",Kf);Kf.VERSION=Wf;/*! @name @videojs/http-streaming @version 3.14.2 @license Apache-2.0 */const Ye=Un,In=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,dt=i=>k.log.debug?k.log.debug.bind(k,"VHS:",`${i} >`):function(){};function ie(...i){const e=k.obj||k;return(e.merge||e.mergeOptions).apply(e,i)}function Re(...i){const e=k.time||k;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function cx(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-s}) +`}return e}const St=1/30,xt=St*3,Xf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s=e})},Yr=function(i,e){return Xf(i,function(t){return t-St>=e})},dx=function(i){if(i.length<2)return Re();const e=[];for(let t=1;t{const e=[];if(!i||!i.length)return"";for(let t=0;t "+i.end(t));return e.join(", ")},fx=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},gi=i=>{const e=[];for(let t=0;tn)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},Lu=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},xo=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),Qf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Jf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Zf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Qf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},mx=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Lu(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},gx=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r"u"&&(e=i.mediaSequence+i.segments.length),e"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return x.Infinity}return ep(i,e,t)},Qs=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n0)for(let d=l-1;d>=0;d--){const m=o[d];if(a+=m.duration,n){if(a<0)continue}else if(a+St<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Qs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:d})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let d=l;d<0;d++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let d=l;dSt,T=a===0,E=y&&a+St>=0;if(!((T||E)&&d!==o.length-1)){if(n){if(a>0)continue}else if(a-St>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Qs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:d})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},sp=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Ou=function(i){return i.excludeUntil&&i.excludeUntil===1/0},oa=function(i){const e=sp(i);return!i.disabled&&!e},vx=function(i){return i.disabled},Tx=function(i){for(let e=0;e{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>oa(s)?(s.attributes.BANDWIDTH||0)!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Gc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},_r=i=>{if(!i||!i.playlists||!i.playlists.length)return Gc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;eFd(n))||Gc(i,n=>Ru(t,n))))return!1}return!0};var Qe={liveEdgeDelay:Zf,duration:tp,seekable:yx,getMediaInfoForTime:_x,isEnabled:oa,isDisabled:vx,isExcluded:sp,isIncompatible:Ou,playlistEnd:ip,isAes:Tx,hasAttribute:rp,estimateSegmentRequestTime:bx,isLowestEnabledRendition:Eo,isAudioOnly:_r,playlistMatch:Ru,segmentDurationWithParts:Lu};const{log:np}=k,Xi=(i,e)=>`${i}-${e}`,ap=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,Sx=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new Fb;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(d=>a.addParser(d)),r.forEach(d=>a.addTagMapper(d)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(d){o.hasOwnProperty(d)&&delete o[d]}),o.segments&&o.segments.forEach(function(d){["parts","preloadHints"].forEach(function(m){d.hasOwnProperty(m)&&delete d[m]})})),!o.targetDuration){let d=10;o.segments&&o.segments.length&&(d=o.segments.reduce((m,y)=>Math.max(m,y.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${d}`}),o.targetDuration=d}const l=Qf(o);if(l.length&&!o.partTargetDuration){const d=l.reduce((m,y)=>Math.max(m,y.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${d}`}),np.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.")),o.partTargetDuration=d}return o},vs=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},op=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},xx=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];op({playlist:t,id:Xi(e,t.uri)}),t.resolvedUri=Ye(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||np.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Ex=i=>{vs(i,e=>{e.uri&&(e.resolvedUri=Ye(i.uri,e.uri))})},Cx=(i,e)=>{const t=Xi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:x.location.href,resolvedUri:x.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},up=(i,e,t=ap)=>{i.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let l=0;l(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!n||s;if(t&&n)a.error=ve({},t),a.errorType=k.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=k.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=k.Error.NetworkRequestTimeout;else if(o){const l=s?k.Error.NetworkBodyParserFailed:k.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:Dx}=k,Ax=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=Jf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new x.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},wx=(i,e)=>{if(!i)return e;const t=ie(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o{!i.resolvedUri&&i.uri&&(i.resolvedUri=Ye(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Ye(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Ye(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Ye(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ye(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ye(e,t.uri))})},dp=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;si===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Co=(i,e,t=hp)=>{const s=ie(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=dp(e);const n=ie(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{cp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let m=0;m{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Kc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:s}};class Vi extends Dx{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=dt("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Wc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ye(this.main.uri,e.uri);this.llhls&&(t=Ax(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:bi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return Sx({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(s){this.error=s,this.error.metadata={errorType:k.Error.StreamingHlsPlaylistParserError,error:s}}}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),op({playlist:a,uri:s,id:r});const o=Co(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Do(this.media(),!!o)),n.parsedPlaylist=Kc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),x.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Wc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(x.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=x.setTimeout(this.media.bind(this,e,!1),o);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Do(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=In(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=x.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:bi({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=In(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Kc(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,up(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=dp(s),s.segments.forEach(r=>{cp(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||x.location.href;this.main=Cx(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const d=this.createCloneURI_(a.resolvedUri,e),m=Xi(r,d),y=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,y);s.playlists[n]=T,s.playlists[m]=T,s.playlists[d]=T}else s.playlists.splice(n,1);delete s.playlists[l],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((d,m)=>{const y=s.playlists[d.id],T=y.id,E=y.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Xi(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=l,s.playlists[a]=l,s.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=ve({},l);const d=r.mediaGroups[n][t][o],m=this.createCloneURI_(l.resolvedUri,e);d.resolvedUri=m,d.uri=m,d.playlists=[],l.playlists.forEach((y,T)=>{const E=r.playlists[y.id],D=ap(n,t,o),_=Xi(t,D);if(E&&!r.playlists[_]){const A=this.createClonePlaylist_(E,_,e),w=A.resolvedUri;r.playlists[_]=A,r.playlists[w]=A}d.playlists[T]=this.createClonePlaylist_(y,_,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),ie(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const Ao=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},Ix=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},Px=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},fp=function(){const i=function e(t,s){t=ie({timeout:45e3},t);const r=e.beforeRequest||k.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||k.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||k.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(k.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=k.Vhs.xhr.original===!0?k.xhr:k.Vhs.xhr,l=Ix(n,t);n.delete(r);const d=o(l||t,function(y,T){return Px(a,d,y,T),Ao(d,y,T,s)}),m=d.abort;return d.abort=function(){return d.aborted=!0,m.apply(d,arguments)},d.uri=t.uri,d.requestType=t.requestType,d.requestTime=Date.now(),d};return i.original=!0,i},Lx=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},wo=function(i){const e={};return i.byterange&&(e.Range=Lx(i.byterange)),e},Ox=function(i,e){return i.start(e)+"-"+i.end(e)},Rx=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Mx=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},pp=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];$d(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},Pn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},mp=function(i){return i.resolvedUri},gp=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;agp(i),Bx=i=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},$x=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,qx=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(to?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Qe.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},jx=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;nt){if(i>t+r.duration*yp)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Vx=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Hx=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=jx(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=Ux(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},_p=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Hx(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=qx(i,e);if(!o)return a({message:`${i} was not found in the stream`});const l=o.segment,d=Vx(l.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+d),n.one("seeked",()=>{_p({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=l.start+d,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),s(m)},Za=(i,e)=>{if(i.readyState===4)return e()},Gx=(i,e,t,s)=>{let r=[],n,a=!1;const o=function(y,T,E,D){return T.abort(),a=!0,t(y,T,E,D)},l=function(y,T){if(a)return;if(y)return y.metadata=bi({requestType:s,request:T,error:y}),o(y,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=Yb(r,qd(E,!0)),n=n||js(r),r.length<10||n&&r.lengtho(y,T,"",r));const D=eu(r);return D==="ts"&&r.length<188?Za(T,()=>o(y,T,"",r)):!D&&r.length<376?Za(T,()=>o(y,T,"",r)):o(null,T,D,r)},m=e({uri:i,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:T,loaded:E}){return Ao(y,null,{statusCode:y.status},l)})}},function(y,T){return Ao(m,y,T,l)});return m},{EventTarget:Wx}=k,Xc=function(i,e){if(!hp(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Xx=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=y1(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return up(n,e,Kx),n},Yx=(i,e)=>{vs(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},Qx=(i,e,t)=>{let s=!0,r=ie(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const d=n.playlists[0].id,m=Co(r,n.playlists[0],Xc);m&&(r=m,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[d],s=!1)}}),Yx(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Jx=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Yc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Vn(n);if(!e[a])break;const o=e[a].sidxInfo;Jx(o,n)&&(t[a]=e[a])}}return t},Zx=(i,e)=>{let s=Yc(i.playlists,e);return vs(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;s=ie(s,Yc(l,e))}}),s};class ko extends Wx{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=dt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Vn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=x.setTimeout(()=>s(!1),0);return}const n=In(e.sidx.resolvedUri),a=(l,d)=>{if(this.requestErrored_(l,d,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=d;let T;try{T=x1(z(d.response).subarray(8))}catch(E){E.metadata=bi({requestType:y,request:d,parseFailure:!0}),this.requestErrored_(E,d,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},Qo(e,T,e.sidx.resolvedUri),s(!0)},o="dash-sidx";this.request=Gx(n,this.vhs_.xhr,(l,d,m,y)=>{if(l)return a(l,d);if(!m||m!=="mp4"){const D=m||"unknown";return a({status:d.status,message:`Unsupported ${D} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},d)}const{offset:T,length:E}=e.sidx.byterange;if(y.length>=E+T)return a(l,{response:y.subarray(T,T+E),status:d.status,uri:d.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:wo({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=bi({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=In(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=_1(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ye(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=bi({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=Xx({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:k.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=Qx(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,o=[];s.playlists.forEach(d=>{o.push({id:d.id,bandwidth:d.attributes.BANDWIDTH,resolution:d.attributes.RESOLUTION,codecs:d.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(x.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Zx(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Do(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ie={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const eE=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t-1):!1},this.trigger=function(c){var f,h,p,g;if(f=u[c],!!f)if(arguments.length===2)for(p=f.length,h=0;h"u")){for(u in H)H.hasOwnProperty(u)&&(H[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);ee=new Uint8Array([105,115,111,109]),te=new Uint8Array([97,118,99,49]),Fe=new Uint8Array([0,0,0,1]),Te=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]),Pt=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]),ii={video:Te,audio:Pt},ni=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ri=new Uint8Array([0,0,0,0,0,0,0,0]),vr=new Uint8Array([0,0,0,0,0,0,0,0]),Uu=vr,$u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),qu=vr,si=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var c=[],f=0,h,p,g;for(h=1;h>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},m=function(){return o(H.ftyp,ee,Fe,ee,te)},N=function(u){return o(H.hdlr,ii[u])},y=function(u){return o(H.mdat,u)},I=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=u.samplerate&255),o(H.mdhd,c)},R=function(u){return o(H.mdia,I(u),N(u.type),E(u))},T=function(u){return o(H.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},E=function(u){return o(H.minf,u.type==="video"?o(H.vmhd,si):o(H.smhd,ri),l(),q(u))},D=function(u,c){for(var f=[],h=c.length;h--;)f[h]=ce(c[h]);return o.apply(null,[H.moof,T(u)].concat(f))},_=function(u){for(var c=u.length,f=[];c--;)f[c]=O(u[c]);return o.apply(null,[H.moov,w(4294967295)].concat(f).concat(A(u)))},A=function(u){for(var c=u.length,f=[];c--;)f[c]=Z(u[c]);return o.apply(null,[H.mvex].concat(f))},w=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&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 o(H.mvhd,c)},V=function(u){var c=u.samples||[],f=new Uint8Array(4+c.length),h,p;for(p=0;p>>8),g.push(h[b].byteLength&255),g=g.concat(Array.prototype.slice.call(h[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(S=[H.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]),o(H.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([h.length],g,[p.length],v))),o(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var C=f.sarRatio[0],P=f.sarRatio[1];S.push(o(H.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return o.apply(null,S)},c=function(f){return o(H.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]),d(f))}}(),L=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.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,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(H.tkhd,c)},ce=function(u){var c,f,h,p,g,v,b;return c=o(H.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(u.baseMediaDecodeTime/a),b=Math.floor(u.baseMediaDecodeTime%a),f=o(H.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,u.type==="audio"?(h=oe(u,g),o(H.traf,c,f,h)):(p=V(u),h=oe(u,p.length+g),o(H.traf,c,f,h,p))},O=function(u){return u.duration=u.duration||4294967295,o(H.trak,L(u),R(u))},Z=function(u){var c=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),o(H.trex,c)},function(){var u,c,f;f=function(h,p){var g=0,v=0,b=0,S=0;return h.length&&(h[0].duration!==void 0&&(g=1),h[0].size!==void 0&&(v=2),h[0].flags!==void 0&&(b=4),h[0].compositionTimeOffset!==void 0&&(S=8)),[0,0,g|v|b|S,1,(h.length&4278190080)>>>24,(h.length&16711680)>>>16,(h.length&65280)>>>8,h.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(h,p){var g,v,b,S,C,P;for(S=h.samples||[],p+=20+16*S.length,b=f(S,p),v=new Uint8Array(b.length+S.length*16),v.set(b),g=b.length,P=0;P>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(H.trun,v)},u=function(h,p){var g,v,b,S,C,P;for(S=h.samples||[],p+=20+8*S.length,b=f(S,p),g=new Uint8Array(b.length+S.length*8),g.set(b),v=b.length,P=0;P>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(H.trun,g)},oe=function(h,p){return h.type==="audio"?u(h,p):c(h,p)}}();var y_={ftyp:m,mdat:y,moof:D,moov:_,initSegment:function(u){var c=m(),f=_(u),h;return h=new Uint8Array(c.byteLength+f.byteLength),h.set(c),h.set(f,c.byteLength),h}},__=function(u){var c,f,h=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,h.byteLength=0,c=0;c1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},b_=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},ju=function(u,c){var f=b_();return f.dataOffset=c,f.compositionTimeOffset=u.pts-u.dts,f.duration=u.duration,f.size=4*u.length,f.size+=u.byteLength,u.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},S_=function(u,c){var f,h,p,g,v,b=c||0,S=[];for(f=0;fbr.ONE_SECOND_IN_TS/2))){for(C=k_()[u.samplerate],C||(C=c[0].data),P=0;P=f?u:(c.minSegmentDts=1/0,u.filter(function(h){return h.dts>=f?(c.minSegmentDts=Math.min(c.minSegmentDts,h.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},O_=function(u){var c,f,h=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Lt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Lt.prototype.addText=function(u){this.rows[this.rowIdx]+=u},Lt.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var Er=function(u,c,f){this.serviceNum=u,this.text="",this.currentWindow=new Lt(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Er.prototype.init=function(u,c){this.startPts=u;for(var f=0;f<8;f++)this.windows[f]=new Lt(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Er.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},Er.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var ue=function(u){u=u||{},ue.prototype.init.call(this);var c=this,f=u.captionServices||{},h={},p;Object.keys(f).forEach(g=>{p=f[g],/^SERVICE/.test(g)&&(h[g]=p.encoding)}),this.serviceEncodings=h,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};ue.prototype=new ga,ue.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ue.prototype.add708Bytes=function(u){var c=u.ccData,f=c>>>8,h=c&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(h)},ue.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,f=null,h=null,p=0,g=c[p++];for(u.seq=g>>6,u.sizeCode=g&63;p>5,h=g&31,f===7&&h>0&&(g=c[p++],f=g),this.pushServiceBlock(f,p,h),h>0&&(p+=h-1)},ue.prototype.pushServiceBlock=function(u,c,f){var h,p=c,g=this.current708Packet.data,v=this.services[u];for(v||(v=this.initService(u,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(M=[b,S],u++):M=[b],c.textDecoder_&&!h)P=c.textDecoder_.decode(new Uint8Array(M));else if(p){const F=$(M);P=String.fromCharCode(parseInt(F,16))}else P=W_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(u)),C.pendingNewLine=!1,C.addText(P),u},ue.prototype.multiByteCharacter=function(u,c){var f=this.current708Packet.data,h=f[u+1],p=f[u+2];return xr(h)&&xr(p)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},ue.prototype.setCurrentWindow=function(u,c){var f=this.current708Packet.data,h=f[u],p=h&7;return c.setCurrentWindow(p),u},ue.prototype.defineWindow=function(u,c){var f=this.current708Packet.data,h=f[u],p=h&7;c.setCurrentWindow(p);var g=c.currentWindow;return h=f[++u],g.visible=(h&32)>>5,g.rowLock=(h&16)>>4,g.columnLock=(h&8)>>3,g.priority=h&7,h=f[++u],g.relativePositioning=(h&128)>>7,g.anchorVertical=h&127,h=f[++u],g.anchorHorizontal=h,h=f[++u],g.anchorPoint=(h&240)>>4,g.rowCount=h&15,h=f[++u],g.columnCount=h&63,h=f[++u],g.windowStyle=(h&56)>>3,g.penStyle=h&7,g.virtualRowCount=g.rowCount+1,u},ue.prototype.setWindowAttributes=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.winAttr;return h=f[++u],p.fillOpacity=(h&192)>>6,p.fillRed=(h&48)>>4,p.fillGreen=(h&12)>>2,p.fillBlue=h&3,h=f[++u],p.borderType=(h&192)>>6,p.borderRed=(h&48)>>4,p.borderGreen=(h&12)>>2,p.borderBlue=h&3,h=f[++u],p.borderType+=(h&128)>>5,p.wordWrap=(h&64)>>6,p.printDirection=(h&48)>>4,p.scrollDirection=(h&12)>>2,p.justify=h&3,h=f[++u],p.effectSpeed=(h&240)>>4,p.effectDirection=(h&12)>>2,p.displayEffect=h&3,u},ue.prototype.flushDisplayed=function(u,c){for(var f=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&f.push(c.windows[h].getText());c.endPts=u,c.text=f.join(` + +`),this.pushCaption(c),c.startPts=u},ue.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},ue.prototype.displayWindows=function(u,c){var f=this.current708Packet.data,h=f[++u],p=this.getPts(u);this.flushDisplayed(p,c);for(var g=0;g<8;g++)h&1<>4,p.offset=(h&12)>>2,p.penSize=h&3,h=f[++u],p.italics=(h&128)>>7,p.underline=(h&64)>>6,p.edgeType=(h&56)>>3,p.fontStyle=h&7,u},ue.prototype.setPenColor=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.penColor;return h=f[++u],p.fgOpacity=(h&192)>>6,p.fgRed=(h&48)>>4,p.fgGreen=(h&12)>>2,p.fgBlue=h&3,h=f[++u],p.bgOpacity=(h&192)>>6,p.bgRed=(h&48)>>4,p.bgGreen=(h&12)>>2,p.bgBlue=h&3,h=f[++u],p.edgeRed=(h&48)>>4,p.edgeGreen=(h&12)>>2,p.edgeBlue=h&3,u},ue.prototype.setPenLocation=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=f[++u],p.row=h&15,h=f[++u],p.column=h&63,u},ue.prototype.reset=function(u,c){var f=this.getPts(u);return this.flushDisplayed(f,c),this.initService(c.serviceNum,u)};var K_={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},Cr=function(u){return u===null?"":(u=K_[u]||u,String.fromCharCode(u))},Dr=14,X_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ai=function(){for(var u=[],c=Dr+1;c--;)u.push({text:"",indent:0,offset:0});return u},fe=function(u,c){fe.prototype.init.call(this),this.field_=u||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var h,p,g,v,b;if(h=f.ccData&32639,h===this.lastControlCode_){this.lastControlCode_=null;return}if((h&61440)===4096?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),g=h>>>8,v=h&255,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=f.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(h===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=ai();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ai();else if(h===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=ai()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=Cr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=Cr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(v&14)===14&&this.addFormatting(f.pts,["i"]),(v&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var S=X_.indexOf(h&7968);if(this.mode_==="rollUp"&&(S-this.rollUpRows_+1<0&&(S=this.rollUpRows_-1),this.setRollUp(f.pts,S)),S!==this.row_&&S>=0&&S<=14&&(this.clearFormatting(f.pts),this.row_=S),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(h&16)===16){const C=(h&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=Cr(g),b+=Cr(v),this[this.mode_](f.pts,b),this.column_+=b.length)}};fe.prototype=new ga,fe.prototype.flushDisplayed=function(u){const c=h=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."})},f=[];this.displayed_.forEach((h,p)=>{if(h&&h.text&&h.text.length){try{h.text=h.text.trim()}catch{c(p)}h.text.length&&f.push({text:h.text,line:p+1,position:10+Math.min(70,h.indent*10)+h.offset*2.5})}else h==null&&c(p)}),f.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:f,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ai(),this.nonDisplayed_=ai(),this.lastControlCode_=null,this.column_=0,this.row_=Dr,this.rollUpRows_=2,this.formatting_=[]},fe.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},fe.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(u,c){return u>=this.BASE_&&u=64&&c<=127},fe.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},fe.prototype.isNormalChar=function(u){return u>=32&&u<=127},fe.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=Dr,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=ai(),this.displayed_=ai()),c!==void 0&&c!==this.row_)for(var f=0;f"},"");this[this.mode_](u,f)},fe.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,h){return f+""},"");this.formatting_=[],this[this.mode_](u,c)}},fe.prototype.popOn=function(u,c){var f=this.nonDisplayed_[this.row_].text;f+=c,this.nonDisplayed_[this.row_].text=f},fe.prototype.rollUp=function(u,c){var f=this.displayed_[this.row_].text;f+=c,this.displayed_[this.row_].text=f},fe.prototype.shiftRowsUp_=function(){var u;for(u=0;uc&&(f=-1);Math.abs(c-u)>J_;)u+=f*Q_;return u},_a=function(u){var c,f;_a.prototype.init.call(this),this.type_=u||Xu,this.push=function(h){if(h.type==="metadata"){this.trigger("data",h);return}this.type_!==Xu&&h.type!==this.type_||(f===void 0&&(f=h.dts),h.dts=ya(h.dts,f),h.pts=ya(h.pts,f),c=h.dts,this.trigger("data",h))},this.flush=function(){f=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};_a.prototype=new Y_;var Yu={TimestampRolloverStream:_a,handleRollover:ya},Z_=(u,c,f)=>{if(!u)return-1;for(var h=f;h";u.data[0]===kr.Utf8&&(f=wr(u.data,0,c),!(f<0)&&(u.mimeType=bs(u.data,c,f),c=f+1,u.pictureType=u.data[c],c++,h=wr(u.data,0,c),!(h<0)&&(u.description=Ts(u.data,c,h),c=h+1,u.mimeType===p?u.url=bs(u.data,c,u.data.length):u.pictureData=u.data.subarray(c,u.data.length))))},"T*":function(u){u.data[0]===kr.Utf8&&(u.value=Ts(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var c;u.data[0]===kr.Utf8&&(c=wr(u.data,0,1),c!==-1&&(u.description=Ts(u.data,1,c),u.value=Ts(u.data,c+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=bs(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var c;u.data[0]===kr.Utf8&&(c=wr(u.data,0,1),c!==-1&&(u.description=Ts(u.data,1,c),u.url=bs(u.data,c+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var c;for(c=0;c>>2;G*=4,G+=F[7]&3,P.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=P.timeStamp,b.dts=P.timeStamp),this.trigger("timestamp",P)}b.frames.push(P),S+=10,S+=C}while(S>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",u(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",u(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=ht.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=ht.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},Es.prototype=new va,Es.STREAM_TYPES={h264:27,adts:15},Lr=function(){var u=this,c=!1,f={data:[],size:0},h={data:[],size:0},p={data:[],size:0},g,v=function(S,C){var P;const M=S[0]<<16|S[1]<<8|S[2];C.data=new Uint8Array,M===1&&(C.packetLength=6+(S[4]<<8|S[5]),C.dataAlignmentIndicator=(S[6]&4)!==0,P=S[7],P&192&&(C.pts=(S[9]&14)<<27|(S[10]&255)<<20|(S[11]&254)<<12|(S[12]&255)<<5|(S[13]&254)>>>3,C.pts*=4,C.pts+=(S[13]&6)>>>1,C.dts=C.pts,P&64&&(C.dts=(S[14]&14)<<27|(S[15]&255)<<20|(S[16]&254)<<12|(S[17]&255)<<5|(S[18]&254)>>>3,C.dts*=4,C.dts+=(S[18]&6)>>>1)),C.data=S.subarray(9+S[8]))},b=function(S,C,P){var M=new Uint8Array(S.size),$={type:C},F=0,G=0,K=!1,Ae;if(!(!S.data.length||S.size<9)){for($.trackId=S.data[0].pid,F=0;F>5,S=((c[p+6]&3)+1)*1024,C=S*uv/el[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:el[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),f++,p+=g}typeof P=="number"&&(this.skipWarn_(P,p),P=null),c=c.subarray(p)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Or.prototype=new ov;var lv=Or,tl;tl=function(u){var c=u.byteLength,f=0,h=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+h},this.loadWord=function(){var p=u.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(u.subarray(p,p+v)),f=new DataView(g.buffer).getUint32(0),h=v*8,c-=v},this.skipBits=function(p){var g;h>p?(f<<=p,h-=p):(p-=h,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),f<<=p,h-=p)},this.readBits=function(p){var g=Math.min(h,p),v=f>>>32-g;return h-=g,h>0?f<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return f<<=p,h-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var cv=tl,il=t,dv=cv,Rr,Cs,sl;Cs=function(){var u=0,c,f;Cs.prototype.init.call(this),this.push=function(h){var p;f?(p=new Uint8Array(f.byteLength+h.data.byteLength),p.set(f),p.set(h.data,f.byteLength),f=p):f=h.data;for(var g=f.byteLength;u3&&this.trigger("data",f.subarray(u+3)),f=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Cs.prototype=new il,sl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Rr=function(){var u=new Cs,c,f,h,p,g,v,b;Rr.prototype.init.call(this),c=this,this.push=function(S){S.type==="video"&&(f=S.trackId,h=S.pts,p=S.dts,u.push(S))},u.on("data",function(S){var C={trackId:f,pts:h,dts:p,data:S,nalUnitTypeCode:S[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(S.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(S.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),u.on("done",function(){c.trigger("done")}),u.on("partialdone",function(){c.trigger("partialdone")}),u.on("reset",function(){c.trigger("reset")}),u.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},b=function(S,C){var P=8,M=8,$,F;for($=0;$>4;return f=f>=0?f:0,p?f+20:f+10},nl=function(u,c){return u.length-c<10||u[c]!==73||u[c+1]!==68||u[c+2]!==51?c:(c+=rl(u,c),nl(u,c))},pv=function(u){var c=nl(u,0);return u.length>=c+2&&(u[c]&255)===255&&(u[c+1]&240)===240&&(u[c+1]&22)===16},al=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},mv=function(u,c,f){var h,p="";for(h=c;h>5,h=u[c+4]<<3,p=u[c+3]&6144;return p|h|f},_v=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":u[c]&!0&&(u[c+1]&240)===240?"audio":null},vv=function(u){for(var c=0;c+5>>2]}return null},Tv=function(u){var c,f,h,p;c=10,u[5]&64&&(c+=4,c+=al(u.subarray(10,14)));do{if(f=al(u.subarray(c+4,c+8)),f<1)return null;if(p=String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3]),p==="PRIV"){h=u.subarray(c+10,c+f+10);for(var g=0;g>>2;return S*=4,S+=b[7]&3,S}break}}c+=10,c+=f}while(c=3;){if(u[p]===73&&u[p+1]===68&&u[p+2]===51){if(u.length-p<10||(h=ol.parseId3TagSize(u,p),p+h>u.length))break;v={type:"timed-metadata",data:u.subarray(p,p+h)},this.trigger("data",v),p+=h;continue}else if((u[p]&255)===255&&(u[p+1]&240)===240){if(u.length-p<7||(h=ol.parseAdtsSize(u,p),p+h>u.length))break;b={type:"audio",data:u.subarray(p,p+h),pts:c,dts:c},this.trigger("data",b),p+=h;continue}p++}g=u.length-p,g>0?u=u.subarray(p):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Mr.prototype=new bv;var Sv=Mr,xv=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ev=xv,Cv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Dv=Cv,Nr=t,Ds=y_,As=D_,Br=M_,ft=$_,Ot=av,Fr=he,ul=lv,Av=hv.H264Stream,wv=Sv,kv=xa.isLikelyAacData,Iv=he.ONE_SECOND_IN_TS,Ea=Ev,Ca=Dv,ws,Ai,Ur,oi,Pv=function(u,c){c.stream=u,this.trigger("log",c)},ll=function(u,c){for(var f=Object.keys(c),h=0;h=-C&&M<=S&&(!$||P>M)&&($=G,P=M)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var S,C,P,M,$,F,G,K;for($=b.byteLength,F=b.nalCount,G=b.duration,S=C=0;SP.pts){S++;continue}C++,$-=M.byteLength,F-=M.nalCount,G-=M.duration}return C===0?b:C===b.length?null:(K=b.slice(C),K.byteLength=$,K.duration=G,K.nalCount=F,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(b){var S,C,P,M,$,F;for(S=p.length-1,C=b.length-1,$=null,F=!1;S>=0&&C>=0;){if(P=p[S],M=b[C],P.pts===M.pts){F=!0;break}if(P.pts>M.pts){S--;continue}S===p.length-1&&($=C),C--}if(!F&&$===null)return null;var G;if(F?G=C:G=$,G===0)return b;var K=b.slice(G),Ae=K.reduce(function(at,li){return at.byteLength+=li.byteLength,at.duration+=li.duration,at.nalCount+=li.nalCount,at},{byteLength:0,duration:0,nalCount:0});return K.byteLength=Ae.byteLength,K.duration=Ae.duration,K.nalCount=Ae.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(b){p=b}},ws.prototype=new Nr,oi=function(u,c){this.numberOfTracks=0,this.metadataStream=c,u=u||{},typeof u.remux<"u"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,oi.prototype.init.call(this),this.push=function(f){if(f.content||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))}},oi.prototype=new Nr,oi.prototype.flush=function(u){var c=0,f={captions:[],captionStreams:{},metadata:[],info:{}},h,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,Ca.forEach(function(S){f.info[S]=this.videoTrack[S]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,Ea.forEach(function(S){f.info[S]=this.audioTrack[S]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?f.type=this.pendingTracks[0].type:f.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Ds.initSegment(this.pendingTracks),f.initSegment=new Uint8Array(g.byteLength),f.initSegment.set(g),f.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},oi.prototype.setRemux=function(u){this.remuxTracks=u},Ur=function(u){var c=this,f=!0,h,p;Ur.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Ot.MetadataStream,g.aacStream=new wv,g.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),g.adtsStream=new ul,g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ai(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ll(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Ot.MetadataStream,g.packetStream=new Ot.TransportPacketStream,g.parseStream=new Ot.TransportParseStream,g.elementaryStream=new Ot.ElementaryStream,g.timestampRolloverStream=new Ot.TimestampRolloverStream,g.adtsStream=new ul,g.h264Stream=new Av,g.captionStream=new Ot.CaptionStream(u),g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!h&&v.tracks[b].type==="video"?(h=v.tracks[b],h.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);h&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new ws(h,u),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(S){p&&!u.keepOriginalTimestamps&&(p.timelineStartInfo=S,g.audioSegmentStream.setEarliestDts(S.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(S){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(S)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ai(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ll(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ft.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),h&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,ft.clearDtsInfo(h),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;u.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(f){var v=kv(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(g)},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()}},Ur.prototype=new Nr;var Lv={Transmuxer:Ur,VideoSegmentStream:ws,AudioSegmentStream:Ai,AUDIO_PROPERTIES:Ea,VIDEO_PROPERTIES:Ca,generateSegmentTimingInfo:Da},Ov=function(u){return u>>>0},Rv=function(u){return("00"+u.toString(16)).slice(-2)},$r={toUnsigned:Ov,toHexString:Rv},Mv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3]),c},dl=Mv,Nv=$r.toUnsigned,Bv=dl,hl=function(u,c){var f=[],h,p,g,v,b;if(!c.length)return null;for(h=0;h1?h+p:u.byteLength,g===c[0]&&(c.length===1?f.push(u.subarray(h+8,v)):(b=hl(u.subarray(h+8,v),c.slice(1)),b.length&&(f=f.concat(b)))),h=v;return f},fl=hl,Fv=$r.toUnsigned,Uv=n.getUint64,$v=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=Uv(u.subarray(4)):c.baseMediaDecodeTime=Fv(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},pl=$v,qv=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},jv=qv,ml=jv,Vv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},f=new DataView(u.buffer,u.byteOffset,u.byteLength),h=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,S=c.flags[1]&8,C=f.getUint32(4),P=8,M;for(h&&(c.dataOffset=f.getInt32(P),P+=4),p&&C&&(M={flags:ml(u.subarray(P,P+4))},P+=4,g&&(M.duration=f.getUint32(P),P+=4),v&&(M.size=f.getUint32(P),P+=4),S&&(c.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),c.samples.push(M),C--);C--;)M={},g&&(M.duration=f.getUint32(P),P+=4),v&&(M.size=f.getUint32(P),P+=4),b&&(M.flags=ml(u.subarray(P,P+4)),P+=4),S&&(c.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),c.samples.push(M);return c},gl=Vv,Hv=function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),f={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:c.getUint32(4)},h=f.flags[2]&1,p=f.flags[2]&2,g=f.flags[2]&8,v=f.flags[2]&16,b=f.flags[2]&32,S=f.flags[0]&65536,C=f.flags[0]&131072,P;return P=8,h&&(P+=4,f.baseDataOffset=c.getUint32(12),P+=4),p&&(f.sampleDescriptionIndex=c.getUint32(P),P+=4),g&&(f.defaultSampleDuration=c.getUint32(P),P+=4),v&&(f.defaultSampleSize=c.getUint32(P),P+=4),b&&(f.defaultSampleFlags=c.getUint32(P)),S&&(f.durationIsEmpty=!0),!h&&C&&(f.baseDataOffsetIsMoof=!0),f},yl=Hv,ks;typeof window<"u"?ks=window:typeof i<"u"?ks=i:typeof self<"u"?ks=self:ks={};var _l=ks,zv=Wu.discardEmulationPreventionBytes,Gv=Ku.CaptionStream,Is=fl,Wv=pl,Kv=gl,Xv=yl,vl=_l,Yv=function(u,c){for(var f=u,h=0;h0?Wv($[0]).baseMediaDecodeTime:0,G=Is(S,["trun"]),K,Ae;c===M&&G.length>0&&(K=Jv(G,F,P),Ae=Qv(b,K,M),p[M]||(p[M]={seiNals:[],logs:[]}),p[M].seiNals=p[M].seiNals.concat(Ae.seiNals),p[M].logs=p[M].logs.concat(Ae.logs))}),p},eT=function(u,c,f){var h;if(c===null)return null;h=Zv(u,c);var p=h[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:f}},tT=function(){var u=!1,c,f,h,p,g,v;this.isInitialized=function(){return u},this.init=function(b){c=new Gv,u=!0,v=b?b.isPartial:!1,c.on("data",function(S){S.startTime=S.startPts/p,S.endTime=S.endPts/p,g.captions.push(S),g.captionStreams[S.stream]=!0}),c.on("log",function(S){g.logs.push(S)})},this.isNewInit=function(b,S){return b&&b.length===0||S&&typeof S=="object"&&Object.keys(S).length===0?!1:h!==b[0]||p!==S[h]},this.parse=function(b,S,C){var P;if(this.isInitialized()){if(!S||!C)return null;if(this.isNewInit(S,C))h=S[0],p=C[h];else if(h===null||!p)return f.push(b),null}else return null;for(;f.length>0;){var M=f.shift();this.parse(M,S,C)}return P=eT(b,h,p),P&&P.logs&&(g.logs=g.logs.concat(P.logs)),P===null||!P.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(S){c.push(S)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],h=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},iT=tT,sT=function(u){for(var c=0,f=String.fromCharCode(u[c]),h="";f!=="\0";)h+=f,c++,f=String.fromCharCode(u[c]);return h+=f,h},rT={uint8ToCString:sT},qr=rT.uint8ToCString,nT=n.getUint64,aT=function(u){var c=4,f=u[0],h,p,g,v,b,S,C,P;if(f===0){h=qr(u.subarray(c)),c+=h.length,p=qr(u.subarray(c)),c+=p.length;var M=new DataView(u.buffer);g=M.getUint32(c),c+=4,b=M.getUint32(c),c+=4,S=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4}else if(f===1){var M=new DataView(u.buffer);g=M.getUint32(c),c+=4,v=nT(u.subarray(c)),c+=8,S=M.getUint32(c),c+=4,C=M.getUint32(c),c+=4,h=qr(u.subarray(c)),c+=h.length,p=qr(u.subarray(c)),c+=p.length}P=new Uint8Array(u.subarray(c,u.byteLength));var $={scheme_id_uri:h,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:S,id:C,message_data:P};return uT(f,$)?$:void 0},oT=function(u,c,f,h){return u||u===0?u/c:h+f/c},uT=function(u,c){var f=c.scheme_id_uri!=="\0",h=u===0&&Tl(c.presentation_time_delta)&&f,p=u===1&&Tl(c.presentation_time)&&f;return!(u>1)&&h||p},Tl=function(u){return u!==void 0||u!==null},lT={parseEmsgBox:aT,scaleTime:oT},jr=$r.toUnsigned,Ps=$r.toHexString,be=fl,wi=dl,Aa=lT,cT=yl,dT=gl,hT=pl,fT=n.getUint64,bl,Sl,xl,El,Cl,wa,Dl,ka=_l,pT=Ju.parseId3Frames;bl=function(u){var c={},f=be(u,["moov","trak"]);return f.reduce(function(h,p){var g,v,b,S,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,S=jr(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,h[S]=jr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),h)},c)},Sl=function(u,c){var f;f=be(c,["moof","traf"]);var h=f.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=jr(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),S=u[b]||9e4,C=be(g,["tfdt"])[0],P=new DataView(C.buffer,C.byteOffset,C.byteLength),M;C[0]===1?M=fT(C.subarray(4,12)):M=P.getUint32(4);let $;return typeof M=="bigint"?$=M/ka.BigInt(S):typeof M=="number"&&!isNaN(M)&&($=M/S),$11?(p.codec+=".",p.codec+=Ps(F[9]),p.codec+=Ps(F[10]),p.codec+=Ps(F[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(F=$.subarray(28),G=wi(F.subarray(4,8)),G==="esds"&&F.length>20&&F[19]!==0?(p.codec+="."+Ps(F[19]),p.codec+="."+Ps(F[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=be(h,["mdia","mdhd"])[0];K&&(p.timescale=wa(K)),f.push(p)}),f},Dl=function(u,c=0){var f=be(u,["emsg"]);return f.map(h=>{var p=Aa.parseEmsgBox(new Uint8Array(h)),g=pT(p.message_data);return{cueTime:Aa.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:Aa.scaleTime(p.event_duration,p.timescale),frames:g}})};var Ia={findBox:be,parseType:wi,timescale:bl,startTime:Sl,compositionStartTime:xl,videoTrackIds:El,tracks:Cl,getTimescaleFromMediaHeader:wa,getEmsgID3:Dl},Pa=Ar,Al=function(u){var c=u[1]&31;return c<<=8,c|=u[2],c},Vr=function(u){return!!(u[1]&64)},Hr=function(u){var c=0;return(u[3]&48)>>>4>1&&(c+=u[4]+1),c},mT=function(u,c){var f=Al(u);return f===0?"pat":f===c?"pmt":c?"pes":null},gT=function(u){var c=Vr(u),f=4+Hr(u);return c&&(f+=u[f]+1),(u[f+10]&31)<<8|u[f+11]},yT=function(u){var c={},f=Vr(u),h=4+Hr(u);if(f&&(h+=u[h]+1),!!(u[h+5]&1)){var p,g,v;p=(u[h+1]&15)<<8|u[h+2],g=3+p-4,v=(u[h+10]&15)<<8|u[h+11];for(var b=12+v;b=u.byteLength)return null;var h=null,p;return p=u[f+7],p&192&&(h={},h.pts=(u[f+9]&14)<<27|(u[f+10]&255)<<20|(u[f+11]&254)<<12|(u[f+12]&255)<<5|(u[f+13]&254)>>>3,h.pts*=4,h.pts+=(u[f+13]&6)>>>1,h.dts=h.pts,p&64&&(h.dts=(u[f+14]&14)<<27|(u[f+15]&255)<<20|(u[f+16]&254)<<12|(u[f+17]&255)<<5|(u[f+18]&254)>>>3,h.dts*=4,h.dts+=(u[f+18]&6)>>>1)),h},La=function(u){switch(u){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}},TT=function(u){for(var c=4+Hr(u),f=u.subarray(c),h=0,p=0,g=!1,v;p3&&(v=La(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},bT={parseType:mT,parsePat:gT,parsePmt:yT,parsePayloadUnitStartIndicator:Vr,parsePesType:_T,parsePesTime:vT,videoPacketContainsKeyFrame:TT},wl=Ar,ki=Yu.handleRollover,re={};re.ts=bT,re.aac=xa;var ui=he.ONE_SECOND_IN_TS,Ue=188,yt=71,ST=function(u,c){for(var f=0,h=Ue,p,g;h=0;){if(u[h]===yt&&(u[p]===yt||p===u.byteLength)){switch(g=u.subarray(h,p),v=re.ts.parseType(g,c.pid),v){case"pes":b=re.ts.parsePesType(g,c.table),S=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&S&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",f.audio.push(C),P=!0));break}if(P)break;h-=Ue,p-=Ue;continue}h--,p--}},xT=function(u,c,f){for(var h=0,p=Ue,g,v,b,S,C,P,M,$,F=!1,G={data:[],size:0};p=0;){if(u[h]===yt&&u[p]===yt){switch(g=u.subarray(h,p),v=re.ts.parseType(g,c.pid),v){case"pes":b=re.ts.parsePesType(g,c.table),S=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&S&&(C=re.ts.parsePesTime(g),C&&(C.type="video",f.video.push(C),F=!0));break}if(F)break;h-=Ue,p-=Ue;continue}h--,p--}},ET=function(u,c){if(u.audio&&u.audio.length){var f=c;(typeof f>"u"||isNaN(f))&&(f=u.audio[0].dts),u.audio.forEach(function(g){g.dts=ki(g.dts,f),g.pts=ki(g.pts,f),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui})}if(u.video&&u.video.length){var h=c;if((typeof h>"u"||isNaN(h))&&(h=u.video[0].dts),u.video.forEach(function(g){g.dts=ki(g.dts,h),g.pts=ki(g.pts,h),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui}),u.firstKeyFrame){var p=u.firstKeyFrame;p.dts=ki(p.dts,h),p.pts=ki(p.pts,h),p.dtsTime=p.dts/ui,p.ptsTime=p.pts/ui}}},CT=function(u){for(var c=!1,f=0,h=null,p=null,g=0,v=0,b;u.length-v>=3;){var S=re.aac.parseType(u,v);switch(S){case"timed-metadata":if(u.length-v<10){c=!0;break}if(g=re.aac.parseId3TagSize(u,v),g>u.length){c=!0;break}p===null&&(b=u.subarray(v,v+g),p=re.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(u.length-v<7){c=!0;break}if(g=re.aac.parseAdtsSize(u,v),g>u.length){c=!0;break}h===null&&(b=u.subarray(v,v+g),h=re.aac.parseSampleRate(b)),f++,v+=g;break;default:v++;break}if(c)return null}if(h===null||p===null)return null;var C=ui/h,P={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+f*1024*C,pts:p+f*1024*C}]};return P},DT=function(u){var c={pid:null,table:null},f={};ST(u,c);for(var h in c.table)if(c.table.hasOwnProperty(h)){var p=c.table[h];switch(p){case wl.H264_STREAM_TYPE:f.video=[],xT(u,c,f),f.video.length===0&&delete f.video;break;case wl.ADTS_STREAM_TYPE:f.audio=[],kl(u,c,f),f.audio.length===0&&delete f.audio;break}}return f},AT=function(u,c){var f=re.aac.isLikelyAacData(u),h;return f?h=CT(u):h=DT(u),!h||!h.audio&&!h.video?null:(ET(h,c),h)},wT={inspect:AT,parseAudioPes_:kl};const kT=function(u,c){c.on("data",function(f){const h=f.initSegment;f.initSegment={data:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength};const p=f.data;f.data=p.buffer,u.postMessage({action:"data",segment:f,byteOffset:p.byteOffset,byteLength:p.byteLength},[f.data])}),c.on("done",function(f){u.postMessage({action:"done"})}),c.on("gopInfo",function(f){u.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:h})}),c.on("audioSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:h})}),c.on("id3Frame",function(f){u.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){u.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){u.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("log",function(f){u.postMessage({action:"log",log:f})})};class Il{constructor(c,f){this.options=f||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Lv.Transmuxer(this.options),kT(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new iT,this.captionParser.init());const f=new Uint8Array(c.data,c.byteOffset,c.byteLength),h=this.captionParser.parse(f,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:f.buffer},[f.buffer])}probeMp4StartTime({timescales:c,data:f}){const h=Ia.startTime(c,f);this.self.postMessage({action:"probeMp4StartTime",startTime:h,data:f},[f.buffer])}probeMp4Tracks({data:c}){const f=Ia.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:f,data:c},[c.buffer])}probeEmsgID3({data:c,offset:f}){const h=Ia.getEmsgID3(c,f);this.self.postMessage({action:"probeEmsgID3",id3Frames:h,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:f}){const h=typeof f=="number"&&!isNaN(f)?f*he.ONE_SECOND_IN_TS:void 0,p=wT.inspect(c,h);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const f=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(f)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const f=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he.secondsToVideoTs(f)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(he.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new Il(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new Il(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var sE=Tp(iE);const rE=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(y.videoFrameDtsTime=l),typeof d<"u"&&(y.videoFramePtsTime=d),t(y)},nE=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},aE=(i,e)=>{e.gopInfo=i.data.gopInfo},xp=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:E,onDone:D,onEndedTimeline:_,onTransmuxerLog:A,isEndOfTimeline:w,segment:O,triggerSegmentEventFn:L}=i,R={buffer:[]};let I=w;const N=q=>{e.currentTransmux===i&&(q.data.action==="data"&&rE(q,R,a),q.data.action==="trackinfo"&&o(q.data.trackInfo),q.data.action==="gopInfo"&&aE(q,R),q.data.action==="audioTimingInfo"&&l(q.data.audioTimingInfo),q.data.action==="videoTimingInfo"&&d(q.data.videoTimingInfo),q.data.action==="videoSegmentTimingInfo"&&m(q.data.videoSegmentTimingInfo),q.data.action==="audioSegmentTimingInfo"&&y(q.data.audioSegmentTimingInfo),q.data.action==="id3Frame"&&T([q.data.id3Frame],q.data.id3Frame.dispatchType),q.data.action==="caption"&&E(q.data.caption),q.data.action==="endedtimeline"&&(I=!1,_()),q.data.action==="log"&&A(q.data.log),q.data.type==="transmuxed"&&(I||(e.onmessage=null,nE({transmuxedData:R,callback:D}),Ep(e))))},V=()=>{const q={message:"Received an error message from the transmuxer worker",metadata:{errorType:k.Error.StreamingFailedToTransmuxSegment,segmentInfo:fi({segment:O})}};D(null,q)};if(e.onmessage=N,e.onerror=V,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const q=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:O}),e.postMessage({action:"push",data:q,byteOffset:X,byteLength:t.byteLength},[q])}w&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Ep=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():xp(i.currentTransmux))},Qc=(i,e)=>{i.postMessage({action:e}),Ep(i)},Cp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Qc(e,i);return}e.transmuxQueue.push(Qc.bind(null,e,i))},oE=i=>{Cp("reset",i)},uE=i=>{Cp("endTimeline",i)},Dp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,xp(i);return}i.transmuxer.transmuxQueue.push(i)},lE=i=>{const e=new sE;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var eo={reset:oE,endTimeline:uE,transmux:Dp,createTransmuxer:lE};const Js=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=ve({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},Et={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Io=i=>{i.forEach(e=>{e.abort()})},cE=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),dE=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Mu=(i,e)=>{const{requestType:t}=e,s=bi({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Et.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Et.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Et.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Et.FAILURE,xhr:e,metadata:s}:null},Jc=(i,e,t,s)=>(r,n)=>{const a=n.response,o=Mu(r,n);if(o)return t(o,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Et.FAILURE,xhr:n},i);const l=new DataView(a),d=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let y=0;y{const t=eu(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:Et.FAILURE,metadata:{mediaType:r}})}Js({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},hE=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=Mu(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Ap(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},fE=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=Mu(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!n.responseText?n.response:eE(n.responseText.substring(i.lastReachedChar||0));return i.stats=cE(n),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},pE=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const D=i.map&&i.map.tracks||{},_=!!(D.audio&&D.video);let A=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let O=s.bind(null,i,"video","start");const L=s.bind(null,i,"video","end"),R=()=>Dp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:I=>{I.type=I.type==="combined"?"video":I.type,m(i,I)},onTrackInfo:I=>{t&&(_&&(I.isMuxed=!0),t(i,I))},onAudioTimingInfo:I=>{A&&typeof I.start<"u"&&(A(I.start),A=null),w&&typeof I.end<"u"&&w(I.end)},onVideoTimingInfo:I=>{O&&typeof I.start<"u"&&(O(I.start),O=null),L&&typeof I.end<"u"&&L(I.end)},onVideoSegmentTimingInfo:I=>{const N={pts:{start:I.start.presentation,end:I.end.presentation},dts:{start:I.start.decode,end:I.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:N}),r(I)},onAudioSegmentTimingInfo:I=>{const N={pts:{start:I.start.pts,end:I.end.pts},dts:{start:I.start.dts,end:I.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:N}),n(I)},onId3:(I,N)=>{a(i,I,N)},onCaptions:I=>{o(i,[I])},isEndOfTimeline:l,onEndedTimeline:()=>{d()},onTransmuxerLog:T,onDone:(I,N)=>{y&&(I.type=I.type==="combined"?"video":I.type,E({type:"segmenttransmuxingcomplete",segment:i}),y(N,i,I))},segment:i,triggerSegmentEventFn:E});Js({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:I=>{i.bytes=e=I.data;const N=I.result;N&&(t(i,{hasAudio:N.hasAudio,hasVideo:N.hasVideo,isMuxed:_}),t=null),R()}})},wp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let D=new Uint8Array(e);if(F1(D)){i.isFmp4=!0;const{tracks:_}=i.map,A={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(A.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(A.videoCodec=_.video.codec),_.video&&_.audio&&(A.isMuxed=!0),t(i,A);const w=(O,L)=>{m(i,{data:D,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),O&&O.length&&o(i,O),y(null,i,{})};Js({action:"probeMp4StartTime",timescales:i.map.timescales,data:D,transmuxer:i.transmuxer,callback:({data:O,startTime:L})=>{e=O.buffer,i.bytes=D=O,A.hasAudio&&!A.isMuxed&&s(i,"audio","start",L),A.hasVideo&&s(i,"video","start",L),Js({action:"probeEmsgID3",data:D,transmuxer:i.transmuxer,offset:L,callback:({emsgData:R,id3Frames:I})=>{if(e=R.buffer,i.bytes=D=R,!_.video||!R.byteLength||!i.transmuxer){w(void 0,I);return}Js({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:D,timescales:i.map.timescales,trackIds:[_.video.id],callback:N=>{e=N.data.buffer,i.bytes=D=N.data,N.logs.forEach(function(V){T(ie(V,{stream:"mp4CaptionParser"}))}),w(N.captions,I)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=eu(D)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}pE({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})},kp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const o=d=>{if(d.data.source===i){s.removeEventListener("message",o);const m=d.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const d="An error occurred in the decryption worker",m=fi({segment:r}),y={message:d,metadata:{error:new Error(d),errorType:k.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},s.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(pp({source:i,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},mE=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),kp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:y},D=>{e.bytes=D,E({type:"segmentdecryptioncomplete",segment:e}),wp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})})},gE=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let D=0,_=!1;return(A,w)=>{if(!_){if(A)return _=!0,Io(i),y(A,w);if(D+=1,D===i.length){const O=function(){if(w.encryptedBytes)return mE({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E});wp({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return E({type:"segmentdecryptionstart",segment:w}),kp({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key,segment:w,doneFn:y},L=>{w.map.bytes=L,E({type:"segmentdecryptioncomplete",segment:w}),Ap(w,R=>{if(R)return Io(i),y(R,w);O()})});O()}}}},yE=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},_E=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=ie(i.stats,dE(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},vE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D,doneFn:_,onTransmuxerLog:A,triggerSegmentEventFn:w})=>{const O=[],L=gE({activeXhrs:O,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D,doneFn:_,onTransmuxerLog:A,triggerSegmentEventFn:w});if(s.key&&!s.key.bytes){const q=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&q.push(s.map.key);const X=ie(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ce=Jc(s,q,L,w),Z={uri:s.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const oe=i(X,ce);O.push(oe)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const oe=ie(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),H=Jc(s,[s.map.key],L,w),ee={uri:s.map.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:ee});const Fe=i(oe,H);O.push(Fe)}const X=ie(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:wo(s.map),requestType:"segment-media-initialization"}),ce=hE({segment:s,finishProcessingFn:L,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const Z=i(X,ce);O.push(Z)}const R=ie(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:wo(s),requestType:"segment"}),I=fE({segment:s,finishProcessingFn:L,responseType:R.responseType,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const N=i(R,I);N.addEventListener("progress",_E({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D})),O.push(N);const V={};return O.forEach(q=>{q.addEventListener("loadend",yE({loadendState:V,abortFn:r}))}),()=>Io(O)},TE=dt("CodecUtils"),bE=function(i){const e=i.attributes||{};if(e.CODECS)return vt(e.CODECS)},Ip=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},SE=(i,e)=>{if(!Ip(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},Ln=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Bd(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){TE(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Zc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Zs=function(i,e){const t=e.attributes||{},s=Ln(bE(e)||[]);if(Ip(i,e)&&!s.audio&&!SE(i,e)){const r=Ln($b(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},Qr=dt("PlaylistSelector"),ed=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},On=function(i,e){if(!i)return"";const t=x.getComputedStyle(i);return t?t[e]:""},Yi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Nu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||x.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||x.Number.MAX_VALUE,t-s},xE=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||x.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||x.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let Pp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;Qe.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(I=>{let N;const V=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.width,q=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.height;return N=I.attributes&&I.attributes.BANDWIDTH,N=N||x.Number.MAX_VALUE,{bandwidth:N,width:V,height:q,playlist:I}});Yi(l,(I,N)=>I.bandwidth-N.bandwidth),l=l.filter(I=>!Qe.isIncompatible(I.playlist));let d=l.filter(I=>Qe.isEnabled(I.playlist));d.length||(d=l.filter(I=>!Qe.isDisabled(I.playlist)));const m=d.filter(I=>I.bandwidth*Ie.BANDWIDTH_VARIANCEI.bandwidth===y.bandwidth)[0];if(r===!1){const I=T||d[0]||l[0];if(I&&I.playlist){let N="sortedPlaylistReps";return T&&(N="bandwidthBestRep"),d[0]&&(N="enabledPlaylistReps"),Qr(`choosing ${ed(I)} using ${N} with options`,a),I.playlist}return Qr("could not choose a playlist with options",a),null}const E=m.filter(I=>I.width&&I.height);Yi(E,(I,N)=>I.width-N.width);const D=E.filter(I=>I.width===t&&I.height===s);y=D[D.length-1];const _=D.filter(I=>I.bandwidth===y.bandwidth)[0];let A,w,O;_||(A=E.filter(I=>I.width>t||I.height>s),w=A.filter(I=>I.width===A[0].width&&I.height===A[0].height),y=w[w.length-1],O=w.filter(I=>I.bandwidth===y.bandwidth)[0]);let L;if(n.leastPixelDiffSelector){const I=E.map(N=>(N.pixelDiff=Math.abs(N.width-t)+Math.abs(N.height-s),N));Yi(I,(N,V)=>N.pixelDiff===V.pixelDiff?V.bandwidth-N.bandwidth:N.pixelDiff-V.pixelDiff),L=I[0]}const R=L||O||_||T||d[0]||l[0];if(R&&R.playlist){let I="sortedPlaylistReps";return L?I="leastPixelDiffRep":O?I="resolutionPlusOneRep":_?I="resolutionBestRep":T?I="bandwidthBestRep":d[0]&&(I="enabledPlaylistReps"),Qr(`choosing ${ed(R)} using ${I} with options`,a),R.playlist}return Qr("could not choose a playlist with options",a),null};const td=function(){let i=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),Pp(this.playlists.main,this.systemBandwidth,parseInt(On(this.tech_.el(),"width"),10)*i,parseInt(On(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},EE=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),Pp(this.playlists.main,e,parseInt(On(this.tech_.el(),"width"),10)*s,parseInt(On(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},CE=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,d=e.playlists.filter(D=>!Qe.isIncompatible(D));let m=d.filter(Qe.isEnabled);m.length||(m=d.filter(D=>!Qe.isDisabled(D)));const T=m.filter(Qe.hasAttribute.bind(null,"BANDWIDTH")).map(D=>{const A=l.getSyncPoint(D,r,o,t)?1:2,O=Qe.estimateSegmentRequestTime(n,s,D)*A-a;return{playlist:D,rebufferingImpact:O}}),E=T.filter(D=>D.rebufferingImpact<=0);return Yi(E,(D,_)=>Nu(_.playlist,D.playlist)),E.length?E[0]:(Yi(T,(D,_)=>D.rebufferingImpact-_.rebufferingImpact),T[0]||null)},DE=function(){const i=this.playlists.main.playlists.filter(Qe.isEnabled);return Yi(i,(t,s)=>Nu(t,s)),i.filter(t=>!!Zs(this.playlists.main,t).video)[0]||null},AE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Lp(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const wE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const d=n[s];d&&(a=d.label,o=d.language,l=d.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:l,label:a,language:o},!1).track}}},kE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},IE=function(i){Object.defineProperties(i.frame,{id:{get(){return k.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return k.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return k.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},PE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=x.WebKitDataCue||x.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||x.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(y,y,T.value||T.url||T.data||"");E.frame=T,E.value=T,IE(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),d=Object.keys(l).sort((m,y)=>Number(m)-Number(y));d.forEach((m,y)=>{const T=l[m],E=isFinite(s)?s:m,D=Number(d[y+1])||E;T.forEach(_=>{_.endTime=D})})},LE={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},OE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),RE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(OE.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:LE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},id=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,k.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Hs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},ME=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},NE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*mi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},BE=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},FE=(i,e,t,s)=>{const r=Math.ceil((e-s)*mi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*mi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},UE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},Fs=1,qE=500,sd=i=>typeof i=="number"&&isFinite(i),Jr=1/60,jE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,VE=(i,e,t)=>{let s=e-Ie.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Ni=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof d=="number",D=i.segment.uri?"segment":"pre-segment",_=E?Jf({preloadSegment:s})-1:0;return`${D} [${n+l}/${n+y}]`+(E?` part [${d}/${_}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},rd=i=>`${i}TimingInfo`,HE=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},zE=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},GE=i=>{i&&(i.pause(),i.resetEverything(),i.load())},WE=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=i.pendingSegment_;if(!e)return;if(Po({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&zE(i.timelineChangeController_)){if(WE(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}GE(i)}},KE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=x.BigInt(n)-x.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+St:!1,XE=(i,e)=>{if(e!=="hls")return null;const t=KE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=nd({segmentDuration:t,maxDuration:s*2}),n=nd({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. 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||n?{severity:r?"warn":"info",message:a}:null},fi=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class Lo extends k.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=dt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Xt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(ve({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Xt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(ve({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Xt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Xt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return eo.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,x.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&eo.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Re();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=Pn(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=mp(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${Ja(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&eo.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=FE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Hs(e,t,this.inbandTextTracks_[o]);Hs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),qE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:fi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ja(e)||0,s=Pu(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=$E(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=E+1):o.mediaIndex=this.mediaIndex+1}else{let T,E,D;const _=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${_}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const A=this.getSyncInfoFromMediaSequenceSync_(_);if(!A){const w="No sync info found while using media sequence sync";return this.error({message:w,metadata:{errorType:k.Error.StreamingFailedToSelectNextSegment,error:new Error(w)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${A.start} --> ${A.end})`),T=A.segmentIndex,E=A.partIndex,D=A.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const A=Qe.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:_,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=A.segmentIndex,E=A.partIndex,D=A.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${_}`:`currentTime ${_}`,o.mediaIndex=T,o.startOfSegment=D,o.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let d=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!d)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,d=l.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&d&&!m&&!d.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:d}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:d,independent:t},E=typeof l<"u"?l:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const D=Ja(this.sourceUpdater_.audioBuffered());return typeof D=="number"&&(T.audioAppendStart=D-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=NE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return HE(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=Qe.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=fx(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=CE({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const d=n-a-o.rebufferingImpact;let m=.5;a<=St&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||d{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:d}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),wE(m,this.vhs_.tech_,a),Hs(o,l,m[a]),kE({captionArray:d,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Po({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Po({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Xt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const 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[rd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.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,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=Pn(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+gi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+gi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,d=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(l-o<=Fs&&m-d<=Fs){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${gi(n).join(", ")}, video buffer: ${gi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Fs;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Fs}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Fs*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===lp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:k.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const o=[r];let l=r.byteLength;s&&(o.unshift(s),l+=s.byteLength),n=AE({bytes:l,segments:o})}const a={segmentInfo:fi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Xt(this),this.loadQueue_.push(()=>{const t=ve({},e,{forceTimestampOffset:!0});ve(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting +${Lp(e.uri)} +${Ni(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=vE({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:d})=>{this.logger_(`${Ni(e)} logged from transmuxer stream ${d} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:d,trackInfo:m,timingInfo:y})=>{const E={segmentInfo:fi({segment:l})};d&&(E.keyInfo=d),m&&(E.trackInfo=m),y&&(E.timingInfo=y),this.trigger({type:o,metadata:E})}})}trimBackBuffer_(e){const t=VE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||d.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=jE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:fi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=XE(e,this.sourceType_);if(t&&(t.severity==="warn"?k.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Ni(e)}`);return}this.logger_(`Appended ${Ni(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Ni(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},YE=["video","audio"],Oo=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},QE=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Qi("audio",e),Qi("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Oo(i,e))){if(s.type!==i){if(t=QE(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Qi(i,e);return}}},Rp=(i,e)=>{const t=e[`${i}Buffer`],s=Op(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Tt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,tt={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(Tt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===lp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(Tt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];Tt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){k.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){k.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(Tt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){k.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Op(i),r=Ji(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Rp(i,e),!!Tt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){k.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Ji(i);if(!Tt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(d){l.errorType=k.Error.StreamingCodecsChangeError,l.error=d,d.metadata=l,t.error_=d,t.trigger("error"),k.log.warn(`Failed to changeType on ${e}Buffer`,d)}}},it=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Qi(i,e)},ad=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=cx(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Qi(i,e)};class Mp extends k.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Qi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=dt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=ad("video",this),this.onAudioUpdateEnd_=ad("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){it({type:"mediaSource",sourceUpdater:this,action:tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){it({type:e,sourceUpdater:this,action:tt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){k.log.error("removeSourceBuffer is not supported!");return}it({type:"mediaSource",sourceUpdater:this,action:tt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!k.browser.IS_FIREFOX&&x.MediaSource&&x.MediaSource.prototype&&typeof x.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return x.SourceBuffer&&x.SourceBuffer.prototype&&typeof x.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){k.log.error("changeType is not supported!");return}it({type:e,sourceUpdater:this,action:tt.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(it({type:r,sourceUpdater:this,action:tt.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return Tt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Re()}videoBuffered(){return Tt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Re()}buffered(){const e=Tt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Tt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():hx(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Nt){it({type:"mediaSource",sourceUpdater:this,action:tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Nt){typeof e!="string"&&(e=void 0),it({type:"mediaSource",sourceUpdater:this,action:tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Nt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}it({type:"audio",sourceUpdater:this,action:tt.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Nt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}it({type:"video",sourceUpdater:this,action:tt.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(Oo("audio",this)||Oo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(it({type:"audio",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(it({type:"video",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&it({type:"audio",sourceUpdater:this,action:tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&it({type:"video",sourceUpdater:this,action:tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),YE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Rp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const od=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),JE=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},ud=new Uint8Array(` + +`.split("").map(i=>i.charCodeAt(0)));class ZE extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class eC extends Lo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Re();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Re([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=Pn(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=ud.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(ud,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Hs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Et.TIMEOUT&&this.handleTimeout_(),e.code===Et.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof x.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:k.Error.StreamingVttParserError,error:a}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new x.VTTCue(a.startTime,a.endTime,a.text):a)}),ME(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof x.WebVTT!="function")throw new ZE;typeof x.TextDecoder=="function"?t=new x.TextDecoder("utf8"):(t=x.WebVTT.StringDecoder(),s=!0);const r=new x.WebVTT.Parser(x,x.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{k.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=od(a)),r.parse(a)}let n=e.bytes;s&&(n=od(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/mi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(d=>{const m=d.endTime-d.startTime,y=this.handleRollover_(d.startTime+l,t.time);d.startTime=Math.max(y,0),d.endTime=Math.max(y+m,0)}),!s.syncInfo){const d=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(d,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*mi.ONE_SECOND_IN_TS;const r=t*mi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/mi.ONE_SECOND_IN_TS}}const tC=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},iC=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Np{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=` +`,a=s,o=t;this.start_=a,e.forEach((l,d)=>{const m=this.storage_.get(o),y=a,T=y+l.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),D=new ld({start:y,end:T,appended:E,segmentIndex:d});l.syncInfo=D;let _=a;const A=(l.parts||[]).map((w,O)=>{const L=_,R=_+w.duration,I=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[O]&&m.partsSyncInfo[O].isAppended),N=new ld({start:L,end:R,appended:I,segmentIndex:d,partIndex:O});return _=R,n+=`Media Sequence: ${o}.${O} | Range: ${L} --> ${R} | Appended: ${I} +`,w.syncInfo=N,N});r.set(o,new sC(D,A)),n+=`${Lp(l.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${E} +`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class cd extends Np{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const rC=86400,to=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=xo(e);r=r||0;for(let l=0;l{let n=null,a=null;r=r||0;const o=xo(e);for(let l=0;l=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class nC extends k.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Np,s=new cd(t),r=new cd(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=dt("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return to.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:d}=o,{segmentIndex:m,time:y}=l;if(m<0)continue;const T=e.segments[m],E=y,D=E+T.duration;if(this.logger_(`Strategy: ${d}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${D}]}`),r>=E&&r0&&(r.time*=-1),Math.abs(r.time+Qs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;orC){k.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||ol){let d;o<0?d=s.start-Qs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):d=s.end+Qs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:d,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class aC extends k.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const oC=bp(Sp(function(){var i=function(){function _(){this.listeners={}}var A=_.prototype;return A.on=function(O,L){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push(L)},A.off=function(O,L){if(!this.listeners[O])return!1;var R=this.listeners[O].indexOf(L);return this.listeners[O]=this.listeners[O].slice(0),this.listeners[O].splice(R,1),R>-1},A.trigger=function(O){var L=this.listeners[O];if(L)if(arguments.length===2)for(var R=L.length,I=0;I>7)*283)^R]=R;for(I=N=0;!O[I];I^=X||1,N=q[N]||1)for(oe=N^N<<1^N<<2^N<<3^N<<4,oe=oe>>8^oe&255^99,O[I]=oe,L[oe]=I,Z=V[ce=V[X=V[I]]],ee=Z*16843009^ce*65537^X*257^I*16843008,H=V[oe]*257^oe*16843008,R=0;R<4;R++)A[R][I]=H=H<<24^H>>>8,w[R][oe]=ee=ee<<24^ee>>>8;for(R=0;R<5;R++)A[R]=A[R].slice(0),w[R]=w[R].slice(0);return _};let s=null;class r{constructor(A){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let w,O,L;const R=this._tables[0][4],I=this._tables[1],N=A.length;let V=1;if(N!==4&&N!==6&&N!==8)throw new Error("Invalid aes key size");const q=A.slice(0),X=[];for(this._key=[q,X],w=N;w<4*N+28;w++)L=q[w-1],(w%N===0||N===8&&w%N===4)&&(L=R[L>>>24]<<24^R[L>>16&255]<<16^R[L>>8&255]<<8^R[L&255],w%N===0&&(L=L<<8^L>>>24^V<<24,V=V<<1^(V>>7)*283)),q[w]=q[w-N]^L;for(O=0;w;O++,w--)L=q[O&3?w:w-4],w<=4||O<4?X[O]=L:X[O]=I[0][R[L>>>24]]^I[1][R[L>>16&255]]^I[2][R[L>>8&255]]^I[3][R[L&255]]}decrypt(A,w,O,L,R,I){const N=this._key[1];let V=A^N[0],q=L^N[1],X=O^N[2],ce=w^N[3],Z,oe,H;const ee=N.length/4-2;let Fe,te=4;const Te=this._tables[1],Pt=Te[0],ii=Te[1],si=Te[2],ri=Te[3],ni=Te[4];for(Fe=0;Fe>>24]^ii[q>>16&255]^si[X>>8&255]^ri[ce&255]^N[te],oe=Pt[q>>>24]^ii[X>>16&255]^si[ce>>8&255]^ri[V&255]^N[te+1],H=Pt[X>>>24]^ii[ce>>16&255]^si[V>>8&255]^ri[q&255]^N[te+2],ce=Pt[ce>>>24]^ii[V>>16&255]^si[q>>8&255]^ri[X&255]^N[te+3],te+=4,V=Z,q=oe,X=H;for(Fe=0;Fe<4;Fe++)R[(3&-Fe)+I]=ni[V>>>24]<<24^ni[q>>16&255]<<16^ni[X>>8&255]<<8^ni[ce&255]^N[te++],Z=V,V=q,q=X,X=ce,ce=Z}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(_){return _<<24|(_&65280)<<8|(_&16711680)>>8|_>>>24},o=function(_,A,w){const O=new Int32Array(_.buffer,_.byteOffset,_.byteLength>>2),L=new r(Array.prototype.slice.call(A)),R=new Uint8Array(_.byteLength),I=new Int32Array(R.buffer);let N,V,q,X,ce,Z,oe,H,ee;for(N=w[0],V=w[1],q=w[2],X=w[3],ee=0;ee{const O=_[w];T(O)?A[w]={bytes:O.buffer,byteOffset:O.byteOffset,byteLength:O.byteLength}:A[w]=O}),A};self.onmessage=function(_){const A=_.data,w=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),O=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),L=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new l(w,O,L,function(R,I){self.postMessage(D({source:A.source,decrypted:I}),[I.buffer])})}}));var uC=Tp(oC);const lC=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Bp=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Ro=(i,e)=>{e.activePlaylistLoader=i,i.load()},cC=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,Bp(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),Ro(a.playlistLoader,r)}},dC=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},hC=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,d=n.lastTrack_;if(!(d&&a&&d.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,Bp(s,n),!!o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Ro(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Ro(o.playlistLoader,n)}},Rn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}k.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;k.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},dd={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Rn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Rn[i](i,t))}},fC={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:m}=e,y=_r(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const E in a[i][T]){let D=a[i][T][E],_;if(y?(d(`AUDIO group '${T}' label '${E}' is a main playlist`),D.isMainPlaylist=!0,_=null):s==="vhs-json"&&D.playlists?_=new Vi(D.playlists[0],t,n):D.resolvedUri?_=new Vi(D.resolvedUri,t,n):D.playlists&&s==="dash"?_=new ko(D.playlists[0],t,n,m):_=null,D=ie({id:E,playlistLoader:_},D),dd[i](i,D.playlistLoader,e),o[T].push(D),typeof l[E]>"u"){const A=new k.AudioTrack({id:E,kind:lC(D),enabled:!1,language:D.language,default:D.default,label:E});l[E]=A}}}r.on("error",Rn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:d}},mainPlaylistLoader:m}=e;for(const y in o[i]){l[y]||(l[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let E=o[i][y][T],D;if(r==="hls")D=new Vi(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(A=>A.excludeUntil!==1/0).length)return;D=new ko(E.playlists[0],s,a,m)}else r==="vhs-json"&&(D=new Vi(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=ie({id:T,playlistLoader:D},E),dd[i](i,E.playlistLoader,e),l[y].push(E),typeof d[T]>"u"){const _=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;d[T]=_}}}n.on("error",Rn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const l=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const d=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[m.instreamId]&&(m=ie(m,d[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(ie({id:o},l)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},Fp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&_r(e.main))for(let l=0;l"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},mC={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},gC=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},yC=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(d=>{fC[d](d,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(d=>{e[d].activeGroup=pC(d,i),e[d].activeTrack=mC[d](d,i),e[d].onGroupChanged=cC(d,i),e[d].onGroupChanging=dC(d,i),e[d].onTrackChanged=hC(d,i),e[d].getActiveGroup=gC(d,i)});const o=e.AUDIO.activeGroup();if(o){const d=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[d].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const d in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[d])},_C=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Nt,activeTrack:Nt,getActiveGroup:Nt,onGroupChanged:Nt,onTrackChanged:Nt,lastTrack_:null,logger_:dt(`MediaGroups[${e}]`)}}),i};class hd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ye(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class vC extends k.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new hd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=dt("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ye(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const d=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${d} seconds.`),this.startTTLTimeout_(parseInt(d,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(d){const m={errorType:k.Error.StreamingContentSteeringParserError,error:d};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new x.URL(e),s=new x.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new x.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new hd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ye(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const TC=10;let Rt;const bC=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],SC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},xC=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return k.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return l(`${d} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!ji(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${d} as current playlist is live`),!0);const y=Pu(e,t),T=o?Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ie.MAX_BUFFER_LOW_WATER_LINE;if(aD)&&y>=r){let _=`${d} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(_+=` and next bandwidth > current bandwidth (${E} > ${D})`),l(_),!0}return l(`not ${d} as no switching criteria met`),!1};class EC extends k.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:d,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:D,experimentalUseMMS:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=e;(A===null||typeof A>"u")&&(A=1/0),Rt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=d,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=_C(),_&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,k.log("Using ManagedMediaSource")):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Re(),this.hasPlayed_=!1,this.syncController_=new nC(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new uC,this.sourceUpdater_=new Mp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new aC,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:D,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new ko(t,this.vhs_,ie(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Vi(t,this.vhs_,ie(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Lo(ie(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Lo(ie(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new eC(ie(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((R,I)=>{function N(){r.off("vttjserror",V),R()}function V(){r.off("vttjsloaded",N),I()}r.one("vttjsloaded",N),r.one("vttjserror",V),r.addWebVttScript_()})}),e);const O=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new vC(this.vhs_.xhr,O),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),bC.forEach(R=>{this[R+"_"]=SC.bind(this,R)}),this.logger_=dt("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{const R=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-R,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const l=s[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let d=0;d{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;Eo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),yC({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;Eo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(ve({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Rt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return xC({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:TC}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Rt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=xt;const o=a.end(a.length-1);return o-n<=xt&&r-o<=xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(oa),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return k.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const D=this.pathwayAttribute_(e),_=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(D),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(D)},_);return}let E=!1;r.forEach(D=>{if(D===e)return;const _=D.excludeUntil;typeof _<"u"&&_!==1/0&&(E=!0,delete D.excludeUntil)}),E&&(k.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const d=t.internal?this.logger_:k.log.warn,m=t.message?" "+t.message:"";d(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=l.targetDuration/2*1e3||5*1e3,T=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=y;return this.switchMedia_(l,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=ji(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Rt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Rt.Playlist.seekable(t,s,Rt.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Rt.Playlist.seekable(t,s,Rt.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Re([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Zs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||jb),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Wl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Wl,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(d,m)=>d?Ws(m):Fa(m),o={};let l;if(["video","audio"].forEach(function(d){if(r.hasOwnProperty(d)&&!a(e[d].isFmp4,r[d])){const m=e[d].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[d]),d==="audio"&&(l=m)}}),n&&l&&t.attributes.AUDIO){const d=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===d&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${d} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const d=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:d},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const d=[];if(["video","audio"].forEach(m=>{const y=(vt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(vt(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&d.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),d.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${d.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Zs(this.main,r),a=[];n.audio&&!Fa(n.audio)&&!Ws(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Fa(n.video)&&!Ws(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=Ln(vt(e)),n=Zc(r),a=r.video&&vt(r.video)[0]||null,o=r.audio&&vt(r.audio)[0]||null;Object.keys(s).forEach(l=>{const d=s[l];if(t.indexOf(d.id)!==-1||d.excludeUntil===1/0)return;t.push(d.id);const m=[],y=Zs(this.mainPlaylistLoader_.main,d),T=Zc(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&vt(y.video)[0]||null,D=y.audio&&vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),D&&o&&D.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${D.type}" !== "${o.type}"`)}m.length&&(d.excludeUntil=1/0,this.logger_(`excluding ${d.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),iC(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ie.GOAL_BUFFER_LENGTH,s=Ie.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ie.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ie.BUFFER_LOW_WATER_LINE,s=Ie.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ie.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ie.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){id(this.inbandTextTracks_,"com.apple.streaming",this.tech_),RE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();id(this.inbandTextTracks_,e,this.tech_),PE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(ve({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],l=this.pathwayAttribute_(o),d=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!d&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&d&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=s.get(a);if(!l){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&l&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,k.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:JE(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const CC=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Ou(r),a=oa(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(t(r),s?i.trigger({type:"renditionenabled",metadata:o}):i.trigger({type:"renditiondisabled",metadata:o})),s};class DC{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Zs(r.main(),t),this.playlist=t,this.id=s,this.enabled=CC(e.playlists,t.id,n)}}const AC=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=_r(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Ou(s)).map((s,r)=>new DC(i,s,s.id)):[]}},fd=["seeking","seeked","pause","playing","error"];class wC extends k.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=dt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(m=>{l[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",l[m].reset),this.tech_.on(["seeked","seeking"],l[m].reset)});const d=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(fd,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(fd,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",l[m].reset),this.tech_.off(["seeked","seeking"],l[m].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=px(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:gi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Re([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const D=t.start(0);n=D+(D===t.end(0)?0:xt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${Yf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,d=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-St)*2,T=[l,d];for(let D=0;D ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Yr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+xt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const kC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},Up=function(i,e){let t=0,s=0;const r=ie(kC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ge,i,{get(){return k.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ie[i]},set(e){if(k.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){k.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ie[i]=e}})});const qp="videojs-vhs",jp=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),jp(i,e.playlists)};ge.canPlaySource=function(){return k.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const NC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=Ln(vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Ji(s.video),n=Ji(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return ie(i,a)},BC=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),FC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=BC(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((d,m)=>{i.tech_.one("keysessioncreated",d)})),a.push(new Promise((d,m)=>{i.eme.initializeMediaKeys({keySystems:l},y=>{if(y){m(y);return}d()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},UC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=NC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(k.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Vp=()=>{if(!x.localStorage)return null;const i=x.localStorage.getItem(qp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},$C=i=>{if(!x.localStorage)return!1;let e=Vp();e=e?ie(e,i):i;try{x.localStorage.setItem(qp,JSON.stringify(e))}catch{return!1}return e},qC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,Hp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},zp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Gp=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Wp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!U||!U.createElement)return!1;const i=U.createElement("video");return k.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!U||!U.createElement||!k.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(U.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return k.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){Hp(ge.xhr,i)};ge.xhr.onResponse=function(i){zp(ge.xhr,i)};ge.xhr.offRequest=function(i){Gp(ge.xhr,i)};ge.xhr.offResponse=function(i){Wp(ge.xhr,i)};const jC=k.getComponent("Component");class Kp extends jC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=dt("VhsHandler"),t.options_&&t.options_.playerId){const r=k.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(U,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=U.fullscreenElement||U.webkitFullscreenElement||U.mozFullScreenElement||U.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ie(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!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,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=Vp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ie.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ie.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=qC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=Ud(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new EC(this.options_);const s=ie({liveRangeSafeTimeDelta:xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new wC(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=k.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){k.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>gi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>gi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&$C({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{AC(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),FC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=UC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=k.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{MC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{jp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":$p,"mux.js":PC,"mpd-parser":LC,"m3u8-parser":OC,"aes-decrypter":RC}}version(){return this.constructor.version()}canChangeType(){return Mp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return zx({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return _p({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Hp(this.xhr,e)},this.xhr.onResponse=e=>{zp(this.xhr,e)},this.xhr.offRequest=e=>{Gp(this.xhr,e)},this.xhr.offResponse=e=>{Wp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(ve({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(ve({},r))})})}}const Mn={name:"videojs-http-streaming",VERSION:$p,canHandleSource(i,e={}){const t=ie(k.options,e);return!t.vhs.experimentalUseMMS&&!Ws("avc1.4d400d,mp4a.40.2",!1)?!1:Mn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=ie(k.options,t);return e.vhs=new Kp(i,e,s),e.vhs.xhr=fp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Ud(i);if(!t)return"";const s=Mn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(k.browser.IS_ANY_SAFARI||k.browser.IS_IOS),{overrideNative:s=t}=e;return s}},VC=()=>Ws("avc1.4d400d,mp4a.40.2",!0);VC()&&k.getTech("Html5").registerSourceHandler(Mn,0);k.VhsHandler=Kp;k.VhsSourceHandler=Mn;k.Vhs=ge;k.use||k.registerComponent("Vhs",ge);k.options.vhs=k.options.vhs||{};(!k.getPlugin||!k.getPlugin("reloadSourceOnError"))&&k.registerPlugin("reloadSourceOnError",IC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function Nn(){return Nn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var KC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new x.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),l=0;l"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(E,D){if(s.keySystem=a.keySystem,T=md(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){E(a);return}T.getCertificate(o,function(_,A){if(_){D(_);return}y=A,E()})}).then(function(){return a.createMediaKeys()}).then(function(E){return JC({player:t,video:s,certificate:y,createdMediaKeys:E})}).catch(function(E){return E?Promise.reject(E):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var E=md(s.keySystem,o.keySystems[s.keySystem]),D=E.getLicense;return QC({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?tD(D,d):null,removeSession:l,eventBus:d})})},Fu="com.apple.fps.1_0",sD=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=HC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),l=new Uint8Array(a,n,t.byteLength);l.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var d=new Uint16Array(a,n,s.length);d.set(s),n+=d.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},rD=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,l=e.eventBus;return new Promise(function(d,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new x.WebKitMediaKeys(Fu))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",sD({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}l.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(E,D){if(l&&l.trigger("licenserequestattempted"),E){m(E);return}y.update(new Uint8Array(D))})}),y.addEventListener("webkitkeyadded",function(){d()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},nD=function(e){return function(t,s){var r=ua(t.emeHeaders,e.certificateHeaders);k.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},ds(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},aD=function(e,t){return GC(zC(t))},oD=function(e){return function(t,s,r,n){var a=ua({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);k.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},ds(n,!0))}},uD=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Fu],o=a.getCertificate||nD(a),l=a.getContentId||aD,d=a.getLicense||oD(a);return new Promise(function(m,y){o(r,function(T,E){if(T){y(T);return}m(E)})}).then(function(m){return rD({video:t,cert:m,initData:s,getLicense:d,options:r,contentId:l(r,s),eventBus:n})})},Hi="com.microsoft.playready",lD=function(e,t,s,r){var n=e.keySystems[Hi];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,l){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(l)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(l,d){if(r&&r.trigger("licenserequestattempted"),l){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(d))};n.getLicense?n.getLicense(e,s.message.buffer,a):Xp(n,s.message.buffer,e,a)},cD=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){lD(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},dD=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new x.MSMediaKeys(Hi))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}cD(e,t,s,r)},hD="3.11.2",fD=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function _d(i,e){if(i==null)return{};var t=bD(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var SD="1.14.0";const xD=k.getComponent("player");class ED extends xD{constructor(e,t,s){t=k.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}k.registerComponent("player",ED);const ae=k;ae.VERSION={pillarbox:SD,videojs:k.VERSION,[k.VhsSourceHandler.name]:k.VhsSourceHandler.VERSION,eme:k.getPlugin("eme").VERSION};ae.options.enableSmoothSeeking=!0;ae.options.fill=!0;ae.options.html5={vhs:{useForcedSubtitles:!0}};ae.options.liveTracker={trackingThreshold:120,liveTolerance:15};ae.options.liveui=!0;ae.options.playsinline=!0;ae.options.responsive=!0;ae.options.trackers={};class vd{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=Ui(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Bi={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},en={JPG:"jpg",WEBP:"webp",PNG:"png"},CD="https://il.srgssr.ch/images/";class DD{static scale({url:e,width:t=Bi.WIDTH_960,format:s=en.JPG}={},r=CD){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return en.JPG}static get PNG(){return en.PNG}static get WEBP(){return en.WEBP}static get WIDTH_240(){return Bi.WIDTH_240}static get WIDTH_320(){return Bi.WIDTH_320}static get WIDTH_480(){return Bi.WIDTH_480}static get WIDTH_960(){return Bi.WIDTH_960}static get WIDTH_1920(){return Bi.WIDTH_1920}}const AD={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class or{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=or.vendors[s.type];if(or.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return AD}}const tn={AKAMAI:"AKAMAI",NONE:"NONE"};class Si{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return tn.AKAMAI}static hasToken(e){return e.some(t=>Si.isAkamai(t.tokenType))}static isAkamai(e){return tn.AKAMAI===e}static isNone(e){return tn.NONE===e}static get NONE(){return tn.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=Si.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((l,d)=>s.searchParams.set(d,l)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=Si.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const Td="emptied",bd="ended",Sd="loadeddata",xd="loadstart",io="pause",wD="play",so="playing",Ed="ratechange",Cd="seeking",ro="timeupdate",Dd="waiting";class pi{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(Td,this.emptiedListener),this.player.off(bd,this.endedListener),this.player.off(xd,this.loadstartListener),this.player.off(Sd,this.loadeddataListener),this.player.off(so,this.playListener),this.player.off(io,this.pauseListener),this.player.off(Ed,this.rateChangeListener),this.player.off(Cd,this.seekingListener),this.player.off(ro,this.timeUpdateListener),this.player.off(Dd,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=pi.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:pi.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[wD,io].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(Td,this.emptiedListener),this.player.on(bd,this.endedListener),this.player.on(xd,this.loadstartListener),this.player.on(Sd,this.loadeddataListener),this.player.on(so,this.playListener),this.player.on(io,this.pauseListener),this.player.on(Ed,this.rateChangeListener),this.player.on(Cd,this.seekingListener),this.player.on(ro,this.timeUpdateListener),this.player.on(Dd,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&&ethis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===pi.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=pi.now()),this.mediaSession===0&&(this.mediaSession=pi.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),ae.browser.IS_ANY_SAFARI?this.player.one(ro,e):this.player.one(so,e)}}class Ce{constructor(e,{playerName:t="none",playerVersion:s="none",platform:r="Web",schemaVersion:n=1,heartbeatInterval:a=3e4,beaconUrl:o="https://monitoring.pillarbox.ch/api/events"}={}){this.player=e,this.playerName=t,this.playerVersion=s,this.platform=r,this.schemaVersion=n,this.heartbeatInterval=a,this.beaconUrl=o,this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=void 0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.tokenRequestTime=0,this.addListeners()}addListeners(){this.bindCallBacks(),this.player.on("loadstart",this.loadStart),this.player.on("loadeddata",this.loadedData),this.player.on("playing",this.playbackStart),this.player.on("pause",this.playbackStop),this.player.on("error",this.error),this.player.on(["playerreset","dispose","ended"],this.sessionStop),this.player.on(["waiting","stalled"],this.stalled),window.addEventListener("beforeunload",this.sessionStop)}bandwidth(){const e=this.player.tech(!0).vhs?this.player.tech(!0).vhs.stats:void 0;return e?e.bandwidth:void 0}bindCallBacks(){this.error=this.error.bind(this),this.loadedData=this.loadedData.bind(this),this.loadStart=this.loadStart.bind(this),this.playbackStart=this.playbackStart.bind(this),this.playbackStop=this.playbackStop.bind(this),this.stalled=this.stalled.bind(this),this.sessionStop=this.sessionStop.bind(this)}bufferDuration(){const e=this.player.buffered();let t=0;for(let s=0;ss==="metadata"&&t==="segment-metadata")||{};return e?e.value:void 0}currentResource(){let{bandwidth:e,uri:t}=this.currentRepresentation()||{};if(ae.browser.IS_ANY_SAFARI){const{configuration:s}=Array.from(this.player.videoTracks()).find(r=>r.selected)||{};e=s?s.bitrate:void 0,t=this.player.currentSource().src}return{bitrate:e,url:t}}currentSourceMediaData(){return this.player.currentSource().mediaData?this.player.currentSource().mediaData:{}}error(){const e=this.player.error(),t=this.playbackPosition(),s=this.currentRepresentation(),r=s?s.uri:this.player.currentSource().src;this.player.hasStarted()||this.sendEvent("START",this.startEventData()),this.sendEvent("ERROR",we(we({log:JSON.stringify(e.metadata||ae.log.history().slice(-15)),message:e.message,name:e.code},t),{},{url:r})),this.reset()}getDrmRequestDuration(){const e=Object.values(this.player.currentSource().keySystems||{}).map(s=>s.url);if(!e.length)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="xmlhttprequest"&&e.includes(r)).pop();return t&&t.duration}getMetadataInfo(e){const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes(e)).pop();return t?{name:t.name,duration:t.duration}:{}}getTokenRequestDuration(e){if(!e)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes("/akahd/token")).pop();return t&&t.duration}heartbeat(){this.heartbeatIntervalId=setInterval(()=>{this.sendEvent("HEARTBEAT",this.statusEventData())},this.heartbeatInterval)}isTrackerDisabled(){const e=this.player.currentSource();return Array.isArray(e.disableTrackers)?!!e.disableTrackers.find(t=>t.toLowerCase()===Ce.name.toLowerCase()):!!e.disableTrackers}loadedData(){this.sendEvent("START",this.startEventData()),this.sendEvent("HEARTBEAT",this.statusEventData()),this.heartbeat()}loadStart(){!Object.keys(this.currentSourceMediaData()).length&&this.currentSessionId&&(this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp()),this.loadStartTimestamp=Ce.timestamp()}mediaInfo(){return{asset_url:this.mediaAssetUrl,id:this.mediaId,metadata_url:this.mediaMetadataUrl,origin:this.mediaOrigin}}playbackDuration(){return this.lastPlaybackStartTimestamp?Ce.timestamp()+this.lastPlaybackDuration-this.lastPlaybackStartTimestamp:this.lastPlaybackDuration}playbackPosition(){const e=this.currentRepresentation(),t=Ce.secondsToMilliseconds(this.player.currentTime());let s;if(e&&(s=e.programDateTime),ae.browser.IS_ANY_SAFARI){const r=Date.parse(this.player.$("video").getStartDate());s=isNaN(r)?void 0:r+t}return{position:t,position_timestamp:s}}playbackStart(){this.lastPlaybackStartTimestamp=Ce.timestamp()}playbackStop(){this.lastPlaybackDuration+=Ce.timestamp()-this.lastPlaybackStartTimestamp,this.lastPlaybackStartTimestamp=0}playerCurrentDimensions(){return this.player.currentDimensions()}playerInfo(){return{name:this.playerName,version:this.playerVersion,platform:this.platform}}qoeTimings(e,t){return{metadata:this.metadataRequestTime,asset:e,total:t-this.sessionStartTimestamp}}qosTimings(e){return{asset:e,drm:this.getDrmRequestDuration(),metadata:this.metadataRequestTime,token:this.tokenRequestTime}}removeListeners(){this.player.off("loadstart",this.loadStart),this.player.off("loadeddata",this.loadedData),this.player.off("playing",this.playbackStart),this.player.off("pause",this.playbackStop),this.player.off("error",this.error),this.player.off(["playerreset","dispose","ended"],this.sessionStop),this.player.off(["waiting","stalled"],this.stalled),window.removeEventListener("beforeunload",this.sessionStop)}removeTokenFromAssetUrl(e){if(e)try{const t=new URL(e);return t.searchParams.delete("hdnts"),t.href}catch{return}}reset(e){this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.sessionStartTimestamp=void 0,this.tokenRequestTime=0,clearInterval(this.heartbeatIntervalId),e&&!["ended","playerreset"].includes(e.type)&&this.removeListeners()}sendEvent(e,t={}){if(this.isTrackerDisabled()&&!this.currentSessionId||!this.currentSessionId)return;const s=JSON.stringify({event_name:e,session_id:this.currentSessionId,timestamp:Ce.timestamp(),version:this.schemaVersion,data:t});navigator.sendBeacon(this.beaconUrl,s)}sessionStart(){this.sessionStartTimestamp&&this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp(),this.mediaId=this.player.currentSource().src||void 0}sessionStop(e){this.sendEvent("STOP",this.statusEventData()),this.reset(e)}stalled(){if(!this.player.hasStarted()||this.player.seeking()||this.isStalled)return;this.isStalled=!0;const e=Ce.timestamp(),t=()=>{const s=Ce.timestamp();this.isStalled=!1,this.lastStallCount+=1,this.lastStallDuration+=s-e};ae.browser.IS_ANY_SAFARI?this.player.one("timeupdate",t):this.player.one("playing",t)}stallInfo(){return{count:this.lastStallCount,duration:this.lastStallDuration}}statusEventData(){const e=this.bandwidth(),t=this.bufferDuration(),{bitrate:s,url:r}=this.currentResource(),{droppedVideoFrames:n}=this.player.getVideoPlaybackQuality(),a=this.playbackDuration(),{position:o,position_timestamp:l}=this.playbackPosition(),d=isFinite(this.player.duration())?"On-demand":"Live",m=this.stallInfo();return{bandwidth:e,bitrate:s,buffered_duration:t,frame_drops:n,playback_duration:a,position:o,position_timestamp:l,stall:m,stream_type:d,url:r}}startEventData(){const e=Ce.timestamp(),t=this.loadStartTimestamp?e-this.loadStartTimestamp:0;return this.isTrackerDisabled()||(this.currentSessionId=Ce.sessionId()),this.mediaAssetUrl=this.removeTokenFromAssetUrl(this.player.currentSource().src),this.mediaMetadataUrl=this.getMetadataInfo(this.mediaId).name,this.metadataRequestTime=this.getMetadataInfo(this.mediaId).duration,this.mediaOrigin=window.location.href,this.tokenRequestTime=this.getTokenRequestDuration(this.currentSourceMediaData().tokenType),{browser:Ce.userAgent(),device:{id:Ce.deviceId()},media:this.mediaInfo(),player:this.playerInfo(),qoe_timings:this.qoeTimings(t,e),qos_timings:this.qosTimings(t),screen:this.playerCurrentDimensions()}}static sessionId(){return Ce.randomUUID()}static deviceId(){if(!localStorage)return;const e="pillarbox_device_id";let t=localStorage.getItem(e);return t||(t=Ce.randomUUID(),localStorage.setItem(e,t)),t}static randomUUID(){return crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static secondsToMilliseconds(e){return parseInt(e*1e3)}static timestamp(){return Date.now()}static userAgent(){return{user_agent:navigator.userAgent}}}class kD{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return we(we(we({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return we(we(we({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var em="Wiedergabe",tm="Pause",im="Erneut abspielen",sm="Dauer",rm="LIVE",nm="Geladen",am="Status",om="Vollbild",um="Stumm schalten",lm="Ton einschalten",cm="Untertitel",dm="Untertitel",hm="Kapitel",fm="Schließen",pm="Beschreibungen",mm="Schrift",gm="Weiß",ym="Schwarz",_m="Rot",vm="Grün",Tm="Blau",bm="Gelb",Sm="Magenta",xm="Türkis",Em="Hintergrund",Cm="Fenster",Dm="Durchsichtig",Am="Undurchsichtig",wm="Kein",km="Erhoben",Im="Gedrückt",Pm="Uniform",Lm="Zwanglos",Om="Schreibschrift",Rm="Zurücksetzen",Mm="Fertig",Nm="Farbe",Bm="Deckkraft",ID={Play:em,Pause:tm,Replay:im,"Current Time":"Aktueller Zeitpunkt",Duration:sm,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:rm,Loaded:nm,Progress:am,Fullscreen:om,"Exit Fullscreen":"Vollbildmodus beenden",Mute:um,Unmute:lm,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:cm,"subtitles off":"Untertitel aus",Captions:dm,"captions off":"Untertitel aus",Chapters:hm,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:fm,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:pm,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:mm,White:gm,Black:ym,Red:_m,Green:vm,Blue:Tm,Yellow:bm,Magenta:Sm,Cyan:xm,Background:Em,Window:Cm,Transparent:Dm,"Semi-Transparent":"Halbdurchsichtig",Opaque:Am,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:wm,Raised:km,Depressed:Im,Uniform:Pm,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Lm,Script:Om,"Small Caps":"Small-Caps",Reset:Rm,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:Mm,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Nm,Opacity:Bm,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},PD=Object.freeze({__proto__:null,Background:Em,Black:ym,Blue:Tm,Captions:dm,Casual:Lm,Chapters:hm,Close:fm,Color:Nm,Cyan:xm,Depressed:Im,Descriptions:pm,Done:Mm,Duration:sm,Fullscreen:om,Green:vm,LIVE:rm,Loaded:nm,Magenta:Sm,Mute:um,None:wm,Opacity:Bm,Opaque:Am,Pause:tm,Play:em,Progress:am,Raised:km,Red:_m,Replay:im,Reset:Rm,Script:Om,Subtitles:cm,Text:mm,Transparent:Dm,Uniform:Pm,Unmute:lm,White:gm,Window:Cm,Yellow:bm,default:ID}),Fm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",Um="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",$m="Die Werbung wurde übersprungen.",qm="Dieser Inhalt ist nicht mehr verfügbar.",jm="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",Vm="Dieser Inhalt steht aus publizistischen Gründen vorübergehend nicht zur Verfügung.",Hm="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",zm="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",Gm="Dieser Inhalt ist nicht verfügbar.",LD={AGERATING12:Fm,AGERATING18:Um,COMMERCIAL:$m,ENDDATE:qm,GEOBLOCK:jm,JOURNALISTIC:Vm,LEGAL:Hm,STARTDATE:zm,UNKNOWN:Gm},OD=Object.freeze({__proto__:null,AGERATING12:Fm,AGERATING18:Um,COMMERCIAL:$m,ENDDATE:qm,GEOBLOCK:jm,JOURNALISTIC:Vm,LEGAL:Hm,STARTDATE:zm,UNKNOWN:Gm,default:LD});ae.addLanguage("de",we(we({},PD),OD));var Wm="Play",Km="Pause",Xm="Replay",Ym="Duration",Qm="LIVE",Jm="Loaded",Zm="Progress",eg="Fullscreen",tg="Mute",ig="Unmute",sg="Subtitles",rg="Captions",ng="Chapters",ag="Descriptions",og="Close",ug="Text",lg="White",cg="Black",dg="Red",hg="Green",fg="Blue",pg="Yellow",mg="Magenta",gg="Cyan",yg="Background",_g="Window",vg="Transparent",Tg="Opaque",bg="None",Sg="Raised",xg="Depressed",Eg="Uniform",Cg="Casual",Dg="Script",Ag="Reset",wg="Done",kg="Color",Ig="Opacity",RD={"Audio Player":"Audio Player","Video Player":"Video Player",Play:Wm,Pause:Km,Replay:Xm,"Current Time":"Current Time",Duration:Ym,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:Qm,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:Jm,Progress:Zm,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:eg,"Exit Fullscreen":"Exit Fullscreen",Mute:tg,Unmute:ig,"Playback Rate":"Playback Rate",Subtitles:sg,"subtitles off":"subtitles off",Captions:rg,"captions off":"captions off",Chapters:ng,Descriptions:ag,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:og,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:ug,White:lg,Black:cg,Red:dg,Green:hg,Blue:fg,Yellow:pg,Magenta:mg,Cyan:gg,Background:yg,Window:_g,Transparent:vg,"Semi-Transparent":"Semi-Transparent",Opaque:Tg,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:bg,Raised:Sg,Depressed:xg,Uniform:Eg,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:Cg,Script:Dg,"Small Caps":"Small Caps",Reset:Ag,"restore all settings to the default values":"restore all settings to the default values",Done:wg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:kg,Opacity:Ig,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},MD=Object.freeze({__proto__:null,Background:yg,Black:cg,Blue:fg,Captions:rg,Casual:Cg,Chapters:ng,Close:og,Color:kg,Cyan:gg,Depressed:xg,Descriptions:ag,Done:wg,Duration:Ym,Fullscreen:eg,Green:hg,LIVE:Qm,Loaded:Jm,Magenta:mg,Mute:tg,None:bg,Opacity:Ig,Opaque:Tg,Pause:Km,Play:Wm,Progress:Zm,Raised:Sg,Red:dg,Replay:Xm,Reset:Ag,Script:Dg,Subtitles:sg,Text:ug,Transparent:vg,Uniform:Eg,Unmute:ig,White:lg,Window:_g,Yellow:pg,default:RD}),Pg="To protect children this content is only available between 8PM and 6AM.",Lg="To protect children this content is only available between 10PM and 5AM.",Og="This commercial content is not available.",Rg="This content is not available anymore.",Mg="This content is not available outside Switzerland.",Ng="This content is temporarily unavailable for journalistic reasons.",Bg="This content is not available due to legal restrictions.",Fg="This content is not available yet.",Ug="This content is not available.",ND={AGERATING12:Pg,AGERATING18:Lg,COMMERCIAL:Og,ENDDATE:Rg,GEOBLOCK:Mg,JOURNALISTIC:Ng,LEGAL:Bg,STARTDATE:Fg,UNKNOWN:Ug},BD=Object.freeze({__proto__:null,AGERATING12:Pg,AGERATING18:Lg,COMMERCIAL:Og,ENDDATE:Rg,GEOBLOCK:Mg,JOURNALISTIC:Ng,LEGAL:Bg,STARTDATE:Fg,UNKNOWN:Ug,default:ND});ae.addLanguage("en",we(we({},MD),BD));var $g="Lecture",qg="Pause",jg="Revoir",Vg="Durée",Hg="EN DIRECT",zg="Chargé",Gg="Progression",Wg="Plein écran",Kg="Mettre en sourdine",Xg="Activer le son",Yg="Sous-titres",Qg="Sous-titres transcrits",Jg="Chapitres",Zg="Descriptions",e0="Fermer",t0="Texte",i0="Blanc",s0="Noir",r0="Rouge",n0="Vert",a0="Bleu",o0="Jaune",u0="Magenta",l0="Cyan",c0="Arrière-plan",d0="Fenêtre",h0="Transparent",f0="Opaque",p0="Aucun",m0="Élevé",g0="Enfoncé",y0="Uniforme",_0="Manuscrite",v0="Scripte",T0="Réinitialiser",b0="Terminé",S0="Couleur",x0="Opacité",FD={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:$g,Pause:qg,Replay:jg,"Current Time":"Temps actuel",Duration:Vg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:Hg,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:zg,Progress:Gg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:Wg,"Exit Fullscreen":"Fenêtré",Mute:Kg,Unmute:Xg,"Playback Rate":"Vitesse de lecture",Subtitles:Yg,"subtitles off":"Sous-titres désactivés",Captions:Qg,"captions off":"Sous-titres transcrits désactivés",Chapters:Jg,Descriptions:Zg,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:e0,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:t0,White:i0,Black:s0,Red:r0,Green:n0,Blue:a0,Yellow:o0,Magenta:u0,Cyan:l0,Background:c0,Window:d0,Transparent:h0,"Semi-Transparent":"Semi-transparent",Opaque:f0,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:p0,Raised:m0,Depressed:g0,Uniform:y0,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:_0,Script:v0,"Small Caps":"Petites capitales",Reset:T0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:b0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:S0,Opacity:x0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},UD=Object.freeze({__proto__:null,Background:c0,Black:s0,Blue:a0,Captions:Qg,Casual:_0,Chapters:Jg,Close:e0,Color:S0,Cyan:l0,Depressed:g0,Descriptions:Zg,Done:b0,Duration:Vg,Fullscreen:Wg,Green:n0,LIVE:Hg,Loaded:zg,Magenta:u0,Mute:Kg,None:p0,Opacity:x0,Opaque:f0,Pause:qg,Play:$g,Progress:Gg,Raised:m0,Red:r0,Replay:jg,Reset:T0,Script:v0,Subtitles:Yg,Text:t0,Transparent:h0,Uniform:y0,Unmute:Xg,White:i0,Window:d0,Yellow:o0,default:FD}),E0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",C0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",D0="Ce contenu n'est actuellement pas disponible.",A0="Ce contenu n'est plus disponible.",w0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",k0="Ce contenu est temporairement indisponible pour des raisons éditoriales.",I0="Pour des raisons juridiques, ce contenu n'est pas disponible.",P0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",L0="Ce contenu n'est actuellement pas disponible.",$D={AGERATING12:E0,AGERATING18:C0,COMMERCIAL:D0,ENDDATE:A0,GEOBLOCK:w0,JOURNALISTIC:k0,LEGAL:I0,STARTDATE:P0,UNKNOWN:L0},qD=Object.freeze({__proto__:null,AGERATING12:E0,AGERATING18:C0,COMMERCIAL:D0,ENDDATE:A0,GEOBLOCK:w0,JOURNALISTIC:k0,LEGAL:I0,STARTDATE:P0,UNKNOWN:L0,default:$D});ae.addLanguage("fr",we(we({},UD),qD));var O0="Play",R0="Pausa",M0="Replay",N0="Durata",B0="LIVE",F0="Caricato",U0="Stato",$0="Schermo intero",q0="Disattiva l’audio",j0="Attiva l’audio",V0="Sottotitoli",H0="Sottotitoli non udenti",z0="Capitolo",G0="Descrizioni",W0="Chiudi",K0="Testo",X0="Bianco",Y0="Nero",Q0="Rosso",J0="Verde",Z0="Blu",ey="Giallo",ty="Magenta",iy="Ciano",sy="Sfondo",ry="Finestra",ny="Trasparente",ay="Opaco",oy="Nessuno",uy="Uniforme",ly="Reinizializza",cy="Fatto",dy="Colore",hy="Opacità",jD={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:O0,Pause:R0,Replay:M0,"Current Time":"Orario attuale",Duration:N0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:B0,Loaded:F0,Progress:U0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:$0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:q0,Unmute:j0,"Playback Rate":"Velocità di riproduzione",Subtitles:V0,"subtitles off":"Senza sottotitoli",Captions:H0,"captions off":"Senza sottotitoli non udenti",Chapters:z0,Descriptions:G0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:W0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:K0,White:X0,Black:Y0,Red:Q0,Green:J0,Blue:Z0,Yellow:ey,Magenta:ty,Cyan:iy,Background:sy,Window:ry,Transparent:ny,"Semi-Transparent":"Semi-Trasparente",Opaque:ay,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:oy,Uniform:uy,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:ly,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:cy,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:dy,Opacity:hy,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},VD=Object.freeze({__proto__:null,Background:sy,Black:Y0,Blue:Z0,Captions:H0,Chapters:z0,Close:W0,Color:dy,Cyan:iy,Descriptions:G0,Done:cy,Duration:N0,Fullscreen:$0,Green:J0,LIVE:B0,Loaded:F0,Magenta:ty,Mute:q0,None:oy,Opacity:hy,Opaque:ay,Pause:R0,Play:O0,Progress:U0,Red:Q0,Replay:M0,Reset:ly,Subtitles:V0,Text:K0,Transparent:ny,Uniform:uy,Unmute:j0,White:X0,Window:ry,Yellow:ey,default:jD}),fy="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",py="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",my="Questo contenuto commerciale non è disponibile.",gy="Questo media non è più disponibile.",yy="Questo media non è disponibile fuori dalla Svizzera.",_y="Questo contenuto è temporaneamente non disponibile per motivi editoriali.",vy="Il contenuto non è fruibile a causa di restrizioni legali.",Ty="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",by="Questo media non è disponibile.",HD={AGERATING12:fy,AGERATING18:py,COMMERCIAL:my,ENDDATE:gy,GEOBLOCK:yy,JOURNALISTIC:_y,LEGAL:vy,STARTDATE:Ty,UNKNOWN:by},zD=Object.freeze({__proto__:null,AGERATING12:fy,AGERATING18:py,COMMERCIAL:my,ENDDATE:gy,GEOBLOCK:yy,JOURNALISTIC:_y,LEGAL:vy,STARTDATE:Ty,UNKNOWN:by,default:HD});ae.addLanguage("it",we(we({},VD),zD));var Sy="Laschar ir",xy="Pausa",Ey="Mussar danovamain",Cy="Durada",Dy="LIVE",Ay="Chargià",wy="Progress",ky="Entir visur",Iy="Senza tun",Py="Cun tun",Ly="Suttitels",Oy="Suttitels",Ry="Chapitels",My="Descripziuns",Ny="Serrar",By="Text",Fy="Alv",Uy="Nair",$y="Cotschn",qy="Verd",jy="Blau",Vy="Mellen",Hy="Magenta",zy="Cyan",Gy="Fund",Wy="Fanestra",Ky="Transparent",Xy="Betg transparent",Yy="Nagin",Qy="Auzà",Jy="Sbassà",Zy="Uniform",e_="Sumbriva",t_="Casual",i_="Script",s_="Da nov",r_="Fatg",n_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",a_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",o_="Quest medium commerzial n'è betg disponibel.",u_="Quest cuntegn n'è betg pli disponibel.",l_="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",c_="Quest cuntegn na stat ad interim betg a disposiziun per motivs publicistics.",d_="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",h_="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",f_="Quest cuntegn n'è betg disponibel.",GD={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:Sy,Pause:xy,Replay:Ey,"Current Time":"Temp actual",Duration:Cy,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:Dy,Loaded:Ay,Progress:wy,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:ky,"Non-Fullscreen":"Betg entir visur",Mute:Iy,Unmute:Py,"Playback Rate":"Tempo ",Subtitles:Ly,"subtitles off":"senza suttitels",Captions:Oy,"captions off":"senza suttitels",Chapters:Ry,Descriptions:My,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:Ny,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:By,White:Fy,Black:Uy,Red:$y,Green:qy,Blue:jy,Yellow:Vy,Magenta:Hy,Cyan:zy,Background:Gy,Window:Wy,Transparent:Ky,"Semi-Transparent":"Mez transparent",Opaque:Xy,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Yy,Raised:Qy,Depressed:Jy,Uniform:Zy,Dropshadow:e_,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:t_,Script:i_,"Small Caps":"Bustabs pitschens",Reset:s_,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:r_,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:n_,AGERATING18:a_,COMMERCIAL:o_,ENDDATE:u_,GEOBLOCK:l_,JOURNALISTIC:c_,LEGAL:d_,STARTDATE:h_,UNKNOWN:f_},WD=Object.freeze({__proto__:null,AGERATING12:n_,AGERATING18:a_,Background:Gy,Black:Uy,Blue:jy,COMMERCIAL:o_,Captions:Oy,Casual:t_,Chapters:Ry,Close:Ny,Cyan:zy,Depressed:Jy,Descriptions:My,Done:r_,Dropshadow:e_,Duration:Cy,ENDDATE:u_,Fullscreen:ky,GEOBLOCK:l_,Green:qy,JOURNALISTIC:c_,LEGAL:d_,LIVE:Dy,Loaded:Ay,Magenta:Hy,Mute:Iy,None:Yy,Opaque:Xy,Pause:xy,Play:Sy,Progress:wy,Raised:Qy,Red:$y,Replay:Ey,Reset:s_,STARTDATE:h_,Script:i_,Subtitles:Ly,Text:By,Transparent:Ky,UNKNOWN:f_,Uniform:Zy,Unmute:Py,White:Fy,Window:Wy,Yellow:Vy,default:GD});ae.addLanguage("rm",we({},WD));const KD=["url","mimeType","keySystems"],XD=["src"];class Q{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&Q.createTextTrack(e,s).then(a=>{n.forEach(o=>{Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){Q.addRemoteTextTracks(e,t.subtitles),Q.addChapters(e,t.urn,t.chapters),Q.addBlockedSegments(e,t.blockedSegments),Q.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&Q.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&Q.createTextTrack(e,s).then(n=>{t.forEach(a=>{Q.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return Q.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return Ui(function*(){return Si.hasToken(e)?Si.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return or.hasDrm(e)?e.map(s=>we(we({},s),or.buildKeySystems(s.drmList))):e}static composeMainResources(e){return Q.composeAkamaiResources(Q.composeKeySystemsResources(Q.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=ae.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,l=_d(r,KD);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:l}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new ae.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new vd(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return Q.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=Q.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return Ui(function*(){Q.pillarboxMonitoring(e)&&Q.pillarboxMonitoring(e).sessionStart();const{src:s}=t,r=_d(t,XD),n=yield Q.getMediaComposition(s,Q.dataProvider(e)),a=yield Q.composeMainResources(n),o=Q.getMediaData(a);return Q.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=Q.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=Q.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return Ui(function*(){try{const r=yield Q.getSrcMediaObj(e,t);return Q.srgAnalytics(e),Q.updateTitleBar(e,r),Q.updatePoster(e,r),Q.blockingReason(e,r)?void 0:(Q.addTextTracks(e,r),s(null,r))}catch(r){return Q.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new pi(e,{debug:e.debug(),playerVersion:ae.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static pillarboxMonitoring(e){if(e.options().trackers.pillarboxMonitoring!==!1){if(!e.options().trackers.pillarboxMonitoring){const t=new Ce(e,{debug:e.debug(),playerVersion:ae.VERSION.pillarbox,playerName:"Pillarbox"});e.options({trackers:{pillarboxMonitoring:t}})}return e.options().trackers.pillarboxMonitoring}}static updatePoster(e,t,s=DD){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return Q.pillarboxMonitoring(e),Q.cuechangeEventProxy(e),{currentTime:t=>Q.handleCurrentTime(e,t),setCurrentTime:t=>Q.handleSetCurrentTime(e,t),setSource:function(){var t=Ui(function*(s,r){return Q.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}ae.use("srgssr/urn",Q.middleware);ae.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const YD="1.0.0",QD=k.getComponent("Component");class JD extends QD{constructor(e,t){super(e,t)}createEl(e,t={},s={}){return super.createEl(e,k.obj.merge({className:this.buildCSSClass()},t),s)}update(e){k.dom.textContent(this.el(),`${this.options().label}: ${this.localize(e)}`)}buildCSSClass(){return`${super.buildCSSClass()} metric-label`}}k.registerComponent("MetricLabel",JD);const ZD=k.getComponent("Component"),eA=k.log.createLogger("graph-component");class p_ extends ZD{constructor(e,t={}){super(e,t),this.data=[]}createEl(e="canvas",t={},s={}){if(e!=="canvas")throw eA.error(`Creating a GraphComponent with an HTML element of ${e} is not supported; the element must be a 'canvas'`),new Error(`'${e}' is not supported for GraphComponent`);return super.createEl(e,k.obj.merge({className:this.buildCSSClass()},t),s)}update(e){this.data.length>=this.options().maxDataPoints&&this.data.shift(),this.data.push(e),this.drawGraph()}drawGraph(){const e=this.el(),t=e.getContext("2d");e.width=this.width(),e.height=this.height();const s=Math.max(...this.data);t.clearRect(0,0,e.width,e.height);const r=e.width/this.options().maxDataPoints;this.data.forEach((n,a)=>{const o=a*r,l=e.height-n/s*e.height,d=n/s*e.height;t.beginPath(),t.rect(o,l,r,d),t.closePath(),t.fillStyle=this.options().fillStyle,t.fill(),t.strokeStyle=this.options().strokeStyle,t.stroke()})}buildCSSClass(){return`${super.buildCSSClass()} graph-component`}el(){return this.el_}}p_.prototype.options_={fillStyle:"rgba(11,83,148)",strokeStyle:"rgb(50,50,50)",maxDataPoints:30};k.registerComponent("GraphComponent",p_);const tA=k.getComponent("Component");class m_ extends tA{constructor(e,t){super(e,t)}update(){var t,s;const e=this.options().valueExtractor(this.player());(t=this.metricLabel)==null||t.update(this.options().valueFormatter(e)),(s=this.graphComponent)==null||s.update(e)}createEl(e,t={},s={}){return super.createEl(e,k.obj.merge({className:this.buildCSSClass()},t),s)}buildCSSClass(){return`${super.buildCSSClass()} metric-component`}}m_.prototype.options_={valueFormatter:i=>i,children:["metricLabel","graphComponent"]};k.registerComponent("MetricComponent",m_);const iA=k.getComponent("Component");class g_ extends iA{constructor(t,s){super(t,s);Nl(this,"update_",()=>this.update());this.player().one("loadeddata",this.update_),this.player().on("timeupdate",this.update_)}dispose(){this.player().off("loadeddata",this.update_),this.player().off("timeupdate",this.update_)}update(){this.children().forEach(t=>t.update&&t.update())}createEl(t,s={},r={}){return super.createEl(t,k.obj.merge({className:this.buildCSSClass()},s),r)}buildCSSClass(){return`${super.buildCSSClass()} pbw-debug-panel`}static get VERSION(){return YD}}function sn(i,e){const t=i.tech({});if(t!=null&&t.vhs)return t.vhs.playlists.media().attributes[e]}function sA(i,e){const t=i.tech({});if(t!=null&&t.vhs)return t.vhs.stats[e]}function on(i){return Array.from(i.videoTracks()).find(e=>e.selected)}function rA(i){var e,t;return(t=(e=on(i))==null?void 0:e.configuration)==null?void 0:t.codec}function nA(i){return Array.from(i.audioTracks()).find(e=>e.enabled)}function aA(i){var e,t;return(t=(e=nA(i))==null?void 0:e.configuration)==null?void 0:t.codec}g_.prototype.options_={children:[{name:"bufferMetricComponent",id:"bufferMetricComponent",componentClass:"MetricComponent",metricLabel:{label:"Buffer"},graphComponent:{fillStyle:"rgb(151,32,48)"},valueExtractor:i=>{const e=i.buffered(),t=i.currentTime();return Math.max(0,e.length?e.end(e.length-1)-t:0).toFixed(2)},valueFormatter:i=>i?`${i} s`:"N/A"},{name:"bandwidthMetricComponent",id:"bandwidthMetricComponent",componentClass:"MetricComponent",metricLabel:{label:"Bandwidth"},valueExtractor:i=>sA(i,"bandwidth"),valueFormatter:i=>i?`${(i/1e6).toFixed(2)} Mbps`:"N/A"},{name:"bitrateMetricComponent",id:"bitrateMetricComponent",componentClass:"MetricComponent",metricLabel:{label:"Bitrate"},graphComponent:{fillStyle:"rgb(0,128,128)"},valueExtractor:i=>{var e,t;return sn(i,"BANDWIDTH")??((t=(e=on(i))==null?void 0:e.configuration)==null?void 0:t.bitrate)},valueFormatter:i=>i?`${(i/1e6).toFixed(2)} Mbps`:"N/A"},{name:"mediaDurationMetricComponent",id:"mediaDurationMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Media Duration"},valueExtractor:i=>i.duration().toFixed(2)+"s"},{name:"positionMetricComponent",id:"positionMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Position"},valueExtractor:i=>i.currentTime().toFixed(2)+"s"},{name:"codecsMetricComponent",id:"codecsMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Codecs"},valueExtractor:i=>{const e=sn(i,"CODECS");return e||[rA(i),aA(i)].filter(Boolean).join(",")||"N/A"}},{name:"framerateMetricComponent",id:"framerateMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Framerate"},valueExtractor:i=>{var t,s;const e=sn(i,"FRAME-RATE")??((s=(t=on(i))==null?void 0:t.configuration)==null?void 0:s.framerate);return e?`${e} fps`:"N/A"}},{name:"totalFramesMetricComponent",id:"totalFramesMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Total frames"},valueExtractor:i=>i.getVideoPlaybackQuality().totalVideoFrames??"N/A"},{name:"droppedFramesMetricComponent",id:"droppedFramesMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Dropped frames"},valueExtractor:i=>i.getVideoPlaybackQuality().droppedVideoFrames??"N/A"},{name:"resolutionMetricComponent",id:"resolutionMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Resolution"},valueExtractor:i=>{var t;const e=sn(i,"RESOLUTION")??((t=on(i))==null?void 0:t.configuration);return e?`${e.width}x${e.height}`:"N/A"}},{name:"timestampMetricComponent",id:"timestampMetricComponent",componentClass:"MetricComponent",graphComponent:!1,metricLabel:{label:"Timestamp"},valueExtractor:()=>new Date().toLocaleTimeString()}]};k.registerComponent("PillarboxDebugPanel",g_);const la=new URLSearchParams(location.search),oA=la.has("debug"),uA=la.get("ilHost")||void 0,lA=la.get("language"),cA=la.get("urn")||"urn:rts:video:14651145";window.player=ae("player",{debug:oA,language:lA,srgOptions:{dataProviderHost:uA},pillarboxDebugPanel:!0});player.src({src:cA,type:"srgssr/urn",disableTrackers:!0});window.player=player;window.pillarbox=ae; diff --git a/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-DhtRFMaS.css b/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-DhtRFMaS.css new file mode 100644 index 0000000..5bbe8dc --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-debug-panel/assets/index-DhtRFMaS.css @@ -0,0 +1 @@ +.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen,.pillarbox-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button,.pillarbox-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text,.pillarbox-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled,.pillarbox-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000}.pbw-debug-panel{position:absolute;bottom:6em;left:2.1em;width:30%;padding:.8em;color:#fff;background-color:#000000b3;transition:bottom .5s}.pbw-debug-panel>*{margin-bottom:.2em}.vjs-layout-tiny .pbw-debug-panel,.vjs-layout-x-small .pbw-debug-panel,.vjs-layout-small .pbw-debug-panel,.vjs-layout-medium .pbw-debug-panel{width:calc(100% - 4.2em)}.vjs-layout-large .pbw-debug-panel{width:40%}.vjs-playing.vjs-user-inactive .pbw-debug-panel{bottom:1em}.metric-component{display:flex;gap:.5em;justify-content:space-between;font-weight:800;white-space:nowrap}.graph-component{width:60%;height:1em;image-rendering:pixelated} diff --git a/pr-preview/pr-36/packages/pillarbox-debug-panel/index.html b/pr-preview/pr-36/packages/pillarbox-debug-panel/index.html new file mode 100644 index 0000000..bc15334 --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-debug-panel/index.html @@ -0,0 +1,25 @@ + + + + + + + Pillarbox-Debug-Panel Demo + + + + + + + + diff --git a/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BGSA8Lbi.js b/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BGSA8Lbi.js new file mode 100644 index 0000000..ef4879d --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BGSA8Lbi.js @@ -0,0 +1,219 @@ +var OT=Object.defineProperty;var RT=(i,e,t)=>e in i?OT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Nt=(i,e,t)=>RT(i,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cr(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Id(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var qs;typeof window<"u"?qs=window:typeof cn<"u"?qs=cn:typeof self<"u"?qs=self:qs={};var Un=qs;const x=cr(Un),NT={},MT=Object.freeze(Object.defineProperty({__proto__:null,default:NT},Symbol.toStringTag,{value:"Module"})),BT=Id(MT);var Fu=typeof cn<"u"?cn:typeof window<"u"?window:{},FT=BT,js;typeof document<"u"?js=document:(js=Fu["__GLOBAL_DOCUMENT_CACHE@4"],js||(js=Fu["__GLOBAL_DOCUMENT_CACHE@4"]=FT));var Pd=js;const U=cr(Pd);var Mo={exports:{}};function ve(){return ve=Object.assign?Object.assign.bind():function(i){for(var e=1;e=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zT(i,e){if(i){if(typeof i=="string")return Uu(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Uu(i,e)}}function Uu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t=400&&r.statusCode<=599){var a=n;if(t)if(QT.TextDecoder){var o=ZT(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function ZT(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var eb=JT,Ld=Un,tb=$T,ib=qT,Od=WT,sb=YT;xe.httpHandler=eb;xe.requestInterceptorsStorage=new Od;xe.responseInterceptorsStorage=new Od;xe.retryManager=new sb;/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */var rb=function(e){var t={};return e&&e.trim().split(` +`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Mo.exports=xe;Mo.exports.default=xe;xe.XMLHttpRequest=Ld.XMLHttpRequest||lb;xe.XDomainRequest="withCredentials"in new xe.XMLHttpRequest?xe.XMLHttpRequest:Ld.XDomainRequest;nb(["get","put","post","patch","head","delete"],function(i){xe[i==="delete"?"del":i]=function(e,t,s){return t=Rd(e,t,s),t.method=i.toUpperCase(),Bo(t)}});function nb(i,e){for(var t=0;t"u")throw new Error("callback argument missing");if(i.requestType&&xe.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=xe.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(I,M,V){s||(s=!0,i.callback(I,M,V))};function n(){d.readyState===4&&!xe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(u,0)}function a(){var R=void 0;if(d.response?R=d.response:R=d.responseText||ob(d),k)try{R=JSON.parse(R)}catch{}return R}function o(R){if(clearTimeout(O),clearTimeout(i.retryTimeout),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,!y&&xe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=d,Bo(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var I={headers:L.headers||{},body:L.body,responseUrl:d.responseURL,responseType:d.responseType},M=xe.responseInterceptorsStorage.execute(i.requestType,I);L.body=M.body,L.headers=M.headers}return r(R,L)}function u(){if(!y){var R;clearTimeout(O),clearTimeout(i.retryTimeout),i.useXDR&&d.status===void 0?R=200:R=d.status===1223?204:d.status;var I=L,M=null;if(R!==0?(I={body:a(),statusCode:R,method:E,headers:{},url:T,rawRequest:d},d.getAllResponseHeaders&&(I.headers=rb(d.getAllResponseHeaders()))):M=new Error("Internal XMLHttpRequest Error"),i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var V={headers:I.headers||{},body:I.body,responseUrl:d.responseURL,responseType:d.responseType},q=xe.responseInterceptorsStorage.execute(i.requestType,V);I.body=q.body,I.headers=q.headers}return r(M,I,I.body)}}var d=i.xhr||null;d||(i.cors||i.useXDR?d=new xe.XDomainRequest:d=new xe.XMLHttpRequest);var m,y,T=d.url=i.uri||i.url,E=d.method=i.method||"GET",A=i.body||i.data,_=d.headers=i.headers||{},w=!!i.sync,k=!1,O,L={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:d};if("json"in i&&i.json!==!1&&(k=!0,_.accept||_.Accept||(_.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),A=JSON.stringify(i.json===!0?A:i.json))),d.onreadystatechange=n,d.onload=u,d.onerror=o,d.onprogress=function(){},d.onabort=function(){y=!0,clearTimeout(i.retryTimeout)},d.ontimeout=o,d.open(E,T,!w,i.username,i.password),w||(d.withCredentials=!!i.withCredentials),!w&&i.timeout>0&&(O=setTimeout(function(){if(!y){y=!0,d.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",o(R)}},i.timeout)),d.setRequestHeader)for(m in _)_.hasOwnProperty(m)&&d.setRequestHeader(m,_[m]);else if(i.headers&&!ab(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(d.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(d),d.send(A||null),d}function ob(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function lb(){}var ub=Mo.exports;const Nd=cr(ub);var Md={exports:{}},$u=Pd,Fo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function it(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}it.prototype=Fo(Error.prototype);it.prototype.constructor=it;it.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Uo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Ks(){this.values=Fo(null)}Ks.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function Vs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),u=a[1].trim();e(o,u)}}}function cb(i,e,t){var s=i;function r(){var o=Uo(i);if(o===null)throw new it(it.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,u){var d=new Ks;Vs(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){d.set(m,t[T].region);break}break;case"vertical":d.alt(m,y,["rl","lr"]);break;case"line":var E=y.split(","),A=E[0];d.integer(m,A),d.percent(m,A)&&d.set("snapToLines",!1),d.alt(m,A,["auto"]),E.length===2&&d.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=y.split(","),d.percent(m,E[0]),E.length===2&&d.alt("positionAlign",E[1],["start","center","end"]);break;case"size":d.percent(m,y);break;case"align":d.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),u.region=d.get("region",null),u.vertical=d.get("vertical","");try{u.line=d.get("line","auto")}catch{}u.lineAlign=d.get("lineAlign","start"),u.snapToLines=d.get("snapToLines",!0),u.size=d.get("size",100);try{u.align=d.get("align","center")}catch{u.align=d.get("align","middle")}try{u.position=d.get("position","auto")}catch{u.position=d.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},u.align)}u.positionAlign=d.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},u.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new it(it.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Na=$u.createElement&&$u.createElement("textarea"),db={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},qu={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)"},hb={v:"title",lang:"lang"},ju={rt:"ruby"};function Bd(i,e){function t(){if(!e)return null;function A(w){return e=e.substr(w.length),w}var _=e.match(/^([^<]*)(<[^>]*>?)?/);return A(_[1]?_[1]:_[2])}function s(A){return Na.innerHTML=A,A=Na.textContent,Na.textContent="",A}function r(A,_){return!ju[_.localName]||ju[_.localName]===A.localName}function n(A,_){var w=db[A];if(!w)return null;var k=i.document.createElement(w),O=hb[A];return O&&_&&(k[O]=_.trim()),k}for(var a=i.document.createElement("div"),o=a,u,d=[];(u=t())!==null;){if(u[0]==="<"){if(u[1]==="/"){d.length&&d[d.length-1]===u.substr(2).replace(">","")&&(d.pop(),o=o.parentNode);continue}var m=Uo(u.substr(1,u.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=u.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(A){var _=/^bg_/.test(A),w=_?A.slice(3):A;if(qu.hasOwnProperty(w)){var k=_?"background-color":"color",O=qu[w];y.style[k]=O}}),y.className=E.join(" ")}d.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(u)))}return a}var Vu=[[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 fb(i){for(var e=0;e=t[0]&&i<=t[1])return!0}return!1}function pb(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,u){for(var d=u.childNodes.length-1;d>=0;d--)o.push(u.childNodes[d])}function n(o){if(!o||!o.length)return null;var u=o.pop(),d=u.textContent||u.innerText;if(d){var m=d.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):d}if(u.tagName==="ruby")return n(o);if(u.childNodes)return r(o,u),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Ve.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ve.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Ve.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Ve.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Ve.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function gb(i,e,t,s){function r(w,k){for(var O,L=new Ve(w),R=1,I=0;IM&&(O=new Ve(w),R=M),w=new Ve(L)}return O||L}var n=new Ve(e),a=e.cue,o=mb(a),u=[];if(a.snapToLines){var d;switch(a.vertical){case"":u=["+y","-y"],d="height";break;case"rl":u=["+x","-x"],d="width";break;case"lr":u=["-x","+x"],d="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[d]+m,E=u[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,u=u.reverse()),n.move(E,y)}else{var A=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=A/2;break;case"end":o-=A;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"],n=new Ve(e)}var _=r(n,u);e.move(_.toCSSCompatValues(t))}function ps(){}ps.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};ps.convertCueToDOMTree=function(i,e){return!i||!e?null:Bd(i,e)};var yb=.05,_b="sans-serif",vb="1.5%";ps.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=vb,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{cb(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var d=a.indexOf("-->")!==-1;if(!a||d&&(u=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` +`),e.cue.text+=a.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` + +`,i.parse()),i.state==="INITIAL")throw new it(it.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var Tb=ps,bb="auto",Sb={"":1,lr:1,rl:1},xb={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Eb(i){if(typeof i!="string")return!1;var e=Sb[i.toLowerCase()];return e?i.toLowerCase():!1}function Ma(i){if(typeof i!="string")return!1;var e=xb[i.toLowerCase()];return e?i.toLowerCase():!1}function Fd(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,u=null,d="",m=!0,y="auto",T="start",E="auto",A="auto",_=100,w="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(k){s=""+k}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(k){r=!!k}},startTime:{enumerable:!0,get:function(){return n},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");n=k,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");a=k,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(k){o=""+k,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(k){u=k,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(k){var O=Eb(k);if(O===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=O,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(k){m=!!k,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(k){if(typeof k!="number"&&k!==bb)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=k,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(k){var O=Ma(k);O?(T=O,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");E=k,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return A},set:function(k){var O=Ma(k);O?(A=O,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return _},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");_=k,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return w},set:function(k){var O=Ma(k);if(!O)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");w=O,this.hasBeenReset=!0}}}),this.displayState=void 0}Fd.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Cb=Fd,Ab={"":!0,up:!0};function Db(i){if(typeof i!="string")return!1;var e=Ab[i.toLowerCase()];return e?i.toLowerCase():!1}function Rs(i){return typeof i=="number"&&i>=0&&i<=100}function wb(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Rs(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Rs(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Rs(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Rs(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Rs(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var u=Db(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=u}}})}var kb=wb,qt=Un,Di=Md.exports={WebVTT:Tb,VTTCue:Cb,VTTRegion:kb};qt.vttjs=Di;qt.WebVTT=Di.WebVTT;var Ib=Di.VTTCue,Pb=Di.VTTRegion,Lb=qt.VTTCue,Ob=qt.VTTRegion;Di.shim=function(){qt.VTTCue=Ib,qt.VTTRegion=Pb};Di.restore=function(){qt.VTTCue=Lb,qt.VTTRegion=Ob};qt.VTTCue||Di.shim();var Rb=Md.exports;const Hu=cr(Rb);var zu="https://example.com",qn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||"");var s=/^\/\//.test(e),r=!x.location&&!/\/\//i.test(e);e=new x.URL(e,x.location||zu);var n=new URL(t,e);return r?n.href.slice(zu.length):s?n.href.slice(n.protocol.length):n.href},$o=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Bb=" ",Ba=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Fb=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},$e=function(i){const e={};if(!i)return e;const t=i.split(Fb());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},Gu=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Ub extends $o{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const $b=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Kt=function(i){const e={};return Object.keys(i).forEach(function(t){e[$b(t)]=i[t]}),e},Fa=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,u=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(_){let w,k;if(t.manifest.definitions){for(const O in t.manifest.definitions)if(_.uri&&(_.uri=_.uri.replace(`{$${O}}`,t.manifest.definitions[O])),_.attributes)for(const L in _.attributes)typeof _.attributes[L]=="string"&&(_.attributes[L]=_.attributes[L].replace(`{$${O}}`,t.manifest.definitions[O]))}({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const O={};"length"in _&&(r.byterange=O,O.length=_.length,"offset"in _||(_.offset=T)),"offset"in _&&(r.byterange=O,O.offset=_.offset),T=O.offset+O.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(r.title=_.title),_.duration>0&&(r.duration=_.duration),_.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){a=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.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:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:Ud(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(a.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,y=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){n={},_.uri&&(n.uri=_.uri),_.byterange&&(n.byterange=_.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||d,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),ve(r.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const O=this.manifest.mediaGroups[_.attributes.TYPE];O[_.attributes["GROUP-ID"]]=O[_.attributes["GROUP-ID"]]||{},w=O[_.attributes["GROUP-ID"]],k={default:/yes/i.test(_.attributes.DEFAULT)},k.default?k.autoselect=!0:k.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(k.language=_.attributes.LANGUAGE),_.attributes.URI&&(k.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(k.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(k.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(k.forced=/yes/i.test(_.attributes.FORCED)),w[_.attributes.NAME]=k},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),r.dateTimeString=_.dateTimeString,r.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:O}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),O===null&&this.manifest.segments.reduceRight((L,R)=>(R.programDateTime=L-R.duration*1e3,R.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Fa.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){r.cueOut=_.data},"cue-out-cont"(){r.cueOutCont=_.data},"cue-in"(){r.cueIn=_.data},skip(){this.manifest.skip=Kt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const O=this.manifest.segments.length,L=Kt(_.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=E),E=L.byterange.offset+L.byterange.length);const R=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${R} for segment #${O}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((I,M)=>{I.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${M} lacks required attribute(s): LAST-PART`})})},"server-control"(){const O=this.manifest.serverControl=Kt(_.attributes);O.hasOwnProperty("canBlockReload")||(O.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Fa.call(this,this.manifest),O.canSkipDateranges&&!O.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const O=this.manifest.segments.length,L=Kt(_.attributes),R=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=R?E:0,R&&(E=L.byterange.offset+L.byterange.length)));const I=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${I} for segment #${O}`,_.attributes,["TYPE","URI"]),!!L.type)for(let M=0;MM.id===L.id);this.manifest.dateRanges[I]=ve(this.manifest.dateRanges[I],L),A[L.id]=ve(A[L.id],L),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Kt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const O=(L,R)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=R};if("QUERYPARAM"in _.attributes){if("NAME"in _.attributes||"IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const L=this.params.get(_.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${_.attributes.QUERYPARAM}`});return}O(_.attributes.QUERYPARAM,decodeURIComponent(L));return}if("NAME"in _.attributes){if("IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in _.attributes)||typeof _.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${_.attributes.NAME}`});return}O(_.attributes.NAME,_.attributes.VALUE);return}if("IMPORT"in _.attributes){if(!this.mainDefinitions[_.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${_.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}O(_.attributes.IMPORT,this.mainDefinitions[_.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:_.attributes,uri:_.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",_.attributes,["BANDWIDTH","URI"])}}[_.tagType]||u).call(t)},uri(){r.uri=_.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=y,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){_.segment?(r.custom=r.custom||{},r.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(t)})}requiredCompatibilityversion(e,t){(ey&&(m-=y,m-=y,m-=Oe(2))}return Number(m)},Jb=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Oe(e);for(var a=Xb(e),o=new Uint8Array(new ArrayBuffer(a)),u=0;u=t.length&&d.call(t,function(m,y){var T=u[y]?u[y]&e[a+y]:e[a+y];return m===T})},e2=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},ii={},zt={};function t2(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==ts?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==ts?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function sh(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}dr(Ze,ne);dr(Ze,ne.prototype);function sr(i,e){if(e(i))return!0;if(i=i.firstChild)do if(sr(i,e))return!0;while(i=i.nextSibling)}function hr(){this.ownerDocument=this}function u2(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===ir.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function rh(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===ir.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Vo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function nh(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Vo(i.ownerDocument,i),e}function c2(i){return i&&(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.ELEMENT_NODE)}function d2(i){return i&&(At(i)||Ho(i)||Vt(i)||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE||i.nodeType===ne.COMMENT_NODE||i.nodeType===ne.PROCESSING_INSTRUCTION_NODE)}function Vt(i){return i&&i.nodeType===ne.DOCUMENT_TYPE_NODE}function At(i){return i&&i.nodeType===ne.ELEMENT_NODE}function Ho(i){return i&&i.nodeType===ne.TEXT_NODE}function Zu(i,e){var t=i.childNodes||[];if(Ct(t,At)||Vt(e))return!1;var s=Ct(t,Vt);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function ec(i,e){var t=i.childNodes||[];function s(n){return At(n)&&n!==e}if(Ct(t,s))return!1;var r=Ct(t,Vt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function h2(i,e,t){if(!c2(i))throw new Ee(Xe,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Ee(eh,"child not in parent");if(!d2(e)||Vt(e)&&i.nodeType!==ne.DOCUMENT_NODE)throw new Ee(Xe,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function f2(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var n=r.filter(At);if(n.length>1||Ct(r,Ho))throw new Ee(Xe,"More than one element or text in fragment");if(n.length===1&&!Zu(i,t))throw new Ee(Xe,"Element in fragment can not be inserted before doctype")}if(At(e)&&!Zu(i,t))throw new Ee(Xe,"Only one element can be added and only after doctype");if(Vt(e)){if(Ct(s,Vt))throw new Ee(Xe,"Only one doctype is allowed");var a=Ct(s,At);if(t&&s.indexOf(a)1||Ct(r,Ho))throw new Ee(Xe,"More than one element or text in fragment");if(n.length===1&&!ec(i,t))throw new Ee(Xe,"Element in fragment can not be inserted before doctype")}if(At(e)&&!ec(i,t))throw new Ee(Xe,"Only one element can be added and only after doctype");if(Vt(e)){let u=function(d){return Vt(d)&&d!==t};var o=u;if(Ct(s,u))throw new Ee(Xe,"Only one doctype is allowed");var a=Ct(s,At);if(t&&s.indexOf(a)0&&sr(t.documentElement,function(r){if(r!==t&&r.nodeType===pt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=Xu(n);a=e.every(a2(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new Ci;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Ut;var t=e.attributes=new fn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Vn;return i.ownerDocument=this,i.childNodes=new Ut,i},createTextNode:function(i){var e=new zo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Go;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Wo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Xo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new mn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Ko;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new Ci,s=e.split(":"),r=t.attributes=new fn;return t.childNodes=new Ut,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new mn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Je(hr,ne);function Ci(){this._nsMap={}}Ci.prototype={nodeType:pt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===jt?this.insertBefore(i,null):p2(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new is(this,function(e){var t=[];return sr(e,function(s){s!==e&&s.nodeType==pt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new is(this,function(t){var s=[];return sr(t,function(r){r!==t&&r.nodeType===pt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};hr.prototype.getElementsByTagName=Ci.prototype.getElementsByTagName;hr.prototype.getElementsByTagNameNS=Ci.prototype.getElementsByTagNameNS;Je(Ci,ne);function mn(){}mn.prototype.nodeType=ts;Je(mn,ne);function fr(){}fr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(Le[Xe])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Je(fr,ne);function zo(){}zo.prototype={nodeName:"#text",nodeType:hn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Je(zo,fr);function Go(){}Go.prototype={nodeName:"#comment",nodeType:Qd};Je(Go,fr);function Wo(){}Wo.prototype={nodeName:"#cdata-section",nodeType:Kd};Je(Wo,fr);function jn(){}jn.prototype.nodeType=Zd;Je(jn,ne);function oh(){}oh.prototype.nodeType=l2;Je(oh,ne);function lh(){}lh.prototype.nodeType=o2;Je(lh,ne);function Ko(){}Ko.prototype.nodeType=Xd;Je(Ko,ne);function Vn(){}Vn.prototype.nodeName="#document-fragment";Vn.prototype.nodeType=jt;Je(Vn,ne);function Xo(){}Xo.prototype.nodeType=Yd;Je(Xo,ne);function uh(){}uh.prototype.serializeToString=function(i,e,t){return ch.call(i,e,t)};ne.prototype.toString=ch;function ch(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return ji(this,t,i,e,a),t.join("")}function tc(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===ir.XML||r===ir.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function $a(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,sh),'"')}function ji(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case pt:var n=i.attributes,a=n.length,k=i.firstChild,o=i.tagName;t=ir.isHTML(i.namespaceURI)||t;var u=o;if(!t&&!i.prefix&&i.namespaceURI){for(var d,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){d=T.namespace;break}}if(d!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(u=T.prefix+":"+o);break}}}e.push("<",u);for(var E=0;E"),t&&/^script$/i.test(o))for(;k;)k.data?e.push(k.data):ji(k,e,t,s,r.slice()),k=k.nextSibling;else for(;k;)ji(k,e,t,s,r.slice()),k=k.nextSibling;e.push("")}else e.push("/>");return;case Jd:case jt:for(var k=i.firstChild;k;)ji(k,e,t,s,r.slice()),k=k.nextSibling;return;case ts:return $a(e,i.name,i.value);case hn:return e.push(i.data.replace(/[<&>]/g,sh));case Kd:return e.push("");case Qd:return e.push("");case Zd:var O=i.publicId,L=i.systemId;if(e.push("");else if(L&&L!=".")e.push(" SYSTEM ",L,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case Yd:return e.push("");case Xd:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function dh(i,e,t){var s;switch(e.nodeType){case pt:s=e.cloneNode(!1),s.ownerDocument=i;case jt:break;case ts:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(dh(i,r,t)),r=r.nextSibling;return s}function oo(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Ut),s.ownerDocument=i,s.nodeType){case pt:var a=e.attributes,o=s.attributes=new fn,u=a.length;o._ownerElement=s;for(var d=0;d",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(fh);var Yo={},rr=zt.NAMESPACE,lo=/[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]/,ic=new RegExp("[\\-\\.0-9"+lo.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),sc=new RegExp("^"+lo.source+ic.source+"*(?::"+lo.source+ic.source+"*)?$"),Ns=0,Xt=1,Li=2,Ms=3,Oi=4,Ri=5,Bs=6,Kr=7;function ss(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,ss)}ss.prototype=new Error;ss.prototype.name=ss.name;function ph(){}ph.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),mh(e,e={}),m2(i,e,t,s,this.errorHandler),s.endDocument()}};function m2(i,e,t,s,r){function n(te){if(te>65535){te-=65536;var Te=55296+(te>>10),Lt=56320+(te&1023);return String.fromCharCode(Te,Lt)}else return String.fromCharCode(te)}function a(te){var Te=te.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+te),te)}function o(te){if(te>_){var Te=i.substring(_,te).replace(/&#?\w+;/g,a);T&&u(_),s.characters(Te,0,te-_),_=te}}function u(te,Te){for(;te>=m&&(Te=y.exec(i));)d=Te.index,m=d+Te[0].length,T.lineNumber++;T.columnNumber=te-d+1}for(var d=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],A={},_=0;;){try{var w=i.indexOf("<",_);if(w<0){if(!i.substr(_).match(/^\s*$/)){var k=s.doc,O=k.createTextNode(i.substr(_));k.appendChild(O),s.currentElement=O}return}switch(w>_&&o(w),i.charAt(w+1)){case"/":var Z=i.indexOf(">",w+3),L=i.substring(w+2,Z).replace(/[ \t\n\r]+$/g,""),R=E.pop();Z<0?(L=i.substring(w+2).replace(/[\s<].*/,""),r.error("end tag name: "+L+" is not complete:"+R.tagName),Z=w+1+L.length):L.match(/\s_?_=Z:o(Math.max(w,_)+1)}}function rc(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function g2(i,e,t,s,r,n){function a(T,E,A){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),A)}for(var o,u,d=++e,m=Ns;;){var y=i.charAt(d);switch(y){case"=":if(m===Xt)o=i.slice(e,d),m=Ms;else if(m===Li)m=Ms;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Ms||m===Xt)if(m===Xt&&(n.warning('attribute value must after "="'),o=i.slice(e,d)),e=d+1,d=i.indexOf(y,e),d>0)u=i.slice(e,d),a(o,u,e-1),m=Ri;else throw new Error("attribute value no end '"+y+"' match");else if(m==Oi)u=i.slice(e,d),a(o,u,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=d+1,m=Ri;else throw new Error('attribute value must after "="');break;case"/":switch(m){case Ns:t.setTagName(i.slice(e,d));case Ri:case Bs:case Kr:m=Kr,t.closed=!0;case Oi:case Xt:break;case Li:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==Ns&&t.setTagName(i.slice(e,d)),d;case">":switch(m){case Ns:t.setTagName(i.slice(e,d));case Ri:case Bs:case Kr:break;case Oi:case Xt:u=i.slice(e,d),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Li:m===Li&&(u=o),m==Oi?(n.warning('attribute "'+u+'" missed quot(")!'),a(o,u,e)):((!rr.isHTML(s[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,e));break;case Ms:throw new Error("attribute value missed!!")}return d;case"€":y=" ";default:if(y<=" ")switch(m){case Ns:t.setTagName(i.slice(e,d)),m=Bs;break;case Xt:o=i.slice(e,d),m=Li;break;case Oi:var u=i.slice(e,d);n.warning('attribute "'+u+'" missed quot(")!!'),a(o,u,e);case Ri:m=Bs;break}else switch(m){case Li:t.tagName,(!rr.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=d,m=Xt;break;case Ri:n.warning('attribute space is required"'+o+'"!!');case Bs:m=Xt,e=d;break;case Ms:m=Oi,e=d;break;case Kr:throw new Error("elements closed character '/' and '>' must be connected to")}}d++}}function nc(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var u=n.prefix=a.slice(0,T),d=a.slice(T+1),m=u==="xmlns"&&d;else d=a,u=null,m=a==="xmlns"&&"";n.localName=d,m!==!1&&(r==null&&(r={},mh(t,t={})),t[m]=r[m]=o,n.uri=rr.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var u=n.prefix;u&&(u==="xml"&&(n.uri=rr.XML),u!=="xmlns"&&(n.uri=t[u||""]))}var T=s.indexOf(":");T>0?(u=i.prefix=s.slice(0,T),d=i.localName=s.slice(T+1)):(u=null,d=i.localName=s);var E=i.uri=t[u||""];if(e.startElement(E,d,s,i),i.closed){if(e.endElement(E,d,s),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&e.endPrefixMapping(u)}else return i.currentNSMap=t,i.localNSMap=r,!0}function y2(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function _2(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=b2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],d=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(d=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(u,d,m),t.endDTD(),y.index+y[0].length}}return-1}function T2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function gh(){this.attributeNames={}}gh.prototype={setTagName:function(i){if(!sc.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!sc.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function b2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Yo.XMLReader=ph;Yo.ParseError=ss;var S2=zt,x2=ii,ac=fh,yh=Yo,E2=x2.DOMImplementation,oc=S2.NAMESPACE,C2=yh.ParseError,A2=yh.XMLReader;function _h(i){return i.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function vh(i){this.options=i||{locator:{}}}vh.prototype.parseFromString=function(i,e){var t=this.options,s=new A2,r=t.domBuilder||new pr,n=t.errorHandler,a=t.locator,o=t.xmlns||{},u=/\/x?html?$/.test(e),d=u?ac.HTML_ENTITIES:ac.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=D2(n,r,a),s.domBuilder=t.domBuilder||r,u&&(o[""]=oc.HTML),o.xml=o.xml||oc.XML;var m=t.normalizeLineEndings||_h;return i&&typeof i=="string"?s.parse(m(i),o,d):s.errorHandler.error("invalid doc source"),r.doc};function D2(i,e,t){if(!i){if(e instanceof pr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(u){i(a,u)}:i),s[a]=o&&function(u){o("[xmldom "+a+"] "+u+uo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function pr(){this.cdata=!1}function Ni(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}pr.prototype={startDocument:function(){this.doc=new E2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;Xr(this,n),this.currentElement=n,this.locator&&Ni(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){pr.prototype[i]=function(){return null}});function Xr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Hn.__DOMHandler=pr;Hn.normalizeLineEndings=_h;Hn.DOMParser=vh;var w2=Hn.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const uc=i=>!!i&&typeof i=="object",Pe=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):uc(e[s])&&uc(t[s])?e[s]=Pe(e[s],t[s]):e[s]=t[s]}),e),{}),Th=i=>Object.keys(i).map(e=>i[e]),k2=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),bh=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),P2=(i,e)=>Th(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var ns={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",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"};const nr=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:qn(i||"",e)};if(t||s){const a=(t||s).split("-");let o=x.BigInt?x.BigInt(a[0]):parseInt(a[0],10),u=x.BigInt?x.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},cc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),O2={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=cc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:u=1/0}=i,d=cc(i.endNumber),m=(e+t)/1e3,y=s+a,E=m+o-y,A=Math.ceil(E*r/n),_=Math.floor((m-y-u)*r/n),w=Math.floor((m-y)*r/n);return{start:Math.max(0,_),end:typeof d=="number"?d:Math.min(A,w)}}},R2=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Qo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=O2[e](i),u=k2(a,o).map(R2(i));if(e==="static"){const d=u.length-1,m=typeof r=="number"?r:n;u[d].duration=m-t/s*d}return u},Sh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:u}=i;if(!e)throw new Error(ns.NO_BASE_URL);const d=nr({baseUrl:e,source:t.sourceURL,range:t.range}),m=nr({baseUrl:e,source:e,indexRange:r});if(m.map=d,u){const y=Qo(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Jo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,u=e.timescale,d=e.references.filter(w=>w.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,A=i.mediaSequence||0,_;typeof e.firstOffset=="bigint"?_=x.BigInt(o)+e.firstOffset:_=o+e.firstOffset;for(let w=0;wP2(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),B2=(i,e)=>{for(let t=0;t{let e=[];return e2(i,N2,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},hc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},F2=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:u}){return u===s.timeline});const r=B2(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(u){return Math.abs(u.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),hc({playlist:s,mediaSequence:r.segments[a].number})})},U2=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(dc(i)),s=e.playlists.concat(dc(e));return e.timelineStarts=xh([i.timelineStarts,e.timelineStarts]),F2({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},zn=i=>i&&i.uri+"-"+L2(i.byterange),qa=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=Th(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=I2(s.segments||[],"discontinuity"),s))},Zo=(i,e)=>{const t=zn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Jo(i,s,i.sidx.resolvedUri),i},$2=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Zo(i[t],e);return i},q2=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},j2=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},V2=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",u=a.attributes.lang||"";let d=a.attributes.label||"main";if(u&&!a.attributes.label){const y=o?` (${o})`:"";d=`${a.attributes.lang}${y}`}n[d]||(n[d]={language:u,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=Zo(q2(a,t),e);return n[d].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},H2=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Zo(j2(s),e)),t},{}),z2=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),G2=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},W2=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",K2=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",X2=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",Y2=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},fc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],Q2=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:u,minimumUpdatePeriod:d}=i[0].attributes,m=qa(i.filter(W2)).map(G2),y=qa(i.filter(K2)),T=qa(i.filter(X2)),E=i.map(R=>R.attributes.captionServices).filter(Boolean),A={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:$2(m,s)};d>=0&&(A.minimumUpdatePeriod=d*1e3),e&&(A.locations=e),t&&(A.contentSteering=t),o==="dynamic"&&(A.suggestedPresentationDelay=u),n&&n.length>0&&(A.eventStream=n);const _=A.playlists.length===0,w=y.length?V2(y,s,_):null,k=T.length?H2(T,s):null,O=m.concat(fc(w),fc(k)),L=O.map(({timelineStarts:R})=>R);return A.timelineStarts=xh(L),Y2(O,A.timelineStarts),w&&(A.mediaGroups.AUDIO.audio=w),k&&(A.mediaGroups.SUBTITLES.subs=k),E.length&&(A.mediaGroups["CLOSED-CAPTIONS"].cc=z2(E)),r?U2({oldManifest:r,newManifest:A}):A},J2=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:u=0}=i,d=(s+r)/1e3,m=n+o,T=d+u-m;return Math.ceil((T*a-e)/t)},Eh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:u}=i,d=[];let m=-1;for(let y=0;ym&&(m=_);let w;if(A<0){const L=y+1;L===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?w=J2(i,m,E):w=(n*a-m)/E:w=(e[L].t-m)/E}else w=A+1;const k=o+d.length+w;let O=o+d.length;for(;O(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},pc=(i,e)=>i.replace(Z2,e1(e)),t1=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Qo(i):Eh(i,e),i1=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=nr({baseUrl:i.baseUrl,source:pc(s.sourceURL,t),range:s.range});return t1(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=pc(i.media||"",t),u=i.timescale||1,d=i.presentationTimeOffset||0,m=i.periodStart+(a.time-d)/u;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:qn(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},s1=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=nr({baseUrl:t,source:s.sourceURL,range:s.range}),n=nr({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},r1=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(ns.SEGMENT_TIME_UNSPECIFIED);const n=s.map(u=>s1(i,u));let a;return t&&(a=Qo(i)),e&&(a=Eh(i,e)),a.map((u,d)=>{if(n[d]){const m=n[d],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=u.timeline,m.duration=u.duration,m.number=u.number,m.presentationTime=r+(u.time-T)/y,m}}).filter(u=>u)},n1=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=i1,t=Pe(i,e.template)):e.base?(s=Sh,t=Pe(i,e.base)):e.list&&(s=r1,t=Pe(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},a1=i=>i.map(n1),me=(i,e)=>bh(i.childNodes).filter(({tagName:t})=>t===e),mr=i=>i.textContent.trim(),o1=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Mi=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[u,d,m,y,T,E]=o.slice(1);return parseFloat(u||0)*31536e3+parseFloat(d||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},l1=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),mc={mediaPresentationDuration(i){return Mi(i)},availabilityStartTime(i){return l1(i)/1e3},minimumUpdatePeriod(i){return Mi(i)},suggestedPresentationDelay(i){return Mi(i)},type(i){return i},timeShiftBufferDepth(i){return Mi(i)},start(i){return Mi(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return o1(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Mi(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ae=i=>i&&i.attributes?bh(i.attributes).reduce((e,t)=>{const s=mc[t.name]||mc.DEFAULT;return e[t.name]=s(t.value),e},{}):{},u1={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Gn=(i,e)=>e.length?rs(i.map(function(t){return e.map(function(s){const r=mr(s),n=qn(t.baseUrl,r),a=Pe(Ae(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,el=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(y=>Pe({tag:"SegmentURL"},Ae(y))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],o=t||r||e,u=o&&me(o,"Initialization")[0],d=e&&Ae(e);d&&u?d.initialization=u&&Ae(u):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});const m={template:d,segmentTimeline:a&&me(a,"S").map(y=>Ae(y)),list:t&&Pe(Ae(t),{segmentUrls:s,initialization:Ae(u)}),base:r&&Pe(Ae(r),{initialization:Ae(u)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},c1=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=Gn(e,r),a=Pe(i,Ae(s)),o=el(s);return n.map(u=>({segmentInfo:Pe(t,o),attributes:Pe(a,u)}))},d1=i=>i.reduce((e,t)=>{const s=Ae(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=u1[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=mr(n);e[r].pssh=a&&Ud(a)}}return e},{}),h1=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,u]=a.split(":");o==="lang"?s.language=u:o==="er"?s.easyReader=Number(u):o==="war"?s.aspectRatio=Number(u):o==="3D"&&(s["3D"]=Number(u))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},f1=i=>rs(me(i.node,"EventStream").map(e=>{const t=Ae(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=Ae(r),a=n.presentationTime||0,o=t.timescale||1,u=n.duration||0,d=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:d,end:d+u/o,messageData:mr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),p1=(i,e,t)=>s=>{const r=Ae(s),n=Gn(e,me(s,"BaseURL")),a=me(s,"Role")[0],o={role:Ae(a)};let u=Pe(i,r,o);const d=me(s,"Accessibility")[0],m=h1(Ae(d));m&&(u=Pe(u,{captionServices:m}));const y=me(s,"Label")[0];if(y&&y.childNodes.length){const w=y.childNodes[0].nodeValue.trim();u=Pe(u,{label:w})}const T=d1(me(s,"ContentProtection"));Object.keys(T).length&&(u=Pe(u,{contentProtection:T}));const E=el(s),A=me(s,"Representation"),_=Pe(t,E);return rs(A.map(c1(u,n,_)))},m1=(i,e)=>(t,s)=>{const r=Gn(e,me(t.node,"BaseURL")),n=Pe(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),o=el(t.node);return rs(a.map(p1(n,r,o)))},g1=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=Pe({serverURL:mr(i[0])},Ae(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},y1=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,_1=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(ns.INVALID_NUMBER_OF_PERIOD);const o=me(i,"Location"),u=Ae(i),d=Gn([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");u.type=u.type||"static",u.sourceDuration=u.mediaPresentationDuration||0,u.NOW=s,u.clientOffset=r,o.length&&(u.locations=o.map(mr));const y=[];return a.forEach((T,E)=>{const A=Ae(T),_=y[E-1];A.start=y1({attributes:A,priorPeriodAttributes:_?_.attributes:null,mpdType:u.type}),y.push({node:T,attributes:A})}),{locations:u.locations,contentSteeringInfo:g1(m,n),representationInfo:rs(y.map(m1(u,d))),eventStream:rs(y.map(f1))}},Ch=i=>{if(i==="")throw new Error(ns.DASH_EMPTY_MANIFEST);const e=new w2;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(ns.DASH_INVALID_XML);return s},v1=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=Ae(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ns.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},T1=(i,e={})=>{const t=_1(Ch(i),e),s=a1(t.representationInfo);return Q2({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},b1=i=>v1(Ch(i));var Ah=Math.pow(2,32),S1=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},C1=E1;const A1=cr(C1);var D1=z([73,68,51]),w1=function(e,t){t===void 0&&(t=0),e=z(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Hs=function i(e,t){return t===void 0&&(t=0),e=z(e),e.length-t<10||!pe(e,D1,{offset:t})?t:(t+=w1(e,t),i(e,t))},yc=function(e){return typeof e=="string"?Hd(e):e},k1=function(e){return Array.isArray(e)?e.map(function(t){return yc(t)}):[yc(e)]},I1=function i(e,t,s){s===void 0&&(s=!1),t=k1(t),e=z(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var u=n+a;if(u>e.length){if(s)break;u=e.length}var d=e.subarray(n+8,u);pe(o,t[0])&&(t.length===1?r.push(d):r.push.apply(r,i(d,t.slice(1),s))),n=u}return r},Yr={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},co=[128,64,32,16,8,4,2,1],P1=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=gn(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=gn(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},vc=function i(e,t){t=L1(t),e=z(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,d=e.subarray(o,u);pe(t[0],n.bytes)&&(t.length===1?s.push(d):s=s.concat(i(d,t.slice(1))));var m=n.length+a.length+d.length;r+=m}return s},R1=z([0,0,0,1]),N1=z([0,0,1]),M1=z([0,0,3]),B1=function(e){for(var t=[],s=1;s>1&63),s.indexOf(d)!==-1&&(a=n+u),n+=u+(t==="h264"?1:2)}return e.subarray(0,0)},F1=function(e,t,s){return Dh(e,"h264",t,s)},U1=function(e,t,s){return Dh(e,"h265",t,s)},qe={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102])},as={aac:function(e){var t=Hs(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Hs(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=vc(e,[Yr.EBML,Yr.DocType])[0];return pe(t,qe.webm)},mkv:function(e){var t=vc(e,[Yr.EBML,Yr.DocType])[0];return pe(t,qe.matroska)},mp4:function(e){if(as["3gp"](e)||as.mov(e))return!1;if(pe(e,qe.mp4,{offset:4})||pe(e,qe.fmp4,{offset:4})||pe(e,qe.moof,{offset:4})||pe(e,qe.moov,{offset:4}))return!0},mov:function(e){return pe(e,qe.mov,{offset:4})},"3gp":function(e){return pe(e,qe["3gp"],{offset:4})},ac3:function(e){var t=Hs(e);return pe(e,qe.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},il=9e4,sl,rl,Wn,nl,wh,kh,Ih;sl=function(i){return i*il};rl=function(i,e){return i*e};Wn=function(i){return i/il};nl=function(i,e){return i/e};wh=function(i,e){return sl(nl(i,e))};kh=function(i,e){return rl(Wn(i),e)};Ih=function(i,e,t){return Wn(t?i:i-e)};var yi={ONE_SECOND_IN_TS:il,secondsToVideoTs:sl,secondsToAudioTs:rl,videoTsToSeconds:Wn,audioTsToSeconds:nl,audioTsToVideoTs:wh,videoTsToAudioTs:kh,metadataTsToSeconds:Ih};/** + * @license + * Video.js 8.18.1 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */var fo="8.18.1";const Bt={},ei=function(i,e){return Bt[i]=Bt[i]||[],e&&(Bt[i]=Bt[i].concat(e)),Bt[i]},j1=function(i,e){ei(i,e)},Ph=function(i,e){const t=ei(i).indexOf(e);return t<=-1?!1:(Bt[i]=Bt[i].slice(),Bt[i].splice(t,1),!0)},V1=function(i,e){ei(i,[].concat(e).map(t=>{const s=(...r)=>(Ph(i,s),t(...r));return s}))},yn={prefixed:!0},an=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Tc=an[0];let zs;for(let i=0;i(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let u=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(u=`%c${i}`,n.unshift(t)),n.unshift(u+":"),Ke){Ke.push([].concat(n));const m=Ke.length-1e3;Ke.splice(0,m>0?m:0)}if(!x.console)return;let d=x.console[s];!d&&s==="debug"&&(d=x.console.info||x.console.log),!(!d||!a||!o.test(s))&&d[Array.isArray(n)?"apply":"call"](x.console,n)};function po(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=H1(i,n,t),n.createLogger=(a,o,u)=>{const d=o!==void 0?o:e,m=u!==void 0?u:t,y=`${i} ${d} ${a}`;return po(y,d,m)},n.createNewLogger=(a,o,u)=>po(a,o,u),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>Ke?[].concat(Ke):[],n.history.filter=a=>(Ke||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ke&&(Ke.length=0)},n.history.disable=()=>{Ke!==null&&(Ke.length=0,Ke=null)},n.history.enable=()=>{Ke===null&&(Ke=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const J=po("VIDEOJS"),Lh=J.createLogger,z1=Object.prototype.toString,Oh=function(i){return Dt(i)?Object.keys(i):[]};function Wi(i,e){Oh(i).forEach(t=>e(i[t],t))}function Rh(i,e,t=0){return Oh(i).reduce((s,r)=>e(s,i[r],r),t)}function Dt(i){return!!i&&typeof i=="object"}function os(i){return Dt(i)&&z1.call(i)==="[object Object]"&&i.constructor===Object}function ue(...i){const e={};return i.forEach(t=>{t&&Wi(t,(s,r)=>{if(!os(s)){e[r]=s;return}os(e[r])||(e[r]={}),e[r]=ue(e[r],s)})}),e}function Nh(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Kn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var G1=Object.freeze({__proto__:null,each:Wi,reduce:Rh,isObject:Dt,isPlain:os,merge:ue,values:Nh,defineLazyProperty:Kn});let al=!1,Mh=null,wt=!1,Bh,Fh=!1,Ki=!1,Xi=!1,kt=!1,ol=null,Xn=null;const W1=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let Uh=null,_n=!1,Yn=!1,vn=!1,Qn=!1,Tn=!1,bn=!1,Sn=!1;const ar=!!(ms()&&("ontouchstart"in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),Yt=x.navigator&&x.navigator.userAgentData;Yt&&Yt.platform&&Yt.brands&&(wt=Yt.platform==="Android",Ki=!!Yt.brands.find(i=>i.brand==="Microsoft Edge"),Xi=!!Yt.brands.find(i=>i.brand==="Chromium"),kt=!Ki&&Xi,ol=Xn=(Yt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Yn=Yt.platform==="Windows");if(!Xi){const i=x.navigator&&x.navigator.userAgent||"";al=/iPod/i.test(i),Mh=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),wt=/Android/i.test(i),Bh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Fh=/Firefox/i.test(i),Ki=/Edg/i.test(i),Xi=/Chrome/i.test(i)||/CriOS/i.test(i),kt=!Ki&&Xi,ol=Xn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Uh=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),Tn=/Tizen/i.test(i),bn=/Web0S/i.test(i),Sn=Tn||bn,_n=/Safari/i.test(i)&&!kt&&!wt&&!Ki&&!Sn,Yn=/Windows/i.test(i),vn=/iPad/i.test(i)||_n&&ar&&!/iPhone/i.test(i),Qn=/iPhone/i.test(i)&&!vn}const ze=Qn||vn||al,Jn=(_n||ze)&&!kt;var $h=Object.freeze({__proto__:null,get IS_IPOD(){return al},get IOS_VERSION(){return Mh},get IS_ANDROID(){return wt},get ANDROID_VERSION(){return Bh},get IS_FIREFOX(){return Fh},get IS_EDGE(){return Ki},get IS_CHROMIUM(){return Xi},get IS_CHROME(){return kt},get CHROMIUM_VERSION(){return ol},get CHROME_VERSION(){return Xn},IS_CHROMECAST_RECEIVER:W1,get IE_VERSION(){return Uh},get IS_SAFARI(){return _n},get IS_WINDOWS(){return Yn},get IS_IPAD(){return vn},get IS_IPHONE(){return Qn},get IS_TIZEN(){return Tn},get IS_WEBOS(){return bn},get IS_SMART_TV(){return Sn},TOUCH_ENABLED:ar,IS_IOS:ze,IS_ANY_SAFARI:Jn});function bc(i){return typeof i=="string"&&!!i.trim()}function K1(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ms(){return U===x.document}function gs(i){return Dt(i)&&i.nodeType===1}function qh(){try{return x.parent!==x.self}catch{return!0}}function jh(i){return function(e,t){if(!bc(e))return U[i](null);bc(t)&&(t=U.querySelector(t));const s=gs(t)?t:U;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=U.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?si(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&ll(r,s),r}function si(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function mo(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function Ys(i,e){return K1(e),i.classList.contains(e)}function Ti(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Zn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(J.warn("removeClass was called with an element that doesn't exist"),null)}function Vh(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Hh(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Jt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function zh(i,e){return i.getAttribute(e)}function ls(i,e,t){i.setAttribute(e,t)}function ea(i,e){i.removeAttribute(e)}function Gh(){U.body.focus(),U.onselectstart=function(){return!1}}function Wh(){U.onselectstart=function(){return!0}}function us(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(cs(i,"height"))),t.width||(t.width=parseFloat(cs(i,"width"))),t}}function or(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==U[yn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function ta(i,e){const t={x:0,y:0};if(ze){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=cs(m,"transform");if(/^matrix/.test(y)){const T=y.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(y)){const T=y.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&x.WebKitCSSMatrix){const T=x.getComputedStyle(m.assignedSlot.parentElement).transform,E=new x.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=or(e.target),n=or(i),a=n.width,o=n.height;let u=e.offsetY-(n.top-r.top),d=e.offsetX-(n.left-r.left);return e.changedTouches&&(d=e.changedTouches[0].pageX-n.left,u=e.changedTouches[0].pageY+n.top,ze&&(d-=t.x,u-=t.y)),s.y=1-Math.max(0,Math.min(1,u/o)),s.x=Math.max(0,Math.min(1,d/a)),s}function Kh(i){return Dt(i)&&i.nodeType===3}function ia(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function Xh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),gs(e)||Kh(e))return e;if(typeof e=="string"&&/\S/.test(e))return U.createTextNode(e)}).filter(e=>e)}function ll(i,e){return Xh(e).forEach(t=>i.appendChild(t)),i}function Yh(i,e){return ll(ia(i),e)}function lr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const ti=jh("querySelector"),Qh=jh("querySelectorAll");function cs(i,e){if(!i||!e)return"";if(typeof x.getComputedStyle=="function"){let t;try{t=x.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Jh(i){[...U.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=U.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=U.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Zh=Object.freeze({__proto__:null,isReal:ms,isEl:gs,isInFrame:qh,createEl:W,textContent:si,prependTo:mo,hasClass:Ys,addClass:Ti,removeClass:Zn,toggleClass:Vh,setAttributes:Hh,getAttributes:Jt,getAttribute:zh,setAttribute:ls,removeAttribute:ea,blockTextSelection:Gh,unblockTextSelection:Wh,getBoundingClientRect:us,findPosition:or,getPointerPosition:ta,isTextNode:Kh,emptyEl:ia,normalizeContent:Xh,appendContent:ll,insertContent:Yh,isSingleLeftClick:lr,$:ti,$$:Qh,computedStyle:cs,copyStyleSheetsToWindow:Jh});let ef=!1,go;const X1=function(){if(go.options.autoSetup===!1)return;const i=Array.prototype.slice.call(U.getElementsByTagName("video")),e=Array.prototype.slice.call(U.getElementsByTagName("audio")),t=Array.prototype.slice.call(U.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Ne(i,e,t){if(!He.has(i))return;const s=He.get(i);if(!s.handlers)return;if(Array.isArray(e))return ul(Ne,i,e,t);const r=function(a,o){s.handlers[o]=[],Sc(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a=e&&(i(...r),t=n)}},rf=function(i,e,t,s=x){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,u=arguments;let d=function(){r=null,d=null,t||i.apply(o,u)};!r&&t&&i.apply(o,u),s.clearTimeout(r),r=s.setTimeout(d,e)};return a.cancel=n,a};var tS=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:ct,bind_:de,throttle:It,debounce:rf});let Fs;class rt{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},st(this,e,t),this.addEventListener=s}off(e,t){Ne(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},ra(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},cl(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=sa(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ys(this,e)}queueTrigger(e){Fs||(Fs=new Map);const t=e.type||e;let s=Fs.get(this);s||(s=new Map,Fs.set(this,s));const r=s.get(t);s.delete(t),x.clearTimeout(r);const n=x.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Fs.delete(this)),this.trigger(e)},0);s.set(t,n)}}rt.prototype.allowedEvents_={};rt.prototype.addEventListener=rt.prototype.on;rt.prototype.removeEventListener=rt.prototype.off;rt.prototype.dispatchEvent=rt.prototype.trigger;const na=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,$t=i=>i instanceof rt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),iS=(i,e)=>{$t(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},vo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,xn=(i,e,t)=>{if(!i||!i.nodeName&&!$t(i))throw new Error(`Invalid target for ${na(e)}#${t}; must be a DOM node or evented object.`)},nf=(i,e,t)=>{if(!vo(i))throw new Error(`Invalid event type for ${na(e)}#${t}; must be a non-empty string or array.`)},af=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${na(e)}#${t}; must be a function.`)},ja=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),xn(r,i,t),nf(n,i,t),af(a,i,t),a=de(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},fi=(i,e,t,s)=>{xn(i,i,e),i.nodeName?eS[e](i,t,s):i[e](t,s)},sS={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=ja(this,i,"on");if(fi(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,fi(this,"on","dispose",n),fi(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=ja(this,i,"one");if(e)fi(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,fi(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=ja(this,i,"any");if(e)fi(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,fi(t,"any",s,n)}},off(i,e,t){if(!i||vo(i))Ne(this.eventBusEl_,i,e);else{const s=i,r=e;xn(s,this,"off"),nf(r,this,"off"),af(t,this,"off"),t=de(this,t),this.off("dispose",t),s.nodeName?(Ne(s,r,t),Ne(s,"dispose",t)):$t(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){xn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!vo(t))throw new Error(`Invalid event type for ${na(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ys(this.eventBusEl_,i,e)}};function dl(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,sS),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&He.has(s)&&He.delete(s)}),x.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const rS={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Wi(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&$t(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function of(i,e){return Object.assign(i,rS),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&$t(i)&&i.on("statechanged",i.handleStateChanged),i}const Qs=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},_e=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},lf=function(i,e){return _e(i)===_e(e)};var nS=Object.freeze({__proto__:null,toLowerCase:Qs,toTitleCase:_e,titleCaseEquals:lf});let B=class We{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ue({},this.options_),t=this.options_=ue(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${ut()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(dl(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),of(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=ue(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],u=n&&n[o];let d=s;return a&&a[e]?d=a[e]:u&&u[e]&&(d=u[e]),t&&(d=d.replace(/\{(\d+)\}/g,function(m,y){const T=t[y-1];let E=T;return typeof T>"u"&&(E=m),E})),d}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[_e(e.name())]=null,this.childNameIndex_[Qs(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let u=a.opts;if(t[o]!==void 0&&(u=t[o]),u===!1)return;u===!0&&(u={}),u.playerOptions=this.options_.playerOptions;const d=this.addChild(o,u);d&&(this[o]=d)};let r;const n=We.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,u;return typeof a=="string"?(o=a,u=e[o]||this.options_[o]||{}):(o=a.name,u=a),{name:o,opts:u}}).filter(a=>{const o=We.getComponent(a.opts.componentClass||_e(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ti(e,t||this.contentEl())}$$(e,t){return Qh(e,t||this.contentEl())}hasClass(e){return Ys(this.el_,e)}addClass(...e){Ti(this.el_,...e)}removeClass(...e){Zn(this.el_,...e)}toggleClass(e,t){Vh(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return zh(this.el_,e)}setAttribute(e,t){ls(this.el_,e,t)}removeAttribute(e){ea(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+_e(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=cs(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${_e(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const u=o.touches[0].pageX-t.pageX,d=o.touches[0].pageY-t.pageY;Math.sqrt(u*u+d*d)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&x.performance.now()-e{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=de(this,e),this.clearTimersOnDispose_();const s=x.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=de(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=de(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=x.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||x.getComputedStyle(n).height==="0px"||x.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(U.documentElement.clientWidth||x.innerWidth)||a.y<0||a.y>(U.documentElement.clientHeight||x.innerHeight))return!1;let o=U.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=We.getComponent("Tech"),r=s&&s.isTech(t),n=We===t||We.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=_e(e),We.components_||(We.components_={});const a=We.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,u=Object.keys(o);if(o&&u.length>0&&u.map(d=>o[d]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return We.components_[e]=t,We.components_[Qs(e)]=t,t}static getComponent(e){if(!(!e||!We.components_))return We.components_[e]}};B.registerComponent("Component",B);function aS(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function xc(i,e,t,s){return aS(i,s,t.length-1),t[s][e]}function Va(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:xc.bind(null,"start",0,i),end:xc.bind(null,"end",1,i)},x.Symbol&&x.Symbol.iterator&&(e[x.Symbol.iterator]=()=>(i||[]).values()),e}function mt(i,e){return Array.isArray(i)?Va(i):i===void 0||e===void 0?Va():Va([[i,e]])}const uf=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let hl=uf;function cf(i){hl=i}function df(){hl=uf}function Ai(i,e=i){return hl(i,e)}var oS=Object.freeze({__proto__:null,createTimeRanges:mt,createTimeRange:mt,setFormatTime:cf,resetFormatTime:df,formatTime:Ai});function hf(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=mt(0,0));for(let n=0;ne&&(r=e),t+=r-s;return t/e}function ye(i){if(i instanceof ye)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Dt(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=ye.defaultMessages[this.code]||"")}ye.prototype.code=0;ye.prototype.message="";ye.prototype.status=null;ye.prototype.metadata=null;ye.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ye.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."};ye.MEDIA_ERR_CUSTOM=0;ye.prototype.MEDIA_ERR_CUSTOM=0;ye.MEDIA_ERR_ABORTED=1;ye.prototype.MEDIA_ERR_ABORTED=1;ye.MEDIA_ERR_NETWORK=2;ye.prototype.MEDIA_ERR_NETWORK=2;ye.MEDIA_ERR_DECODE=3;ye.prototype.MEDIA_ERR_DECODE=3;ye.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.MEDIA_ERR_ENCRYPTED=5;ye.prototype.MEDIA_ERR_ENCRYPTED=5;function Js(i){return i!=null&&typeof i.then=="function"}function bt(i){Js(i)&&i.then(null,e=>{})}const To=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},lS=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=To(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(To))},uS=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var Ec={textTracksToJson:lS,jsonToTextTracks:uS,trackToJson_:To};const Ha="vjs-modal-dialog";let _s=class extends B{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${Ha}-content`},{role:"document"}),this.descEl_=W("p",{className:`${Ha}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),si(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ha} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),Yh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),ia(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=U.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof x.HTMLAnchorElement||t instanceof x.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof x.HTMLInputElement||t instanceof x.HTMLSelectElement||t instanceof x.HTMLTextAreaElement||t instanceof x.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof x.HTMLIFrameElement||t instanceof x.HTMLObjectElement||t instanceof x.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};_s.prototype.options_={pauseOnOpen:!0,temporary:!0};B.registerComponent("ModalDialog",_s);class ds extends rt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},$t(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s=0;t--)if(e[t].enabled){za(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&za(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,za(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ga=function(i,e){for(let t=0;t=0;t--)if(e[t].selected){Ga(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ga(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class ff extends ds{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class hS{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>J.error(r)),x.console&&x.console.groupEnd&&x.console.groupEnd()),t.flush()},Dc=function(i,e){const t={uri:i},s=aa(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Nd(t,de(this,function(n,a,o){if(n)return J.error(n,a);e.loaded_=!0,typeof x.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],u=>{if(u.type==="vttjserror"){J.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Ac(o,e)}):Ac(o,e)}))};class gr extends fl{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=ue(e,{kind:mS[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=Cc[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new En(this.cues_),a=new En(this.activeCues_);let o=!1;this.timeupdateHandler=de(this,function(d={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const u=()=>{this.stopTracking()};this.tech_.one("dispose",u),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(d){Cc[d]&&s!==d&&(s=d,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Dc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const d=this.tech_.currentTime(),m=[];for(let y=0,T=this.cues.length;y=d&&m.push(E)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let y=0;y{t=Ht.LOADED,this.trigger({type:"load",target:this})})}}Ht.prototype.allowedEvents_={load:"load"};Ht.NONE=0;Ht.LOADING=1;Ht.LOADED=2;Ht.ERROR=3;const lt={audio:{ListClass:cS,TrackClass:mf,capitalName:"Audio"},video:{ListClass:dS,TrackClass:gf,capitalName:"Video"},text:{ListClass:ff,TrackClass:gr,capitalName:"Text"}};Object.keys(lt).forEach(function(i){lt[i].getterName=`${i}Tracks`,lt[i].privateName=`${i}Tracks_`});const hs={remoteText:{ListClass:ff,TrackClass:gr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:hS,TrackClass:Ht,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},je=Object.assign({},lt,hs);hs.names=Object.keys(hs);lt.names=Object.keys(lt);je.names=[].concat(hs.names).concat(lt.names);function yS(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new je.text.TrackClass(r);return n.addTrack(a),a}class Y extends B{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),je.names.forEach(s=>{const r=je[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new je.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(de(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return mt(0,0)}bufferedPercent(){return hf(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(lt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ye(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?mt(0,0):mt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){lt.names.forEach(e=>{const t=lt[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!x.WebVTT)if(U.body.contains(this.el())){if(!this.options_["vtt.js"]&&os(Hu)&&Object.keys(Hu).length>0){this.trigger("vttjsloaded");return}const e=U.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;othis.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=ut();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=_e(e),Y.techs_[e]=t,Y.techs_[Qs(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=_e(e),x&&x.videojs&&x.videojs[e])return J.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}je.names.forEach(function(i){const e=je[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;npi(e,bi[e.type],t,i),1)}function TS(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function bS(i,e,t){return i.reduceRight(gl(t),e[t]())}function SS(i,e,t,s){return e[t](i.reduce(gl(t),s))}function wc(i,e,t,s=null){const r="call"+_e(t),n=i.reduce(gl(r),s),a=n===An,o=a?null:e[t](n);return CS(i,t,o,a),o}const xS={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ES={setCurrentTime:1,setMuted:1,setVolume:1},kc={play:1,pause:1};function gl(i){return(e,t)=>e===An?An:t[i]?t[i](e):e}function CS(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function AS(i){Cn.hasOwnProperty(i.id())&&delete Cn[i.id()]}function DS(i,e){const t=Cn[i.id()];let s=null;if(t==null)return s=e(i),Cn[i.id()]=[[e,s]],s;for(let r=0;r{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;const Pc=Tn?10009:bn?461:8,Bi={codes:{play:415,pause:19,ff:417,rw:412,back:Pc},names:{415:"play",19:"pause",417:"ff",412:"rw",[Pc]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},Lc=5;class PS extends rt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Bi.isEventKey(t,"play")||Bi.isEventKey(t,"pause")||Bi.isEventKey(t,"ff")||Bi.isEventKey(t,"rw")){t.preventDefault();const s=Bi.getEventName(t);this.performMediaAction_(s)}else Bi.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+Lc);break;case"rw":this.userSeek_(this.player_.currentTime()-Lc);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,u)=>{t.push({name:()=>"ModalButton"+(u+1),el:()=>o,getPositions:()=>{const d=o.getBoundingClientRect(),m={x:d.x,y:d.y,width:d.width,height:d.height,top:d.top,right:d.right,bottom:d.bottom,left:d.left},y={x:d.left+d.width/2,y:d.top+d.height/2,width:0,height:0,top:d.top+d.height/2,right:d.left+d.width/2,bottom:d.top+d.height/2,left:d.left+d.width/2};return{boundingClientRect:m,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:d=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,u=this.calculateDistance_(e,o,s);u=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&J.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,si(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("ClickableComponent",oa);class bo extends oa{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?bt(this.player_.play()):this.player_.pause())}}bo.prototype.crossorigin=bo.prototype.crossOrigin;B.registerComponent("PosterImage",bo);const at="#222",Oc="#ccc",OS={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 Wa(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function _t(i,e,t){try{i.style[e]=t}catch{return}}function Rc(i){return i?`${i}px`:""}class RS extends B{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(de(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=x.screen.orientation||x,o=x.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const u=this.options_.playerOptions.tracks||[];for(let d=0;d0&&o.forEach(m=>{if(m.style.inset){const y=m.style.inset.split(" ");y.length===3&&Object.assign(m.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!x.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),_t(this.el_,"insetInline",Rc(n)),_t(this.el_,"insetBlock",Rc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&_t(a.firstChild,"color",Wa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&_t(a.firstChild,"backgroundColor",Wa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?_t(a,"backgroundColor",Wa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${at}, 2px 2px 4px ${at}, 2px 2px 5px ${at}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${at}, 2px 2px ${at}, 3px 3px ${at}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Oc}, 0 1px ${Oc}, -1px -1px ${at}, 0 -1px ${at}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${at}, 0 0 4px ${at}, 0 0 4px ${at}, 0 0 4px ${at}`)),t.fontPercent&&t.fontPercent!==1){const o=x.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=OS[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;sthis.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){bt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Js(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}_f.prototype.controlText_="Play Video";B.registerComponent("BigPlayButton",_f);class MS extends Me{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("CloseButton",MS);class vf extends Me{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?bt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}vf.prototype.controlText_="Play";B.registerComponent("PlayToggle",vf);class vs extends B{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Ai(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,J.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=U.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}vs.prototype.labelText_="Time";vs.prototype.controlText_="Time";B.registerComponent("TimeDisplay",vs);class yl extends vs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}yl.prototype.labelText_="Current Time";yl.prototype.controlText_="Current Time";B.registerComponent("CurrentTimeDisplay",yl);class _l extends vs{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}_l.prototype.labelText_="Duration";_l.prototype.controlText_="Duration";B.registerComponent("DurationDisplay",_l);class BS extends B{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}B.registerComponent("TimeDivider",BS);class vl extends vs{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}vl.prototype.labelText_="Remaining Time";vl.prototype.controlText_="Remaining Time";B.registerComponent("RemainingTimeDisplay",vl);class FS extends B{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(U.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}B.registerComponent("LiveDisplay",FS);class Tf extends Me{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}Tf.prototype.controlText_="Seek to live, currently playing live";B.registerComponent("SeekToLive",Tf);function yr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var US=Object.freeze({__proto__:null,clamp:yr});class Tl extends B{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!kt&&e.preventDefault(),Gh(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Wh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(yr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=ta(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}B.registerComponent("Slider",Tl);const Ka=(i,e)=>yr(i/e*100,0,100).toFixed(2)+"%";class $S extends B{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=U.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Ka(n,r);this.percent_!==o&&(this.el_.style.width=o,si(this.percentageEl_,o),this.percent_=o);for(let u=0;us.length;u--)this.el_.removeChild(a[u-1]);a.length=s.length})}}B.registerComponent("LoadProgressBar",$S);class qS extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=or(this.el_),n=us(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,u=e.width-a+(n.right-e.right);u||(u=e.width-a,o=a);let d=r.width/2;or.width&&(d=r.width),d=Math.round(d),this.el_.style.right=`-${d}px`,this.write(s)}write(e){si(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),u=o-t*o;n=(u<1?"":"-")+Ai(u,o)}else n=Ai(s,a);this.update(e,t,n),r&&r()})}}B.registerComponent("TimeTooltip",qS);class bl extends B{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}bl.prototype.options_={children:[]};!ze&&!wt&&bl.prototype.options_.children.push("timeTooltip");B.registerComponent("PlayProgressBar",bl);class bf extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}bf.prototype.options_={children:["timeTooltip"]};B.registerComponent("MouseTimeDisplay",bf);const Jr=5,Nc=12;class Sl extends Tl{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=de(this,this.update),this.update=It(this.update_,ct),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.on(U,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){U.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ct))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(U.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ai(s,n),Ai(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(us(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){lr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!lr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?bt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Jr)}stepBack(){this.userSeek_(this.player_.currentTime()-Jr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Jr*Nc)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Jr*Nc)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.off(U,"visibilitychange",this.toggleVisibility_),super.dispose()}}Sl.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ze&&!wt&&Sl.prototype.options_.children.splice(1,0,"mouseTimeDisplay");B.registerComponent("SeekBar",Sl);class Sf extends B{constructor(e,t){super(e,t),this.handleMouseMove=It(de(this,this.handleMouseMove),ct),this.throttledHandleMouseSeek=It(de(this,this.handleMouseSeek),ct),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=or(n);let o=ta(n,e).x;o=yr(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&bt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Sf.prototype.options_={children:["seekBar"]};B.registerComponent("ProgressControl",Sf);class xf extends Me{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){U.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof U.exitPictureInPicture=="function"&&super.show()}}xf.prototype.controlText_="Picture-in-Picture";B.registerComponent("PictureInPictureToggle",xf);class Ef extends Me{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),U[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Ef.prototype.controlText_="Fullscreen";B.registerComponent("FullscreenToggle",Ef);const jS=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class VS extends B{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}B.registerComponent("VolumeLevel",VS);class HS extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=us(this.el_),a=us(this.player_.el()),o=e.width*t;if(!a||!n)return;const u=e.left-a.left+o,d=e.width-o+(a.right-e.right);let m=n.width/2;un.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){si(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}B.registerComponent("VolumeLevelTooltip",HS);class Cf extends B{constructor(e,t){super(e,t),this.update=It(de(this,this.update),ct)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Cf.prototype.options_={children:["volumeLevelTooltip"]};B.registerComponent("MouseVolumeLevelDisplay",Cf);class la extends Tl{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){lr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=us(s),n=this.vertical();let a=ta(s,e);a=n?a.y:a.x,a=yr(a,0,1),t.update(r,a,n)}lr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}la.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ze&&!wt&&la.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");la.prototype.playerEvent="volumechange";B.registerComponent("VolumeBar",la);class Af extends B{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||os(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),jS(this,e),this.throttledHandleMouseMove=It(de(this,this.handleMouseMove),ct),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Af.prototype.options_={children:["volumeBar"]};B.registerComponent("VolumeControl",Af);const zS=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Df extends Me{constructor(e,t){super(e,t),zS(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ze&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Zn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),Ti(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Df.prototype.controlText_="Mute";B.registerComponent("MuteToggle",Df);class wf extends B{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||os(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),st(U,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Ne(U,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}wf.prototype.options_={children:["muteToggle","volumeControl"]};B.registerComponent("VolumePanel",wf);class kf extends Me{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}kf.prototype.controlText_="Skip Forward";B.registerComponent("SkipForward",kf);class If extends Me{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}If.prototype.controlText_="Skip Backward";B.registerComponent("SkipBackward",If);class Pf extends B{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof B&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof B&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),st(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||U.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}B.registerComponent("Menu",Pf);class xl extends B{constructor(e,t={}){super(e,t),this.menuButton_=new Me(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Me.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),st(U,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Pf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:_e(this.options_.title),tabIndex:-1}),s=new B(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof x.Event!="object")try{o=new x.Event("change")}catch{}o||(o=U.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}B.registerComponent("OffTextTrackMenuItem",Lf);class Ts extends El{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=vr){let s;this.label_&&(s=`${this.label_} off`),e.push(new Lf(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}B.registerComponent("TextTrackButton",Ts);class Of extends _r{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(_e(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(_e(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new wl(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Rf),e}}Il.prototype.kinds_=["captions","subtitles"];Il.prototype.controlText_="Subtitles";B.registerComponent("SubsCapsButton",Il);class Nf extends _r{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;sthis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Pl.prototype.contentElType="button";B.registerComponent("PlaybackRateMenuItem",Pl);class Bf extends xl{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new Pl(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Bf.prototype.controlText_="Playback Rate";B.registerComponent("PlaybackRateMenuButton",Bf);class Ff extends B{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}B.registerComponent("Spacer",Ff);class GS extends Ff{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}B.registerComponent("CustomControlSpacer",GS);class Uf extends B{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Uf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};B.registerComponent("ControlBar",Uf);class $f extends _s{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}$f.prototype.options_=Object.assign({},_s.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});B.registerComponent("ErrorDisplay",$f);class qf extends B{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${ut()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:t[1]});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}B.registerComponent("TextTrackSelect",qf);class Si extends B{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,u=a.id.replace("%s",this.options_.id_);let d=null;const m=`vjs_select_${ut()}`;if(this.options_.type==="colors"){d=W("span",{className:o});const T=W("label",{id:u,className:"vjs-label",textContent:a.label});T.setAttribute("for",m),d.appendChild(T)}const y=new qf(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:u});this.addChild(y),this.options_.type==="colors"&&(d.appendChild(y.el()),this.el().appendChild(d))}}createEl(){return W("fieldset",{className:this.options_.className})}}B.registerComponent("TextTrackFieldset",Si);class jf extends B{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Si(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Si(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Si(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}B.registerComponent("TextTrackSettingsColors",jf);class Vf extends B{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new Si(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Si(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Si(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}B.registerComponent("TextTrackSettingsFont",Vf);class Hf extends B{constructor(e,t={}){super(e,t);const s=this.localize("restore all settings to the default values"),r=new Me(e,{controlText:s,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new Me(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}B.registerComponent("TrackSettingsControls",Hf);const Xa="vjs-text-track-settings",Mc=["#000","Black"],Bc=["#00F","Blue"],Fc=["#0FF","Cyan"],Uc=["#0F0","Green"],$c=["#F0F","Magenta"],qc=["#F00","Red"],jc=["#FFF","White"],Vc=["#FF0","Yellow"],Ya=["1","Opaque"],Qa=["0.5","Semi-Transparent"],Hc=["0","Transparent"],Zt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Mc,jc,qc,Uc,Bc,Vc,$c,Fc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ya,Qa,Hc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[jc,Mc,qc,Uc,Bc,Vc,$c,Fc],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ya,Qa],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Hc,Qa,Ya],className:"vjs-window-opacity vjs-opacity"}};Zt.windowColor.options=Zt.backgroundColor.options;function zf(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function WS(i,e){const t=i.options[i.options.selectedIndex].value;return zf(t,e)}function KS(i,e,t){if(e){for(let s=0;s{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Wi(Zt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return Rh(Zt,(e,t,s)=>{const r=WS(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Wi(Zt,(t,s)=>{KS(this.$(t.selector),e[s],t.parser)})}setDefaults(){Wi(Zt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem(Xa))}catch(t){J.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem(Xa,JSON.stringify(e)):x.localStorage.removeItem(Xa)}catch(t){J.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}B.registerComponent("TextTrackSettings",XS);class YS extends B{constructor(e,t){let s=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=ue({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=rf(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Ne(this,"resize",n),Ne(this,"unload",a),a=null};st(this.el_.contentWindow,"unload",a),st(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}B.registerComponent("ResizeManager",YS);const QS={trackingThreshold:20,liveTolerance:15};class JS extends B{constructor(e,t){const s=ue(QS,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(x.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ct),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}B.registerComponent("LiveTracker",JS);class ZS extends B{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${ut()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${ut()}`})},W("div",{className:"vjs-title-bar"},{},Nh(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];ia(a),n&&si(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}B.registerComponent("TitleBar",ZS);const ex={initialDisplay:4e3,position:[],takeFocus:!1};class tx extends Me{constructor(e,t){t=ue(ex,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}B.registerComponent("TransientButton",tx);const So=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let s=0;sGf([i.el(),x.HTMLMediaElement.prototype,x.Element.prototype,ix],"innerHTML"),zc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=sx(i),r=n=>(...a)=>{const o=n.apply(e,a);return So(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",ue(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},rx=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?pf(x.Element.prototype.getAttribute.call(this,"src")):""},set(i){return x.Element.prototype.setAttribute.call(this,"src",i),i}}),nx=i=>Gf([i.el(),x.HTMLMediaElement.prototype,rx],"src"),ax=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=nx(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",ue(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return So(i)||(i.triggerSourceset(""),zc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):So(i)||zc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class j extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const u=n[a];u.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(u),this.remoteTextTracks().addTrack(u.track),this.textTracks().addTrack(u.track),!r&&!this.el_.hasAttribute("crossorigin")&&aa(u.src)&&(r=!0)):o.push(u))}for(let u=0;u{t=[];for(let n=0;ne.removeEventListener("change",s));const r=()=>{for(let n=0;n{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=lt[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const u={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(u),e==="text"&&this[hs.remoteText.getterName]().trigger(u)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let u=0;u{const u=n[o];s.addEventListener(o,u),this.on("dispose",d=>s.removeEventListener(o,u))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){lt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),j.disposeMediaElement(e),e=s}else{e=U.createElement("video");const s=this.options_.tag&&Jt(this.options_.tag),r=ue({},s);(!ar||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Hh(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&ls(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Jn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){J(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&wt&&kt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)bt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){j.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=U.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}Kn(j,"TEST_VID",function(){if(!ms())return;const i=U.createElement("video"),e=U.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});j.isSupported=function(){try{j.TEST_VID.volume=.5}catch{return!1}return!!(j.TEST_VID&&j.TEST_VID.canPlayType)};j.canPlayType=function(i){return j.TEST_VID.canPlayType(i)};j.canPlaySource=function(i,e){return j.canPlayType(i.type)};j.canControlVolume=function(){try{const i=j.TEST_VID.volume;j.TEST_VID.volume=i/2+.1;const e=i!==j.TEST_VID.volume;return e&&ze?(x.setTimeout(()=>{j&&j.prototype&&(j.prototype.featuresVolumeControl=i!==j.TEST_VID.volume)}),!1):e}catch{return!1}};j.canMuteVolume=function(){try{const i=j.TEST_VID.muted;return j.TEST_VID.muted=!i,j.TEST_VID.muted?ls(j.TEST_VID,"muted","muted"):ea(j.TEST_VID,"muted","muted"),i!==j.TEST_VID.muted}catch{return!1}};j.canControlPlaybackRate=function(){if(wt&&kt&&Xn<58)return!1;try{const i=j.TEST_VID.playbackRate;return j.TEST_VID.playbackRate=i/2+.1,i!==j.TEST_VID.playbackRate}catch{return!1}};j.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(U.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};j.supportsNativeTextTracks=function(){return Jn||ze&&kt};j.supportsNativeVideoTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.videoTracks)};j.supportsNativeAudioTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.audioTracks)};j.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([i,e]){Kn(j.prototype,i,()=>j[e](),!0)});j.prototype.featuresVolumeControl=j.canControlVolume();j.prototype.movingMediaElementInDOM=!ze;j.prototype.featuresFullscreenResize=!0;j.prototype.featuresProgressEvents=!0;j.prototype.featuresTimeupdateEvents=!0;j.prototype.featuresVideoFrameCallback=!!(j.TEST_VID&&j.TEST_VID.requestVideoFrameCallback);j.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};j.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(j);j.nativeSourceHandler={};j.nativeSourceHandler.canPlayType=function(i){try{return j.TEST_VID.canPlayType(i)}catch{return""}};j.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return j.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=ml(i.src);return j.nativeSourceHandler.canPlayType(`video/${t}`)}return""};j.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};j.nativeSourceHandler.dispose=function(){};j.registerSourceHandler(j.nativeSourceHandler);Y.registerTech("Html5",j);const Wf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ja={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},xo=["tiny","xsmall","small","medium","large","xlarge","huge"],on={};xo.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;on[i]=`vjs-layout-${e}`});const ox={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let ke=class $i extends B{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${ut()}`,t=Object.assign($i.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Lh(this.id_),this.fsApi_=yn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Jt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=$i.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),dl(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(st(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=ue(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new x.DOMParser().parseFromString(IS,"image/svg+xml");if(o.querySelector("parsererror"))J.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const d=o.documentElement;d.style.display="none",this.el_.appendChild(d),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new PS(this),this.addClass("vjs-spatial-navigation-enabled")),ar&&this.addClass("vjs-touch-enabled"),ze||this.addClass("vjs-workinghover"),$i.players[this.id_]=this;const n=fo.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Ne(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ne(U,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),$i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),AS(this),je.names.forEach(e=>{const t=je[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Jt(e);if(r){for(t=this.el_=e,e=this.tag=U.createElement("video");t.children.length;)e.appendChild(t.firstChild);Ys(t,"video-js")||Ti(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(u=>{try{e[u]=t[u]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",kt&&Yn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(u){r&&u==="class"||t.setAttribute(u,n[u]),r&&e.setAttribute(u,n[u])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(u=>$h[u]).map(u=>"vjs-device-"+u.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=tf("vjs-styles-dimensions");const u=ti(".vjs-styles-defaults"),d=ti("head");d.insertBefore(this.styleEl_,u?u.nextSibling:d.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let u=0;u"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){J.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){J.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,$t(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),iS(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,u=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(o>=0&&(d.width=o),u>=0&&(d.height=u));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),sf(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${a*100}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=_e(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};je.names.forEach(u=>{const d=je[u];a[d.getterName]=this[d.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=Y.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(de(this,this.handleTechReady_),!0),Ec.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Wf.forEach(u=>{this.on(this.tech_,u,d=>this[`handleTech${_e(u)}_`](d))}),Object.keys(Ja).forEach(u=>{this.on(this.tech_,u,d=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ja[u]}_`].bind(this),event:d});return}this[`handleTech${Ja[u]}_`](d)})}),this.on(this.tech_,"loadstart",u=>this.handleTechLoadStart_(u)),this.on(this.tech_,"sourceset",u=>this.handleTechSourceset_(u)),this.on(this.tech_,"waiting",u=>this.handleTechWaiting_(u)),this.on(this.tech_,"ended",u=>this.handleTechEnded_(u)),this.on(this.tech_,"seeking",u=>this.handleTechSeeking_(u)),this.on(this.tech_,"play",u=>this.handleTechPlay_(u)),this.on(this.tech_,"pause",u=>this.handleTechPause_(u)),this.on(this.tech_,"durationchange",u=>this.handleTechDurationChange_(u)),this.on(this.tech_,"fullscreenchange",(u,d)=>this.handleTechFullscreenChange_(u,d)),this.on(this.tech_,"fullscreenerror",(u,d)=>this.handleTechFullscreenError_(u,d)),this.on(this.tech_,"enterpictureinpicture",u=>this.handleTechEnterPictureInPicture_(u)),this.on(this.tech_,"leavepictureinpicture",u=>this.handleTechLeavePictureInPicture_(u)),this.on(this.tech_,"error",u=>this.handleTechError_(u)),this.on(this.tech_,"posterchange",u=>this.handleTechPosterChange_(u)),this.on(this.tech_,"textdata",u=>this.handleTechTextData_(u)),this.on(this.tech_,"ratechange",u=>this.handleTechRateChange_(u)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&mo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){je.names.forEach(e=>{const t=je[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Ec.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&J.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":fo}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Js(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Js(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Js(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=kS(this,t)),this.cache_.source=ue({},e,{src:t,type:s});const r=this.cache_.sources.filter(u=>u.src&&u.src===t),n=[],a=this.$$("source"),o=[];for(let u=0;uthis.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?bt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=U[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in ES)return SS(this.middleware_,this.tech_,e,t);if(e in kc)return wc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw J(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in xS)return bS(this.middleware_,this.tech_,e);if(e in kc)return wc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(J(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(J(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(J(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=bt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Jn||ze);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||mt(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=mt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=mt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return hf(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(d,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const u=t.requestFullscreenHelper_(e);u&&(u.then(n,n),u.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(u,d){r(),s(d)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=U[this.fsApi_.exitFullscreen]();return e&&bt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=U.documentElement.style.overflow,st(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow="hidden",Ti(U.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Ne(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow=this.docOrigOverflow,Zn(U.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){const e=U.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Jh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in U&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in U)return U.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=B.getComponent("FullscreenToggle");U[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),B.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),B.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s[o,Y.getTech(o)]).filter(([o,u])=>u?u.isSupported():(J.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,u,d){let m;return o.some(y=>u.some(T=>{if(m=d(y,T),m)return!0})),m};let r;const n=o=>(u,d)=>o(d,u),a=([o,u],d)=>{if(u.canPlaySource(d,this.options_[o.toLowerCase()]))return{source:d,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=yf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),vS(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}TS(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?lf(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();bt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),$t(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(ei("beforeerror").forEach(t=>{const s=t(this,e);if(!(Dt(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ye(e),this.addClass("vjs-error"),J.error(`(CODE:${this.error_.code} ${ye.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),ei("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=de(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==s)&&(t=y.screenX,s=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const u=this.getChild("controlBar");u&&!ze&&!wt&&(u.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),u.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let d;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(d);const y=this.options_.inactivityTimeout;y<=0||(d=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),$t(this)&&this.trigger("languagechange"))}languages(){return ue($i.prototype.options_.languages,this.languages_)}toJSON(){const e=ue(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;sthis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Dn(r.poster)}]),r}return ue(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Jt(e),r=s["data-setup"];if(Ys(e,"vjs-fill")&&(s.fill=!0),Ys(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){J.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};je.names.forEach(function(i){const e=je[i];ke.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});ke.prototype.crossorigin=ke.prototype.crossOrigin;ke.players={};const Us=x.navigator;ke.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Us&&(Us.languages&&Us.languages[0]||Us.userLanguage||Us.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};Wf.forEach(function(i){ke.prototype[`handleTech${_e(i)}_`]=function(){return this.trigger(i)}});B.registerComponent("Player",ke);const wn="plugin",Yi="activePlugins_",Vi={},kn=i=>Vi.hasOwnProperty(i),ln=i=>kn(i)?Vi[i]:void 0,Kf=(i,e)=>{i[Yi]=i[Yi]||{},i[Yi][e]=!0},In=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},lx=function(i,e){const t=function(){In(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return Kf(this,i),In(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},Gc=(i,e)=>(e.prototype.name=i,function(...t){In(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,In(this,s.getEventHash()),s});let Pt=class un{constructor(e){if(this.constructor===un)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),dl(this),delete this.trigger,of(this,this.constructor.defaultState),Kf(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ys(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Yi][e]=!1,this.player=this.state=null,t[e]=Gc(e,Vi[e])}static isBasic(e){const t=typeof e=="string"?ln(e):e;return typeof t=="function"&&!un.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(kn(e))J.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ke.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Vi[e]=t,e!==wn&&(un.isBasic(t)?ke.prototype[e]=lx(e,t):ke.prototype[e]=Gc(e,t)),t}static deregisterPlugin(e){if(e===wn)throw new Error("Cannot de-register base plugin.");kn(e)&&(delete Vi[e],delete ke.prototype[e])}static getPlugins(e=Object.keys(Vi)){let t;return e.forEach(s=>{const r=ln(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=ln(e);return t&&t.VERSION||""}};Pt.getPlugin=ln;Pt.BASE_PLUGIN_NAME=wn;Pt.registerPlugin(wn,Pt);ke.prototype.usingPlugin=function(i){return!!this[Yi]&&this[Yi][i]===!0};ke.prototype.hasPlugin=function(i){return!!kn(i)};function ux(i,e){let t=!1;return function(...s){return t||J.warn(i),t=!0,e.apply(this,s)}}function gt(i,e,t,s){return ux(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var cx={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Xf=i=>i.indexOf("#")===0?i.slice(1):i;function D(i,e,t){let s=D.getPlayer(i);if(s)return e&&J.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?ti("#"+Xf(i)):i;if(!gs(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof x.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&J.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),ei("beforesetup").forEach(u=>{const d=u(r,ue(e));if(!Dt(d)||Array.isArray(d)){J.error("please return an object in beforesetup hooks");return}e=ue(e,d)});const o=B.getComponent("Player");return s=new o(r,e,t),ei("setup").forEach(u=>u(s)),s}D.hooks_=Bt;D.hooks=ei;D.hook=j1;D.hookOnce=V1;D.removeHook=Ph;if(x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ms()){let i=ti(".vjs-styles-defaults");if(!i){i=tf("vjs-styles-defaults");const e=ti("head");e&&e.insertBefore(i,e.firstChild),sf(i,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}yo(1,D);D.VERSION=fo;D.options=ke.prototype.options_;D.getPlayers=()=>ke.players;D.getPlayer=i=>{const e=ke.players;let t;if(typeof i=="string"){const s=Xf(i),r=e[s];if(r)return r;t=ti("#"+s)}else t=i;if(gs(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};D.getAllPlayers=()=>Object.keys(ke.players).map(i=>ke.players[i]).filter(Boolean);D.players=ke.players;D.getComponent=B.getComponent;D.registerComponent=(i,e)=>(Y.isTech(e)&&J.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),B.registerComponent.call(B,i,e));D.getTech=Y.getTech;D.registerTech=Y.registerTech;D.use=_S;Object.defineProperty(D,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(D.middleware,"TERMINATOR",{value:An,writeable:!1,enumerable:!0});D.browser=$h;D.obj=G1;D.mergeOptions=gt(9,"videojs.mergeOptions","videojs.obj.merge",ue);D.defineLazyProperty=gt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Kn);D.bind=gt(9,"videojs.bind","native Function.prototype.bind",de);D.registerPlugin=Pt.registerPlugin;D.deregisterPlugin=Pt.deregisterPlugin;D.plugin=(i,e)=>(J.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Pt.registerPlugin(i,e));D.getPlugins=Pt.getPlugins;D.getPlugin=Pt.getPlugin;D.getPluginVersion=Pt.getPluginVersion;D.addLanguage=function(i,e){return i=(""+i).toLowerCase(),D.options.languages=ue(D.options.languages,{[i]:e}),D.options.languages[i]};D.log=J;D.createLogger=Lh;D.time=oS;D.createTimeRange=gt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",mt);D.createTimeRanges=gt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",mt);D.formatTime=gt(9,"videojs.formatTime","videojs.time.formatTime",Ai);D.setFormatTime=gt(9,"videojs.setFormatTime","videojs.time.setFormatTime",cf);D.resetFormatTime=gt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",df);D.parseUrl=gt(9,"videojs.parseUrl","videojs.url.parseUrl",pl);D.isCrossOrigin=gt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",aa);D.EventTarget=rt;D.any=cl;D.on=st;D.one=ra;D.off=Ne;D.trigger=ys;D.xhr=Nd;D.TextTrack=gr;D.AudioTrack=mf;D.VideoTrack=gf;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{D[i]=function(){return J.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Zh[i].apply(null,arguments)}});D.computedStyle=gt(9,"videojs.computedStyle","videojs.dom.computedStyle",cs);D.dom=Zh;D.fn=tS;D.num=US;D.str=nS;D.url=gS;D.Error=cx;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class dx{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class Pn extends D.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new dx(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;ss&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;ts,i.qualityLevels.VERSION=Yf,s},Qf=function(i){return hx(this,D.obj.merge({},i))};D.registerPlugin("qualityLevels",Qf);Qf.VERSION=Yf;/*! @name @videojs/http-streaming @version 3.14.2 @license Apache-2.0 */const Ye=qn,Ln=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,dt=i=>D.log.debug?D.log.debug.bind(D,"VHS:",`${i} >`):function(){};function ie(...i){const e=D.obj||D;return(e.merge||e.mergeOptions).apply(e,i)}function Re(...i){const e=D.time||D;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function fx(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-s}) +`}return e}const St=1/30,xt=St*3,Jf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s=e})},Zr=function(i,e){return Jf(i,function(t){return t-St>=e})},px=function(i){if(i.length<2)return Re();const e=[];for(let t=1;t{const e=[];if(!i||!i.length)return"";for(let t=0;t "+i.end(t));return e.join(", ")},gx=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},_i=i=>{const e=[];for(let t=0;tn)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},Ol=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},Eo=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),ep=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},tp=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},ip=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=ep(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},_x=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Ol(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},vx=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r"u"&&(e=i.mediaSequence+i.segments.length),e"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return x.Infinity}return sp(i,e,t)},Zs=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n0)for(let d=u-1;d>=0;d--){const m=o[d];if(a+=m.duration,n){if(a<0)continue}else if(a+St<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Zs({defaultDuration:i.targetDuration,durationList:o,startIndex:u,endIndex:d})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(u<0){for(let d=u;d<0;d++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};u=0}for(let d=u;dSt,T=a===0,E=y&&a+St>=0;if(!((T||E)&&d!==o.length-1)){if(n){if(a>0)continue}else if(a-St>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Zs({defaultDuration:i.targetDuration,durationList:o,startIndex:u,endIndex:d})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},ap=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Rl=function(i){return i.excludeUntil&&i.excludeUntil===1/0},ua=function(i){const e=ap(i);return!i.disabled&&!e},Sx=function(i){return i.disabled},xx=function(i){for(let e=0;e{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>ua(s)?(s.attributes.BANDWIDTH||0)!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Wc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},Tr=i=>{if(!i||!i.playlists||!i.playlists.length)return Wc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;eqd(n))||Wc(i,n=>Nl(t,n))))return!1}return!0};var Qe={liveEdgeDelay:ip,duration:rp,seekable:Tx,getMediaInfoForTime:bx,isEnabled:ua,isDisabled:Sx,isExcluded:ap,isIncompatible:Rl,playlistEnd:np,isAes:xx,hasAttribute:op,estimateSegmentRequestTime:Ex,isLowestEnabledRendition:Co,isAudioOnly:Tr,playlistMatch:Nl,segmentDurationWithParts:Ol};const{log:lp}=D,Qi=(i,e)=>`${i}-${e}`,up=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,Cx=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new qb;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(d=>a.addParser(d)),r.forEach(d=>a.addTagMapper(d)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(d){o.hasOwnProperty(d)&&delete o[d]}),o.segments&&o.segments.forEach(function(d){["parts","preloadHints"].forEach(function(m){d.hasOwnProperty(m)&&delete d[m]})})),!o.targetDuration){let d=10;o.segments&&o.segments.length&&(d=o.segments.reduce((m,y)=>Math.max(m,y.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${d}`}),o.targetDuration=d}const u=ep(o);if(u.length&&!o.partTargetDuration){const d=u.reduce((m,y)=>Math.max(m,y.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${d}`}),lp.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.")),o.partTargetDuration=d}return o},bs=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},cp=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},Ax=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];cp({playlist:t,id:Qi(e,t.uri)}),t.resolvedUri=Ye(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||lp.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Dx=i=>{bs(i,e=>{e.uri&&(e.resolvedUri=Ye(i.uri,e.uri))})},wx=(i,e)=>{const t=Qi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:x.location.href,resolvedUri:x.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},dp=(i,e,t=up)=>{i.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let u=0;u(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!n||s;if(t&&n)a.error=ve({},t),a.errorType=D.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=D.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=D.Error.NetworkRequestTimeout;else if(o){const u=s?D.Error.NetworkBodyParserFailed:D.Error.NetworkBadStatus;a.errorType=u,a.status=e.status,a.headers=e.headers}return a},{EventTarget:kx}=D,Ix=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=tp(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new x.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},Px=(i,e)=>{if(!i)return e;const t=ie(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o{!i.resolvedUri&&i.uri&&(i.resolvedUri=Ye(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Ye(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Ye(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Ye(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ye(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ye(e,t.uri))})},pp=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;si===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Ao=(i,e,t=mp)=>{const s=ie(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=pp(e);const n=ie(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{fp(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let m=0;m{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Xc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:s}};class zi extends kx{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=dt("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Kc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ye(this.main.uri,e.uri);this.llhls&&(t=Ix(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:xi({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return Cx({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(s){this.error=s,this.error.metadata={errorType:D.Error.StreamingHlsPlaylistParserError,error:s}}}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),cp({playlist:a,uri:s,id:r});const o=Ao(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Do(this.media(),!!o)),n.parsedPlaylist=Xc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),x.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Kc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(x.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=x.setTimeout(this.media.bind(this,e,!1),o);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Do(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,u)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ln(e.resolvedUri,u),o)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:u.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=x.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:xi({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Ln(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Xc(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,dp(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=pp(s),s.segments.forEach(r=>{fp(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||x.location.href;this.main=wx(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,u=a.id;if(t){const d=this.createCloneURI_(a.resolvedUri,e),m=Qi(r,d),y=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,y);s.playlists[n]=T,s.playlists[m]=T,s.playlists[d]=T}else s.playlists.splice(n,1);delete s.playlists[u],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((d,m)=>{const y=s.playlists[d.id],T=y.id,E=y.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Qi(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),u=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=u,s.playlists[a]=u,s.playlists[n]=u,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const u=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=ve({},u);const d=r.mediaGroups[n][t][o],m=this.createCloneURI_(u.resolvedUri,e);d.resolvedUri=m,d.uri=m,d.playlists=[],u.playlists.forEach((y,T)=>{const E=r.playlists[y.id],A=up(n,t,o),_=Qi(t,A);if(E&&!r.playlists[_]){const w=this.createClonePlaylist_(E,_,e),k=w.resolvedUri;r.playlists[_]=w,r.playlists[k]=w}d.playlists[T]=this.createClonePlaylist_(y,_,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),ie(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const wo=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},Ox=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},Rx=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},gp=function(){const i=function e(t,s){t=ie({timeout:45e3},t);const r=e.beforeRequest||D.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||D.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||D.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(D.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=D.Vhs.xhr.original===!0?D.xhr:D.Vhs.xhr,u=Ox(n,t);n.delete(r);const d=o(u||t,function(y,T){return Rx(a,d,y,T),wo(d,y,T,s)}),m=d.abort;return d.abort=function(){return d.aborted=!0,m.apply(d,arguments)},d.uri=t.uri,d.requestType=t.requestType,d.requestTime=Date.now(),d};return i.original=!0,i},Nx=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},ko=function(i){const e={};return i.byterange&&(e.Range=Nx(i.byterange)),e},Mx=function(i,e){return i.start(e)+"-"+i.end(e)},Bx=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Fx=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},yp=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];Vd(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},On=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},_p=function(i){return i.resolvedUri},vp=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;avp(i),$x=i=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},Vx=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,Hx=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(to?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Qe.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},zx=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;nt){if(i>t+r.duration*Tp)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Gx=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Wx=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=zx(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=jx(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},bp=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Wx(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=Hx(i,e);if(!o)return a({message:`${i} was not found in the stream`});const u=o.segment,d=Gx(u.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+d),n.one("seeked",()=>{bp({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=u.start+d,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),s(m)},eo=(i,e)=>{if(i.readyState===4)return e()},Xx=(i,e,t,s)=>{let r=[],n,a=!1;const o=function(y,T,E,A){return T.abort(),a=!0,t(y,T,E,A)},u=function(y,T){if(a)return;if(y)return y.metadata=xi({requestType:s,request:T,error:y}),o(y,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=Zb(r,Hd(E,!0)),n=n||Hs(r),r.length<10||n&&r.lengtho(y,T,"",r));const A=tl(r);return A==="ts"&&r.length<188?eo(T,()=>o(y,T,"",r)):!A&&r.length<376?eo(T,()=>o(y,T,"",r)):o(null,T,A,r)},m=e({uri:i,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:T,loaded:E}){return wo(y,null,{statusCode:y.status},u)})}},function(y,T){return wo(m,y,T,u)});return m},{EventTarget:Yx}=D,Yc=function(i,e){if(!mp(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Jx=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=T1(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return dp(n,e,Qx),n},Zx=(i,e)=>{bs(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},eE=(i,e,t)=>{let s=!0,r=ie(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const d=n.playlists[0].id,m=Ao(r,n.playlists[0],Yc);m&&(r=m,u in r.mediaGroups[a][o]||(r.mediaGroups[a][o][u]=n),r.mediaGroups[a][o][u].playlists[0]=r.playlists[d],s=!1)}}),Zx(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},tE=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Qc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=zn(n);if(!e[a])break;const o=e[a].sidxInfo;tE(o,n)&&(t[a]=e[a])}}return t},iE=(i,e)=>{let s=Qc(i.playlists,e);return bs(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const u=r.playlists;s=ie(s,Qc(u,e))}}),s};class Io extends Yx{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=dt("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&zn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=x.setTimeout(()=>s(!1),0);return}const n=Ln(e.sidx.resolvedUri),a=(u,d)=>{if(this.requestErrored_(u,d,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=d;let T;try{T=A1(z(d.response).subarray(8))}catch(E){E.metadata=xi({requestType:y,request:d,parseFailure:!0}),this.requestErrored_(E,d,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},Jo(e,T,e.sidx.resolvedUri),s(!0)},o="dash-sidx";this.request=Xx(n,this.vhs_.xhr,(u,d,m,y)=>{if(u)return a(u,d);if(!m||m!=="mp4"){const A=m||"unknown";return a({status:d.status,message:`Unsupported ${A} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},d)}const{offset:T,length:E}=e.sidx.byterange;if(y.length>=E+T)return a(u,{response:y.subarray(T,T+E),status:d.status,uri:d.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:ko({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=xi({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Ln(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=b1(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ye(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=xi({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=Jx({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:D.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=eE(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,o=[];s.playlists.forEach(d=>{o.push({id:d.id,bandwidth:d.attributes.BANDWIDTH,resolution:d.attributes.RESOLUTION,codecs:d.attributes.CODECS})});const u={duration:n,isLive:!a,renditions:o};t.parsedManifest=u,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(x.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=iE(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Do(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ie={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const sE=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t-1):!1},this.trigger=function(c){var f,h,p,g;if(f=l[c],!!f)if(arguments.length===2)for(p=f.length,h=0;h"u")){for(l in H)H.hasOwnProperty(l)&&(H[l]=[l.charCodeAt(0),l.charCodeAt(1),l.charCodeAt(2),l.charCodeAt(3)]);ee=new Uint8Array([105,115,111,109]),te=new Uint8Array([97,118,99,49]),Fe=new Uint8Array([0,0,0,1]),Te=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]),Lt=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]),ri={video:Te,audio:Lt},oi=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ai=new Uint8Array([0,0,0,0,0,0,0,0]),Sr=new Uint8Array([0,0,0,0,0,0,0,0]),ql=Sr,jl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Vl=Sr,ni=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(l){var c=[],f=0,h,p,g;for(h=1;h>>1,l.samplingfrequencyindex<<7|l.channelcount<<3,6,1,2]))},m=function(){return o(H.ftyp,ee,Fe,ee,te)},M=function(l){return o(H.hdlr,ri[l])},y=function(l){return o(H.mdat,l)},I=function(l){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,l.duration>>>24&255,l.duration>>>16&255,l.duration>>>8&255,l.duration&255,85,196,0,0]);return l.samplerate&&(c[12]=l.samplerate>>>24&255,c[13]=l.samplerate>>>16&255,c[14]=l.samplerate>>>8&255,c[15]=l.samplerate&255),o(H.mdhd,c)},R=function(l){return o(H.mdia,I(l),M(l.type),E(l))},T=function(l){return o(H.mfhd,new Uint8Array([0,0,0,0,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255]))},E=function(l){return o(H.minf,l.type==="video"?o(H.vmhd,ni):o(H.smhd,ai),u(),q(l))},A=function(l,c){for(var f=[],h=c.length;h--;)f[h]=ce(c[h]);return o.apply(null,[H.moof,T(l)].concat(f))},_=function(l){for(var c=l.length,f=[];c--;)f[c]=O(l[c]);return o.apply(null,[H.moov,k(4294967295)].concat(f).concat(w(l)))},w=function(l){for(var c=l.length,f=[];c--;)f[c]=Z(l[c]);return o.apply(null,[H.mvex].concat(f))},k=function(l){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&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 o(H.mvhd,c)},V=function(l){var c=l.samples||[],f=new Uint8Array(4+c.length),h,p;for(p=0;p>>8),g.push(h[b].byteLength&255),g=g.concat(Array.prototype.slice.call(h[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(S=[H.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]),o(H.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([h.length],g,[p.length],v))),o(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var C=f.sarRatio[0],P=f.sarRatio[1];S.push(o(H.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return o.apply(null,S)},c=function(f){return o(H.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]),d(f))}}(),L=function(l){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,0,(l.duration&4278190080)>>24,(l.duration&16711680)>>16,(l.duration&65280)>>8,l.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,(l.width&65280)>>8,l.width&255,0,0,(l.height&65280)>>8,l.height&255,0,0]);return o(H.tkhd,c)},ce=function(l){var c,f,h,p,g,v,b;return c=o(H.tfhd,new Uint8Array([0,0,0,58,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(l.baseMediaDecodeTime/a),b=Math.floor(l.baseMediaDecodeTime%a),f=o(H.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,l.type==="audio"?(h=oe(l,g),o(H.traf,c,f,h)):(p=V(l),h=oe(l,p.length+g),o(H.traf,c,f,h,p))},O=function(l){return l.duration=l.duration||4294967295,o(H.trak,L(l),R(l))},Z=function(l){var c=new Uint8Array([0,0,0,0,(l.id&4278190080)>>24,(l.id&16711680)>>16,(l.id&65280)>>8,l.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return l.type!=="video"&&(c[c.length-1]=0),o(H.trex,c)},function(){var l,c,f;f=function(h,p){var g=0,v=0,b=0,S=0;return h.length&&(h[0].duration!==void 0&&(g=1),h[0].size!==void 0&&(v=2),h[0].flags!==void 0&&(b=4),h[0].compositionTimeOffset!==void 0&&(S=8)),[0,0,g|v|b|S,1,(h.length&4278190080)>>>24,(h.length&16711680)>>>16,(h.length&65280)>>>8,h.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(h,p){var g,v,b,S,C,P;for(S=h.samples||[],p+=20+16*S.length,b=f(S,p),v=new Uint8Array(b.length+S.length*16),v.set(b),g=b.length,P=0;P>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(H.trun,v)},l=function(h,p){var g,v,b,S,C,P;for(S=h.samples||[],p+=20+8*S.length,b=f(S,p),g=new Uint8Array(b.length+S.length*8),g.set(b),v=b.length,P=0;P>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(H.trun,g)},oe=function(h,p){return h.type==="audio"?l(h,p):c(h,p)}}();var T_={ftyp:m,mdat:y,moof:A,moov:_,initSegment:function(l){var c=m(),f=_(l),h;return h=new Uint8Array(c.byteLength+f.byteLength),h.set(c),h.set(f,c.byteLength),h}},b_=function(l){var c,f,h=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,h.byteLength=0,c=0;c1&&(c=l.shift(),l.byteLength-=c.byteLength,l.nalCount-=c.nalCount,l[0][0].dts=c.dts,l[0][0].pts=c.pts,l[0][0].duration+=c.duration),l},E_=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Hl=function(l,c){var f=E_();return f.dataOffset=c,f.compositionTimeOffset=l.pts-l.dts,f.duration=l.duration,f.size=4*l.length,f.size+=l.byteLength,l.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},C_=function(l,c){var f,h,p,g,v,b=c||0,S=[];for(f=0;fEr.ONE_SECOND_IN_TS/2))){for(C=L_()[l.samplerate],C||(C=c[0].data),P=0;P=f?l:(c.minSegmentDts=1/0,l.filter(function(h){return h.dts>=f?(c.minSegmentDts=Math.min(c.minSegmentDts,h.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},M_=function(l){var c,f,h=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(l),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ot.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ot.prototype.addText=function(l){this.rows[this.rowIdx]+=l},Ot.prototype.backspace=function(){if(!this.isEmpty()){var l=this.rows[this.rowIdx];this.rows[this.rowIdx]=l.substr(0,l.length-1)}};var Dr=function(l,c,f){this.serviceNum=l,this.text="",this.currentWindow=new Ot(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Dr.prototype.init=function(l,c){this.startPts=l;for(var f=0;f<8;f++)this.windows[f]=new Ot(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Dr.prototype.setCurrentWindow=function(l){this.currentWindow=this.windows[l]},Dr.prototype.createTextDecoder=function(l){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(l)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+l+" encoding. "+c})}};var le=function(l){l=l||{},le.prototype.init.call(this);var c=this,f=l.captionServices||{},h={},p;Object.keys(f).forEach(g=>{p=f[g],/^SERVICE/.test(g)&&(h[g]=p.encoding)}),this.serviceEncodings=h,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};le.prototype=new ya,le.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},le.prototype.add708Bytes=function(l){var c=l.ccData,f=c>>>8,h=c&255;this.current708Packet.ptsVals.push(l.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(h)},le.prototype.push708Packet=function(){var l=this.current708Packet,c=l.data,f=null,h=null,p=0,g=c[p++];for(l.seq=g>>6,l.sizeCode=g&63;p>5,h=g&31,f===7&&h>0&&(g=c[p++],f=g),this.pushServiceBlock(f,p,h),h>0&&(p+=h-1)},le.prototype.pushServiceBlock=function(l,c,f){var h,p=c,g=this.current708Packet.data,v=this.services[l];for(v||(v=this.initService(l,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(N=[b,S],l++):N=[b],c.textDecoder_&&!h)P=c.textDecoder_.decode(new Uint8Array(N));else if(p){const F=$(N);P=String.fromCharCode(parseInt(F,16))}else P=Y_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(l)),C.pendingNewLine=!1,C.addText(P),l},le.prototype.multiByteCharacter=function(l,c){var f=this.current708Packet.data,h=f[l+1],p=f[l+2];return Ar(h)&&Ar(p)&&(l=this.handleText(++l,c,{isMultiByte:!0})),l},le.prototype.setCurrentWindow=function(l,c){var f=this.current708Packet.data,h=f[l],p=h&7;return c.setCurrentWindow(p),l},le.prototype.defineWindow=function(l,c){var f=this.current708Packet.data,h=f[l],p=h&7;c.setCurrentWindow(p);var g=c.currentWindow;return h=f[++l],g.visible=(h&32)>>5,g.rowLock=(h&16)>>4,g.columnLock=(h&8)>>3,g.priority=h&7,h=f[++l],g.relativePositioning=(h&128)>>7,g.anchorVertical=h&127,h=f[++l],g.anchorHorizontal=h,h=f[++l],g.anchorPoint=(h&240)>>4,g.rowCount=h&15,h=f[++l],g.columnCount=h&63,h=f[++l],g.windowStyle=(h&56)>>3,g.penStyle=h&7,g.virtualRowCount=g.rowCount+1,l},le.prototype.setWindowAttributes=function(l,c){var f=this.current708Packet.data,h=f[l],p=c.currentWindow.winAttr;return h=f[++l],p.fillOpacity=(h&192)>>6,p.fillRed=(h&48)>>4,p.fillGreen=(h&12)>>2,p.fillBlue=h&3,h=f[++l],p.borderType=(h&192)>>6,p.borderRed=(h&48)>>4,p.borderGreen=(h&12)>>2,p.borderBlue=h&3,h=f[++l],p.borderType+=(h&128)>>5,p.wordWrap=(h&64)>>6,p.printDirection=(h&48)>>4,p.scrollDirection=(h&12)>>2,p.justify=h&3,h=f[++l],p.effectSpeed=(h&240)>>4,p.effectDirection=(h&12)>>2,p.displayEffect=h&3,l},le.prototype.flushDisplayed=function(l,c){for(var f=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&f.push(c.windows[h].getText());c.endPts=l,c.text=f.join(` + +`),this.pushCaption(c),c.startPts=l},le.prototype.pushCaption=function(l){l.text!==""&&(this.trigger("data",{startPts:l.startPts,endPts:l.endPts,text:l.text,stream:"cc708_"+l.serviceNum}),l.text="",l.startPts=l.endPts)},le.prototype.displayWindows=function(l,c){var f=this.current708Packet.data,h=f[++l],p=this.getPts(l);this.flushDisplayed(p,c);for(var g=0;g<8;g++)h&1<>4,p.offset=(h&12)>>2,p.penSize=h&3,h=f[++l],p.italics=(h&128)>>7,p.underline=(h&64)>>6,p.edgeType=(h&56)>>3,p.fontStyle=h&7,l},le.prototype.setPenColor=function(l,c){var f=this.current708Packet.data,h=f[l],p=c.currentWindow.penColor;return h=f[++l],p.fgOpacity=(h&192)>>6,p.fgRed=(h&48)>>4,p.fgGreen=(h&12)>>2,p.fgBlue=h&3,h=f[++l],p.bgOpacity=(h&192)>>6,p.bgRed=(h&48)>>4,p.bgGreen=(h&12)>>2,p.bgBlue=h&3,h=f[++l],p.edgeRed=(h&48)>>4,p.edgeGreen=(h&12)>>2,p.edgeBlue=h&3,l},le.prototype.setPenLocation=function(l,c){var f=this.current708Packet.data,h=f[l],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=f[++l],p.row=h&15,h=f[++l],p.column=h&63,l},le.prototype.reset=function(l,c){var f=this.getPts(l);return this.flushDisplayed(f,c),this.initService(c.serviceNum,l)};var Q_={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},wr=function(l){return l===null?"":(l=Q_[l]||l,String.fromCharCode(l))},kr=14,J_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],li=function(){for(var l=[],c=kr+1;c--;)l.push({text:"",indent:0,offset:0});return l},fe=function(l,c){fe.prototype.init.call(this),this.field_=l||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var h,p,g,v,b;if(h=f.ccData&32639,h===this.lastControlCode_){this.lastControlCode_=null;return}if((h&61440)===4096?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),g=h>>>8,v=h&255,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=f.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(h===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=li();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=li();else if(h===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=li()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=wr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=wr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(v&14)===14&&this.addFormatting(f.pts,["i"]),(v&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var S=J_.indexOf(h&7968);if(this.mode_==="rollUp"&&(S-this.rollUpRows_+1<0&&(S=this.rollUpRows_-1),this.setRollUp(f.pts,S)),S!==this.row_&&S>=0&&S<=14&&(this.clearFormatting(f.pts),this.row_=S),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(h&16)===16){const C=(h&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=wr(g),b+=wr(v),this[this.mode_](f.pts,b),this.column_+=b.length)}};fe.prototype=new ya,fe.prototype.flushDisplayed=function(l){const c=h=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."})},f=[];this.displayed_.forEach((h,p)=>{if(h&&h.text&&h.text.length){try{h.text=h.text.trim()}catch{c(p)}h.text.length&&f.push({text:h.text,line:p+1,position:10+Math.min(70,h.indent*10)+h.offset*2.5})}else h==null&&c(p)}),f.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,content:f,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=li(),this.nonDisplayed_=li(),this.lastControlCode_=null,this.column_=0,this.row_=kr,this.rollUpRows_=2,this.formatting_=[]},fe.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},fe.prototype.isSpecialCharacter=function(l,c){return l===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(l,c){return(l===this.EXT_+1||l===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(l,c){return l===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(l,c){return l===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(l,c){return l>=this.BASE_&&l=64&&c<=127},fe.prototype.isColorPAC=function(l){return l>=64&&l<=79||l>=96&&l<=127},fe.prototype.isNormalChar=function(l){return l>=32&&l<=127},fe.prototype.setRollUp=function(l,c){if(this.mode_!=="rollUp"&&(this.row_=kr,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=li(),this.displayed_=li()),c!==void 0&&c!==this.row_)for(var f=0;f"},"");this[this.mode_](l,f)},fe.prototype.clearFormatting=function(l){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,h){return f+""},"");this.formatting_=[],this[this.mode_](l,c)}},fe.prototype.popOn=function(l,c){var f=this.nonDisplayed_[this.row_].text;f+=c,this.nonDisplayed_[this.row_].text=f},fe.prototype.rollUp=function(l,c){var f=this.displayed_[this.row_].text;f+=c,this.displayed_[this.row_].text=f},fe.prototype.shiftRowsUp_=function(){var l;for(l=0;lc&&(f=-1);Math.abs(c-l)>tv;)l+=f*ev;return l},va=function(l){var c,f;va.prototype.init.call(this),this.type_=l||Ql,this.push=function(h){if(h.type==="metadata"){this.trigger("data",h);return}this.type_!==Ql&&h.type!==this.type_||(f===void 0&&(f=h.dts),h.dts=_a(h.dts,f),h.pts=_a(h.pts,f),c=h.dts,this.trigger("data",h))},this.flush=function(){f=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};va.prototype=new Z_;var Jl={TimestampRolloverStream:va,handleRollover:_a},iv=(l,c,f)=>{if(!l)return-1;for(var h=f;h";l.data[0]===Lr.Utf8&&(f=Pr(l.data,0,c),!(f<0)&&(l.mimeType=xs(l.data,c,f),c=f+1,l.pictureType=l.data[c],c++,h=Pr(l.data,0,c),!(h<0)&&(l.description=Ss(l.data,c,h),c=h+1,l.mimeType===p?l.url=xs(l.data,c,l.data.length):l.pictureData=l.data.subarray(c,l.data.length))))},"T*":function(l){l.data[0]===Lr.Utf8&&(l.value=Ss(l.data,1,l.data.length).replace(/\0*$/,""),l.values=l.value.split("\0"))},TXXX:function(l){var c;l.data[0]===Lr.Utf8&&(c=Pr(l.data,0,1),c!==-1&&(l.description=Ss(l.data,1,c),l.value=Ss(l.data,c+1,l.data.length).replace(/\0*$/,""),l.data=l.value))},"W*":function(l){l.url=xs(l.data,0,l.data.length).replace(/\0.*$/,"")},WXXX:function(l){var c;l.data[0]===Lr.Utf8&&(c=Pr(l.data,0,1),c!==-1&&(l.description=Ss(l.data,1,c),l.url=xs(l.data,c+1,l.data.length).replace(/\0.*$/,"")))},PRIV:function(l){var c;for(c=0;c>>2;G*=4,G+=F[7]&3,P.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=P.timeStamp,b.dts=P.timeStamp),this.trigger("timestamp",P)}b.frames.push(P),S+=10,S+=C}while(S>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",l(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",l(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=ht.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=ht.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},As.prototype=new Ta,As.STREAM_TYPES={h264:27,adts:15},Nr=function(){var l=this,c=!1,f={data:[],size:0},h={data:[],size:0},p={data:[],size:0},g,v=function(S,C){var P;const N=S[0]<<16|S[1]<<8|S[2];C.data=new Uint8Array,N===1&&(C.packetLength=6+(S[4]<<8|S[5]),C.dataAlignmentIndicator=(S[6]&4)!==0,P=S[7],P&192&&(C.pts=(S[9]&14)<<27|(S[10]&255)<<20|(S[11]&254)<<12|(S[12]&255)<<5|(S[13]&254)>>>3,C.pts*=4,C.pts+=(S[13]&6)>>>1,C.dts=C.pts,P&64&&(C.dts=(S[14]&14)<<27|(S[15]&255)<<20|(S[16]&254)<<12|(S[17]&255)<<5|(S[18]&254)>>>3,C.dts*=4,C.dts+=(S[18]&6)>>>1)),C.data=S.subarray(9+S[8]))},b=function(S,C,P){var N=new Uint8Array(S.size),$={type:C},F=0,G=0,K=!1,De;if(!(!S.data.length||S.size<9)){for($.trackId=S.data[0].pid,F=0;F>5,S=((c[p+6]&3)+1)*1024,C=S*dv/iu[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:iu[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),f++,p+=g}typeof P=="number"&&(this.skipWarn_(P,p),P=null),c=c.subarray(p)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Mr.prototype=new cv;var hv=Mr,su;su=function(l){var c=l.byteLength,f=0,h=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+h},this.loadWord=function(){var p=l.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(l.subarray(p,p+v)),f=new DataView(g.buffer).getUint32(0),h=v*8,c-=v},this.skipBits=function(p){var g;h>p?(f<<=p,h-=p):(p-=h,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),f<<=p,h-=p)},this.readBits=function(p){var g=Math.min(h,p),v=f>>>32-g;return h-=g,h>0?f<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return f<<=p,h-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var fv=su,ru=t,pv=fv,Br,Ds,nu;Ds=function(){var l=0,c,f;Ds.prototype.init.call(this),this.push=function(h){var p;f?(p=new Uint8Array(f.byteLength+h.data.byteLength),p.set(f),p.set(h.data,f.byteLength),f=p):f=h.data;for(var g=f.byteLength;l3&&this.trigger("data",f.subarray(l+3)),f=null,l=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ds.prototype=new ru,nu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Br=function(){var l=new Ds,c,f,h,p,g,v,b;Br.prototype.init.call(this),c=this,this.push=function(S){S.type==="video"&&(f=S.trackId,h=S.pts,p=S.dts,l.push(S))},l.on("data",function(S){var C={trackId:f,pts:h,dts:p,data:S,nalUnitTypeCode:S[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(S.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(S.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),l.on("done",function(){c.trigger("done")}),l.on("partialdone",function(){c.trigger("partialdone")}),l.on("reset",function(){c.trigger("reset")}),l.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){l.flush()},this.partialFlush=function(){l.partialFlush()},this.reset=function(){l.reset()},this.endTimeline=function(){l.endTimeline()},b=function(S,C){var P=8,N=8,$,F;for($=0;$>4;return f=f>=0?f:0,p?f+20:f+10},ou=function(l,c){return l.length-c<10||l[c]!==73||l[c+1]!==68||l[c+2]!==51?c:(c+=au(l,c),ou(l,c))},yv=function(l){var c=ou(l,0);return l.length>=c+2&&(l[c]&255)===255&&(l[c+1]&240)===240&&(l[c+1]&22)===16},lu=function(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]},_v=function(l,c,f){var h,p="";for(h=c;h>5,h=l[c+4]<<3,p=l[c+3]&6144;return p|h|f},bv=function(l,c){return l[c]===73&&l[c+1]===68&&l[c+2]===51?"timed-metadata":l[c]&!0&&(l[c+1]&240)===240?"audio":null},Sv=function(l){for(var c=0;c+5>>2]}return null},xv=function(l){var c,f,h,p;c=10,l[5]&64&&(c+=4,c+=lu(l.subarray(10,14)));do{if(f=lu(l.subarray(c+4,c+8)),f<1)return null;if(p=String.fromCharCode(l[c],l[c+1],l[c+2],l[c+3]),p==="PRIV"){h=l.subarray(c+10,c+f+10);for(var g=0;g>>2;return S*=4,S+=b[7]&3,S}break}}c+=10,c+=f}while(c=3;){if(l[p]===73&&l[p+1]===68&&l[p+2]===51){if(l.length-p<10||(h=uu.parseId3TagSize(l,p),p+h>l.length))break;v={type:"timed-metadata",data:l.subarray(p,p+h)},this.trigger("data",v),p+=h;continue}else if((l[p]&255)===255&&(l[p+1]&240)===240){if(l.length-p<7||(h=uu.parseAdtsSize(l,p),p+h>l.length))break;b={type:"audio",data:l.subarray(p,p+h),pts:c,dts:c},this.trigger("data",b),p+=h;continue}p++}g=l.length-p,g>0?l=l.subarray(p):l=new Uint8Array},this.reset=function(){l=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){l=new Uint8Array,this.trigger("endedtimeline")}},Fr.prototype=new Ev;var Cv=Fr,Av=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Dv=Av,wv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],kv=wv,Ur=t,ws=T_,ks=k_,$r=F_,ft=V_,Rt=uv,qr=he,cu=hv,Iv=mv.H264Stream,Pv=Cv,Lv=Ea.isLikelyAacData,Ov=he.ONE_SECOND_IN_TS,Ca=Dv,Aa=kv,Is,ki,jr,ui,Rv=function(l,c){c.stream=l,this.trigger("log",c)},du=function(l,c){for(var f=Object.keys(c),h=0;h=-C&&N<=S&&(!$||P>N)&&($=G,P=N)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var S,C,P,N,$,F,G,K;for($=b.byteLength,F=b.nalCount,G=b.duration,S=C=0;SP.pts){S++;continue}C++,$-=N.byteLength,F-=N.nalCount,G-=N.duration}return C===0?b:C===b.length?null:(K=b.slice(C),K.byteLength=$,K.duration=G,K.nalCount=F,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(b){var S,C,P,N,$,F;for(S=p.length-1,C=b.length-1,$=null,F=!1;S>=0&&C>=0;){if(P=p[S],N=b[C],P.pts===N.pts){F=!0;break}if(P.pts>N.pts){S--;continue}S===p.length-1&&($=C),C--}if(!F&&$===null)return null;var G;if(F?G=C:G=$,G===0)return b;var K=b.slice(G),De=K.reduce(function(nt,di){return nt.byteLength+=di.byteLength,nt.duration+=di.duration,nt.nalCount+=di.nalCount,nt},{byteLength:0,duration:0,nalCount:0});return K.byteLength=De.byteLength,K.duration=De.duration,K.nalCount=De.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(b){p=b}},Is.prototype=new Ur,ui=function(l,c){this.numberOfTracks=0,this.metadataStream=c,l=l||{},typeof l.remux<"u"?this.remuxTracks=!!l.remux:this.remuxTracks=!0,typeof l.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=l.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ui.prototype.init.call(this),this.push=function(f){if(f.content||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))}},ui.prototype=new Ur,ui.prototype.flush=function(l){var c=0,f={captions:[],captionStreams:{},metadata:[],info:{}},h,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,Aa.forEach(function(S){f.info[S]=this.videoTrack[S]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,Ca.forEach(function(S){f.info[S]=this.audioTrack[S]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?f.type=this.pendingTracks[0].type:f.type="combined",this.emittedTracks+=this.pendingTracks.length,g=ws.initSegment(this.pendingTracks),f.initSegment=new Uint8Array(g.byteLength),f.initSegment.set(g),f.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ui.prototype.setRemux=function(l){this.remuxTracks=l},jr=function(l){var c=this,f=!0,h,p;jr.prototype.init.call(this),l=l||{},this.baseMediaDecodeTime=l.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Rt.MetadataStream,g.aacStream=new Pv,g.audioTimestampRolloverStream=new Rt.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Rt.TimestampRolloverStream("timed-metadata"),g.adtsStream=new cu,g.coalesceStream=new ui(l,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new ki(p,l),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),du(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Rt.MetadataStream,g.packetStream=new Rt.TransportPacketStream,g.parseStream=new Rt.TransportParseStream,g.elementaryStream=new Rt.ElementaryStream,g.timestampRolloverStream=new Rt.TimestampRolloverStream,g.adtsStream=new cu,g.h264Stream=new Iv,g.captionStream=new Rt.CaptionStream(l),g.coalesceStream=new ui(l,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!h&&v.tracks[b].type==="video"?(h=v.tracks[b],h.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);h&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Is(h,l),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(S){p&&!l.keepOriginalTimestamps&&(p.timelineStartInfo=S,g.audioSegmentStream.setEarliestDts(S.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(S){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(S)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new ki(p,l),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),du(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;l.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ft.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),h&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,ft.clearDtsInfo(h),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;l.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(f){var v=Lv(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(g)},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()}},jr.prototype=new Ur;var Nv={Transmuxer:jr,VideoSegmentStream:Is,AudioSegmentStream:ki,AUDIO_PROPERTIES:Ca,VIDEO_PROPERTIES:Aa,generateSegmentTimingInfo:Da},Mv=function(l){return l>>>0},Bv=function(l){return("00"+l.toString(16)).slice(-2)},Vr={toUnsigned:Mv,toHexString:Bv},Fv=function(l){var c="";return c+=String.fromCharCode(l[0]),c+=String.fromCharCode(l[1]),c+=String.fromCharCode(l[2]),c+=String.fromCharCode(l[3]),c},fu=Fv,Uv=Vr.toUnsigned,$v=fu,pu=function(l,c){var f=[],h,p,g,v,b;if(!c.length)return null;for(h=0;h1?h+p:l.byteLength,g===c[0]&&(c.length===1?f.push(l.subarray(h+8,v)):(b=pu(l.subarray(h+8,v),c.slice(1)),b.length&&(f=f.concat(b)))),h=v;return f},mu=pu,qv=Vr.toUnsigned,jv=n.getUint64,Vv=function(l){var c={version:l[0],flags:new Uint8Array(l.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=jv(l.subarray(4)):c.baseMediaDecodeTime=qv(l[4]<<24|l[5]<<16|l[6]<<8|l[7]),c},gu=Vv,Hv=function(l){return{isLeading:(l[0]&12)>>>2,dependsOn:l[0]&3,isDependedOn:(l[1]&192)>>>6,hasRedundancy:(l[1]&48)>>>4,paddingValue:(l[1]&14)>>>1,isNonSyncSample:l[1]&1,degradationPriority:l[2]<<8|l[3]}},zv=Hv,yu=zv,Gv=function(l){var c={version:l[0],flags:new Uint8Array(l.subarray(1,4)),samples:[]},f=new DataView(l.buffer,l.byteOffset,l.byteLength),h=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,S=c.flags[1]&8,C=f.getUint32(4),P=8,N;for(h&&(c.dataOffset=f.getInt32(P),P+=4),p&&C&&(N={flags:yu(l.subarray(P,P+4))},P+=4,g&&(N.duration=f.getUint32(P),P+=4),v&&(N.size=f.getUint32(P),P+=4),S&&(c.version===1?N.compositionTimeOffset=f.getInt32(P):N.compositionTimeOffset=f.getUint32(P),P+=4),c.samples.push(N),C--);C--;)N={},g&&(N.duration=f.getUint32(P),P+=4),v&&(N.size=f.getUint32(P),P+=4),b&&(N.flags=yu(l.subarray(P,P+4)),P+=4),S&&(c.version===1?N.compositionTimeOffset=f.getInt32(P):N.compositionTimeOffset=f.getUint32(P),P+=4),c.samples.push(N);return c},_u=Gv,Wv=function(l){var c=new DataView(l.buffer,l.byteOffset,l.byteLength),f={version:l[0],flags:new Uint8Array(l.subarray(1,4)),trackId:c.getUint32(4)},h=f.flags[2]&1,p=f.flags[2]&2,g=f.flags[2]&8,v=f.flags[2]&16,b=f.flags[2]&32,S=f.flags[0]&65536,C=f.flags[0]&131072,P;return P=8,h&&(P+=4,f.baseDataOffset=c.getUint32(12),P+=4),p&&(f.sampleDescriptionIndex=c.getUint32(P),P+=4),g&&(f.defaultSampleDuration=c.getUint32(P),P+=4),v&&(f.defaultSampleSize=c.getUint32(P),P+=4),b&&(f.defaultSampleFlags=c.getUint32(P)),S&&(f.durationIsEmpty=!0),!h&&C&&(f.baseDataOffsetIsMoof=!0),f},vu=Wv,Ps;typeof window<"u"?Ps=window:typeof i<"u"?Ps=i:typeof self<"u"?Ps=self:Ps={};var Tu=Ps,Kv=Xl.discardEmulationPreventionBytes,Xv=Yl.CaptionStream,Ls=mu,Yv=gu,Qv=_u,Jv=vu,bu=Tu,Zv=function(l,c){for(var f=l,h=0;h0?Yv($[0]).baseMediaDecodeTime:0,G=Ls(S,["trun"]),K,De;c===N&&G.length>0&&(K=tT(G,F,P),De=eT(b,K,N),p[N]||(p[N]={seiNals:[],logs:[]}),p[N].seiNals=p[N].seiNals.concat(De.seiNals),p[N].logs=p[N].logs.concat(De.logs))}),p},sT=function(l,c,f){var h;if(c===null)return null;h=iT(l,c);var p=h[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:f}},rT=function(){var l=!1,c,f,h,p,g,v;this.isInitialized=function(){return l},this.init=function(b){c=new Xv,l=!0,v=b?b.isPartial:!1,c.on("data",function(S){S.startTime=S.startPts/p,S.endTime=S.endPts/p,g.captions.push(S),g.captionStreams[S.stream]=!0}),c.on("log",function(S){g.logs.push(S)})},this.isNewInit=function(b,S){return b&&b.length===0||S&&typeof S=="object"&&Object.keys(S).length===0?!1:h!==b[0]||p!==S[h]},this.parse=function(b,S,C){var P;if(this.isInitialized()){if(!S||!C)return null;if(this.isNewInit(S,C))h=S[0],p=C[h];else if(h===null||!p)return f.push(b),null}else return null;for(;f.length>0;){var N=f.shift();this.parse(N,S,C)}return P=sT(b,h,p),P&&P.logs&&(g.logs=g.logs.concat(P.logs)),P===null||!P.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(S){c.push(S)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],h=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},nT=rT,aT=function(l){for(var c=0,f=String.fromCharCode(l[c]),h="";f!=="\0";)h+=f,c++,f=String.fromCharCode(l[c]);return h+=f,h},oT={uint8ToCString:aT},Hr=oT.uint8ToCString,lT=n.getUint64,uT=function(l){var c=4,f=l[0],h,p,g,v,b,S,C,P;if(f===0){h=Hr(l.subarray(c)),c+=h.length,p=Hr(l.subarray(c)),c+=p.length;var N=new DataView(l.buffer);g=N.getUint32(c),c+=4,b=N.getUint32(c),c+=4,S=N.getUint32(c),c+=4,C=N.getUint32(c),c+=4}else if(f===1){var N=new DataView(l.buffer);g=N.getUint32(c),c+=4,v=lT(l.subarray(c)),c+=8,S=N.getUint32(c),c+=4,C=N.getUint32(c),c+=4,h=Hr(l.subarray(c)),c+=h.length,p=Hr(l.subarray(c)),c+=p.length}P=new Uint8Array(l.subarray(c,l.byteLength));var $={scheme_id_uri:h,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:S,id:C,message_data:P};return dT(f,$)?$:void 0},cT=function(l,c,f,h){return l||l===0?l/c:h+f/c},dT=function(l,c){var f=c.scheme_id_uri!=="\0",h=l===0&&Su(c.presentation_time_delta)&&f,p=l===1&&Su(c.presentation_time)&&f;return!(l>1)&&h||p},Su=function(l){return l!==void 0||l!==null},hT={parseEmsgBox:uT,scaleTime:cT},zr=Vr.toUnsigned,Os=Vr.toHexString,be=mu,Ii=fu,wa=hT,fT=vu,pT=_u,mT=gu,gT=n.getUint64,xu,Eu,Cu,Au,Du,ka,wu,Ia=Tu,yT=eu.parseId3Frames;xu=function(l){var c={},f=be(l,["moov","trak"]);return f.reduce(function(h,p){var g,v,b,S,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,S=zr(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,h[S]=zr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),h)},c)},Eu=function(l,c){var f;f=be(c,["moof","traf"]);var h=f.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=zr(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),S=l[b]||9e4,C=be(g,["tfdt"])[0],P=new DataView(C.buffer,C.byteOffset,C.byteLength),N;C[0]===1?N=gT(C.subarray(4,12)):N=P.getUint32(4);let $;return typeof N=="bigint"?$=N/Ia.BigInt(S):typeof N=="number"&&!isNaN(N)&&($=N/S),$11?(p.codec+=".",p.codec+=Os(F[9]),p.codec+=Os(F[10]),p.codec+=Os(F[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(F=$.subarray(28),G=Ii(F.subarray(4,8)),G==="esds"&&F.length>20&&F[19]!==0?(p.codec+="."+Os(F[19]),p.codec+="."+Os(F[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=be(h,["mdia","mdhd"])[0];K&&(p.timescale=ka(K)),f.push(p)}),f},wu=function(l,c=0){var f=be(l,["emsg"]);return f.map(h=>{var p=wa.parseEmsgBox(new Uint8Array(h)),g=yT(p.message_data);return{cueTime:wa.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:wa.scaleTime(p.event_duration,p.timescale),frames:g}})};var Pa={findBox:be,parseType:Ii,timescale:xu,startTime:Eu,compositionStartTime:Cu,videoTrackIds:Au,tracks:Du,getTimescaleFromMediaHeader:ka,getEmsgID3:wu},La=Ir,ku=function(l){var c=l[1]&31;return c<<=8,c|=l[2],c},Gr=function(l){return!!(l[1]&64)},Wr=function(l){var c=0;return(l[3]&48)>>>4>1&&(c+=l[4]+1),c},_T=function(l,c){var f=ku(l);return f===0?"pat":f===c?"pmt":c?"pes":null},vT=function(l){var c=Gr(l),f=4+Wr(l);return c&&(f+=l[f]+1),(l[f+10]&31)<<8|l[f+11]},TT=function(l){var c={},f=Gr(l),h=4+Wr(l);if(f&&(h+=l[h]+1),!!(l[h+5]&1)){var p,g,v;p=(l[h+1]&15)<<8|l[h+2],g=3+p-4,v=(l[h+10]&15)<<8|l[h+11];for(var b=12+v;b=l.byteLength)return null;var h=null,p;return p=l[f+7],p&192&&(h={},h.pts=(l[f+9]&14)<<27|(l[f+10]&255)<<20|(l[f+11]&254)<<12|(l[f+12]&255)<<5|(l[f+13]&254)>>>3,h.pts*=4,h.pts+=(l[f+13]&6)>>>1,h.dts=h.pts,p&64&&(h.dts=(l[f+14]&14)<<27|(l[f+15]&255)<<20|(l[f+16]&254)<<12|(l[f+17]&255)<<5|(l[f+18]&254)>>>3,h.dts*=4,h.dts+=(l[f+18]&6)>>>1)),h},Oa=function(l){switch(l){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},xT=function(l){for(var c=4+Wr(l),f=l.subarray(c),h=0,p=0,g=!1,v;p3&&(v=Oa(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},ET={parseType:_T,parsePat:vT,parsePmt:TT,parsePayloadUnitStartIndicator:Gr,parsePesType:bT,parsePesTime:ST,videoPacketContainsKeyFrame:xT},Iu=Ir,Pi=Jl.handleRollover,re={};re.ts=ET,re.aac=Ea;var ci=he.ONE_SECOND_IN_TS,Ue=188,yt=71,CT=function(l,c){for(var f=0,h=Ue,p,g;h=0;){if(l[h]===yt&&(l[p]===yt||p===l.byteLength)){switch(g=l.subarray(h,p),v=re.ts.parseType(g,c.pid),v){case"pes":b=re.ts.parsePesType(g,c.table),S=re.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&S&&(C=re.ts.parsePesTime(g),C&&(C.type="audio",f.audio.push(C),P=!0));break}if(P)break;h-=Ue,p-=Ue;continue}h--,p--}},AT=function(l,c,f){for(var h=0,p=Ue,g,v,b,S,C,P,N,$,F=!1,G={data:[],size:0};p=0;){if(l[h]===yt&&l[p]===yt){switch(g=l.subarray(h,p),v=re.ts.parseType(g,c.pid),v){case"pes":b=re.ts.parsePesType(g,c.table),S=re.ts.parsePayloadUnitStartIndicator(g),b==="video"&&S&&(C=re.ts.parsePesTime(g),C&&(C.type="video",f.video.push(C),F=!0));break}if(F)break;h-=Ue,p-=Ue;continue}h--,p--}},DT=function(l,c){if(l.audio&&l.audio.length){var f=c;(typeof f>"u"||isNaN(f))&&(f=l.audio[0].dts),l.audio.forEach(function(g){g.dts=Pi(g.dts,f),g.pts=Pi(g.pts,f),g.dtsTime=g.dts/ci,g.ptsTime=g.pts/ci})}if(l.video&&l.video.length){var h=c;if((typeof h>"u"||isNaN(h))&&(h=l.video[0].dts),l.video.forEach(function(g){g.dts=Pi(g.dts,h),g.pts=Pi(g.pts,h),g.dtsTime=g.dts/ci,g.ptsTime=g.pts/ci}),l.firstKeyFrame){var p=l.firstKeyFrame;p.dts=Pi(p.dts,h),p.pts=Pi(p.pts,h),p.dtsTime=p.dts/ci,p.ptsTime=p.pts/ci}}},wT=function(l){for(var c=!1,f=0,h=null,p=null,g=0,v=0,b;l.length-v>=3;){var S=re.aac.parseType(l,v);switch(S){case"timed-metadata":if(l.length-v<10){c=!0;break}if(g=re.aac.parseId3TagSize(l,v),g>l.length){c=!0;break}p===null&&(b=l.subarray(v,v+g),p=re.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(l.length-v<7){c=!0;break}if(g=re.aac.parseAdtsSize(l,v),g>l.length){c=!0;break}h===null&&(b=l.subarray(v,v+g),h=re.aac.parseSampleRate(b)),f++,v+=g;break;default:v++;break}if(c)return null}if(h===null||p===null)return null;var C=ci/h,P={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+f*1024*C,pts:p+f*1024*C}]};return P},kT=function(l){var c={pid:null,table:null},f={};CT(l,c);for(var h in c.table)if(c.table.hasOwnProperty(h)){var p=c.table[h];switch(p){case Iu.H264_STREAM_TYPE:f.video=[],AT(l,c,f),f.video.length===0&&delete f.video;break;case Iu.ADTS_STREAM_TYPE:f.audio=[],Pu(l,c,f),f.audio.length===0&&delete f.audio;break}}return f},IT=function(l,c){var f=re.aac.isLikelyAacData(l),h;return f?h=wT(l):h=kT(l),!h||!h.audio&&!h.video?null:(DT(h,c),h)},PT={inspect:IT,parseAudioPes_:Pu};const LT=function(l,c){c.on("data",function(f){const h=f.initSegment;f.initSegment={data:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength};const p=f.data;f.data=p.buffer,l.postMessage({action:"data",segment:f,byteOffset:p.byteOffset,byteLength:p.byteLength},[f.data])}),c.on("done",function(f){l.postMessage({action:"done"})}),c.on("gopInfo",function(f){l.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),l.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:h})}),c.on("audioSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),l.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:h})}),c.on("id3Frame",function(f){l.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){l.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){l.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){l.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){l.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("log",function(f){l.postMessage({action:"log",log:f})})};class Lu{constructor(c,f){this.options=f||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Nv.Transmuxer(this.options),LT(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new nT,this.captionParser.init());const f=new Uint8Array(c.data,c.byteOffset,c.byteLength),h=this.captionParser.parse(f,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:f.buffer},[f.buffer])}probeMp4StartTime({timescales:c,data:f}){const h=Pa.startTime(c,f);this.self.postMessage({action:"probeMp4StartTime",startTime:h,data:f},[f.buffer])}probeMp4Tracks({data:c}){const f=Pa.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:f,data:c},[c.buffer])}probeEmsgID3({data:c,offset:f}){const h=Pa.getEmsgID3(c,f);this.self.postMessage({action:"probeEmsgID3",id3Frames:h,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:f}){const h=typeof f=="number"&&!isNaN(f)?f*he.ONE_SECOND_IN_TS:void 0,p=PT.inspect(c,h);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const f=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(f)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const f=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he.secondsToVideoTs(f)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(he.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(l){if(l.data.action==="init"&&l.data.options){this.messageHandlers=new Lu(self,l.data.options);return}this.messageHandlers||(this.messageHandlers=new Lu(self)),l.data&&l.data.action&&l.data.action!=="init"&&this.messageHandlers[l.data.action]&&this.messageHandlers[l.data.action](l.data)}}));var aE=xp(nE);const oE=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:u,videoFramePtsTime:d}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof u<"u"&&(y.videoFrameDtsTime=u),typeof d<"u"&&(y.videoFramePtsTime=d),t(y)},lE=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},uE=(i,e)=>{e.gopInfo=i.data.gopInfo},Ap=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:u,onVideoTimingInfo:d,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:E,onDone:A,onEndedTimeline:_,onTransmuxerLog:w,isEndOfTimeline:k,segment:O,triggerSegmentEventFn:L}=i,R={buffer:[]};let I=k;const M=q=>{e.currentTransmux===i&&(q.data.action==="data"&&oE(q,R,a),q.data.action==="trackinfo"&&o(q.data.trackInfo),q.data.action==="gopInfo"&&uE(q,R),q.data.action==="audioTimingInfo"&&u(q.data.audioTimingInfo),q.data.action==="videoTimingInfo"&&d(q.data.videoTimingInfo),q.data.action==="videoSegmentTimingInfo"&&m(q.data.videoSegmentTimingInfo),q.data.action==="audioSegmentTimingInfo"&&y(q.data.audioSegmentTimingInfo),q.data.action==="id3Frame"&&T([q.data.id3Frame],q.data.id3Frame.dispatchType),q.data.action==="caption"&&E(q.data.caption),q.data.action==="endedtimeline"&&(I=!1,_()),q.data.action==="log"&&w(q.data.log),q.data.type==="transmuxed"&&(I||(e.onmessage=null,lE({transmuxedData:R,callback:A}),Dp(e))))},V=()=>{const q={message:"Received an error message from the transmuxer worker",metadata:{errorType:D.Error.StreamingFailedToTransmuxSegment,segmentInfo:mi({segment:O})}};A(null,q)};if(e.onmessage=M,e.onerror=V,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const q=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:O}),e.postMessage({action:"push",data:q,byteOffset:X,byteLength:t.byteLength},[q])}k&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Dp=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():Ap(i.currentTransmux))},Jc=(i,e)=>{i.postMessage({action:e}),Dp(i)},wp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Jc(e,i);return}e.transmuxQueue.push(Jc.bind(null,e,i))},cE=i=>{wp("reset",i)},dE=i=>{wp("endTimeline",i)},kp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,Ap(i);return}i.transmuxer.transmuxQueue.push(i)},hE=i=>{const e=new aE;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var to={reset:cE,endTimeline:dE,transmux:kp,createTransmuxer:hE};const er=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=ve({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},Et={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Po=i=>{i.forEach(e=>{e.abort()})},fE=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),pE=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Ml=(i,e)=>{const{requestType:t}=e,s=xi({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Et.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Et.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Et.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Et.FAILURE,xhr:e,metadata:s}:null},Zc=(i,e,t,s)=>(r,n)=>{const a=n.response,o=Ml(r,n);if(o)return t(o,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Et.FAILURE,xhr:n},i);const u=new DataView(a),d=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]);for(let y=0;y{const t=tl(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:Et.FAILURE,metadata:{mediaType:r}})}er({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},mE=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=Ml(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Ip(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},gE=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=Ml(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!n.responseText?n.response:sE(n.responseText.substring(i.lastReachedChar||0));return i.stats=fE(n),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},yE=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const A=i.map&&i.map.tracks||{},_=!!(A.audio&&A.video);let w=s.bind(null,i,"audio","start");const k=s.bind(null,i,"audio","end");let O=s.bind(null,i,"video","start");const L=s.bind(null,i,"video","end"),R=()=>kp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:I=>{I.type=I.type==="combined"?"video":I.type,m(i,I)},onTrackInfo:I=>{t&&(_&&(I.isMuxed=!0),t(i,I))},onAudioTimingInfo:I=>{w&&typeof I.start<"u"&&(w(I.start),w=null),k&&typeof I.end<"u"&&k(I.end)},onVideoTimingInfo:I=>{O&&typeof I.start<"u"&&(O(I.start),O=null),L&&typeof I.end<"u"&&L(I.end)},onVideoSegmentTimingInfo:I=>{const M={pts:{start:I.start.presentation,end:I.end.presentation},dts:{start:I.start.decode,end:I.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:M}),r(I)},onAudioSegmentTimingInfo:I=>{const M={pts:{start:I.start.pts,end:I.end.pts},dts:{start:I.start.dts,end:I.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:M}),n(I)},onId3:(I,M)=>{a(i,I,M)},onCaptions:I=>{o(i,[I])},isEndOfTimeline:u,onEndedTimeline:()=>{d()},onTransmuxerLog:T,onDone:(I,M)=>{y&&(I.type=I.type==="combined"?"video":I.type,E({type:"segmenttransmuxingcomplete",segment:i}),y(M,i,I))},segment:i,triggerSegmentEventFn:E});er({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:I=>{i.bytes=e=I.data;const M=I.result;M&&(t(i,{hasAudio:M.hasAudio,hasVideo:M.hasVideo,isMuxed:_}),t=null),R()}})},Pp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=new Uint8Array(e);if(q1(A)){i.isFmp4=!0;const{tracks:_}=i.map,w={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(w.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(w.videoCodec=_.video.codec),_.video&&_.audio&&(w.isMuxed=!0),t(i,w);const k=(O,L)=>{m(i,{data:A,type:w.hasAudio&&!w.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),O&&O.length&&o(i,O),y(null,i,{})};er({action:"probeMp4StartTime",timescales:i.map.timescales,data:A,transmuxer:i.transmuxer,callback:({data:O,startTime:L})=>{e=O.buffer,i.bytes=A=O,w.hasAudio&&!w.isMuxed&&s(i,"audio","start",L),w.hasVideo&&s(i,"video","start",L),er({action:"probeEmsgID3",data:A,transmuxer:i.transmuxer,offset:L,callback:({emsgData:R,id3Frames:I})=>{if(e=R.buffer,i.bytes=A=R,!_.video||!R.byteLength||!i.transmuxer){k(void 0,I);return}er({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:A,timescales:i.map.timescales,trackIds:[_.video.id],callback:M=>{e=M.data.buffer,i.bytes=A=M.data,M.logs.forEach(function(V){T(ie(V,{stream:"mp4CaptionParser"}))}),k(M.captions,I)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=tl(A)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}yE({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})},Lp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const o=d=>{if(d.data.source===i){s.removeEventListener("message",o);const m=d.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const d="An error occurred in the decryption worker",m=mi({segment:r}),y={message:d,metadata:{error:new Error(d),errorType:D.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},s.addEventListener("message",o);let u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(yp({source:i,encrypted:t,key:u,iv:e.iv}),[t.buffer,u.buffer])},_E=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Lp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:y},A=>{e.bytes=A,E({type:"segmentdecryptioncomplete",segment:e}),Pp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})})},vE=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let A=0,_=!1;return(w,k)=>{if(!_){if(w)return _=!0,Po(i),y(w,k);if(A+=1,A===i.length){const O=function(){if(k.encryptedBytes)return _E({decryptionWorker:e,segment:k,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E});Pp({segment:k,bytes:k.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(k.endOfAllRequests=Date.now(),k.map&&k.map.encryptedBytes&&!k.map.bytes)return E({type:"segmentdecryptionstart",segment:k}),Lp({decryptionWorker:e,id:k.requestId+"-init",encryptedBytes:k.map.encryptedBytes,key:k.map.key,segment:k,doneFn:y},L=>{k.map.bytes=L,E({type:"segmentdecryptioncomplete",segment:k}),Ip(k,R=>{if(R)return Po(i),y(R,k);O()})});O()}}}},TE=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},bE=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:u,endedTimelineFn:d,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=ie(i.stats,pE(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},SE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:_,onTransmuxerLog:w,triggerSegmentEventFn:k})=>{const O=[],L=vE({activeXhrs:O,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A,doneFn:_,onTransmuxerLog:w,triggerSegmentEventFn:k});if(s.key&&!s.key.bytes){const q=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&q.push(s.map.key);const X=ie(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ce=Zc(s,q,L,k),Z={uri:s.key.resolvedUri};k({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const oe=i(X,ce);O.push(oe)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const oe=ie(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),H=Zc(s,[s.map.key],L,k),ee={uri:s.map.key.resolvedUri};k({type:"segmentkeyloadstart",segment:s,keyInfo:ee});const Fe=i(oe,H);O.push(Fe)}const X=ie(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:ko(s.map),requestType:"segment-media-initialization"}),ce=mE({segment:s,finishProcessingFn:L,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:s});const Z=i(X,ce);O.push(Z)}const R=ie(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:ko(s),requestType:"segment"}),I=gE({segment:s,finishProcessingFn:L,responseType:R.responseType,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:s});const M=i(R,I);M.addEventListener("progress",bE({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:A})),O.push(M);const V={};return O.forEach(q=>{q.addEventListener("loadend",TE({loadendState:V,abortFn:r}))}),()=>Po(O)},xE=dt("CodecUtils"),EE=function(i){const e=i.attributes||{};if(e.CODECS)return vt(e.CODECS)},Op=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},CE=(i,e)=>{if(!Op(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},Rn=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push($d(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){xE(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},ed=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},tr=function(i,e){const t=e.attributes||{},s=Rn(EE(e)||[]);if(Op(i,e)&&!s.audio&&!CE(i,e)){const r=Rn(Vb(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},en=dt("PlaylistSelector"),td=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},Nn=function(i,e){if(!i)return"";const t=x.getComputedStyle(i);return t?t[e]:""},Ji=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Bl=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||x.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||x.Number.MAX_VALUE,t-s},AE=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||x.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||x.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let Rp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;Qe.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let u=o.map(I=>{let M;const V=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.width,q=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.height;return M=I.attributes&&I.attributes.BANDWIDTH,M=M||x.Number.MAX_VALUE,{bandwidth:M,width:V,height:q,playlist:I}});Ji(u,(I,M)=>I.bandwidth-M.bandwidth),u=u.filter(I=>!Qe.isIncompatible(I.playlist));let d=u.filter(I=>Qe.isEnabled(I.playlist));d.length||(d=u.filter(I=>!Qe.isDisabled(I.playlist)));const m=d.filter(I=>I.bandwidth*Ie.BANDWIDTH_VARIANCEI.bandwidth===y.bandwidth)[0];if(r===!1){const I=T||d[0]||u[0];if(I&&I.playlist){let M="sortedPlaylistReps";return T&&(M="bandwidthBestRep"),d[0]&&(M="enabledPlaylistReps"),en(`choosing ${td(I)} using ${M} with options`,a),I.playlist}return en("could not choose a playlist with options",a),null}const E=m.filter(I=>I.width&&I.height);Ji(E,(I,M)=>I.width-M.width);const A=E.filter(I=>I.width===t&&I.height===s);y=A[A.length-1];const _=A.filter(I=>I.bandwidth===y.bandwidth)[0];let w,k,O;_||(w=E.filter(I=>I.width>t||I.height>s),k=w.filter(I=>I.width===w[0].width&&I.height===w[0].height),y=k[k.length-1],O=k.filter(I=>I.bandwidth===y.bandwidth)[0]);let L;if(n.leastPixelDiffSelector){const I=E.map(M=>(M.pixelDiff=Math.abs(M.width-t)+Math.abs(M.height-s),M));Ji(I,(M,V)=>M.pixelDiff===V.pixelDiff?V.bandwidth-M.bandwidth:M.pixelDiff-V.pixelDiff),L=I[0]}const R=L||O||_||T||d[0]||u[0];if(R&&R.playlist){let I="sortedPlaylistReps";return L?I="leastPixelDiffRep":O?I="resolutionPlusOneRep":_?I="resolutionBestRep":T?I="bandwidthBestRep":d[0]&&(I="enabledPlaylistReps"),en(`choosing ${td(R)} using ${I} with options`,a),R.playlist}return en("could not choose a playlist with options",a),null};const id=function(){let i=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),Rp(this.playlists.main,this.systemBandwidth,parseInt(Nn(this.tech_.el(),"width"),10)*i,parseInt(Nn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},DE=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),Rp(this.playlists.main,e,parseInt(Nn(this.tech_.el(),"width"),10)*s,parseInt(Nn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},wE=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:u}=i,d=e.playlists.filter(A=>!Qe.isIncompatible(A));let m=d.filter(Qe.isEnabled);m.length||(m=d.filter(A=>!Qe.isDisabled(A)));const T=m.filter(Qe.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{const w=u.getSyncPoint(A,r,o,t)?1:2,O=Qe.estimateSegmentRequestTime(n,s,A)*w-a;return{playlist:A,rebufferingImpact:O}}),E=T.filter(A=>A.rebufferingImpact<=0);return Ji(E,(A,_)=>Bl(_.playlist,A.playlist)),E.length?E[0]:(Ji(T,(A,_)=>A.rebufferingImpact-_.rebufferingImpact),T[0]||null)},kE=function(){const i=this.playlists.main.playlists.filter(Qe.isEnabled);return Ji(i,(t,s)=>Bl(t,s)),i.filter(t=>!!tr(this.playlists.main,t).video)[0]||null},IE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Np(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const PE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,u=!1;const d=n[s];d&&(a=d.label,o=d.language,u=d.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:u,label:a,language:o},!1).track}}},LE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},OE=function(i){Object.defineProperties(i.frame,{id:{get(){return D.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return D.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return D.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},RE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=x.WebKitDataCue||x.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||x.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(y,y,T.value||T.url||T.data||"");E.frame=T,E.value=T,OE(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),d=Object.keys(u).sort((m,y)=>Number(m)-Number(y));d.forEach((m,y)=>{const T=u[m],E=isFinite(s)?s:m,A=Number(d[y+1])||E;T.forEach(_=>{_.endTime=A})})},NE={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},ME=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),BE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(ME.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:NE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},sd=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,D.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Gs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},FE=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},UE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*yi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},$E=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},qE=(i,e,t,s)=>{const r=Math.ceil((e-s)*yi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*yi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let u=o+1;for(;u--&&!(i[u].pts<=r););return u=Math.max(u,0),a.splice(u,o-u+1),a},jE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},$s=1,HE=500,rd=i=>typeof i=="number"&&isFinite(i),tn=1/60,zE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,GE=(i,e,t)=>{let s=e-Ie.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Fi=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:u,partIndex:d,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof d=="number",A=i.segment.uri?"segment":"pre-segment",_=E?tp({preloadSegment:s})-1:0;return`${A} [${n+u}/${n+y}]`+(E?` part [${d}/${_}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},nd=i=>`${i}TimingInfo`,WE=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},KE=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},XE=i=>{i&&(i.pause(),i.resetEverything(),i.load())},YE=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=i.pendingSegment_;if(!e)return;if(Lo({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&KE(i.timelineChangeController_)){if(YE(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}XE(i)}},QE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=x.BigInt(n)-x.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+St:!1,JE=(i,e)=>{if(e!=="hls")return null;const t=QE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=ad({segmentDuration:t,maxDuration:s*2}),n=ad({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. 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||n?{severity:r?"warn":"info",message:a}:null},mi=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class Oo extends D.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=dt(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(ve({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(ve({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Qt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Qt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return to.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,x.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&to.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Re();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=On(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=_p(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${Za(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const u=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=u}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&to.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=qE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Gs(e,t,this.inbandTextTracks_[o]);Gs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),HE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:mi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Za(e)||0,s=Ll(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=VE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=E+1):o.mediaIndex=this.mediaIndex+1}else{let T,E,A;const _=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${_}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const w=this.getSyncInfoFromMediaSequenceSync_(_);if(!w){const k="No sync info found while using media sequence sync";return this.error({message:k,metadata:{errorType:D.Error.StreamingFailedToSelectNextSegment,error:new Error(k)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${w.start} --> ${w.end})`),T=w.segmentIndex,E=w.partIndex,A=w.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const w=Qe.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:_,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=w.segmentIndex,E=w.partIndex,A=w.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${_}`:`currentTime ${_}`,o.mediaIndex=T,o.startOfSegment=A,o.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const u=a[o.mediaIndex];let d=u&&typeof o.partIndex=="number"&&u.parts&&u.parts[o.partIndex];if(!u||typeof o.partIndex=="number"&&!d)return null;typeof o.partIndex!="number"&&u.parts&&(o.partIndex=0,d=u.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&d&&!m&&!d.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else u.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:u,getMediaInfoForTime:d}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:d,independent:t},E=typeof u<"u"?u:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const A=Za(this.sourceUpdater_.audioBuffered());return typeof A=="number"&&(T.audioAppendStart=A-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=UE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return WE(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=Qe.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=gx(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=wE({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const d=n-a-o.rebufferingImpact;let m=.5;a<=St&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||d{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:u,captions:d}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${u} for ${a}`),PE(m,this.vhs_.tech_,a),Gs(o,u,m[a]),LE({captionArray:d,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Lo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Lo({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Qt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const 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[nd(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.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,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=On(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+_i(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+_i(a).join(", "));const o=n.length?n.start(0):0,u=n.length?n.end(n.length-1):0,d=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(u-o<=$s&&m-d<=$s){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${_i(n).join(", ")}, video buffer: ${_i(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-$s;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${$s}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},$s*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===hp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:D.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const o=[r];let u=r.byteLength;s&&(o.unshift(s),u+=s.byteLength),n=IE({bytes:u,segments:o})}const a={segmentInfo:mi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Qt(this),this.loadQueue_.push(()=>{const t=ve({},e,{forceTimestampOffset:!0});ve(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting +${Np(e.uri)} +${Fi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=SE({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:u,stream:d})=>{this.logger_(`${Fi(e)} logged from transmuxer stream ${d} as a ${u}: ${o}`)},triggerSegmentEventFn:({type:o,segment:u,keyInfo:d,trackInfo:m,timingInfo:y})=>{const E={segmentInfo:mi({segment:u})};d&&(E.keyInfo=d),m&&(E.trackInfo=m),y&&(E.timingInfo=y),this.trigger({type:o,metadata:E})}})}trimBackBuffer_(e){const t=GE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const u=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=u}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||d.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=zE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const u={segmentInfo:mi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:u})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=JE(e,this.sourceType_);if(t&&(t.severity==="warn"?D.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Fi(e)}`);return}this.logger_(`Appended ${Fi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Fi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},ZE=["video","audio"],Ro=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},eC=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Zi("audio",e),Zi("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Ro(i,e))){if(s.type!==i){if(t=eC(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Zi(i,e);return}}},Bp=(i,e)=>{const t=e[`${i}Buffer`],s=Mp(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Tt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,et={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(Tt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===hp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(Tt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];Tt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){D.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){D.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(Tt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){D.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Mp(i),r=es(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Bp(i,e),!!Tt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){D.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=es(i);if(!Tt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const u={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:u}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(d){u.errorType=D.Error.StreamingCodecsChangeError,u.error=d,d.metadata=u,t.error_=d,t.trigger("error"),D.log.warn(`Failed to changeType on ${e}Buffer`,d)}}},tt=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Zi(i,e)},od=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=fx(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Zi(i,e)};class Fp extends D.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Zi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=dt("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=od("video",this),this.onAudioUpdateEnd_=od("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){tt({type:"mediaSource",sourceUpdater:this,action:et.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){tt({type:e,sourceUpdater:this,action:et.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){D.log.error("removeSourceBuffer is not supported!");return}tt({type:"mediaSource",sourceUpdater:this,action:et.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!D.browser.IS_FIREFOX&&x.MediaSource&&x.MediaSource.prototype&&typeof x.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return x.SourceBuffer&&x.SourceBuffer.prototype&&typeof x.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){D.log.error("changeType is not supported!");return}tt({type:e,sourceUpdater:this,action:et.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(tt({type:r,sourceUpdater:this,action:et.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(u=>{this.appendBuffer.apply(this,u)})}}audioBuffered(){return Tt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Re()}videoBuffered(){return Tt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Re()}buffered(){const e=Tt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Tt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():mx(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Ft){tt({type:"mediaSource",sourceUpdater:this,action:et.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Ft){typeof e!="string"&&(e=void 0),tt({type:"mediaSource",sourceUpdater:this,action:et.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Ft){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}tt({type:"audio",sourceUpdater:this,action:et.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Ft){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}tt({type:"video",sourceUpdater:this,action:et.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(Ro("audio",this)||Ro("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(tt({type:"audio",sourceUpdater:this,action:et.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(tt({type:"video",sourceUpdater:this,action:et.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&tt({type:"audio",sourceUpdater:this,action:et.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&tt({type:"video",sourceUpdater:this,action:et.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),ZE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Bp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const ld=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),tC=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},ud=new Uint8Array(` + +`.split("").map(i=>i.charCodeAt(0)));class iC extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class sC extends Oo{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Re();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Re([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=On(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=ud.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(ud,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Gs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Et.TIMEOUT&&this.handleTimeout_(),e.code===Et.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof x.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:D.Error.StreamingVttParserError,error:a}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new x.VTTCue(a.startTime,a.endTime,a.text):a)}),FE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof x.WebVTT!="function")throw new iC;typeof x.TextDecoder=="function"?t=new x.TextDecoder("utf8"):(t=x.WebVTT.StringDecoder(),s=!0);const r=new x.WebVTT.Parser(x,x.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{D.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=ld(a)),r.parse(a)}let n=e.bytes;s&&(n=ld(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,u=n/yi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(d=>{const m=d.endTime-d.startTime,y=this.handleRollover_(d.startTime+u,t.time);d.startTime=Math.max(y,0),d.endTime=Math.max(y+m,0)}),!s.syncInfo){const d=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(d,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*yi.ONE_SECOND_IN_TS;const r=t*yi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/yi.ONE_SECOND_IN_TS}}const rC=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},nC=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Up{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=` +`,a=s,o=t;this.start_=a,e.forEach((u,d)=>{const m=this.storage_.get(o),y=a,T=y+u.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),A=new cd({start:y,end:T,appended:E,segmentIndex:d});u.syncInfo=A;let _=a;const w=(u.parts||[]).map((k,O)=>{const L=_,R=_+k.duration,I=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[O]&&m.partsSyncInfo[O].isAppended),M=new cd({start:L,end:R,appended:I,segmentIndex:d,partIndex:O});return _=R,n+=`Media Sequence: ${o}.${O} | Range: ${L} --> ${R} | Appended: ${I} +`,k.syncInfo=M,M});r.set(o,new aC(A,w)),n+=`${Np(u.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${E} +`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class dd extends Up{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const oC=86400,io=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=Eo(e);r=r||0;for(let u=0;u{let n=null,a=null;r=r||0;const o=Eo(e);for(let u=0;u=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:u,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class lC extends D.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Up,s=new dd(t),r=new dd(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=dt("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return io.find(({name:u})=>u==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:u,strategy:d}=o,{segmentIndex:m,time:y}=u;if(m<0)continue;const T=e.segments[m],E=y,A=E+T.duration;if(this.logger_(`Strategy: ${d}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${A}]}`),r>=E&&r0&&(r.time*=-1),Math.abs(r.time+Zs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;ooC){D.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,u;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,u=t.end+a.mapping;else if(a)o=t.start+a.mapping,u=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=u),(!r.start||ou){let d;o<0?d=s.start-Zs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):d=s.end+Zs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:d,accuracy:u}}}}dispose(){this.trigger("dispose"),this.off()}}class uC extends D.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const cC=Ep(Cp(function(){var i=function(){function _(){this.listeners={}}var w=_.prototype;return w.on=function(O,L){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push(L)},w.off=function(O,L){if(!this.listeners[O])return!1;var R=this.listeners[O].indexOf(L);return this.listeners[O]=this.listeners[O].slice(0),this.listeners[O].splice(R,1),R>-1},w.trigger=function(O){var L=this.listeners[O];if(L)if(arguments.length===2)for(var R=L.length,I=0;I>7)*283)^R]=R;for(I=M=0;!O[I];I^=X||1,M=q[M]||1)for(oe=M^M<<1^M<<2^M<<3^M<<4,oe=oe>>8^oe&255^99,O[I]=oe,L[oe]=I,Z=V[ce=V[X=V[I]]],ee=Z*16843009^ce*65537^X*257^I*16843008,H=V[oe]*257^oe*16843008,R=0;R<4;R++)w[R][I]=H=H<<24^H>>>8,k[R][oe]=ee=ee<<24^ee>>>8;for(R=0;R<5;R++)w[R]=w[R].slice(0),k[R]=k[R].slice(0);return _};let s=null;class r{constructor(w){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let k,O,L;const R=this._tables[0][4],I=this._tables[1],M=w.length;let V=1;if(M!==4&&M!==6&&M!==8)throw new Error("Invalid aes key size");const q=w.slice(0),X=[];for(this._key=[q,X],k=M;k<4*M+28;k++)L=q[k-1],(k%M===0||M===8&&k%M===4)&&(L=R[L>>>24]<<24^R[L>>16&255]<<16^R[L>>8&255]<<8^R[L&255],k%M===0&&(L=L<<8^L>>>24^V<<24,V=V<<1^(V>>7)*283)),q[k]=q[k-M]^L;for(O=0;k;O++,k--)L=q[O&3?k:k-4],k<=4||O<4?X[O]=L:X[O]=I[0][R[L>>>24]]^I[1][R[L>>16&255]]^I[2][R[L>>8&255]]^I[3][R[L&255]]}decrypt(w,k,O,L,R,I){const M=this._key[1];let V=w^M[0],q=L^M[1],X=O^M[2],ce=k^M[3],Z,oe,H;const ee=M.length/4-2;let Fe,te=4;const Te=this._tables[1],Lt=Te[0],ri=Te[1],ni=Te[2],ai=Te[3],oi=Te[4];for(Fe=0;Fe>>24]^ri[q>>16&255]^ni[X>>8&255]^ai[ce&255]^M[te],oe=Lt[q>>>24]^ri[X>>16&255]^ni[ce>>8&255]^ai[V&255]^M[te+1],H=Lt[X>>>24]^ri[ce>>16&255]^ni[V>>8&255]^ai[q&255]^M[te+2],ce=Lt[ce>>>24]^ri[V>>16&255]^ni[q>>8&255]^ai[X&255]^M[te+3],te+=4,V=Z,q=oe,X=H;for(Fe=0;Fe<4;Fe++)R[(3&-Fe)+I]=oi[V>>>24]<<24^oi[q>>16&255]<<16^oi[X>>8&255]<<8^oi[ce&255]^M[te++],Z=V,V=q,q=X,X=ce,ce=Z}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(_){return _<<24|(_&65280)<<8|(_&16711680)>>8|_>>>24},o=function(_,w,k){const O=new Int32Array(_.buffer,_.byteOffset,_.byteLength>>2),L=new r(Array.prototype.slice.call(w)),R=new Uint8Array(_.byteLength),I=new Int32Array(R.buffer);let M,V,q,X,ce,Z,oe,H,ee;for(M=k[0],V=k[1],q=k[2],X=k[3],ee=0;ee{const O=_[k];T(O)?w[k]={bytes:O.buffer,byteOffset:O.byteOffset,byteLength:O.byteLength}:w[k]=O}),w};self.onmessage=function(_){const w=_.data,k=new Uint8Array(w.encrypted.bytes,w.encrypted.byteOffset,w.encrypted.byteLength),O=new Uint32Array(w.key.bytes,w.key.byteOffset,w.key.byteLength/4),L=new Uint32Array(w.iv.bytes,w.iv.byteOffset,w.iv.byteLength/4);new u(k,O,L,function(R,I){self.postMessage(A({source:w.source,decrypted:I}),[I.buffer])})}}));var dC=xp(cC);const hC=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},$p=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},No=(i,e)=>{e.activePlaylistLoader=i,i.load()},fC=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,u=r.lastGroup_;if(!(a&&u&&a.id===u.id)&&(r.lastGroup_=a,r.lastTrack_=n,$p(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),No(a.playlistLoader,r)}},pC=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},mC=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),u=n.activePlaylistLoader,d=n.lastTrack_;if(!(d&&a&&d.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,$p(s,n),!!o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(u===o.playlistLoader){No(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),No(o.playlistLoader,n)}},Mn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(u=>u.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}D.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const u in t.tracks)t.tracks[u].enabled=t.tracks[u]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;D.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},hd={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Mn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Mn[i](i,t))}},gC={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:u,logger_:d}},mainPlaylistLoader:m}=e,y=Tr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const E in a[i][T]){let A=a[i][T][E],_;if(y?(d(`AUDIO group '${T}' label '${E}' is a main playlist`),A.isMainPlaylist=!0,_=null):s==="vhs-json"&&A.playlists?_=new zi(A.playlists[0],t,n):A.resolvedUri?_=new zi(A.resolvedUri,t,n):A.playlists&&s==="dash"?_=new Io(A.playlists[0],t,n,m):_=null,A=ie({id:E,playlistLoader:_},A),hd[i](i,A.playlistLoader,e),o[T].push(A),typeof u[E]>"u"){const w=new D.AudioTrack({id:E,kind:hC(A),enabled:!1,language:A.language,default:A.default,label:E});u[E]=w}}}r.on("error",Mn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:u,tracks:d}},mainPlaylistLoader:m}=e;for(const y in o[i]){u[y]||(u[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let E=o[i][y][T],A;if(r==="hls")A=new zi(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(w=>w.excludeUntil!==1/0).length)return;A=new Io(E.playlists[0],s,a,m)}else r==="vhs-json"&&(A=new zi(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=ie({id:T,playlistLoader:A},E),hd[i](i,E.playlistLoader,e),u[y].push(E),typeof d[T]>"u"){const _=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;d[T]=_}}}n.on("error",Mn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const u=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(u.instreamId))continue;const d=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(d[m.instreamId]&&(m=ie(m,d[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(ie({id:o},u)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},qp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&Tr(e.main))for(let u=0;u"u"?a:t===null||!a?null:a.filter(u=>u.id===t.id)[0]||null},_C={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},vC=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},TC=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(d=>{gC[d](d,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(d=>{e[d].activeGroup=yC(d,i),e[d].activeTrack=_C[d](d,i),e[d].onGroupChanged=fC(d,i),e[d].onGroupChanging=pC(d,i),e[d].onTrackChanged=mC(d,i),e[d].getActiveGroup=vC(d,i)});const o=e.AUDIO.activeGroup();if(o){const d=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[d].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanging())});const u=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",u),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",u),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const d in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[d])},bC=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ft,activeTrack:Ft,getActiveGroup:Ft,onGroupChanged:Ft,onTrackChanged:Ft,lastTrack_:null,logger_:dt(`MediaGroups[${e}]`)}}),i};class fd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ye(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class SC extends D.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new fd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=dt("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ye(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const d=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${d} seconds.`),this.startTTLTimeout_(parseInt(d,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(d){const m={errorType:D.Error.StreamingContentSteeringParserError,error:d};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(o);const u={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:u}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new x.URL(e),s=new x.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new x.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new fd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ye(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const xC=10;let Mt;const EC=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],CC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},AC=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:u}){if(!s)return D.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return u(`${d} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Hi(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(u(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(u(`${d} as current playlist is live`),!0);const y=Ll(e,t),T=o?Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ie.MAX_BUFFER_LOW_WATER_LINE;if(aA)&&y>=r){let _=`${d} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(_+=` and next bandwidth > current bandwidth (${E} > ${A})`),u(_),!0}return u(`not ${d} as no switching criteria met`),!1};class DC extends D.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:u,enableLowInitialPlaylist:d,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:A,experimentalUseMMS:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:w}=e;(w===null||typeof w>"u")&&(w=1/0),Mt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=u,this.maxPlaylistRetries=w,this.enableLowInitialPlaylist=d,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:w,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=bC(),_&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,D.log("Using ManagedMediaSource")):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Re(),this.hasPlayed_=!1,this.syncController_=new lC(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new dC,this.sourceUpdater_=new Fp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new uC,this.keyStatusMap_=new Map;const k={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:A,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Io(t,this.vhs_,ie(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new zi(t,this.vhs_,ie(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Oo(ie(k,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Oo(ie(k,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new sC(ie(k,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((R,I)=>{function M(){r.off("vttjserror",V),R()}function V(){r.off("vttjsloaded",M),I()}r.one("vttjsloaded",M),r.one("vttjserror",V),r.addWebVttScript_()})}),e);const O=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new SC(this.vhs_.xhr,O),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),EC.forEach(R=>{this[R+"_"]=CC.bind(this,R)}),this.logger_=dt("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{const R=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-R,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const u in o)if(o[u].default){n={label:u};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const u=s[o][n.label];if(u.playlists&&u.playlists.length)a.push.apply(a,u.playlists);else if(u.uri)a.push(u);else if(e.playlists.length)for(let d=0;d{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;Co(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),TC({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;Co(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(ve({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Mt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return AC({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:xC}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Mt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=xt;const o=a.end(a.length-1);return o-n<=xt&&r-o<=xt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(ua),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return D.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const A=this.pathwayAttribute_(e),_=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(A),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(A)},_);return}let E=!1;r.forEach(A=>{if(A===e)return;const _=A.excludeUntil;typeof _<"u"&&_!==1/0&&(E=!0,delete A.excludeUntil)}),E&&(D.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const u=this.selectPlaylist();if(!u){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const d=t.internal?this.logger_:D.log.warn,m=t.message?" "+t.message:"";d(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${u.id}.`),u.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=u.targetDuration/2*1e3||5*1e3,T=typeof u.lastRequest=="number"&&Date.now()-u.lastRequest<=y;return this.switchMedia_(u,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Hi(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Mt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Re([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=tr(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||zb),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Ku}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Ku,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(d,m)=>d?Xs(m):Ua(m),o={};let u;if(["video","audio"].forEach(function(d){if(r.hasOwnProperty(d)&&!a(e[d].isFmp4,r[d])){const m=e[d].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[d]),d==="audio"&&(u=m)}}),n&&u&&t.attributes.AUDIO){const d=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===d&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${d} as ${u} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const d=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:d},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const d=[];if(["video","audio"].forEach(m=>{const y=(vt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(vt(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&d.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),d.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${d.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=tr(this.main,r),a=[];n.audio&&!Ua(n.audio)&&!Xs(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Ua(n.video)&&!Xs(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=Rn(vt(e)),n=ed(r),a=r.video&&vt(r.video)[0]||null,o=r.audio&&vt(r.audio)[0]||null;Object.keys(s).forEach(u=>{const d=s[u];if(t.indexOf(d.id)!==-1||d.excludeUntil===1/0)return;t.push(d.id);const m=[],y=tr(this.mainPlaylistLoader_.main,d),T=ed(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&vt(y.video)[0]||null,A=y.audio&&vt(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),A&&o&&A.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${A.type}" !== "${o.type}"`)}m.length&&(d.excludeUntil=1/0,this.logger_(`excluding ${d.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),nC(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ie.GOAL_BUFFER_LENGTH,s=Ie.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ie.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ie.BUFFER_LOW_WATER_LINE,s=Ie.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ie.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ie.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){sd(this.inbandTextTracks_,"com.apple.streaming",this.tech_),BE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();sd(this.inbandTextTracks_,e,this.tech_),RE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(ve({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const u=o.attributes.serviceLocation;if(u&&(a.push(u),!n.has(u)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],u=this.pathwayAttribute_(o),d=u&&e!==u;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!d&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&d&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const u=o.activePlaylistLoader.media_;u&&u.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const u=s.get(a);if(!u){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(u,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,u=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&u&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,D.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:tC(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const wC=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Rl(r),a=ua(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(t(r),s?i.trigger({type:"renditionenabled",metadata:o}):i.trigger({type:"renditiondisabled",metadata:o})),s};class kC{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=tr(r.main(),t),this.playlist=t,this.id=s,this.enabled=wC(e.playlists,t.id,n)}}const IC=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=Tr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Rl(s)).map((s,r)=>new kC(i,s,s.id)):[]}},pd=["seeking","seeked","pause","playing","error"];class PC extends D.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=dt("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],u={};o.forEach(m=>{u[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",u[m].reset),this.tech_.on(["seeked","seeking"],u[m].reset)});const d=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(pd,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(pd,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",u[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",u[m].reset),this.tech_.off(["seeked","seeking"],u[m].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=yx(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:_i(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+xt>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Re([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const A=t.start(0);n=A+(A===t.end(0)?0:xt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${Zf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),u=a.audioBuffer?a.audioBuffered():null,d=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-St)*2,T=[u,d];for(let A=0;A ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Zr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+xt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const LC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},jp=function(i,e){let t=0,s=0;const r=ie(LC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ge,i,{get(){return D.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ie[i]},set(e){if(D.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){D.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ie[i]=e}})});const Hp="videojs-vhs",zp=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),zp(i,e.playlists)};ge.canPlaySource=function(){return D.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const UC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=Rn(vt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=es(s.video),n=es(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return ie(i,a)},$C=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),qC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=$C(r,Object.keys(e)),a=[],o=[];return n.forEach(u=>{o.push(new Promise((d,m)=>{i.tech_.one("keysessioncreated",d)})),a.push(new Promise((d,m)=>{i.eme.initializeMediaKeys({keySystems:u},y=>{if(y){m(y);return}d()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},jC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=UC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(D.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Gp=()=>{if(!x.localStorage)return null;const i=x.localStorage.getItem(Hp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},VC=i=>{if(!x.localStorage)return!1;let e=Gp();e=e?ie(e,i):i;try{x.localStorage.setItem(Hp,JSON.stringify(e))}catch{return!1}return e},HC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,Wp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},Kp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Xp=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Yp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!U||!U.createElement)return!1;const i=U.createElement("video");return D.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!U||!U.createElement||!D.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(U.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return D.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){Wp(ge.xhr,i)};ge.xhr.onResponse=function(i){Kp(ge.xhr,i)};ge.xhr.offRequest=function(i){Xp(ge.xhr,i)};ge.xhr.offResponse=function(i){Yp(ge.xhr,i)};const zC=D.getComponent("Component");class Qp extends zC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=dt("VhsHandler"),t.options_&&t.options_.playerId){const r=D.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(U,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=U.fullscreenElement||U.webkitFullscreenElement||U.mozFullScreenElement||U.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=ie(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!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,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=Gp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ie.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ie.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=HC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=jd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new DC(this.options_);const s=ie({liveRangeSafeTimeDelta:xt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new PC(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=D.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const u=a.downlink*1e3*1e3;u>=o&&n>=o?n=Math.max(n,u):n=u}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){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:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>_i(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>_i(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&VC({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{IC(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),qC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=jC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=D.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{FC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{zp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Vp,"mux.js":RC,"mpd-parser":NC,"m3u8-parser":MC,"aes-decrypter":BC}}version(){return this.constructor.version()}canChangeType(){return Fp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Kx({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return bp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Wp(this.xhr,e)},this.xhr.onResponse=e=>{Kp(this.xhr,e)},this.xhr.offRequest=e=>{Xp(this.xhr,e)},this.xhr.offResponse=e=>{Yp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(ve({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(ve({},r))})})}}const Bn={name:"videojs-http-streaming",VERSION:Vp,canHandleSource(i,e={}){const t=ie(D.options,e);return!t.vhs.experimentalUseMMS&&!Xs("avc1.4d400d,mp4a.40.2",!1)?!1:Bn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=ie(D.options,t);return e.vhs=new Qp(i,e,s),e.vhs.xhr=gp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=jd(i);if(!t)return"";const s=Bn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(D.browser.IS_ANY_SAFARI||D.browser.IS_IOS),{overrideNative:s=t}=e;return s}},GC=()=>Xs("avc1.4d400d,mp4a.40.2",!0);GC()&&D.getTech("Html5").registerSourceHandler(Bn,0);D.VhsHandler=Qp;D.VhsSourceHandler=Bn;D.Vhs=ge;D.use||D.registerComponent("Vhs",ge);D.options.vhs=D.options.vhs||{};(!D.getPlugin||!D.getPlugin("reloadSourceOnError"))&&D.registerPlugin("reloadSourceOnError",OC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function Fn(){return Fn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var QC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new x.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),u=0;u"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(E,A){if(s.keySystem=a.keySystem,T=gd(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){E(a);return}T.getCertificate(o,function(_,w){if(_){A(_);return}y=w,E()})}).then(function(){return a.createMediaKeys()}).then(function(E){return tA({player:t,video:s,certificate:y,createdMediaKeys:E})}).catch(function(E){return E?Promise.reject(E):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var E=gd(s.keySystem,o.keySystems[s.keySystem]),A=E.getLicense;return eA({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?rA(A,d):null,removeSession:u,eventBus:d})})},Ul="com.apple.fps.1_0",aA=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=WC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),u=new Uint8Array(a,n,t.byteLength);u.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var d=new Uint16Array(a,n,s.length);d.set(s),n+=d.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},oA=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,u=e.eventBus;return new Promise(function(d,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new x.WebKitMediaKeys(Ul))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",aA({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}u.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(E,A){if(u&&u.trigger("licenserequestattempted"),E){m(E);return}y.update(new Uint8Array(A))})}),y.addEventListener("webkitkeyadded",function(){d()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},lA=function(e){return function(t,s){var r=ca(t.emeHeaders,e.certificateHeaders);D.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},fs(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},uA=function(e,t){return XC(KC(t))},cA=function(e){return function(t,s,r,n){var a=ca({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);D.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},fs(n,!0))}},dA=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Ul],o=a.getCertificate||lA(a),u=a.getContentId||uA,d=a.getLicense||cA(a);return new Promise(function(m,y){o(r,function(T,E){if(T){y(T);return}m(E)})}).then(function(m){return oA({video:t,cert:m,initData:s,getLicense:d,options:r,contentId:u(r,s),eventBus:n})})},Gi="com.microsoft.playready",hA=function(e,t,s,r){var n=e.keySystems[Gi];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,u){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(u)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(u,d){if(r&&r.trigger("licenserequestattempted"),u){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(d))};n.getLicense?n.getLicense(e,s.message.buffer,a):Jp(n,s.message.buffer,e,a)},fA=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){hA(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},pA=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new x.MSMediaKeys(Gi))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}fA(e,t,s,r)},mA="3.11.2",gA=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function vd(i,e){if(i==null)return{};var t=EA(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var CA="1.14.0";const AA=D.getComponent("player");class DA extends AA{constructor(e,t,s){t=D.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}D.registerComponent("player",DA);const ae=D;ae.VERSION={pillarbox:CA,videojs:D.VERSION,[D.VhsSourceHandler.name]:D.VhsSourceHandler.VERSION,eme:D.getPlugin("eme").VERSION};ae.options.enableSmoothSeeking=!0;ae.options.fill=!0;ae.options.html5={vhs:{useForcedSubtitles:!0}};ae.options.liveTracker={trackingThreshold:120,liveTolerance:15};ae.options.liveui=!0;ae.options.playsinline=!0;ae.options.responsive=!0;ae.options.trackers={};class Td{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=qi(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Ui={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},rn={JPG:"jpg",WEBP:"webp",PNG:"png"},wA="https://il.srgssr.ch/images/";class kA{static scale({url:e,width:t=Ui.WIDTH_960,format:s=rn.JPG}={},r=wA){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return rn.JPG}static get PNG(){return rn.PNG}static get WEBP(){return rn.WEBP}static get WIDTH_240(){return Ui.WIDTH_240}static get WIDTH_320(){return Ui.WIDTH_320}static get WIDTH_480(){return Ui.WIDTH_480}static get WIDTH_960(){return Ui.WIDTH_960}static get WIDTH_1920(){return Ui.WIDTH_1920}}const IA={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class ur{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=ur.vendors[s.type];if(ur.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return IA}}const nn={AKAMAI:"AKAMAI",NONE:"NONE"};class Ei{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return nn.AKAMAI}static hasToken(e){return e.some(t=>Ei.isAkamai(t.tokenType))}static isAkamai(e){return nn.AKAMAI===e}static isNone(e){return nn.NONE===e}static get NONE(){return nn.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=Ei.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((u,d)=>s.searchParams.set(d,u)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=Ei.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const bd="emptied",Sd="ended",xd="loadeddata",Ed="loadstart",so="pause",PA="play",ro="playing",Cd="ratechange",Ad="seeking",no="timeupdate",Dd="waiting";class gi{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(bd,this.emptiedListener),this.player.off(Sd,this.endedListener),this.player.off(Ed,this.loadstartListener),this.player.off(xd,this.loadeddataListener),this.player.off(ro,this.playListener),this.player.off(so,this.pauseListener),this.player.off(Cd,this.rateChangeListener),this.player.off(Ad,this.seekingListener),this.player.off(no,this.timeUpdateListener),this.player.off(Dd,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=gi.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:gi.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[PA,so].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(bd,this.emptiedListener),this.player.on(Sd,this.endedListener),this.player.on(Ed,this.loadstartListener),this.player.on(xd,this.loadeddataListener),this.player.on(ro,this.playListener),this.player.on(so,this.pauseListener),this.player.on(Cd,this.rateChangeListener),this.player.on(Ad,this.seekingListener),this.player.on(no,this.timeUpdateListener),this.player.on(Dd,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&&ethis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===gi.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=gi.now()),this.mediaSession===0&&(this.mediaSession=gi.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),ae.browser.IS_ANY_SAFARI?this.player.one(no,e):this.player.one(ro,e)}}class Ce{constructor(e,{playerName:t="none",playerVersion:s="none",platform:r="Web",schemaVersion:n=1,heartbeatInterval:a=3e4,beaconUrl:o="https://monitoring.pillarbox.ch/api/events"}={}){this.player=e,this.playerName=t,this.playerVersion=s,this.platform=r,this.schemaVersion=n,this.heartbeatInterval=a,this.beaconUrl=o,this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=void 0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.tokenRequestTime=0,this.addListeners()}addListeners(){this.bindCallBacks(),this.player.on("loadstart",this.loadStart),this.player.on("loadeddata",this.loadedData),this.player.on("playing",this.playbackStart),this.player.on("pause",this.playbackStop),this.player.on("error",this.error),this.player.on(["playerreset","dispose","ended"],this.sessionStop),this.player.on(["waiting","stalled"],this.stalled),window.addEventListener("beforeunload",this.sessionStop)}bandwidth(){const e=this.player.tech(!0).vhs?this.player.tech(!0).vhs.stats:void 0;return e?e.bandwidth:void 0}bindCallBacks(){this.error=this.error.bind(this),this.loadedData=this.loadedData.bind(this),this.loadStart=this.loadStart.bind(this),this.playbackStart=this.playbackStart.bind(this),this.playbackStop=this.playbackStop.bind(this),this.stalled=this.stalled.bind(this),this.sessionStop=this.sessionStop.bind(this)}bufferDuration(){const e=this.player.buffered();let t=0;for(let s=0;ss==="metadata"&&t==="segment-metadata")||{};return e?e.value:void 0}currentResource(){let{bandwidth:e,uri:t}=this.currentRepresentation()||{};if(ae.browser.IS_ANY_SAFARI){const{configuration:s}=Array.from(this.player.videoTracks()).find(r=>r.selected)||{};e=s?s.bitrate:void 0,t=this.player.currentSource().src}return{bitrate:e,url:t}}currentSourceMediaData(){return this.player.currentSource().mediaData?this.player.currentSource().mediaData:{}}error(){const e=this.player.error(),t=this.playbackPosition(),s=this.currentRepresentation(),r=s?s.uri:this.player.currentSource().src;this.player.hasStarted()||this.sendEvent("START",this.startEventData()),this.sendEvent("ERROR",we(we({log:JSON.stringify(e.metadata||ae.log.history().slice(-15)),message:e.message,name:e.code},t),{},{url:r})),this.reset()}getDrmRequestDuration(){const e=Object.values(this.player.currentSource().keySystems||{}).map(s=>s.url);if(!e.length)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="xmlhttprequest"&&e.includes(r)).pop();return t&&t.duration}getMetadataInfo(e){const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes(e)).pop();return t?{name:t.name,duration:t.duration}:{}}getTokenRequestDuration(e){if(!e)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes("/akahd/token")).pop();return t&&t.duration}heartbeat(){this.heartbeatIntervalId=setInterval(()=>{this.sendEvent("HEARTBEAT",this.statusEventData())},this.heartbeatInterval)}isTrackerDisabled(){const e=this.player.currentSource();return Array.isArray(e.disableTrackers)?!!e.disableTrackers.find(t=>t.toLowerCase()===Ce.name.toLowerCase()):!!e.disableTrackers}loadedData(){this.sendEvent("START",this.startEventData()),this.sendEvent("HEARTBEAT",this.statusEventData()),this.heartbeat()}loadStart(){!Object.keys(this.currentSourceMediaData()).length&&this.currentSessionId&&(this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp()),this.loadStartTimestamp=Ce.timestamp()}mediaInfo(){return{asset_url:this.mediaAssetUrl,id:this.mediaId,metadata_url:this.mediaMetadataUrl,origin:this.mediaOrigin}}playbackDuration(){return this.lastPlaybackStartTimestamp?Ce.timestamp()+this.lastPlaybackDuration-this.lastPlaybackStartTimestamp:this.lastPlaybackDuration}playbackPosition(){const e=this.currentRepresentation(),t=Ce.secondsToMilliseconds(this.player.currentTime());let s;if(e&&(s=e.programDateTime),ae.browser.IS_ANY_SAFARI){const r=Date.parse(this.player.$("video").getStartDate());s=isNaN(r)?void 0:r+t}return{position:t,position_timestamp:s}}playbackStart(){this.lastPlaybackStartTimestamp=Ce.timestamp()}playbackStop(){this.lastPlaybackDuration+=Ce.timestamp()-this.lastPlaybackStartTimestamp,this.lastPlaybackStartTimestamp=0}playerCurrentDimensions(){return this.player.currentDimensions()}playerInfo(){return{name:this.playerName,version:this.playerVersion,platform:this.platform}}qoeTimings(e,t){return{metadata:this.metadataRequestTime,asset:e,total:t-this.sessionStartTimestamp}}qosTimings(e){return{asset:e,drm:this.getDrmRequestDuration(),metadata:this.metadataRequestTime,token:this.tokenRequestTime}}removeListeners(){this.player.off("loadstart",this.loadStart),this.player.off("loadeddata",this.loadedData),this.player.off("playing",this.playbackStart),this.player.off("pause",this.playbackStop),this.player.off("error",this.error),this.player.off(["playerreset","dispose","ended"],this.sessionStop),this.player.off(["waiting","stalled"],this.stalled),window.removeEventListener("beforeunload",this.sessionStop)}removeTokenFromAssetUrl(e){if(e)try{const t=new URL(e);return t.searchParams.delete("hdnts"),t.href}catch{return}}reset(e){this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.sessionStartTimestamp=void 0,this.tokenRequestTime=0,clearInterval(this.heartbeatIntervalId),e&&!["ended","playerreset"].includes(e.type)&&this.removeListeners()}sendEvent(e,t={}){if(this.isTrackerDisabled()&&!this.currentSessionId||!this.currentSessionId)return;const s=JSON.stringify({event_name:e,session_id:this.currentSessionId,timestamp:Ce.timestamp(),version:this.schemaVersion,data:t});navigator.sendBeacon(this.beaconUrl,s)}sessionStart(){this.sessionStartTimestamp&&this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp(),this.mediaId=this.player.currentSource().src||void 0}sessionStop(e){this.sendEvent("STOP",this.statusEventData()),this.reset(e)}stalled(){if(!this.player.hasStarted()||this.player.seeking()||this.isStalled)return;this.isStalled=!0;const e=Ce.timestamp(),t=()=>{const s=Ce.timestamp();this.isStalled=!1,this.lastStallCount+=1,this.lastStallDuration+=s-e};ae.browser.IS_ANY_SAFARI?this.player.one("timeupdate",t):this.player.one("playing",t)}stallInfo(){return{count:this.lastStallCount,duration:this.lastStallDuration}}statusEventData(){const e=this.bandwidth(),t=this.bufferDuration(),{bitrate:s,url:r}=this.currentResource(),{droppedVideoFrames:n}=this.player.getVideoPlaybackQuality(),a=this.playbackDuration(),{position:o,position_timestamp:u}=this.playbackPosition(),d=isFinite(this.player.duration())?"On-demand":"Live",m=this.stallInfo();return{bandwidth:e,bitrate:s,buffered_duration:t,frame_drops:n,playback_duration:a,position:o,position_timestamp:u,stall:m,stream_type:d,url:r}}startEventData(){const e=Ce.timestamp(),t=this.loadStartTimestamp?e-this.loadStartTimestamp:0;return this.isTrackerDisabled()||(this.currentSessionId=Ce.sessionId()),this.mediaAssetUrl=this.removeTokenFromAssetUrl(this.player.currentSource().src),this.mediaMetadataUrl=this.getMetadataInfo(this.mediaId).name,this.metadataRequestTime=this.getMetadataInfo(this.mediaId).duration,this.mediaOrigin=window.location.href,this.tokenRequestTime=this.getTokenRequestDuration(this.currentSourceMediaData().tokenType),{browser:Ce.userAgent(),device:{id:Ce.deviceId()},media:this.mediaInfo(),player:this.playerInfo(),qoe_timings:this.qoeTimings(t,e),qos_timings:this.qosTimings(t),screen:this.playerCurrentDimensions()}}static sessionId(){return Ce.randomUUID()}static deviceId(){if(!localStorage)return;const e="pillarbox_device_id";let t=localStorage.getItem(e);return t||(t=Ce.randomUUID(),localStorage.setItem(e,t)),t}static randomUUID(){return crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static secondsToMilliseconds(e){return parseInt(e*1e3)}static timestamp(){return Date.now()}static userAgent(){return{user_agent:navigator.userAgent}}}class LA{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return we(we(we({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return we(we(we({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var sm="Wiedergabe",rm="Pause",nm="Erneut abspielen",am="Dauer",om="LIVE",lm="Geladen",um="Status",cm="Vollbild",dm="Stumm schalten",hm="Ton einschalten",fm="Untertitel",pm="Untertitel",mm="Kapitel",gm="Schließen",ym="Beschreibungen",_m="Schrift",vm="Weiß",Tm="Schwarz",bm="Rot",Sm="Grün",xm="Blau",Em="Gelb",Cm="Magenta",Am="Türkis",Dm="Hintergrund",wm="Fenster",km="Durchsichtig",Im="Undurchsichtig",Pm="Kein",Lm="Erhoben",Om="Gedrückt",Rm="Uniform",Nm="Zwanglos",Mm="Schreibschrift",Bm="Zurücksetzen",Fm="Fertig",Um="Farbe",$m="Deckkraft",OA={Play:sm,Pause:rm,Replay:nm,"Current Time":"Aktueller Zeitpunkt",Duration:am,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:om,Loaded:lm,Progress:um,Fullscreen:cm,"Exit Fullscreen":"Vollbildmodus beenden",Mute:dm,Unmute:hm,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:fm,"subtitles off":"Untertitel aus",Captions:pm,"captions off":"Untertitel aus",Chapters:mm,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:gm,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:ym,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:_m,White:vm,Black:Tm,Red:bm,Green:Sm,Blue:xm,Yellow:Em,Magenta:Cm,Cyan:Am,Background:Dm,Window:wm,Transparent:km,"Semi-Transparent":"Halbdurchsichtig",Opaque:Im,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:Pm,Raised:Lm,Depressed:Om,Uniform:Rm,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Nm,Script:Mm,"Small Caps":"Small-Caps",Reset:Bm,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:Fm,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Um,Opacity:$m,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},RA=Object.freeze({__proto__:null,Background:Dm,Black:Tm,Blue:xm,Captions:pm,Casual:Nm,Chapters:mm,Close:gm,Color:Um,Cyan:Am,Depressed:Om,Descriptions:ym,Done:Fm,Duration:am,Fullscreen:cm,Green:Sm,LIVE:om,Loaded:lm,Magenta:Cm,Mute:dm,None:Pm,Opacity:$m,Opaque:Im,Pause:rm,Play:sm,Progress:um,Raised:Lm,Red:bm,Replay:nm,Reset:Bm,Script:Mm,Subtitles:fm,Text:_m,Transparent:km,Uniform:Rm,Unmute:hm,White:vm,Window:wm,Yellow:Em,default:OA}),qm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",jm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",Vm="Die Werbung wurde übersprungen.",Hm="Dieser Inhalt ist nicht mehr verfügbar.",zm="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",Gm="Dieser Inhalt steht aus publizistischen Gründen vorübergehend nicht zur Verfügung.",Wm="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",Km="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",Xm="Dieser Inhalt ist nicht verfügbar.",NA={AGERATING12:qm,AGERATING18:jm,COMMERCIAL:Vm,ENDDATE:Hm,GEOBLOCK:zm,JOURNALISTIC:Gm,LEGAL:Wm,STARTDATE:Km,UNKNOWN:Xm},MA=Object.freeze({__proto__:null,AGERATING12:qm,AGERATING18:jm,COMMERCIAL:Vm,ENDDATE:Hm,GEOBLOCK:zm,JOURNALISTIC:Gm,LEGAL:Wm,STARTDATE:Km,UNKNOWN:Xm,default:NA});ae.addLanguage("de",we(we({},RA),MA));var Ym="Play",Qm="Pause",Jm="Replay",Zm="Duration",eg="LIVE",tg="Loaded",ig="Progress",sg="Fullscreen",rg="Mute",ng="Unmute",ag="Subtitles",og="Captions",lg="Chapters",ug="Descriptions",cg="Close",dg="Text",hg="White",fg="Black",pg="Red",mg="Green",gg="Blue",yg="Yellow",_g="Magenta",vg="Cyan",Tg="Background",bg="Window",Sg="Transparent",xg="Opaque",Eg="None",Cg="Raised",Ag="Depressed",Dg="Uniform",wg="Casual",kg="Script",Ig="Reset",Pg="Done",Lg="Color",Og="Opacity",BA={"Audio Player":"Audio Player","Video Player":"Video Player",Play:Ym,Pause:Qm,Replay:Jm,"Current Time":"Current Time",Duration:Zm,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:eg,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:tg,Progress:ig,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:sg,"Exit Fullscreen":"Exit Fullscreen",Mute:rg,Unmute:ng,"Playback Rate":"Playback Rate",Subtitles:ag,"subtitles off":"subtitles off",Captions:og,"captions off":"captions off",Chapters:lg,Descriptions:ug,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:cg,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:dg,White:hg,Black:fg,Red:pg,Green:mg,Blue:gg,Yellow:yg,Magenta:_g,Cyan:vg,Background:Tg,Window:bg,Transparent:Sg,"Semi-Transparent":"Semi-Transparent",Opaque:xg,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:Eg,Raised:Cg,Depressed:Ag,Uniform:Dg,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:wg,Script:kg,"Small Caps":"Small Caps",Reset:Ig,"restore all settings to the default values":"restore all settings to the default values",Done:Pg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:Lg,Opacity:Og,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},FA=Object.freeze({__proto__:null,Background:Tg,Black:fg,Blue:gg,Captions:og,Casual:wg,Chapters:lg,Close:cg,Color:Lg,Cyan:vg,Depressed:Ag,Descriptions:ug,Done:Pg,Duration:Zm,Fullscreen:sg,Green:mg,LIVE:eg,Loaded:tg,Magenta:_g,Mute:rg,None:Eg,Opacity:Og,Opaque:xg,Pause:Qm,Play:Ym,Progress:ig,Raised:Cg,Red:pg,Replay:Jm,Reset:Ig,Script:kg,Subtitles:ag,Text:dg,Transparent:Sg,Uniform:Dg,Unmute:ng,White:hg,Window:bg,Yellow:yg,default:BA}),Rg="To protect children this content is only available between 8PM and 6AM.",Ng="To protect children this content is only available between 10PM and 5AM.",Mg="This commercial content is not available.",Bg="This content is not available anymore.",Fg="This content is not available outside Switzerland.",Ug="This content is temporarily unavailable for journalistic reasons.",$g="This content is not available due to legal restrictions.",qg="This content is not available yet.",jg="This content is not available.",UA={AGERATING12:Rg,AGERATING18:Ng,COMMERCIAL:Mg,ENDDATE:Bg,GEOBLOCK:Fg,JOURNALISTIC:Ug,LEGAL:$g,STARTDATE:qg,UNKNOWN:jg},$A=Object.freeze({__proto__:null,AGERATING12:Rg,AGERATING18:Ng,COMMERCIAL:Mg,ENDDATE:Bg,GEOBLOCK:Fg,JOURNALISTIC:Ug,LEGAL:$g,STARTDATE:qg,UNKNOWN:jg,default:UA});ae.addLanguage("en",we(we({},FA),$A));var Vg="Lecture",Hg="Pause",zg="Revoir",Gg="Durée",Wg="EN DIRECT",Kg="Chargé",Xg="Progression",Yg="Plein écran",Qg="Mettre en sourdine",Jg="Activer le son",Zg="Sous-titres",e0="Sous-titres transcrits",t0="Chapitres",i0="Descriptions",s0="Fermer",r0="Texte",n0="Blanc",a0="Noir",o0="Rouge",l0="Vert",u0="Bleu",c0="Jaune",d0="Magenta",h0="Cyan",f0="Arrière-plan",p0="Fenêtre",m0="Transparent",g0="Opaque",y0="Aucun",_0="Élevé",v0="Enfoncé",T0="Uniforme",b0="Manuscrite",S0="Scripte",x0="Réinitialiser",E0="Terminé",C0="Couleur",A0="Opacité",qA={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:Vg,Pause:Hg,Replay:zg,"Current Time":"Temps actuel",Duration:Gg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:Wg,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:Kg,Progress:Xg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:Yg,"Exit Fullscreen":"Fenêtré",Mute:Qg,Unmute:Jg,"Playback Rate":"Vitesse de lecture",Subtitles:Zg,"subtitles off":"Sous-titres désactivés",Captions:e0,"captions off":"Sous-titres transcrits désactivés",Chapters:t0,Descriptions:i0,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:s0,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:r0,White:n0,Black:a0,Red:o0,Green:l0,Blue:u0,Yellow:c0,Magenta:d0,Cyan:h0,Background:f0,Window:p0,Transparent:m0,"Semi-Transparent":"Semi-transparent",Opaque:g0,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:y0,Raised:_0,Depressed:v0,Uniform:T0,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:b0,Script:S0,"Small Caps":"Petites capitales",Reset:x0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:E0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:C0,Opacity:A0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},jA=Object.freeze({__proto__:null,Background:f0,Black:a0,Blue:u0,Captions:e0,Casual:b0,Chapters:t0,Close:s0,Color:C0,Cyan:h0,Depressed:v0,Descriptions:i0,Done:E0,Duration:Gg,Fullscreen:Yg,Green:l0,LIVE:Wg,Loaded:Kg,Magenta:d0,Mute:Qg,None:y0,Opacity:A0,Opaque:g0,Pause:Hg,Play:Vg,Progress:Xg,Raised:_0,Red:o0,Replay:zg,Reset:x0,Script:S0,Subtitles:Zg,Text:r0,Transparent:m0,Uniform:T0,Unmute:Jg,White:n0,Window:p0,Yellow:c0,default:qA}),D0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",w0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",k0="Ce contenu n'est actuellement pas disponible.",I0="Ce contenu n'est plus disponible.",P0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",L0="Ce contenu est temporairement indisponible pour des raisons éditoriales.",O0="Pour des raisons juridiques, ce contenu n'est pas disponible.",R0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",N0="Ce contenu n'est actuellement pas disponible.",VA={AGERATING12:D0,AGERATING18:w0,COMMERCIAL:k0,ENDDATE:I0,GEOBLOCK:P0,JOURNALISTIC:L0,LEGAL:O0,STARTDATE:R0,UNKNOWN:N0},HA=Object.freeze({__proto__:null,AGERATING12:D0,AGERATING18:w0,COMMERCIAL:k0,ENDDATE:I0,GEOBLOCK:P0,JOURNALISTIC:L0,LEGAL:O0,STARTDATE:R0,UNKNOWN:N0,default:VA});ae.addLanguage("fr",we(we({},jA),HA));var M0="Play",B0="Pausa",F0="Replay",U0="Durata",$0="LIVE",q0="Caricato",j0="Stato",V0="Schermo intero",H0="Disattiva l’audio",z0="Attiva l’audio",G0="Sottotitoli",W0="Sottotitoli non udenti",K0="Capitolo",X0="Descrizioni",Y0="Chiudi",Q0="Testo",J0="Bianco",Z0="Nero",ey="Rosso",ty="Verde",iy="Blu",sy="Giallo",ry="Magenta",ny="Ciano",ay="Sfondo",oy="Finestra",ly="Trasparente",uy="Opaco",cy="Nessuno",dy="Uniforme",hy="Reinizializza",fy="Fatto",py="Colore",my="Opacità",zA={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:M0,Pause:B0,Replay:F0,"Current Time":"Orario attuale",Duration:U0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:$0,Loaded:q0,Progress:j0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:V0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:H0,Unmute:z0,"Playback Rate":"Velocità di riproduzione",Subtitles:G0,"subtitles off":"Senza sottotitoli",Captions:W0,"captions off":"Senza sottotitoli non udenti",Chapters:K0,Descriptions:X0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:Y0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:Q0,White:J0,Black:Z0,Red:ey,Green:ty,Blue:iy,Yellow:sy,Magenta:ry,Cyan:ny,Background:ay,Window:oy,Transparent:ly,"Semi-Transparent":"Semi-Trasparente",Opaque:uy,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:cy,Uniform:dy,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:hy,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:fy,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:py,Opacity:my,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},GA=Object.freeze({__proto__:null,Background:ay,Black:Z0,Blue:iy,Captions:W0,Chapters:K0,Close:Y0,Color:py,Cyan:ny,Descriptions:X0,Done:fy,Duration:U0,Fullscreen:V0,Green:ty,LIVE:$0,Loaded:q0,Magenta:ry,Mute:H0,None:cy,Opacity:my,Opaque:uy,Pause:B0,Play:M0,Progress:j0,Red:ey,Replay:F0,Reset:hy,Subtitles:G0,Text:Q0,Transparent:ly,Uniform:dy,Unmute:z0,White:J0,Window:oy,Yellow:sy,default:zA}),gy="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",yy="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",_y="Questo contenuto commerciale non è disponibile.",vy="Questo media non è più disponibile.",Ty="Questo media non è disponibile fuori dalla Svizzera.",by="Questo contenuto è temporaneamente non disponibile per motivi editoriali.",Sy="Il contenuto non è fruibile a causa di restrizioni legali.",xy="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",Ey="Questo media non è disponibile.",WA={AGERATING12:gy,AGERATING18:yy,COMMERCIAL:_y,ENDDATE:vy,GEOBLOCK:Ty,JOURNALISTIC:by,LEGAL:Sy,STARTDATE:xy,UNKNOWN:Ey},KA=Object.freeze({__proto__:null,AGERATING12:gy,AGERATING18:yy,COMMERCIAL:_y,ENDDATE:vy,GEOBLOCK:Ty,JOURNALISTIC:by,LEGAL:Sy,STARTDATE:xy,UNKNOWN:Ey,default:WA});ae.addLanguage("it",we(we({},GA),KA));var Cy="Laschar ir",Ay="Pausa",Dy="Mussar danovamain",wy="Durada",ky="LIVE",Iy="Chargià",Py="Progress",Ly="Entir visur",Oy="Senza tun",Ry="Cun tun",Ny="Suttitels",My="Suttitels",By="Chapitels",Fy="Descripziuns",Uy="Serrar",$y="Text",qy="Alv",jy="Nair",Vy="Cotschn",Hy="Verd",zy="Blau",Gy="Mellen",Wy="Magenta",Ky="Cyan",Xy="Fund",Yy="Fanestra",Qy="Transparent",Jy="Betg transparent",Zy="Nagin",e_="Auzà",t_="Sbassà",i_="Uniform",s_="Sumbriva",r_="Casual",n_="Script",a_="Da nov",o_="Fatg",l_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",u_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",c_="Quest medium commerzial n'è betg disponibel.",d_="Quest cuntegn n'è betg pli disponibel.",h_="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",f_="Quest cuntegn na stat ad interim betg a disposiziun per motivs publicistics.",p_="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",m_="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",g_="Quest cuntegn n'è betg disponibel.",XA={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:Cy,Pause:Ay,Replay:Dy,"Current Time":"Temp actual",Duration:wy,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:ky,Loaded:Iy,Progress:Py,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:Ly,"Non-Fullscreen":"Betg entir visur",Mute:Oy,Unmute:Ry,"Playback Rate":"Tempo ",Subtitles:Ny,"subtitles off":"senza suttitels",Captions:My,"captions off":"senza suttitels",Chapters:By,Descriptions:Fy,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:Uy,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:$y,White:qy,Black:jy,Red:Vy,Green:Hy,Blue:zy,Yellow:Gy,Magenta:Wy,Cyan:Ky,Background:Xy,Window:Yy,Transparent:Qy,"Semi-Transparent":"Mez transparent",Opaque:Jy,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Zy,Raised:e_,Depressed:t_,Uniform:i_,Dropshadow:s_,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:r_,Script:n_,"Small Caps":"Bustabs pitschens",Reset:a_,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:o_,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:l_,AGERATING18:u_,COMMERCIAL:c_,ENDDATE:d_,GEOBLOCK:h_,JOURNALISTIC:f_,LEGAL:p_,STARTDATE:m_,UNKNOWN:g_},YA=Object.freeze({__proto__:null,AGERATING12:l_,AGERATING18:u_,Background:Xy,Black:jy,Blue:zy,COMMERCIAL:c_,Captions:My,Casual:r_,Chapters:By,Close:Uy,Cyan:Ky,Depressed:t_,Descriptions:Fy,Done:o_,Dropshadow:s_,Duration:wy,ENDDATE:d_,Fullscreen:Ly,GEOBLOCK:h_,Green:Hy,JOURNALISTIC:f_,LEGAL:p_,LIVE:ky,Loaded:Iy,Magenta:Wy,Mute:Oy,None:Zy,Opaque:Jy,Pause:Ay,Play:Cy,Progress:Py,Raised:e_,Red:Vy,Replay:Dy,Reset:a_,STARTDATE:m_,Script:n_,Subtitles:Ny,Text:$y,Transparent:Qy,UNKNOWN:g_,Uniform:i_,Unmute:Ry,White:qy,Window:Yy,Yellow:Gy,default:XA});ae.addLanguage("rm",we({},YA));const QA=["url","mimeType","keySystems"],JA=["src"];class Q{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&Q.createTextTrack(e,s).then(a=>{n.forEach(o=>{Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){Q.addRemoteTextTracks(e,t.subtitles),Q.addChapters(e,t.urn,t.chapters),Q.addBlockedSegments(e,t.blockedSegments),Q.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&Q.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&Q.createTextTrack(e,s).then(n=>{t.forEach(a=>{Q.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return Q.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return qi(function*(){return Ei.hasToken(e)?Ei.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return ur.hasDrm(e)?e.map(s=>we(we({},s),ur.buildKeySystems(s.drmList))):e}static composeMainResources(e){return Q.composeAkamaiResources(Q.composeKeySystemsResources(Q.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=ae.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,u=vd(r,QA);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:u}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new ae.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new Td(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return Q.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=Q.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return qi(function*(){Q.pillarboxMonitoring(e)&&Q.pillarboxMonitoring(e).sessionStart();const{src:s}=t,r=vd(t,JA),n=yield Q.getMediaComposition(s,Q.dataProvider(e)),a=yield Q.composeMainResources(n),o=Q.getMediaData(a);return Q.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=Q.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=Q.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return qi(function*(){try{const r=yield Q.getSrcMediaObj(e,t);return Q.srgAnalytics(e),Q.updateTitleBar(e,r),Q.updatePoster(e,r),Q.blockingReason(e,r)?void 0:(Q.addTextTracks(e,r),s(null,r))}catch(r){return Q.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new gi(e,{debug:e.debug(),playerVersion:ae.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static pillarboxMonitoring(e){if(e.options().trackers.pillarboxMonitoring!==!1){if(!e.options().trackers.pillarboxMonitoring){const t=new Ce(e,{debug:e.debug(),playerVersion:ae.VERSION.pillarbox,playerName:"Pillarbox"});e.options({trackers:{pillarboxMonitoring:t}})}return e.options().trackers.pillarboxMonitoring}}static updatePoster(e,t,s=kA){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return Q.pillarboxMonitoring(e),Q.cuechangeEventProxy(e),{currentTime:t=>Q.handleCurrentTime(e,t),setCurrentTime:t=>Q.handleSetCurrentTime(e,t),setSource:function(){var t=qi(function*(s,r){return Q.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}ae.use("srgssr/urn",Q.middleware);ae.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const ZA="2.1.0",eD=D.getPlugin("plugin"),wd=D.log.createLogger("pillarbox-playlist"),ot={NO_REPEAT:0,REPEAT_ALL:1,REPEAT_ONE:2};class y_ extends eD{constructor(t,s){super(t);Nt(this,"items_",[]);Nt(this,"currentIndex_",-1);Nt(this,"previousNavigationThreshold",3);Nt(this,"repeat",ot.NO_REPEAT);Nt(this,"autoadvance",!1);Nt(this,"onEnded_",()=>this.handleEnded());s=this.options_=D.obj.merge(this.options_,s),s.playlist&&s.playlist.length&&t.ready(()=>{this.load(...s.playlist)}),this.autoadvance=!!s.autoadvance,this.repeat=s.repeat??this.repeat,this.previousNavigationThreshold=Number.isFinite(s.previousNavigationThreshold)?s.previousNavigationThreshold:this.previousNavigationThreshold,this.player.on("ended",this.onEnded_)}toggleRepeat(t=void 0){this.repeat=t??(this.repeat+1)%Object.keys(ot).length}isRepeatOneMode(){return this.repeat===ot.REPEAT_ONE}isRepeatAllMode(){return this.repeat===ot.REPEAT_ALL}isNoRepeatMode(){return this.repeat===ot.NO_REPEAT}toggleAutoadvance(t=void 0){this.autoadvance=t??!this.autoadvance}dispose(){this.player.off("ended",this.onEnded_)}load(t){this.items_=[...t],this.select(0)}push(...t){this.items_.push(...t),this.updateState_()}splice(t,s,...r){const n=r.length,a=this.items_.splice(t,s,...r),o=a.length;return this.currentIndex_>=t&&this.currentIndex_=t&&(this.currentIndex_=this.currentIndex_-o+n),this.updateState_(),a}clear(){this.items_=[],this.currentIndex_=-1,this.updateState_()}reverse(){this.items_.length&&(this.items_.reverse(),this.currentIndex_=this.items_.length-1-this.currentIndex_,this.updateState_())}sort(t){if(!this.items_.length)return;const s=this.currentItem;this.items_.sort(t),this.currentIndex_=this.items_.indexOf(s),this.updateState_()}get currentIndex(){return this.currentIndex_}get currentItem(){return this.items_[this.currentIndex_]}get items(){return[...this.items_]}select(t){if(t<0||t>=this.items_.length){wd.warn(`Index: ${t} is out of bounds (The current playlist has ${this.items_.length} elements)`);return}if(t===this.currentIndex_){wd.warn(`Index: ${t} is already selected`);return}const s=this.items_[t];this.player.src(s.sources),this.player.poster(s.poster),this.currentIndex_=t,this.updateState_()}next(){if(this.hasNext()){this.select(this.currentIndex_+1);return}this.repeat===ot.REPEAT_ALL&&this.select(0)}hasNext(){return this.currentIndex_+1this.previousNavigationThreshold){this.player.currentTime(0);return}if(this.hasPrevious()){this.select(this.currentIndex_-1);return}this.repeat===ot.REPEAT_ALL&&this.select(this.items_.length-1)}isLive(){const t=this.player.liveTracker;return t&&t.isLive()}hasPrevious(){return this.currentIndex_>0}handleEnded(){if(this.repeat===ot.REPEAT_ONE){this.player.play().then(()=>{});return}this.autoadvance&&this.next()}shuffle(){for(let t=this.items_.length-1;t>0;t-=1){const s=Math.floor(Math.random()*(t+1));[this.items_[t],this.items_[s]]=[this.items_[s],this.items_[t]],this.currentIndex_===t?this.currentIndex_=s:this.currentIndex_===s&&(this.currentIndex_=t)}this.updateState_()}updateState_(){this.setState({items:JSON.stringify(this.items_),currentIndex:this.currentIndex_})}static get VERSION(){return ZA}}y_.prototype.options_={autoadvance:!1,repeat:!1};D.registerPlugin("pillarboxPlaylist",y_);const tD=D.getComponent("Button");class iD extends tD{constructor(t,s){s=D.mergeOptions({controlText:"Playlist"},s);super(t,s);Nt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&this.toggleVisibility()});this.setIcon("chapters"),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-chapters",!0)}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}buildCSSClass(){return`pbw-playlist-button vjs-hidden ${super.buildCSSClass()}`}handleClick(t){super.handleClick(t),this.player().getChild("PillarboxPlaylistMenuDialog").open()}toggleVisibility(){if(this.playlist().items.length>0){this.show();return}this.hide()}}D.registerComponent("PillarboxPlaylistButton",iD);const sD=D.getComponent("Button");let rD=class extends sD{constructor(e,t){var s,r;super(e,t),this.selected(t.index===this.playlist().currentIndex),this.controlText(`${(s=this.options_.item.data)==null?void 0:s.title} - ${D.formatTime((r=this.options_.item.data)==null?void 0:r.duration)}`)}playlist(){return this.player().pillarboxPlaylist()}handleClick(e){super.handleClick(e),this.playlist().select(this.options_.index)}selected(e){this.toggleClass("vjs-selected",e)}buildCSSClass(){return`pbw-playlist-item-button vjs-visible-text ${super.buildCSSClass()}`}};D.registerComponent("PillarboxPlaylistMenuItem",rD);const nD=D.getComponent("Button");class aD extends nD{constructor(e,t){t=D.mergeOptions({controlText:"Next Item"},t),super(e,t),this.setIcon("next-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-next-item",!0)}handleClick(e){super.handleClick(e),this.playlist().next()}}D.registerComponent("PillarboxPlaylistNextItemButton",aD);const oD=D.getComponent("Button");class lD extends oD{constructor(e,t){t=D.mergeOptions({controlText:"Previous Item"},t),super(e,t),this.setIcon("previous-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-previous-item",!0)}handleClick(e){super.handleClick(e),this.playlist().previous()}}D.registerComponent("PillarboxPlaylistPreviousItemButton",lD);const uD=D.getComponent("Button");class cD extends uD{constructor(e,t){t=D.mergeOptions({controlText:"Repeat"},t),super(e,t),this.controlText(this.repeatModeAsString()),this.setIcon("repeat")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-repeat",!0)}repeatModeAsString(){switch(this.playlist().repeat){case ot.NO_REPEAT:return"No Repeat";case ot.REPEAT_ALL:return"Repeat All";case ot.REPEAT_ONE:return"Repeat One"}}buildCSSClass(){return`${this.playlist().repeat?"vjs-selected":""} ${super.buildCSSClass()}`}handleClick(e){super.handleClick(e),this.playlist().toggleRepeat(),this.toggleClass("vjs-selected",!this.playlist().isNoRepeatMode()),this.toggleClass("pbw-repeat-one",this.playlist().isRepeatOneMode()),this.controlText(this.repeatModeAsString()),this.setAttribute("aria-pressed",!this.playlist().isNoRepeatMode())}}D.registerComponent("PillarboxPlaylistRepeatButton",cD);const dD=D.getComponent("Button");class hD extends dD{constructor(e,t){t=D.mergeOptions({controlText:"Shuffle"},t),super(e,t),this.setIcon("shuffle")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-shuffle",!0)}handleClick(e){super.handleClick(e),this.playlist().shuffle()}}D.registerComponent("PillarboxPlaylistShuffleButton",hD);const fD=D.getComponent("Component");class __ extends fD{}__.prototype.options_={className:"pbw-playlist-controls",children:["pillarboxPlaylistRepeatButton","pillarboxPlaylistShuffleButton","pillarboxPlaylistPreviousItemButton","pillarboxPlaylistNextItemButton"]};D.registerComponent("PillarboxPlaylistControls",__);const pD=D.getComponent("PillarboxPlaylistMenuItem"),kd=D.getComponent("Component"),mD=D.getComponent("ModalDialog");class gD extends mD{constructor(t,s){s.temporary=!1,s=D.mergeOptions({pauseOnOpen:!1},s);super(t,s);Nt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&(this.removeItems(),this.renderItems()),"currentIndex"in t&&this.select(t.currentIndex.to)});this.fill(),this.addChild("PillarboxPlaylistControls",s.pillarboxPlaylistControls),this.renderItems(),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}buildCSSClass(){return`pbw-playlist-dialog ${super.buildCSSClass()}`}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}playlist(){return this.player().pillarboxPlaylist()}select(t){this.getChild("PillarboxPlaylistMenuItemsList").children().filter(r=>r.name()==="PillarboxPlaylistMenuItem").map(r=>r.getChild("PillarboxPlaylistMenuItemButton")).forEach(r=>r.selected(t===r.options().index))}removeItems(){this.removeChild(this.getChild("PillarboxPlaylistMenuItemsList"))}renderItems(){const t=new kd(this.player(),{name:"PillarboxPlaylistMenuItemsList",el:D.dom.createEl("ol",{className:"pbw-playlist-items"})});this.playlist().items.forEach((s,r)=>{const n=new kd(this.player(),{name:"PillarboxPlaylistMenuItem",el:D.dom.createEl("li",{className:"pbw-playlist-item"})});n.addChild(new pD(this.player(),{item:s,index:r,name:"PillarboxPlaylistMenuItemButton"})),t.addChild(n)}),this.addChild(t)}}D.registerComponent("PillarboxPlaylistMenuDialog",gD);const yD="Wiedergabeliste",_D="Mischen",vD={"Next Item":"Nächstes element","No Repeat":"Keine Wiederholung",Playlist:yD,"Previous Item":"Vorheriges Element","Repeat All":"Alle Wiederholen","Repeat One":"Einzelnes Wiederholen",Shuffle:_D},TD="Playlist",bD="Shuffle",SD={"Next Item":"Next Item","No Repeat":"No Repeat",Playlist:TD,"Previous Item":"Previous Item","Repeat All":"Repeat All","Repeat One":"Repeat One",Shuffle:bD},xD="Liste de lecture",ED="Mélanger",CD={"Next Item":"Élément suivant","No Repeat":"Pas de Répétition",Playlist:xD,"Previous Item":"Élément précédent","Repeat All":"Répéter Tout","Repeat One":"Répéter Un",Shuffle:ED},AD="Playlist",DD="Mescola",wD={"Next Item":"Elemento successivo","No Repeat":"Nessuna Ripetizione",Playlist:AD,"Previous Item":"Elemento precedente","Repeat All":"Ripeti Tutto","Repeat One":"Ripeti Uno",Shuffle:DD},kD="Glista da reprodukziun",ID="Maschadar",PD={"Next Item":"Element proxim","No Repeat":"Nagins Repeter",Playlist:kD,"Previous Item":"Element precedent","Repeat All":"Repeter Tut","Repeat One":"Repeter In",Shuffle:ID};function br(i,e){D.addLanguage(i,{...D.options.language[i]??{},...e})}br("de",vD);br("en",SD);br("fr",CD);br("it",wD);br("rm",PD);const LD=D.getPlugin("plugin"),OD=D.log.createLogger("pillarbox-playlist-ui");class v_ extends LD{constructor(e,t){if(super(e),!e.usingPlugin("pillarboxPlaylist")){OD.error("pillarbox-playlist plugin is required");return}t=this.options_=D.obj.merge(this.options_,t),e.options({pillarboxPlaylistMenuDialog:t.pillarboxPlaylistMenuDialog??!0,controlBar:this.mergeControlBarOptions(e,t)})}mergeControlBarOptions(e,t){if(e.options_.controlBar===!1)return e.options_.controlBar;const s=D.obj.merge(D.getComponent("ControlBar").prototype.options_,e.options_.controlBar),r=s.children.findIndex(n=>n===t.insertChildBefore);if(t.insertChildBefore&&r!==-1){const n=[...s.children];return n.splice(r,0,"pillarboxPlaylistButton"),s.children=n,s}return s.pillarboxPlaylistButton=t.pillarboxPlaylistButton??!0,s}}v_.prototype.options_={insertChildBefore:"fullscreenToggle"};D.registerPlugin("pillarboxPlaylistUI",v_);const $l=new URLSearchParams(location.search),RD=$l.has("debug"),ND=$l.get("ilHost")||void 0,MD=$l.get("language");window.player=ae("player",{debug:RD,language:MD,autoplay:!0,srgOptions:{dataProviderHost:ND},plugins:{pillarboxPlaylist:{autoadvance:!0,repeat:ot.REPEAT_ALL},pillarboxPlaylistUI:!0}});const BD=["urn:rts:video:14827742","urn:srf:video:05457f66-fd67-4131-8e0a-6d85743efc39","urn:rtr:video:33136b80-bec6-40cd-a771-b8954c805098","urn:rts:video:9883196"];Promise.all(BD.map(async i=>{const t=(await Q.getMediaComposition(i,Q.dataProvider(player))).getMainChapter();return{sources:[{src:i,type:"srgssr/urn"}],data:{title:t.title,duration:t.duration/1e3},poster:t.imageUrl}})).then(i=>{player.pillarboxPlaylist().load(i)});window.player=player;window.pillarbox=ae; diff --git a/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BmuOoaPc.css b/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BmuOoaPc.css new file mode 100644 index 0000000..811deb8 --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-playlist/assets/index-BmuOoaPc.css @@ -0,0 +1 @@ +.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen,.pillarbox-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button,.pillarbox-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text,.pillarbox-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled,.pillarbox-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000}.pbw-playlist-button{cursor:pointer}.vjs-modal-dialog.pbw-playlist-dialog{right:0;left:auto;width:100%;max-width:30em}.vjs-modal-dialog.pbw-playlist-dialog .vjs-button{cursor:pointer}.pbw-playlist-dialog .vjs-modal-dialog-content{font-size:1em}.pbw-playlist-dialog .pbw-playlist-items{width:100%;padding-left:0;list-style-position:inside;border-radius:.5em}.pbw-playlist-dialog .vjs-button.pbw-playlist-item-button{width:95%;height:auto;padding:.5em;overflow:hidden;white-space:nowrap;text-align:left;text-overflow:ellipsis;border-radius:.5em}.pbw-playlist-dialog .vjs-selected{color:#000;background-color:#fff}.pbw-playlist-dialog .pbw-playlist-controls{display:flex;justify-content:space-between;margin:1em 0}.pbw-playlist-dialog .pbw-playlist-controls .vjs-button{margin-right:1em;border-radius:.5em}.pbw-playlist-dialog .pbw-repeat-one{position:relative}.pbw-playlist-dialog .pbw-repeat-one:after{position:absolute;right:.5em;bottom:.5em;display:flex;align-items:center;justify-content:center;width:1em;height:1em;font-size:1em;border-radius:50%;content:"1"} diff --git a/pr-preview/pr-36/packages/pillarbox-playlist/index.html b/pr-preview/pr-36/packages/pillarbox-playlist/index.html new file mode 100644 index 0000000..0d4b335 --- /dev/null +++ b/pr-preview/pr-36/packages/pillarbox-playlist/index.html @@ -0,0 +1,26 @@ + + + + + + + Pillarbox-Playlist Demo + + + + + + + + + diff --git a/pr-preview/pr-36/packages/skip-button/assets/index-B9KY0Yw8.js b/pr-preview/pr-36/packages/skip-button/assets/index-B9KY0Yw8.js new file mode 100644 index 0000000..671b93b --- /dev/null +++ b/pr-preview/pr-36/packages/skip-button/assets/index-B9KY0Yw8.js @@ -0,0 +1,219 @@ +var CT=Object.defineProperty;var DT=(i,e,t)=>e in i?CT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var La=(i,e,t)=>DT(i,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Cd(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Fs;typeof window<"u"?Fs=window:typeof an<"u"?Fs=an:typeof self<"u"?Fs=self:Fs={};var Nn=Fs;const x=or(Nn),AT={},wT=Object.freeze(Object.defineProperty({__proto__:null,default:AT},Symbol.toStringTag,{value:"Module"})),kT=Cd(wT);var Nl=typeof an<"u"?an:typeof window<"u"?window:{},IT=kT,Us;typeof document<"u"?Us=document:(Us=Nl["__GLOBAL_DOCUMENT_CACHE@4"],Us||(Us=Nl["__GLOBAL_DOCUMENT_CACHE@4"]=IT));var Dd=Us;const U=or(Dd);var Ro={exports:{}};function ve(){return ve=Object.assign?Object.assign.bind():function(i){for(var e=1;e=i.length?{done:!0}:{done:!1,value:i[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BT(i,e){if(i){if(typeof i=="string")return Ml(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ml(i,e)}}function Ml(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t=400&&r.statusCode<=599){var a=n;if(t)if(VT.TextDecoder){var o=zT(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function zT(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var GT=HT,Ad=Nn,WT=LT,KT=OT,wd=UT,XT=jT;xe.httpHandler=GT;xe.requestInterceptorsStorage=new wd;xe.responseInterceptorsStorage=new wd;xe.retryManager=new XT;/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */var YT=function(e){var t={};return e&&e.trim().split(` +`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Ro.exports=xe;Ro.exports.default=xe;xe.XMLHttpRequest=Ad.XMLHttpRequest||eb;xe.XDomainRequest="withCredentials"in new xe.XMLHttpRequest?xe.XMLHttpRequest:Ad.XDomainRequest;QT(["get","put","post","patch","head","delete"],function(i){xe[i==="delete"?"del":i]=function(e,t,s){return t=kd(e,t,s),t.method=i.toUpperCase(),No(t)}});function QT(i,e){for(var t=0;t"u")throw new Error("callback argument missing");if(i.requestType&&xe.requestInterceptorsStorage.getIsEnabled()){var e={uri:i.uri||i.url,headers:i.headers||{},body:i.body,metadata:i.metadata||{},retry:i.retry,timeout:i.timeout},t=xe.requestInterceptorsStorage.execute(i.requestType,e);i.uri=t.uri,i.headers=t.headers,i.body=t.body,i.metadata=t.metadata,i.retry=t.retry,i.timeout=t.timeout}var s=!1,r=function(k,B,V){s||(s=!0,i.callback(k,B,V))};function n(){d.readyState===4&&!xe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(l,0)}function a(){var R=void 0;if(d.response?R=d.response:R=d.responseText||ZT(d),w)try{R=JSON.parse(R)}catch{}return R}function o(R){if(clearTimeout(O),clearTimeout(i.retryTimeout),R instanceof Error||(R=new Error(""+(R||"Unknown XMLHttpRequest Error"))),R.statusCode=0,!y&&xe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=d,No(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var k={headers:L.headers||{},body:L.body,responseUrl:d.responseURL,responseType:d.responseType},B=xe.responseInterceptorsStorage.execute(i.requestType,k);L.body=B.body,L.headers=B.headers}return r(R,L)}function l(){if(!y){var R;clearTimeout(O),clearTimeout(i.retryTimeout),i.useXDR&&d.status===void 0?R=200:R=d.status===1223?204:d.status;var k=L,B=null;if(R!==0?(k={body:a(),statusCode:R,method:E,headers:{},url:T,rawRequest:d},d.getAllResponseHeaders&&(k.headers=YT(d.getAllResponseHeaders()))):B=new Error("Internal XMLHttpRequest Error"),i.requestType&&xe.responseInterceptorsStorage.getIsEnabled()){var V={headers:k.headers||{},body:k.body,responseUrl:d.responseURL,responseType:d.responseType},q=xe.responseInterceptorsStorage.execute(i.requestType,V);k.body=q.body,k.headers=q.headers}return r(B,k,k.body)}}var d=i.xhr||null;d||(i.cors||i.useXDR?d=new xe.XDomainRequest:d=new xe.XMLHttpRequest);var m,y,T=d.url=i.uri||i.url,E=d.method=i.method||"GET",D=i.body||i.data,_=d.headers=i.headers||{},A=!!i.sync,w=!1,O,L={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:d};if("json"in i&&i.json!==!1&&(w=!0,_.accept||_.Accept||(_.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),D=JSON.stringify(i.json===!0?D:i.json))),d.onreadystatechange=n,d.onload=l,d.onerror=o,d.onprogress=function(){},d.onabort=function(){y=!0,clearTimeout(i.retryTimeout)},d.ontimeout=o,d.open(E,T,!A,i.username,i.password),A||(d.withCredentials=!!i.withCredentials),!A&&i.timeout>0&&(O=setTimeout(function(){if(!y){y=!0,d.abort("timeout");var R=new Error("XMLHttpRequest timeout");R.code="ETIMEDOUT",o(R)}},i.timeout)),d.setRequestHeader)for(m in _)_.hasOwnProperty(m)&&d.setRequestHeader(m,_[m]);else if(i.headers&&!JT(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(d.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(d),d.send(D||null),d}function ZT(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function eb(){}var tb=Ro.exports;const Id=or(tb);var Pd={exports:{}},Bl=Dd,Mo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function it(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}it.prototype=Mo(Error.prototype);it.prototype.constructor=it;it.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Bo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function zs(){this.values=Mo(null)}zs.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function $s(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function ib(i,e,t){var s=i;function r(){var o=Bo(i);if(o===null)throw new it(it.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var d=new zs;$s(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){d.set(m,t[T].region);break}break;case"vertical":d.alt(m,y,["rl","lr"]);break;case"line":var E=y.split(","),D=E[0];d.integer(m,D),d.percent(m,D)&&d.set("snapToLines",!1),d.alt(m,D,["auto"]),E.length===2&&d.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=y.split(","),d.percent(m,E[0]),E.length===2&&d.alt("positionAlign",E[1],["start","center","end"]);break;case"size":d.percent(m,y);break;case"align":d.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=d.get("region",null),l.vertical=d.get("vertical","");try{l.line=d.get("line","auto")}catch{}l.lineAlign=d.get("lineAlign","start"),l.snapToLines=d.get("snapToLines",!0),l.size=d.get("size",100);try{l.align=d.get("align","center")}catch{l.align=d.get("align","middle")}try{l.position=d.get("position","auto")}catch{l.position=d.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=d.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new it(it.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Oa=Bl.createElement&&Bl.createElement("textarea"),sb={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Fl={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)"},rb={v:"title",lang:"lang"},Ul={rt:"ruby"};function Ld(i,e){function t(){if(!e)return null;function D(A){return e=e.substr(A.length),A}var _=e.match(/^([^<]*)(<[^>]*>?)?/);return D(_[1]?_[1]:_[2])}function s(D){return Oa.innerHTML=D,D=Oa.textContent,Oa.textContent="",D}function r(D,_){return!Ul[_.localName]||Ul[_.localName]===D.localName}function n(D,_){var A=sb[D];if(!A)return null;var w=i.document.createElement(A),O=rb[D];return O&&_&&(w[O]=_.trim()),w}for(var a=i.document.createElement("div"),o=a,l,d=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){d.length&&d[d.length-1]===l.substr(2).replace(">","")&&(d.pop(),o=o.parentNode);continue}var m=Bo(l.substr(1,l.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(D){var _=/^bg_/.test(D),A=_?D.slice(3):D;if(Fl.hasOwnProperty(A)){var w=_?"background-color":"color",O=Fl[A];y.style[w]=O}}),y.className=E.join(" ")}d.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(l)))}return a}var $l=[[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 nb(i){for(var e=0;e<$l.length;e++){var t=$l[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function ab(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,l){for(var d=l.childNodes.length-1;d>=0;d--)o.push(l.childNodes[d])}function n(o){if(!o||!o.length)return null;var l=o.pop(),d=l.textContent||l.innerText;if(d){var m=d.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):d}if(l.tagName==="ruby")return n(o);if(l.childNodes)return r(o,l),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Ve.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ve.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Ve.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Ve.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Ve.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function ub(i,e,t,s){function r(A,w){for(var O,L=new Ve(A),R=1,k=0;kB&&(O=new Ve(A),R=B),A=new Ve(L)}return O||L}var n=new Ve(e),a=e.cue,o=ob(a),l=[];if(a.snapToLines){var d;switch(a.vertical){case"":l=["+y","-y"],d="height";break;case"rl":l=["+x","-x"],d="width";break;case"lr":l=["-x","+x"],d="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[d]+m,E=l[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(E,y)}else{var D=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=D/2;break;case"end":o-=D;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new Ve(e)}var _=r(n,l);e.move(_.toCSSCompatValues(t))}function ds(){}ds.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};ds.convertCueToDOMTree=function(i,e){return!i||!e?null:Ld(i,e)};var lb=.05,cb="sans-serif",db="1.5%";ds.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=db,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{ib(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var d=a.indexOf("-->")!==-1;if(!a||d&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` +`),e.cue.text+=a.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` + +`,i.parse()),i.state==="INITIAL")throw new it(it.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var hb=ds,fb="auto",pb={"":1,lr:1,rl:1},mb={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function gb(i){if(typeof i!="string")return!1;var e=pb[i.toLowerCase()];return e?i.toLowerCase():!1}function Ra(i){if(typeof i!="string")return!1;var e=mb[i.toLowerCase()];return e?i.toLowerCase():!1}function Od(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,l=null,d="",m=!0,y="auto",T="start",E="auto",D="auto",_=100,A="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(w){l=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(w){var O=gb(w);if(O===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=O,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(w){if(typeof w!="number"&&w!==fb)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var O=Ra(w);O?(T=O,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");E=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return D},set:function(w){var O=Ra(w);O?(D=O,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return _},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");_=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return A},set:function(w){var O=Ra(w);if(!O)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");A=O,this.hasBeenReset=!0}}}),this.displayState=void 0}Od.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var yb=Od,_b={"":!0,up:!0};function vb(i){if(typeof i!="string")return!1;var e=_b[i.toLowerCase()];return e?i.toLowerCase():!1}function Ps(i){return typeof i=="number"&&i>=0&&i<=100}function Tb(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Ps(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Ps(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Ps(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Ps(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Ps(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=vb(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var bb=Tb,Ft=Nn,Ei=Pd.exports={WebVTT:hb,VTTCue:yb,VTTRegion:bb};Ft.vttjs=Ei;Ft.WebVTT=Ei.WebVTT;var Sb=Ei.VTTCue,xb=Ei.VTTRegion,Eb=Ft.VTTCue,Cb=Ft.VTTRegion;Ei.shim=function(){Ft.VTTCue=Sb,Ft.VTTRegion=xb};Ei.restore=function(){Ft.VTTCue=Eb,Ft.VTTRegion=Cb};Ft.VTTCue||Ei.shim();var Db=Pd.exports;const ql=or(Db);var jl="https://example.com",Bn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=x.location&&x.location.href||"");var s=/^\/\//.test(e),r=!x.location&&!/\/\//i.test(e);e=new x.URL(e,x.location||jl);var n=new URL(t,e);return r?n.href.slice(jl.length):s?n.href.slice(n.protocol.length):n.href},Fo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const kb=" ",Na=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},Ib=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},$e=function(i){const e={};if(!i)return e;const t=i.split(Ib());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},Vl=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class Pb extends Fo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const Lb=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),zt=function(i){const e={};return Object.keys(i).forEach(function(t){e[Lb(t)]=i[t]}),e},Ma=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(_){let A,w;if(t.manifest.definitions){for(const O in t.manifest.definitions)if(_.uri&&(_.uri=_.uri.replace(`{$${O}}`,t.manifest.definitions[O])),_.attributes)for(const L in _.attributes)typeof _.attributes[L]=="string"&&(_.attributes[L]=_.attributes[L].replace(`{$${O}}`,t.manifest.definitions[O]))}({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const O={};"length"in _&&(r.byterange=O,O.length=_.length,"offset"in _||(_.offset=T)),"offset"in _&&(r.byterange=O,O.offset=_.offset),T=O.offset+O.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(r.title=_.title),_.duration>0&&(r.duration=_.duration),_.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){a=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===m){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.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:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:Rd(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(a.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,y=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){n={},_.uri&&(n.uri=_.uri),_.byterange&&(n.byterange=_.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||d,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),ve(r.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const O=this.manifest.mediaGroups[_.attributes.TYPE];O[_.attributes["GROUP-ID"]]=O[_.attributes["GROUP-ID"]]||{},A=O[_.attributes["GROUP-ID"]],w={default:/yes/i.test(_.attributes.DEFAULT)},w.default?w.autoselect=!0:w.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(w.language=_.attributes.LANGUAGE),_.attributes.URI&&(w.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(w.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(w.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(w.forced=/yes/i.test(_.attributes.FORCED)),A[_.attributes.NAME]=w},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),r.dateTimeString=_.dateTimeString,r.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:O}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),O===null&&this.manifest.segments.reduceRight((L,R)=>(R.programDateTime=L-R.duration*1e3,R.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Ma.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){r.cueOut=_.data},"cue-out-cont"(){r.cueOutCont=_.data},"cue-in"(){r.cueIn=_.data},skip(){this.manifest.skip=zt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const O=this.manifest.segments.length,L=zt(_.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=E),E=L.byterange.offset+L.byterange.length);const R=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${R} for segment #${O}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((k,B)=>{k.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${B} lacks required attribute(s): LAST-PART`})})},"server-control"(){const O=this.manifest.serverControl=zt(_.attributes);O.hasOwnProperty("canBlockReload")||(O.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ma.call(this,this.manifest),O.canSkipDateranges&&!O.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const O=this.manifest.segments.length,L=zt(_.attributes),R=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=R?E:0,R&&(E=L.byterange.offset+L.byterange.length)));const k=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${k} for segment #${O}`,_.attributes,["TYPE","URI"]),!!L.type)for(let B=0;BB.id===L.id);this.manifest.dateRanges[k]=ve(this.manifest.dateRanges[k],L),D[L.id]=ve(D[L.id],L),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=zt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const O=(L,R)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=R};if("QUERYPARAM"in _.attributes){if("NAME"in _.attributes||"IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const L=this.params.get(_.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${_.attributes.QUERYPARAM}`});return}O(_.attributes.QUERYPARAM,decodeURIComponent(L));return}if("NAME"in _.attributes){if("IMPORT"in _.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in _.attributes)||typeof _.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${_.attributes.NAME}`});return}O(_.attributes.NAME,_.attributes.VALUE);return}if("IMPORT"in _.attributes){if(!this.mainDefinitions[_.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${_.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}O(_.attributes.IMPORT,this.mainDefinitions[_.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:_.attributes,uri:_.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",_.attributes,["BANDWIDTH","URI"])}}[_.tagType]||l).call(t)},uri(){r.uri=_.uri,s.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=y,n&&(r.map=n),E=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){_.segment?(r.custom=r.custom||{},r.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(t)})}requiredCompatibilityversion(e,t){(ey&&(m-=y,m-=y,m-=Oe(2))}return Number(m)},Hb=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Oe(e);for(var a=qb(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l=t.length&&d.call(t,function(m,y){var T=l[y]?l[y]&e[a+y]:e[a+y];return m===T})},Gb=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},Zt={},jt={};function Wb(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Ji?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Ji?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Jd(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}ur(Ze,ae);ur(Ze,ae.prototype);function er(i,e){if(e(i))return!0;if(i=i.firstChild)do if(er(i,e))return!0;while(i=i.nextSibling)}function lr(){this.ownerDocument=this}function t2(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Zs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Zd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Zs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function qo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function eh(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,qo(i.ownerDocument,i),e}function i2(i){return i&&(i.nodeType===ae.DOCUMENT_NODE||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.ELEMENT_NODE)}function s2(i){return i&&(Ct(i)||jo(i)||$t(i)||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.COMMENT_NODE||i.nodeType===ae.PROCESSING_INSTRUCTION_NODE)}function $t(i){return i&&i.nodeType===ae.DOCUMENT_TYPE_NODE}function Ct(i){return i&&i.nodeType===ae.ELEMENT_NODE}function jo(i){return i&&i.nodeType===ae.TEXT_NODE}function Yl(i,e){var t=i.childNodes||[];if(Et(t,Ct)||$t(e))return!1;var s=Et(t,$t);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Ql(i,e){var t=i.childNodes||[];function s(n){return Ct(n)&&n!==e}if(Et(t,s))return!1;var r=Et(t,$t);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function r2(i,e,t){if(!i2(i))throw new Ee(Ke,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Ee(Xd,"child not in parent");if(!s2(e)||$t(e)&&i.nodeType!==ae.DOCUMENT_NODE)throw new Ee(Ke,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function n2(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||Et(r,jo))throw new Ee(Ke,"More than one element or text in fragment");if(n.length===1&&!Yl(i,t))throw new Ee(Ke,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Yl(i,t))throw new Ee(Ke,"Only one element can be added and only after doctype");if($t(e)){if(Et(s,$t))throw new Ee(Ke,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)1||Et(r,jo))throw new Ee(Ke,"More than one element or text in fragment");if(n.length===1&&!Ql(i,t))throw new Ee(Ke,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Ql(i,t))throw new Ee(Ke,"Only one element can be added and only after doctype");if($t(e)){let l=function(d){return $t(d)&&d!==t};var o=l;if(Et(s,l))throw new Ee(Ke,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)0&&er(t.documentElement,function(r){if(r!==t&&r.nodeType===ft){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=Gl(n);a=e.every(Jb(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new Si;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Mt;var t=e.attributes=new ln;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Un;return i.ownerDocument=this,i.childNodes=new Mt,i},createTextNode:function(i){var e=new Vo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Ho;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new zo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Wo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new dn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Go;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new Si,s=e.split(":"),r=t.attributes=new ln;return t.childNodes=new Mt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new dn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};Je(lr,ae);function Si(){this._nsMap={}}Si.prototype={nodeType:ft,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Ut?this.insertBefore(i,null):a2(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Zi(this,function(e){var t=[];return er(e,function(s){s!==e&&s.nodeType==ft&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Zi(this,function(t){var s=[];return er(t,function(r){r!==t&&r.nodeType===ft&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};lr.prototype.getElementsByTagName=Si.prototype.getElementsByTagName;lr.prototype.getElementsByTagNameNS=Si.prototype.getElementsByTagNameNS;Je(Si,ae);function dn(){}dn.prototype.nodeType=Ji;Je(dn,ae);function cr(){}cr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(Le[Ke])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};Je(cr,ae);function Vo(){}Vo.prototype={nodeName:"#text",nodeType:un,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};Je(Vo,cr);function Ho(){}Ho.prototype={nodeName:"#comment",nodeType:Gd};Je(Ho,cr);function zo(){}zo.prototype={nodeName:"#cdata-section",nodeType:Vd};Je(zo,cr);function Fn(){}Fn.prototype.nodeType=Kd;Je(Fn,ae);function ih(){}ih.prototype.nodeType=e2;Je(ih,ae);function sh(){}sh.prototype.nodeType=Zb;Je(sh,ae);function Go(){}Go.prototype.nodeType=Hd;Je(Go,ae);function Un(){}Un.prototype.nodeName="#document-fragment";Un.prototype.nodeType=Ut;Je(Un,ae);function Wo(){}Wo.prototype.nodeType=zd;Je(Wo,ae);function rh(){}rh.prototype.serializeToString=function(i,e,t){return nh.call(i,e,t)};ae.prototype.toString=nh;function nh(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Ui(this,t,i,e,a),t.join("")}function Jl(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Zs.XML||r===Zs.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Fa(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Jd),'"')}function Ui(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case ft:var n=i.attributes,a=n.length,w=i.firstChild,o=i.tagName;t=Zs.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var d,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){d=T.namespace;break}}if(d!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(l=T.prefix+":"+o);break}}}e.push("<",l);for(var E=0;E"),t&&/^script$/i.test(o))for(;w;)w.data?e.push(w.data):Ui(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)Ui(w,e,t,s,r.slice()),w=w.nextSibling;e.push("")}else e.push("/>");return;case Wd:case Ut:for(var w=i.firstChild;w;)Ui(w,e,t,s,r.slice()),w=w.nextSibling;return;case Ji:return Fa(e,i.name,i.value);case un:return e.push(i.data.replace(/[<&>]/g,Jd));case Vd:return e.push("");case Gd:return e.push("");case Kd:var O=i.publicId,L=i.systemId;if(e.push("");else if(L&&L!=".")e.push(" SYSTEM ",L,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case zd:return e.push("");case Hd:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function ah(i,e,t){var s;switch(e.nodeType){case ft:s=e.cloneNode(!1),s.ownerDocument=i;case Ut:break;case Ji:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(ah(i,r,t)),r=r.nextSibling;return s}function no(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Mt),s.ownerDocument=i,s.nodeType){case ft:var a=e.attributes,o=s.attributes=new ln,l=a.length;o._ownerElement=s;for(var d=0;d",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(uh);var Ko={},tr=jt.NAMESPACE,ao=/[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]/,Zl=new RegExp("[\\-\\.0-9"+ao.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),ec=new RegExp("^"+ao.source+Zl.source+"*(?::"+ao.source+Zl.source+"*)?$"),Ls=0,Gt=1,ki=2,Os=3,Ii=4,Pi=5,Rs=6,zr=7;function es(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,es)}es.prototype=new Error;es.prototype.name=es.name;function lh(){}lh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),ch(e,e={}),o2(i,e,t,s,this.errorHandler),s.endDocument()}};function o2(i,e,t,s,r){function n(ie){if(ie>65535){ie-=65536;var Te=55296+(ie>>10),It=56320+(ie&1023);return String.fromCharCode(Te,It)}else return String.fromCharCode(ie)}function a(ie){var Te=ie.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+ie),ie)}function o(ie){if(ie>_){var Te=i.substring(_,ie).replace(/&#?\w+;/g,a);T&&l(_),s.characters(Te,0,ie-_),_=ie}}function l(ie,Te){for(;ie>=m&&(Te=y.exec(i));)d=Te.index,m=d+Te[0].length,T.lineNumber++;T.columnNumber=ie-d+1}for(var d=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,E=[{currentNSMap:e}],D={},_=0;;){try{var A=i.indexOf("<",_);if(A<0){if(!i.substr(_).match(/^\s*$/)){var w=s.doc,O=w.createTextNode(i.substr(_));w.appendChild(O),s.currentElement=O}return}switch(A>_&&o(A),i.charAt(A+1)){case"/":var Z=i.indexOf(">",A+3),L=i.substring(A+2,Z).replace(/[ \t\n\r]+$/g,""),R=E.pop();Z<0?(L=i.substring(A+2).replace(/[\s<].*/,""),r.error("end tag name: "+L+" is not complete:"+R.tagName),Z=A+1+L.length):L.match(/\s_?_=Z:o(Math.max(A,_)+1)}}function tc(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function u2(i,e,t,s,r,n){function a(T,E,D){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,E.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),D)}for(var o,l,d=++e,m=Ls;;){var y=i.charAt(d);switch(y){case"=":if(m===Gt)o=i.slice(e,d),m=Os;else if(m===ki)m=Os;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Os||m===Gt)if(m===Gt&&(n.warning('attribute value must after "="'),o=i.slice(e,d)),e=d+1,d=i.indexOf(y,e),d>0)l=i.slice(e,d),a(o,l,e-1),m=Pi;else throw new Error("attribute value no end '"+y+"' match");else if(m==Ii)l=i.slice(e,d),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=d+1,m=Pi;else throw new Error('attribute value must after "="');break;case"/":switch(m){case Ls:t.setTagName(i.slice(e,d));case Pi:case Rs:case zr:m=zr,t.closed=!0;case Ii:case Gt:break;case ki:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==Ls&&t.setTagName(i.slice(e,d)),d;case">":switch(m){case Ls:t.setTagName(i.slice(e,d));case Pi:case Rs:case zr:break;case Ii:case Gt:l=i.slice(e,d),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case ki:m===ki&&(l=o),m==Ii?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!tr.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Os:throw new Error("attribute value missed!!")}return d;case"€":y=" ";default:if(y<=" ")switch(m){case Ls:t.setTagName(i.slice(e,d)),m=Rs;break;case Gt:o=i.slice(e,d),m=ki;break;case Ii:var l=i.slice(e,d);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Pi:m=Rs;break}else switch(m){case ki:t.tagName,(!tr.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=d,m=Gt;break;case Pi:n.warning('attribute space is required"'+o+'"!!');case Rs:m=Gt,e=d;break;case Os:m=Ii,e=d;break;case zr:throw new Error("elements closed character '/' and '>' must be connected to")}}d++}}function ic(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var l=n.prefix=a.slice(0,T),d=a.slice(T+1),m=l==="xmlns"&&d;else d=a,l=null,m=a==="xmlns"&&"";n.localName=d,m!==!1&&(r==null&&(r={},ch(t,t={})),t[m]=r[m]=o,n.uri=tr.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var l=n.prefix;l&&(l==="xml"&&(n.uri=tr.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var T=s.indexOf(":");T>0?(l=i.prefix=s.slice(0,T),d=i.localName=s.slice(T+1)):(l=null,d=i.localName=s);var E=i.uri=t[l||""];if(e.startElement(E,d,s,i),i.closed){if(e.endElement(E,d,s),r)for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=r,!0}function l2(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function c2(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=f2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],d=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(d=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(l,d,m),t.endDTD(),y.index+y[0].length}}return-1}function h2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function dh(){this.attributeNames={}}dh.prototype={setTagName:function(i){if(!ec.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!ec.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function f2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Ko.XMLReader=lh;Ko.ParseError=es;var p2=jt,m2=Zt,sc=uh,hh=Ko,g2=m2.DOMImplementation,rc=p2.NAMESPACE,y2=hh.ParseError,_2=hh.XMLReader;function fh(i){return i.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function ph(i){this.options=i||{locator:{}}}ph.prototype.parseFromString=function(i,e){var t=this.options,s=new _2,r=t.domBuilder||new dr,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),d=l?sc.HTML_ENTITIES:sc.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=v2(n,r,a),s.domBuilder=t.domBuilder||r,l&&(o[""]=rc.HTML),o.xml=o.xml||rc.XML;var m=t.normalizeLineEndings||fh;return i&&typeof i=="string"?s.parse(m(i),o,d):s.errorHandler.error("invalid doc source"),r.doc};function v2(i,e,t){if(!i){if(e instanceof dr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(l){i(a,l)}:i),s[a]=o&&function(l){o("[xmldom "+a+"] "+l+oo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function dr(){this.cdata=!1}function Li(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}dr.prototype={startDocument:function(){this.doc=new g2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;Gr(this,n),this.currentElement=n,this.locator&&Li(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){dr.prototype[i]=function(){return null}});function Gr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}$n.__DOMHandler=dr;$n.normalizeLineEndings=fh;$n.DOMParser=ph;var T2=$n.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const ac=i=>!!i&&typeof i=="object",Pe=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):ac(e[s])&&ac(t[s])?e[s]=Pe(e[s],t[s]):e[s]=t[s]}),e),{}),mh=i=>Object.keys(i).map(e=>i[e]),b2=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),gh=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),x2=(i,e)=>mh(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var is={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",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"};const ir=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:Bn(i||"",e)};if(t||s){const a=(t||s).split("-");let o=x.BigInt?x.BigInt(a[0]):parseInt(a[0],10),l=x.BigInt?x.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},oc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),C2={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=oc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,d=oc(i.endNumber),m=(e+t)/1e3,y=s+a,E=m+o-y,D=Math.ceil(E*r/n),_=Math.floor((m-y-l)*r/n),A=Math.floor((m-y)*r/n);return{start:Math.max(0,_),end:typeof d=="number"?d:Math.min(D,A)}}},D2=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Xo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=C2[e](i),l=b2(a,o).map(D2(i));if(e==="static"){const d=l.length-1,m=typeof r=="number"?r:n;l[d].duration=m-t/s*d}return l},yh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(is.NO_BASE_URL);const d=ir({baseUrl:e,source:t.sourceURL,range:t.range}),m=ir({baseUrl:e,source:e,indexRange:r});if(m.map=d,l){const y=Xo(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Yo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,d=e.references.filter(A=>A.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let E=T,D=i.mediaSequence||0,_;typeof e.firstOffset=="bigint"?_=x.BigInt(o)+e.firstOffset:_=o+e.firstOffset;for(let A=0;Ax2(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),k2=(i,e)=>{for(let t=0;t{let e=[];return Gb(i,A2,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},lc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},I2=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:l}){return l===s.timeline});const r=k2(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),lc({playlist:s,mediaSequence:r.segments[a].number})})},P2=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(uc(i)),s=e.playlists.concat(uc(e));return e.timelineStarts=_h([i.timelineStarts,e.timelineStarts]),I2({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},qn=i=>i&&i.uri+"-"+E2(i.byterange),Ua=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=mh(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=S2(s.segments||[],"discontinuity"),s))},Qo=(i,e)=>{const t=qn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Yo(i,s,i.sidx.resolvedUri),i},L2=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Qo(i[t],e);return i},O2=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},R2=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},N2=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let d=a.attributes.label||"main";if(l&&!a.attributes.label){const y=o?` (${o})`:"";d=`${a.attributes.lang}${y}`}n[d]||(n[d]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=Qo(O2(a,t),e);return n[d].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},M2=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text",n=s.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Qo(R2(s),e)),t},{}),B2=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),F2=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},U2=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",$2=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",q2=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",j2=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},cc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],V2=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:d}=i[0].attributes,m=Ua(i.filter(U2)).map(F2),y=Ua(i.filter($2)),T=Ua(i.filter(q2)),E=i.map(R=>R.attributes.captionServices).filter(Boolean),D={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:L2(m,s)};d>=0&&(D.minimumUpdatePeriod=d*1e3),e&&(D.locations=e),t&&(D.contentSteering=t),o==="dynamic"&&(D.suggestedPresentationDelay=l),n&&n.length>0&&(D.eventStream=n);const _=D.playlists.length===0,A=y.length?N2(y,s,_):null,w=T.length?M2(T,s):null,O=m.concat(cc(A),cc(w)),L=O.map(({timelineStarts:R})=>R);return D.timelineStarts=_h(L),j2(O,D.timelineStarts),A&&(D.mediaGroups.AUDIO.audio=A),w&&(D.mediaGroups.SUBTITLES.subs=w),E.length&&(D.mediaGroups["CLOSED-CAPTIONS"].cc=B2(E)),r?P2({oldManifest:r,newManifest:D}):D},H2=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,d=(s+r)/1e3,m=n+o,T=d+l-m;return Math.ceil((T*a-e)/t)},vh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,d=[];let m=-1;for(let y=0;ym&&(m=_);let A;if(D<0){const L=y+1;L===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?A=H2(i,m,E):A=(n*a-m)/E:A=(e[L].t-m)/E}else A=D+1;const w=o+d.length+A;let O=o+d.length;for(;O(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},dc=(i,e)=>i.replace(z2,G2(e)),W2=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Xo(i):vh(i,e),K2=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=ir({baseUrl:i.baseUrl,source:dc(s.sourceURL,t),range:s.range});return W2(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=dc(i.media||"",t),l=i.timescale||1,d=i.presentationTimeOffset||0,m=i.periodStart+(a.time-d)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Bn(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},X2=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=ir({baseUrl:t,source:s.sourceURL,range:s.range}),n=ir({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Y2=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(is.SEGMENT_TIME_UNSPECIFIED);const n=s.map(l=>X2(i,l));let a;return t&&(a=Xo(i)),e&&(a=vh(i,e)),a.map((l,d)=>{if(n[d]){const m=n[d],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=l.timeline,m.duration=l.duration,m.number=l.number,m.presentationTime=r+(l.time-T)/y,m}}).filter(l=>l)},Q2=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=K2,t=Pe(i,e.template)):e.base?(s=yh,t=Pe(i,e.base)):e.list&&(s=Y2,t=Pe(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},J2=i=>i.map(Q2),me=(i,e)=>gh(i.childNodes).filter(({tagName:t})=>t===e),hr=i=>i.textContent.trim(),Z2=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Oi=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,d,m,y,T,E]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(d||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},eS=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),hc={mediaPresentationDuration(i){return Oi(i)},availabilityStartTime(i){return eS(i)/1e3},minimumUpdatePeriod(i){return Oi(i)},suggestedPresentationDelay(i){return Oi(i)},type(i){return i},timeShiftBufferDepth(i){return Oi(i)},start(i){return Oi(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return Z2(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Oi(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},De=i=>i&&i.attributes?gh(i.attributes).reduce((e,t)=>{const s=hc[t.name]||hc.DEFAULT;return e[t.name]=s(t.value),e},{}):{},tS={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},jn=(i,e)=>e.length?ts(i.map(function(t){return e.map(function(s){const r=hr(s),n=Bn(t.baseUrl,r),a=Pe(De(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Jo=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(y=>Pe({tag:"SegmentURL"},De(y))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],o=t||r||e,l=o&&me(o,"Initialization")[0],d=e&&De(e);d&&l?d.initialization=l&&De(l):d&&d.initialization&&(d.initialization={sourceURL:d.initialization});const m={template:d,segmentTimeline:a&&me(a,"S").map(y=>De(y)),list:t&&Pe(De(t),{segmentUrls:s,initialization:De(l)}),base:r&&Pe(De(r),{initialization:De(l)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},iS=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=jn(e,r),a=Pe(i,De(s)),o=Jo(s);return n.map(l=>({segmentInfo:Pe(t,o),attributes:Pe(a,l)}))},sS=i=>i.reduce((e,t)=>{const s=De(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=tS[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=hr(n);e[r].pssh=a&&Rd(a)}}return e},{}),rS=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?s.language=l:o==="er"?s.easyReader=Number(l):o==="war"?s.aspectRatio=Number(l):o==="3D"&&(s["3D"]=Number(l))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},nS=i=>ts(me(i.node,"EventStream").map(e=>{const t=De(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=De(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,d=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:d,end:d+l/o,messageData:hr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),aS=(i,e,t)=>s=>{const r=De(s),n=jn(e,me(s,"BaseURL")),a=me(s,"Role")[0],o={role:De(a)};let l=Pe(i,r,o);const d=me(s,"Accessibility")[0],m=rS(De(d));m&&(l=Pe(l,{captionServices:m}));const y=me(s,"Label")[0];if(y&&y.childNodes.length){const A=y.childNodes[0].nodeValue.trim();l=Pe(l,{label:A})}const T=sS(me(s,"ContentProtection"));Object.keys(T).length&&(l=Pe(l,{contentProtection:T}));const E=Jo(s),D=me(s,"Representation"),_=Pe(t,E);return ts(D.map(iS(l,n,_)))},oS=(i,e)=>(t,s)=>{const r=jn(e,me(t.node,"BaseURL")),n=Pe(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),o=Jo(t.node);return ts(a.map(aS(n,r,o)))},uS=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=Pe({serverURL:hr(i[0])},De(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},lS=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,cS=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(is.INVALID_NUMBER_OF_PERIOD);const o=me(i,"Location"),l=De(i),d=jn([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=r,o.length&&(l.locations=o.map(hr));const y=[];return a.forEach((T,E)=>{const D=De(T),_=y[E-1];D.start=lS({attributes:D,priorPeriodAttributes:_?_.attributes:null,mpdType:l.type}),y.push({node:T,attributes:D})}),{locations:l.locations,contentSteeringInfo:uS(m,n),representationInfo:ts(y.map(oS(l,d))),eventStream:ts(y.map(nS))}},Th=i=>{if(i==="")throw new Error(is.DASH_EMPTY_MANIFEST);const e=new T2;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(is.DASH_INVALID_XML);return s},dS=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=De(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(is.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},hS=(i,e={})=>{const t=cS(Th(i),e),s=J2(t.representationInfo);return V2({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},fS=i=>dS(Th(i));var bh=Math.pow(2,32),pS=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},yS=gS;const _S=or(yS);var vS=z([73,68,51]),TS=function(e,t){t===void 0&&(t=0),e=z(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},qs=function i(e,t){return t===void 0&&(t=0),e=z(e),e.length-t<10||!pe(e,vS,{offset:t})?t:(t+=TS(e,t),i(e,t))},pc=function(e){return typeof e=="string"?Ud(e):e},bS=function(e){return Array.isArray(e)?e.map(function(t){return pc(t)}):[pc(e)]},SS=function i(e,t,s){s===void 0&&(s=!1),t=bS(t),e=z(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(s)break;l=e.length}var d=e.subarray(n+8,l);pe(o,t[0])&&(t.length===1?r.push(d):r.push.apply(r,i(d,t.slice(1),s))),n=l}return r},Wr={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},uo=[128,64,32,16,8,4,2,1],xS=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=hn(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=hn(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},gc=function i(e,t){t=ES(t),e=z(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,d=e.subarray(o,l);pe(t[0],n.bytes)&&(t.length===1?s.push(d):s=s.concat(i(d,t.slice(1))));var m=n.length+a.length+d.length;r+=m}return s},DS=z([0,0,0,1]),AS=z([0,0,1]),wS=z([0,0,3]),kS=function(e){for(var t=[],s=1;s>1&63),s.indexOf(d)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},IS=function(e,t,s){return Sh(e,"h264",t,s)},PS=function(e,t,s){return Sh(e,"h265",t,s)},qe={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102])},ss={aac:function(e){var t=qs(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=qs(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=gc(e,[Wr.EBML,Wr.DocType])[0];return pe(t,qe.webm)},mkv:function(e){var t=gc(e,[Wr.EBML,Wr.DocType])[0];return pe(t,qe.matroska)},mp4:function(e){if(ss["3gp"](e)||ss.mov(e))return!1;if(pe(e,qe.mp4,{offset:4})||pe(e,qe.fmp4,{offset:4})||pe(e,qe.moof,{offset:4})||pe(e,qe.moov,{offset:4}))return!0},mov:function(e){return pe(e,qe.mov,{offset:4})},"3gp":function(e){return pe(e,qe["3gp"],{offset:4})},ac3:function(e){var t=qs(e);return pe(e,qe.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},eu=9e4,tu,iu,Vn,su,xh,Eh,Ch;tu=function(i){return i*eu};iu=function(i,e){return i*e};Vn=function(i){return i/eu};su=function(i,e){return i/e};xh=function(i,e){return tu(su(i,e))};Eh=function(i,e){return iu(Vn(i),e)};Ch=function(i,e,t){return Vn(t?i:i-e)};var pi={ONE_SECOND_IN_TS:eu,secondsToVideoTs:tu,secondsToAudioTs:iu,videoTsToSeconds:Vn,audioTsToSeconds:su,audioTsToVideoTs:xh,videoTsToAudioTs:Eh,metadataTsToSeconds:Ch};/** + * @license + * Video.js 8.18.1 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */var co="8.18.1";const Rt={},Qt=function(i,e){return Rt[i]=Rt[i]||[],e&&(Rt[i]=Rt[i].concat(e)),Rt[i]},RS=function(i,e){Qt(i,e)},Dh=function(i,e){const t=Qt(i).indexOf(e);return t<=-1?!1:(Rt[i]=Rt[i].slice(),Rt[i].splice(t,1),!0)},NS=function(i,e){Qt(i,[].concat(e).map(t=>{const s=(...r)=>(Dh(i,s),t(...r));return s}))},fn={prefixed:!0},sn=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],yc=sn[0];let js;for(let i=0;i(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(l=`%c${i}`,n.unshift(t)),n.unshift(l+":"),We){We.push([].concat(n));const m=We.length-1e3;We.splice(0,m>0?m:0)}if(!x.console)return;let d=x.console[s];!d&&s==="debug"&&(d=x.console.info||x.console.log),!(!d||!a||!o.test(s))&&d[Array.isArray(n)?"apply":"call"](x.console,n)};function ho(i,e=":",t=""){let s="info",r;function n(...a){r("log",s,a)}return r=MS(i,n,t),n.createLogger=(a,o,l)=>{const d=o!==void 0?o:e,m=l!==void 0?l:t,y=`${i} ${d} ${a}`;return ho(y,d,m)},n.createNewLogger=(a,o,l)=>ho(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>We?[].concat(We):[],n.history.filter=a=>(We||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{We&&(We.length=0)},n.history.disable=()=>{We!==null&&(We.length=0,We=null)},n.history.enable=()=>{We===null&&(We=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const J=ho("VIDEOJS"),Ah=J.createLogger,BS=Object.prototype.toString,wh=function(i){return Dt(i)?Object.keys(i):[]};function Hi(i,e){wh(i).forEach(t=>e(i[t],t))}function kh(i,e,t=0){return wh(i).reduce((s,r)=>e(s,i[r],r),t)}function Dt(i){return!!i&&typeof i=="object"}function rs(i){return Dt(i)&&BS.call(i)==="[object Object]"&&i.constructor===Object}function le(...i){const e={};return i.forEach(t=>{t&&Hi(t,(s,r)=>{if(!rs(s)){e[r]=s;return}rs(e[r])||(e[r]={}),e[r]=le(e[r],s)})}),e}function Ih(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Hn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var FS=Object.freeze({__proto__:null,each:Hi,reduce:kh,isObject:Dt,isPlain:rs,merge:le,values:Ih,defineLazyProperty:Hn});let ru=!1,Ph=null,At=!1,Lh,Oh=!1,zi=!1,Gi=!1,wt=!1,nu=null,zn=null;const US=!!(x.cast&&x.cast.framework&&x.cast.framework.CastReceiverContext);let Rh=null,pn=!1,Gn=!1,mn=!1,Wn=!1,gn=!1,yn=!1,_n=!1;const sr=!!(hs()&&("ontouchstart"in x||x.navigator.maxTouchPoints||x.DocumentTouch&&x.document instanceof x.DocumentTouch)),Wt=x.navigator&&x.navigator.userAgentData;Wt&&Wt.platform&&Wt.brands&&(At=Wt.platform==="Android",zi=!!Wt.brands.find(i=>i.brand==="Microsoft Edge"),Gi=!!Wt.brands.find(i=>i.brand==="Chromium"),wt=!zi&&Gi,nu=zn=(Wt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Gn=Wt.platform==="Windows");if(!Gi){const i=x.navigator&&x.navigator.userAgent||"";ru=/iPod/i.test(i),Ph=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),At=/Android/i.test(i),Lh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Oh=/Firefox/i.test(i),zi=/Edg/i.test(i),Gi=/Chrome/i.test(i)||/CriOS/i.test(i),wt=!zi&&Gi,nu=zn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Rh=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),gn=/Tizen/i.test(i),yn=/Web0S/i.test(i),_n=gn||yn,pn=/Safari/i.test(i)&&!wt&&!At&&!zi&&!_n,Gn=/Windows/i.test(i),mn=/iPad/i.test(i)||pn&&sr&&!/iPhone/i.test(i),Wn=/iPhone/i.test(i)&&!mn}const ze=Wn||mn||ru,Kn=(pn||ze)&&!wt;var Nh=Object.freeze({__proto__:null,get IS_IPOD(){return ru},get IOS_VERSION(){return Ph},get IS_ANDROID(){return At},get ANDROID_VERSION(){return Lh},get IS_FIREFOX(){return Oh},get IS_EDGE(){return zi},get IS_CHROMIUM(){return Gi},get IS_CHROME(){return wt},get CHROMIUM_VERSION(){return nu},get CHROME_VERSION(){return zn},IS_CHROMECAST_RECEIVER:US,get IE_VERSION(){return Rh},get IS_SAFARI(){return pn},get IS_WINDOWS(){return Gn},get IS_IPAD(){return mn},get IS_IPHONE(){return Wn},get IS_TIZEN(){return gn},get IS_WEBOS(){return yn},get IS_SMART_TV(){return _n},TOUCH_ENABLED:sr,IS_IOS:ze,IS_ANY_SAFARI:Kn});function _c(i){return typeof i=="string"&&!!i.trim()}function $S(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function hs(){return U===x.document}function fs(i){return Dt(i)&&i.nodeType===1}function Mh(){try{return x.parent!==x.self}catch{return!0}}function Bh(i){return function(e,t){if(!_c(e))return U[i](null);_c(t)&&(t=U.querySelector(t));const s=fs(t)?t:U;return s[i]&&s[i](e)}}function W(i="div",e={},t={},s){const r=U.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ei(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&au(r,s),r}function ei(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function fo(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function Ws(i,e){return $S(e),i.classList.contains(e)}function yi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Xn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(J.warn("removeClass was called with an element that doesn't exist"),null)}function Fh(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Uh(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Xt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function $h(i,e){return i.getAttribute(e)}function ns(i,e,t){i.setAttribute(e,t)}function Yn(i,e){i.removeAttribute(e)}function qh(){U.body.focus(),U.onselectstart=function(){return!1}}function jh(){U.onselectstart=function(){return!0}}function as(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(os(i,"height"))),t.width||(t.width=parseFloat(os(i,"width"))),t}}function rr(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==U[fn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function Qn(i,e){const t={x:0,y:0};if(ze){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=os(m,"transform");if(/^matrix/.test(y)){const T=y.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(y)){const T=y.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(m.assignedSlot&&m.assignedSlot.parentElement&&x.WebKitCSSMatrix){const T=x.getComputedStyle(m.assignedSlot.parentElement).transform,E=new x.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}m=m.parentNode||m.host}}const s={},r=rr(e.target),n=rr(i),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),d=e.offsetX-(n.left-r.left);return e.changedTouches&&(d=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,ze&&(d-=t.x,l-=t.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,d/a)),s}function Vh(i){return Dt(i)&&i.nodeType===3}function Jn(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function Hh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),fs(e)||Vh(e))return e;if(typeof e=="string"&&/\S/.test(e))return U.createTextNode(e)}).filter(e=>e)}function au(i,e){return Hh(e).forEach(t=>i.appendChild(t)),i}function zh(i,e){return au(Jn(i),e)}function nr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Jt=Bh("querySelector"),Gh=Bh("querySelectorAll");function os(i,e){if(!i||!e)return"";if(typeof x.getComputedStyle=="function"){let t;try{t=x.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Wh(i){[...U.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=U.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=U.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Kh=Object.freeze({__proto__:null,isReal:hs,isEl:fs,isInFrame:Mh,createEl:W,textContent:ei,prependTo:fo,hasClass:Ws,addClass:yi,removeClass:Xn,toggleClass:Fh,setAttributes:Uh,getAttributes:Xt,getAttribute:$h,setAttribute:ns,removeAttribute:Yn,blockTextSelection:qh,unblockTextSelection:jh,getBoundingClientRect:as,findPosition:rr,getPointerPosition:Qn,isTextNode:Vh,emptyEl:Jn,normalizeContent:Hh,appendContent:au,insertContent:zh,isSingleLeftClick:nr,$:Jt,$$:Gh,computedStyle:os,copyStyleSheetsToWindow:Wh});let Xh=!1,po;const qS=function(){if(po.options.autoSetup===!1)return;const i=Array.prototype.slice.call(U.getElementsByTagName("video")),e=Array.prototype.slice.call(U.getElementsByTagName("audio")),t=Array.prototype.slice.call(U.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Ne(i,e,t){if(!He.has(i))return;const s=He.get(i);if(!s.handlers)return;if(Array.isArray(e))return ou(Ne,i,e,t);const r=function(a,o){s.handlers[o]=[],vc(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a=e&&(i(...r),t=n)}},Jh=function(i,e,t,s=x){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let d=function(){r=null,d=null,t||i.apply(o,l)};!r&&t&&i.apply(o,l),s.clearTimeout(r),r=s.setTimeout(d,e)};return a.cancel=n,a};var WS=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:lt,bind_:de,throttle:kt,debounce:Jh});let Ns;class rt{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},st(this,e,t),this.addEventListener=s}off(e,t){Ne(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},ea(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},uu(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Zn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ps(this,e)}queueTrigger(e){Ns||(Ns=new Map);const t=e.type||e;let s=Ns.get(this);s||(s=new Map,Ns.set(this,s));const r=s.get(t);s.delete(t),x.clearTimeout(r);const n=x.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ns.delete(this)),this.trigger(e)},0);s.set(t,n)}}rt.prototype.allowedEvents_={};rt.prototype.addEventListener=rt.prototype.on;rt.prototype.removeEventListener=rt.prototype.off;rt.prototype.dispatchEvent=rt.prototype.trigger;const ta=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Bt=i=>i instanceof rt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),KS=(i,e)=>{Bt(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},yo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,vn=(i,e,t)=>{if(!i||!i.nodeName&&!Bt(i))throw new Error(`Invalid target for ${ta(e)}#${t}; must be a DOM node or evented object.`)},Zh=(i,e,t)=>{if(!yo(i))throw new Error(`Invalid event type for ${ta(e)}#${t}; must be a non-empty string or array.`)},ef=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${ta(e)}#${t}; must be a function.`)},$a=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),vn(r,i,t),Zh(n,i,t),ef(a,i,t),a=de(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},ci=(i,e,t,s)=>{vn(i,i,e),i.nodeName?GS[e](i,t,s):i[e](t,s)},XS={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=$a(this,i,"on");if(ci(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,ci(this,"on","dispose",n),ci(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=$a(this,i,"one");if(e)ci(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ci(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=$a(this,i,"any");if(e)ci(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ci(t,"any",s,n)}},off(i,e,t){if(!i||yo(i))Ne(this.eventBusEl_,i,e);else{const s=i,r=e;vn(s,this,"off"),Zh(r,this,"off"),ef(t,this,"off"),t=de(this,t),this.off("dispose",t),s.nodeName?(Ne(s,r,t),Ne(s,"dispose",t)):Bt(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){vn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!yo(t))throw new Error(`Invalid event type for ${ta(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ps(this.eventBusEl_,i,e)}};function lu(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=W("span",{className:"vjs-event-bus"});return Object.assign(i,XS),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&He.has(s)&&He.delete(s)}),x.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const YS={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Hi(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Bt(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function tf(i,e){return Object.assign(i,YS),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Bt(i)&&i.on("statechanged",i.handleStateChanged),i}const Ks=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},_e=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},sf=function(i,e){return _e(i)===_e(e)};var QS=Object.freeze({__proto__:null,toLowerCase:Ks,toTitleCase:_e,titleCaseEquals:sf});class M{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=le({},this.options_),t=this.options_=le(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${ut()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(lu(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),tf(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=le(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return W(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let d=s;return a&&a[e]?d=a[e]:l&&l[e]&&(d=l[e]),t&&(d=d.replace(/\{(\d+)\}/g,function(m,y){const T=t[y-1];let E=T;return typeof T>"u"&&(E=m),E})),d}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[_e(e.name())]=null,this.childNameIndex_[Ks(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const d=this.addChild(o,l);d&&(this[o]=d)};let r;const n=M.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=M.getComponent(a.opts.componentClass||_e(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Jt(e,t||this.contentEl())}$$(e,t){return Gh(e,t||this.contentEl())}hasClass(e){return Ws(this.el_,e)}addClass(...e){yi(this.el_,...e)}removeClass(...e){Xn(this.el_,...e)}toggleClass(e,t){Fh(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return $h(this.el_,e)}setAttribute(e,t){ns(this.el_,e,t)}removeAttribute(e){Yn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+_e(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=os(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${_e(e)}`;t=this.el_[s]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},s={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:s}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=x.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,d=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+d*d)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&x.performance.now()-e{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),x.clearTimeout(e)),e}setInterval(e,t){e=de(this,e),this.clearTimersOnDispose_();const s=x.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),x.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=de(this,e),t=x.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=de(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),x.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=x.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function s(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||x.getComputedStyle(n).height==="0px"||x.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(U.documentElement.clientWidth||x.innerWidth)||a.y<0||a.y>(U.documentElement.clientHeight||x.innerHeight))return!1;let o=U.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&s(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=M.getComponent("Tech"),r=s&&s.isTech(t),n=M===t||M.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=_e(e),M.components_||(M.components_={});const a=M.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(d=>o[d]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return M.components_[e]=t,M.components_[Ks(e)]=t,t}static getComponent(e){if(!(!e||!M.components_))return M.components_[e]}}M.registerComponent("Component",M);function JS(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function Tc(i,e,t,s){return JS(i,s,t.length-1),t[s][e]}function qa(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:Tc.bind(null,"start",0,i),end:Tc.bind(null,"end",1,i)},x.Symbol&&x.Symbol.iterator&&(e[x.Symbol.iterator]=()=>(i||[]).values()),e}function pt(i,e){return Array.isArray(i)?qa(i):i===void 0||e===void 0?qa():qa([[i,e]])}const rf=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let cu=rf;function nf(i){cu=i}function af(){cu=rf}function xi(i,e=i){return cu(i,e)}var ZS=Object.freeze({__proto__:null,createTimeRanges:pt,createTimeRange:pt,setFormatTime:nf,resetFormatTime:af,formatTime:xi});function of(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=pt(0,0));for(let n=0;ne&&(r=e),t+=r-s;return t/e}function ye(i){if(i instanceof ye)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Dt(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=ye.defaultMessages[this.code]||"")}ye.prototype.code=0;ye.prototype.message="";ye.prototype.status=null;ye.prototype.metadata=null;ye.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];ye.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."};ye.MEDIA_ERR_CUSTOM=0;ye.prototype.MEDIA_ERR_CUSTOM=0;ye.MEDIA_ERR_ABORTED=1;ye.prototype.MEDIA_ERR_ABORTED=1;ye.MEDIA_ERR_NETWORK=2;ye.prototype.MEDIA_ERR_NETWORK=2;ye.MEDIA_ERR_DECODE=3;ye.prototype.MEDIA_ERR_DECODE=3;ye.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ye.MEDIA_ERR_ENCRYPTED=5;ye.prototype.MEDIA_ERR_ENCRYPTED=5;function Xs(i){return i!=null&&typeof i.then=="function"}function Tt(i){Xs(i)&&i.then(null,e=>{})}const _o=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},e1=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=_o(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(_o))},t1=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var bc={textTracksToJson:e1,jsonToTextTracks:t1,trackToJson_:_o};const ja="vjs-modal-dialog";class ms extends M{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=W("div",{className:`${ja}-content`},{role:"document"}),this.descEl_=W("p",{className:`${ja}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ei(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${ja} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),zh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Jn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=U.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof x.HTMLAnchorElement||t instanceof x.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof x.HTMLInputElement||t instanceof x.HTMLSelectElement||t instanceof x.HTMLTextAreaElement||t instanceof x.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof x.HTMLIFrameElement||t instanceof x.HTMLObjectElement||t instanceof x.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}ms.prototype.options_={pauseOnOpen:!0,temporary:!0};M.registerComponent("ModalDialog",ms);class us extends rt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},Bt(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s=0;t--)if(e[t].enabled){Va(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Va(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Va(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ha=function(i,e){for(let t=0;t=0;t--)if(e[t].selected){Ha(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ha(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class uf extends us{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class r1{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t0&&(x.console&&x.console.groupCollapsed&&x.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>J.error(r)),x.console&&x.console.groupEnd&&x.console.groupEnd()),t.flush()},Ec=function(i,e){const t={uri:i},s=ia(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Id(t,de(this,function(n,a,o){if(n)return J.error(n,a);e.loaded_=!0,typeof x.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){J.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return xc(o,e)}):xc(o,e)}))};class fr extends du{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=le(e,{kind:o1[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=Sc[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new Tn(this.cues_),a=new Tn(this.activeCues_);let o=!1;this.timeupdateHandler=de(this,function(d={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(d){Sc[d]&&s!==d&&(s=d,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Ec(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const d=this.tech_.currentTime(),m=[];for(let y=0,T=this.cues.length;y=d&&m.push(E)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let y=0;y{t=qt.LOADED,this.trigger({type:"load",target:this})})}}qt.prototype.allowedEvents_={load:"load"};qt.NONE=0;qt.LOADING=1;qt.LOADED=2;qt.ERROR=3;const ot={audio:{ListClass:i1,TrackClass:cf,capitalName:"Audio"},video:{ListClass:s1,TrackClass:df,capitalName:"Video"},text:{ListClass:uf,TrackClass:fr,capitalName:"Text"}};Object.keys(ot).forEach(function(i){ot[i].getterName=`${i}Tracks`,ot[i].privateName=`${i}Tracks_`});const ls={remoteText:{ListClass:uf,TrackClass:fr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:r1,TrackClass:qt,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},je=Object.assign({},ot,ls);ls.names=Object.keys(ls);ot.names=Object.keys(ot);je.names=[].concat(ls.names).concat(ot.names);function l1(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new je.text.TrackClass(r);return n.addTrack(a),a}class Y extends M{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),je.names.forEach(s=>{const r=je[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new je.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(de(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return pt(0,0)}bufferedPercent(){return of(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(ot.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new ye(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?pt(0,0):pt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){ot.names.forEach(e=>{const t=ot[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!x.WebVTT)if(U.body.contains(this.el())){if(!this.options_["vtt.js"]&&rs(ql)&&Object.keys(ql).length>0){this.trigger("vttjsloaded");return}const e=U.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),x.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;othis.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=ut();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return Y.canPlayType(e.type)}static isTech(e){return e.prototype instanceof Y||e instanceof Y||e===Y}static registerTech(e,t){if(Y.techs_||(Y.techs_={}),!Y.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!Y.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!Y.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=_e(e),Y.techs_[e]=t,Y.techs_[Ks(e)]=t,e!=="Tech"&&Y.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(Y.techs_&&Y.techs_[e])return Y.techs_[e];if(e=_e(e),x&&x.videojs&&x.videojs[e])return J.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),x.videojs[e]}}}je.names.forEach(function(i){const e=je[i];Y.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});Y.prototype.featuresVolumeControl=!0;Y.prototype.featuresMuteControl=!0;Y.prototype.featuresFullscreenResize=!1;Y.prototype.featuresPlaybackRate=!1;Y.prototype.featuresProgressEvents=!1;Y.prototype.featuresSourceset=!1;Y.prototype.featuresTimeupdateEvents=!1;Y.prototype.featuresNativeTextTracks=!1;Y.prototype.featuresVideoFrameCallback=!1;Y.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;ndi(e,_i[e.type],t,i),1)}function h1(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function f1(i,e,t){return i.reduceRight(pu(t),e[t]())}function p1(i,e,t,s){return e[t](i.reduce(pu(t),s))}function Cc(i,e,t,s=null){const r="call"+_e(t),n=i.reduce(pu(r),s),a=n===Sn,o=a?null:e[t](n);return y1(i,t,o,a),o}const m1={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},g1={setCurrentTime:1,setMuted:1,setVolume:1},Dc={play:1,pause:1};function pu(i){return(e,t)=>e===Sn?Sn:t[i]?t[i](e):e}function y1(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function _1(i){bn.hasOwnProperty(i.id())&&delete bn[i.id()]}function v1(i,e){const t=bn[i.id()];let s=null;if(t==null)return s=e(i),bn[i.id()]=[[e,s]],s;for(let r=0;r{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;const wc=gn?10009:yn?461:8,Ri={codes:{play:415,pause:19,ff:417,rw:412,back:wc},names:{415:"play",19:"pause",417:"ff",412:"rw",[wc]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},kc=5;class x1 extends rt{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const s=t.key.substring(5).toLowerCase();this.move(s)}else if(Ri.isEventKey(t,"play")||Ri.isEventKey(t,"pause")||Ri.isEventKey(t,"ff")||Ri.isEventKey(t,"rw")){t.preventDefault();const s=Ri.getEventName(t);this.performMediaAction_(s)}else Ri.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+kc);break;case"rw":this.userSeek_(this.player_.currentTime()-kc);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let s=null;const r=this.getCurrentComponent(e.target);t&&(s=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!s||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function s(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&s(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?s(r.children_):r.hasOwnProperty("items")&&r.items.length>0?s(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const d=o.getBoundingClientRect(),m={x:d.x,y:d.y,width:d.width,height:d.height,top:d.top,right:d.right,bottom:d.bottom,left:d.left},y={x:d.left+d.width/2,y:d.top+d.height/2,width:0,height:0,top:d.top+d.height/2,right:d.left+d.width/2,bottom:d.top+d.height/2,left:d.left+d.width/2};return{boundingClientRect:m,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:d=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(s){if(e.getIsFocusable(s)&&e.getIsAvailableToBeFocused(s))return s;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const s=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(s.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(s.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,s){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,s);l=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&J.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=W(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=W("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,ei(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}M.registerComponent("ClickableComponent",sa);class vo extends sa{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return W("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(W("picture",{className:"vjs-poster",tabIndex:-1},{},W("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Tt(this.player_.play()):this.player_.pause())}}vo.prototype.crossorigin=vo.prototype.crossOrigin;M.registerComponent("PosterImage",vo);const at="#222",Ic="#ccc",C1={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 za(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function yt(i,e,t){try{i.style[e]=t}catch{return}}function Pc(i){return i?`${i}px`:""}class D1 extends M{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(de(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=x.screen.orientation||x,o=x.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let d=0;d0&&o.forEach(m=>{if(m.style.inset){const y=m.style.inset.split(" ");y.length===3&&Object.assign(m.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!x.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),s=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(s-r)>.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),yt(this.el_,"insetInline",Pc(n)),yt(this.el_,"insetBlock",Pc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&yt(a.firstChild,"color",za(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&yt(a.firstChild,"backgroundColor",za(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?yt(a,"backgroundColor",za(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${at}, 2px 2px 4px ${at}, 2px 2px 5px ${at}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${at}, 2px 2px ${at}, 3px 3px ${at}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ic}, 0 1px ${Ic}, -1px -1px ${at}, 0 -1px ${at}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${at}, 0 0 4px ${at}, 0 0 4px ${at}, 0 0 4px ${at}`)),t.fontPercent&&t.fontPercent!==1){const o=x.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=C1[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof x.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;sthis.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){Tt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Xs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}ff.prototype.controlText_="Play Video";M.registerComponent("BigPlayButton",ff);class w1 extends Me{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}M.registerComponent("CloseButton",w1);class pf extends Me{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Tt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}pf.prototype.controlText_="Play";M.registerComponent("PlayToggle",pf);class gs extends M{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=W("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=W("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=xi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,J.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=U.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}gs.prototype.labelText_="Time";gs.prototype.controlText_="Time";M.registerComponent("TimeDisplay",gs);class mu extends gs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}mu.prototype.labelText_="Current Time";mu.prototype.controlText_="Current Time";M.registerComponent("CurrentTimeDisplay",mu);class gu extends gs{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}gu.prototype.labelText_="Duration";gu.prototype.controlText_="Duration";M.registerComponent("DurationDisplay",gu);class k1 extends M{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}M.registerComponent("TimeDivider",k1);class yu extends gs{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(W("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}yu.prototype.labelText_="Remaining Time";yu.prototype.controlText_="Remaining Time";M.registerComponent("RemainingTimeDisplay",yu);class I1 extends M{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=W("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(W("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(U.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}M.registerComponent("LiveDisplay",I1);class mf extends Me{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=W("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}mf.prototype.controlText_="Seek to live, currently playing live";M.registerComponent("SeekToLive",mf);function pr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var P1=Object.freeze({__proto__:null,clamp:pr});class _u extends M{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!wt&&e.preventDefault(),qh(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;jh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(pr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Qn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,s=t&&t.enabled,r=t&&t.horizontalSeek;s?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}M.registerComponent("Slider",_u);const Ga=(i,e)=>pr(i/e*100,0,100).toFixed(2)+"%";class L1 extends M{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=W("span",{className:"vjs-control-text"}),s=W("span",{textContent:this.localize("Loaded")}),r=U.createTextNode(": ");return this.percentageEl_=W("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Ga(n,r);this.percent_!==o&&(this.el_.style.width=o,ei(this.percentageEl_,o),this.percent_=o);for(let l=0;ls.length;l--)this.el_.removeChild(a[l-1]);a.length=s.length})}}M.registerComponent("LoadProgressBar",L1);class O1 extends M{constructor(e,t){super(e,t),this.update=kt(de(this,this.update),lt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=rr(this.el_),n=as(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let d=r.width/2;or.width&&(d=r.width),d=Math.round(d),this.el_.style.right=`-${d}px`,this.write(s)}write(e){ei(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+xi(l,o)}else n=xi(s,a);this.update(e,t,n),r&&r()})}}M.registerComponent("TimeTooltip",O1);class vu extends M{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=kt(de(this,this.update),lt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}vu.prototype.options_={children:[]};!ze&&!At&&vu.prototype.options_.children.push("timeTooltip");M.registerComponent("PlayProgressBar",vu);class gf extends M{constructor(e,t){super(e,t),this.update=kt(de(this,this.update),lt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}gf.prototype.options_={children:["timeTooltip"]};M.registerComponent("MouseTimeDisplay",gf);const Xr=5,Lc=12;class Tu extends _u{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=de(this,this.update),this.update=kt(this.update_,lt),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.on(U,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){U.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,lt))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(U.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[xi(s,n),xi(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(as(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){nr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!nr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Tt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Xr)}stepBack(){this.userSeek_(this.player_.currentTime()-Xr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const s=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Xr*Lc)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Xr*Lc)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in U&&"visibilityState"in U&&this.off(U,"visibilitychange",this.toggleVisibility_),super.dispose()}}Tu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ze&&!At&&Tu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");M.registerComponent("SeekBar",Tu);class yf extends M{constructor(e,t){super(e,t),this.handleMouseMove=kt(de(this,this.handleMouseMove),lt),this.throttledHandleMouseSeek=kt(de(this,this.handleMouseSeek),lt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=rr(n);let o=Qn(n,e).x;o=pr(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Tt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}yf.prototype.options_={children:["seekBar"]};M.registerComponent("ProgressControl",yf);class _f extends Me{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){U.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in x?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof U.exitPictureInPicture=="function"&&super.show()}}_f.prototype.controlText_="Picture-in-Picture";M.registerComponent("PictureInPictureToggle",_f);class vf extends Me{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),U[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}vf.prototype.controlText_="Fullscreen";M.registerComponent("FullscreenToggle",vf);const R1=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class N1 extends M{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}M.registerComponent("VolumeLevel",N1);class M1 extends M{constructor(e,t){super(e,t),this.update=kt(de(this,this.update),lt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=as(this.el_),a=as(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,d=e.width-o+(a.right-e.right);let m=n.width/2;ln.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){ei(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}M.registerComponent("VolumeLevelTooltip",M1);class Tf extends M{constructor(e,t){super(e,t),this.update=kt(de(this,this.update),lt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Tf.prototype.options_={children:["volumeLevelTooltip"]};M.registerComponent("MouseVolumeLevelDisplay",Tf);class ra extends _u{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){nr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=as(s),n=this.vertical();let a=Qn(s,e);a=n?a.y:a.x,a=pr(a,0,1),t.update(r,a,n)}nr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}ra.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ze&&!At&&ra.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");ra.prototype.playerEvent="volumechange";M.registerComponent("VolumeBar",ra);class bf extends M{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||rs(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),R1(this,e),this.throttledHandleMouseMove=kt(de(this,this.handleMouseMove),lt),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}bf.prototype.options_={children:["volumeBar"]};M.registerComponent("VolumeControl",bf);const B1=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Sf extends Me{constructor(e,t){super(e,t),B1(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ze&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Xn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),yi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Sf.prototype.controlText_="Mute";M.registerComponent("MuteToggle",Sf);class xf extends M{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||rs(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),st(U,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Ne(U,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}xf.prototype.options_={children:["muteToggle","volumeControl"]};M.registerComponent("VolumePanel",xf);class Ef extends Me{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Ef.prototype.controlText_="Skip Forward";M.registerComponent("SkipForward",Ef);class Cf extends Me{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Cf.prototype.controlText_="Skip Backward";M.registerComponent("SkipBackward",Cf);class Df extends M{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof M&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof M&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=W(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),st(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||U.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}M.registerComponent("Menu",Df);class bu extends M{constructor(e,t={}){super(e,t),this.menuButton_=new Me(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=Me.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),st(U,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Df(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=W("li",{className:"vjs-menu-title",textContent:_e(this.options_.title),tabIndex:-1}),s=new M(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;t{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof x.Event!="object")try{o=new x.Event("change")}catch{}o||(o=U.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}M.registerComponent("OffTextTrackMenuItem",Af);class ys extends Su{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=gr){let s;this.label_&&(s=`${this.label_} off`),e.push(new Af(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}M.registerComponent("TextTrackButton",ys);class wf extends mr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(_e(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(_e(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Du(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,kf),e}}wu.prototype.kinds_=["captions","subtitles"];wu.prototype.controlText_="Subtitles";M.registerComponent("SubsCapsButton",wu);class If extends mr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(W("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(W("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;sthis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}ku.prototype.contentElType="button";M.registerComponent("PlaybackRateMenuItem",ku);class Lf extends bu{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=W("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new ku(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Lf.prototype.controlText_="Playback Rate";M.registerComponent("PlaybackRateMenuButton",Lf);class Of extends M{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}M.registerComponent("Spacer",Of);class F1 extends Of{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}M.registerComponent("CustomControlSpacer",F1);class Rf extends M{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Rf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};M.registerComponent("ControlBar",Rf);class Nf extends ms{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Nf.prototype.options_=Object.assign({},ms.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});M.registerComponent("ErrorDisplay",Nf);class Mf extends M{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),W("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const s=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${ut()}`)+"-"+t[1].replace(/\W+/g,""),r=W("option",{id:s,value:this.localize(t[0]),textContent:t[1]});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${s}`),r}))}}M.registerComponent("TextTrackSelect",Mf);class vi extends M{constructor(e,t={}){super(e,t);const s=W("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(s);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let d=null;const m=`vjs_select_${ut()}`;if(this.options_.type==="colors"){d=W("span",{className:o});const T=W("label",{id:l,className:"vjs-label",textContent:a.label});T.setAttribute("for",m),d.appendChild(T)}const y=new Mf(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:m,labelId:l});this.addChild(y),this.options_.type==="colors"&&(d.appendChild(y.el()),this.el().appendChild(d))}}createEl(){return W("fieldset",{className:this.options_.className})}}M.registerComponent("TextTrackFieldset",vi);class Bf extends M{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new vi(e,{id_:s,legendId:`captions-text-legend-${s}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new vi(e,{id_:s,legendId:`captions-background-${s}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new vi(e,{id_:s,legendId:`captions-window-${s}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-colors"})}}M.registerComponent("TextTrackSettingsColors",Bf);class Ff extends M{constructor(e,t={}){super(e,t);const s=this.options_.textTrackComponentid,r=new vi(e,{id_:s,legendId:`captions-font-size-${s}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new vi(e,{id_:s,legendId:`captions-edge-style-${s}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new vi(e,{id_:s,legendId:`captions-font-family-${s}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return W("div",{className:"vjs-track-settings-font"})}}M.registerComponent("TextTrackSettingsFont",Ff);class Uf extends M{constructor(e,t={}){super(e,t);const s=this.localize("restore all settings to the default values"),r=new Me(e,{controlText:s,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new Me(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return W("div",{className:"vjs-track-settings-controls"})}}M.registerComponent("TrackSettingsControls",Uf);const Wa="vjs-text-track-settings",Oc=["#000","Black"],Rc=["#00F","Blue"],Nc=["#0FF","Cyan"],Mc=["#0F0","Green"],Bc=["#F0F","Magenta"],Fc=["#F00","Red"],Uc=["#FFF","White"],$c=["#FF0","Yellow"],Ka=["1","Opaque"],Xa=["0.5","Semi-Transparent"],qc=["0","Transparent"],Yt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Oc,Uc,Fc,Mc,Rc,$c,Bc,Nc],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ka,Xa,qc],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Uc,Oc,Fc,Mc,Rc,$c,Bc,Nc],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ka,Xa],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[qc,Xa,Ka],className:"vjs-window-opacity vjs-opacity"}};Yt.windowColor.options=Yt.backgroundColor.options;function $f(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function U1(i,e){const t=i.options[i.options.selectedIndex].value;return $f(t,e)}function $1(i,e,t){if(e){for(let s=0;s{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Hi(Yt,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return kh(Yt,(e,t,s)=>{const r=U1(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Hi(Yt,(t,s)=>{$1(this.$(t.selector),e[s],t.parser)})}setDefaults(){Hi(Yt,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(x.localStorage.getItem(Wa))}catch(t){J.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?x.localStorage.setItem(Wa,JSON.stringify(e)):x.localStorage.removeItem(Wa)}catch(t){J.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}M.registerComponent("TextTrackSettings",q1);class j1 extends M{constructor(e,t){let s=t.ResizeObserver||x.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=le({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||x.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Jh(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Ne(this,"resize",n),Ne(this,"unload",a),a=null};st(this.el_.contentWindow,"unload",a),st(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}M.registerComponent("ResizeManager",j1);const V1={trackingThreshold:20,liveTolerance:15};class H1 extends M{constructor(e,t){const s=le(V1,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(x.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,lt),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}M.registerComponent("LiveTracker",H1);class z1 extends M{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:W("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${ut()}`}),description:W("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${ut()}`})},W("div",{className:"vjs-title-bar"},{},Ih(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];Jn(a),n&&ei(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}M.registerComponent("TitleBar",z1);const G1={initialDisplay:4e3,position:[],takeFocus:!1};class W1 extends Me{constructor(e,t){t=le(G1,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],s=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=W("button",{},{type:"button",class:this.buildCSSClass()},W("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}M.registerComponent("TransientButton",W1);const To=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let s=0;sqf([i.el(),x.HTMLMediaElement.prototype,x.Element.prototype,K1],"innerHTML"),jc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=X1(i),r=n=>(...a)=>{const o=n.apply(e,a);return To(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",le(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},Y1=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?lf(x.Element.prototype.getAttribute.call(this,"src")):""},set(i){return x.Element.prototype.setAttribute.call(this,"src",i),i}}),Q1=i=>qf([i.el(),x.HTMLMediaElement.prototype,Y1],"src"),J1=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=Q1(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",le(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return To(i)||(i.triggerSourceset(""),jc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):To(i)||jc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class j extends Y{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&ia(l.src)&&(r=!0)):o.push(l))}for(let l=0;l{t=[];for(let n=0;ne.removeEventListener("change",s));const r=()=>{for(let n=0;n{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=ot[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[ls.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l{const l=n[o];s.addEventListener(o,l),this.on("dispose",d=>s.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){ot.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),j.disposeMediaElement(e),e=s}else{e=U.createElement("video");const s=this.options_.tag&&Xt(this.options_.tag),r=le({},s);(!sr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Uh(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&ns(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Kn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){J(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&At&&wt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Tt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){j.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=U.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),x.performance&&(e.creationTime=x.performance.now()),e}}Hn(j,"TEST_VID",function(){if(!hs())return;const i=U.createElement("video"),e=U.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});j.isSupported=function(){try{j.TEST_VID.volume=.5}catch{return!1}return!!(j.TEST_VID&&j.TEST_VID.canPlayType)};j.canPlayType=function(i){return j.TEST_VID.canPlayType(i)};j.canPlaySource=function(i,e){return j.canPlayType(i.type)};j.canControlVolume=function(){try{const i=j.TEST_VID.volume;j.TEST_VID.volume=i/2+.1;const e=i!==j.TEST_VID.volume;return e&&ze?(x.setTimeout(()=>{j&&j.prototype&&(j.prototype.featuresVolumeControl=i!==j.TEST_VID.volume)}),!1):e}catch{return!1}};j.canMuteVolume=function(){try{const i=j.TEST_VID.muted;return j.TEST_VID.muted=!i,j.TEST_VID.muted?ns(j.TEST_VID,"muted","muted"):Yn(j.TEST_VID,"muted","muted"),i!==j.TEST_VID.muted}catch{return!1}};j.canControlPlaybackRate=function(){if(At&&wt&&zn<58)return!1;try{const i=j.TEST_VID.playbackRate;return j.TEST_VID.playbackRate=i/2+.1,i!==j.TEST_VID.playbackRate}catch{return!1}};j.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(U.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(U.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(U.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};j.supportsNativeTextTracks=function(){return Kn||ze&&wt};j.supportsNativeVideoTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.videoTracks)};j.supportsNativeAudioTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.audioTracks)};j.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([i,e]){Hn(j.prototype,i,()=>j[e](),!0)});j.prototype.featuresVolumeControl=j.canControlVolume();j.prototype.movingMediaElementInDOM=!ze;j.prototype.featuresFullscreenResize=!0;j.prototype.featuresProgressEvents=!0;j.prototype.featuresTimeupdateEvents=!0;j.prototype.featuresVideoFrameCallback=!!(j.TEST_VID&&j.TEST_VID.requestVideoFrameCallback);j.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};j.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){j.prototype["set"+_e(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]()}});Y.withSourceHandlers(j);j.nativeSourceHandler={};j.nativeSourceHandler.canPlayType=function(i){try{return j.TEST_VID.canPlayType(i)}catch{return""}};j.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return j.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=fu(i.src);return j.nativeSourceHandler.canPlayType(`video/${t}`)}return""};j.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};j.nativeSourceHandler.dispose=function(){};j.registerSourceHandler(j.nativeSourceHandler);Y.registerTech("Html5",j);const jf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ya={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bo=["tiny","xsmall","small","medium","large","xlarge","huge"],rn={};bo.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;rn[i]=`vjs-layout-${e}`});const Z1={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let ke=class Bi extends M{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${ut()}`,t=Object.assign(Bi.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=Ah(this.id_),this.fsApi_=fn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Xt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Bi.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),lu(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(st(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=le(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new x.DOMParser().parseFromString(S1,"image/svg+xml");if(o.querySelector("parsererror"))J.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const d=o.documentElement;d.style.display="none",this.el_.appendChild(d),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new x1(this),this.addClass("vjs-spatial-navigation-enabled")),sr&&this.addClass("vjs-touch-enabled"),ze||this.addClass("vjs-workinghover"),Bi.players[this.id_]=this;const n=co.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Ne(U,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ne(U,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Bi.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),_1(this),je.names.forEach(e=>{const t=je[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Xt(e);if(r){for(t=this.el_=e,e=this.tag=U.createElement("video");t.children.length;)e.appendChild(t.firstChild);Ws(t,"video-js")||yi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",wt&&Gn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(l=>Nh[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),x.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Yh("vjs-styles-dimensions");const l=Jt(".vjs-styles-defaults"),d=Jt("head");d.insertBefore(this.styleEl_,l?l.nextSibling:d.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){J.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){J.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Bt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),KS(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(x.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(o>=0&&(d.width=o),l>=0&&(d.height=l));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),Qh(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${a*100}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=_e(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(Y.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};je.names.forEach(l=>{const d=je[l];a[d.getterName]=this[d.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=Y.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(de(this,this.handleTechReady_),!0),bc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),jf.forEach(l=>{this.on(this.tech_,l,d=>this[`handleTech${_e(l)}_`](d))}),Object.keys(Ya).forEach(l=>{this.on(this.tech_,l,d=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ya[l]}_`].bind(this),event:d});return}this[`handleTech${Ya[l]}_`](d)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,d)=>this.handleTechFullscreenChange_(l,d)),this.on(this.tech_,"fullscreenerror",(l,d)=>this.handleTechFullscreenError_(l,d)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&fo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){je.names.forEach(e=>{const t=je[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=bc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&J.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":co}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Xs(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Xs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Xs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=b1(this,t)),this.cache_.source=le({},e,{src:t,type:s});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;lthis.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Tt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=U[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in g1)return p1(this.middleware_,this.tech_,e,t);if(e in Dc)return Cc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw J(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in m1)return f1(this.middleware_,this.tech_,e);if(e in Dc)return Cc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(J(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(J(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(J(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Tt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Kn||ze);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||pt(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=pt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=pt(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return of(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(d,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,d){r(),s(d)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=U[this.fsApi_.exitFullscreen]();return e&&Tt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=U.documentElement.style.overflow,st(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow="hidden",yi(U.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Ne(U,"keydown",this.boundFullWindowOnEscKey_),U.documentElement.style.overflow=this.docOrigOverflow,Xn(U.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&x.documentPictureInPicture){const e=U.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(W("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),x.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Wh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in U&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(x.documentPictureInPicture&&x.documentPictureInPicture.window)return x.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in U)return U.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=M.getComponent("FullscreenToggle");U[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),M.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),M.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s[o,Y.getTech(o)]).filter(([o,l])=>l?l.isSupported():(J.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,l,d){let m;return o.some(y=>l.some(T=>{if(m=d(y,T),m)return!0})),m};let r;const n=o=>(l,d)=>o(d,l),a=([o,l],d)=>{if(l.canPlaySource(d,this.options_[o.toLowerCase()]))return{source:d,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=hf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),d1(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}h1(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?sf(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();Tt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Bt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Qt("beforeerror").forEach(t=>{const s=t(this,e);if(!(Dt(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new ye(e),this.addClass("vjs-error"),J.error(`(CODE:${this.error_.code} ${ye.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Qt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=de(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==s)&&(t=y.screenX,s=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!ze&&!At&&(l.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let d;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(d);const y=this.options_.inactivityTimeout;y<=0||(d=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=s,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(s),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Bt(this)&&this.trigger("languagechange"))}languages(){return le(Bi.prototype.options_.languages,this.languages_)}toJSON(){const e=le(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;sthis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:xn(r.poster)}]),r}return le(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Xt(e),r=s["data-setup"];if(Ws(e,"vjs-fill")&&(s.fill=!0),Ws(e,"vjs-fluid")&&(s.fluid=!0),r!==null)try{Object.assign(s,JSON.parse(r||"{}"))}catch(n){J.error("data-setup",n)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};je.names.forEach(function(i){const e=je[i];ke.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});ke.prototype.crossorigin=ke.prototype.crossOrigin;ke.players={};const Ms=x.navigator;ke.prototype.options_={techOrder:Y.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ms&&(Ms.languages&&Ms.languages[0]||Ms.userLanguage||Ms.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};jf.forEach(function(i){ke.prototype[`handleTech${_e(i)}_`]=function(){return this.trigger(i)}});M.registerComponent("Player",ke);const En="plugin",Wi="activePlugins_",$i={},Cn=i=>$i.hasOwnProperty(i),nn=i=>Cn(i)?$i[i]:void 0,Vf=(i,e)=>{i[Wi]=i[Wi]||{},i[Wi][e]=!0},Dn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},ex=function(i,e){const t=function(){Dn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return Vf(this,i),Dn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},Vc=(i,e)=>(e.prototype.name=i,function(...t){Dn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,Dn(this,s.getEventHash()),s});class Qe{constructor(e){if(this.constructor===Qe)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),lu(this),delete this.trigger,tf(this,this.constructor.defaultState),Vf(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ps(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Wi][e]=!1,this.player=this.state=null,t[e]=Vc(e,$i[e])}static isBasic(e){const t=typeof e=="string"?nn(e):e;return typeof t=="function"&&!Qe.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Cn(e))J.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ke.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return $i[e]=t,e!==En&&(Qe.isBasic(t)?ke.prototype[e]=ex(e,t):ke.prototype[e]=Vc(e,t)),t}static deregisterPlugin(e){if(e===En)throw new Error("Cannot de-register base plugin.");Cn(e)&&(delete $i[e],delete ke.prototype[e])}static getPlugins(e=Object.keys($i)){let t;return e.forEach(s=>{const r=nn(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=nn(e);return t&&t.VERSION||""}}Qe.getPlugin=nn;Qe.BASE_PLUGIN_NAME=En;Qe.registerPlugin(En,Qe);ke.prototype.usingPlugin=function(i){return!!this[Wi]&&this[Wi][i]===!0};ke.prototype.hasPlugin=function(i){return!!Cn(i)};function tx(i,e){let t=!1;return function(...s){return t||J.warn(i),t=!0,e.apply(this,s)}}function mt(i,e,t,s){return tx(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var ix={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const Hf=i=>i.indexOf("#")===0?i.slice(1):i;function P(i,e,t){let s=P.getPlayer(i);if(s)return e&&J.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Jt("#"+Hf(i)):i;if(!fs(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof x.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&J.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Qt("beforesetup").forEach(l=>{const d=l(r,le(e));if(!Dt(d)||Array.isArray(d)){J.error("please return an object in beforesetup hooks");return}e=le(e,d)});const o=M.getComponent("Player");return s=new o(r,e,t),Qt("setup").forEach(l=>l(s)),s}P.hooks_=Rt;P.hooks=Qt;P.hook=RS;P.hookOnce=NS;P.removeHook=Dh;if(x.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&hs()){let i=Jt(".vjs-styles-defaults");if(!i){i=Yh("vjs-styles-defaults");const e=Jt("head");e&&e.insertBefore(i,e.firstChild),Qh(i,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}mo(1,P);P.VERSION=co;P.options=ke.prototype.options_;P.getPlayers=()=>ke.players;P.getPlayer=i=>{const e=ke.players;let t;if(typeof i=="string"){const s=Hf(i),r=e[s];if(r)return r;t=Jt("#"+s)}else t=i;if(fs(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};P.getAllPlayers=()=>Object.keys(ke.players).map(i=>ke.players[i]).filter(Boolean);P.players=ke.players;P.getComponent=M.getComponent;P.registerComponent=(i,e)=>(Y.isTech(e)&&J.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),M.registerComponent.call(M,i,e));P.getTech=Y.getTech;P.registerTech=Y.registerTech;P.use=c1;Object.defineProperty(P,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(P.middleware,"TERMINATOR",{value:Sn,writeable:!1,enumerable:!0});P.browser=Nh;P.obj=FS;P.mergeOptions=mt(9,"videojs.mergeOptions","videojs.obj.merge",le);P.defineLazyProperty=mt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Hn);P.bind=mt(9,"videojs.bind","native Function.prototype.bind",de);P.registerPlugin=Qe.registerPlugin;P.deregisterPlugin=Qe.deregisterPlugin;P.plugin=(i,e)=>(J.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qe.registerPlugin(i,e));P.getPlugins=Qe.getPlugins;P.getPlugin=Qe.getPlugin;P.getPluginVersion=Qe.getPluginVersion;P.addLanguage=function(i,e){return i=(""+i).toLowerCase(),P.options.languages=le(P.options.languages,{[i]:e}),P.options.languages[i]};P.log=J;P.createLogger=Ah;P.time=ZS;P.createTimeRange=mt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",pt);P.createTimeRanges=mt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",pt);P.formatTime=mt(9,"videojs.formatTime","videojs.time.formatTime",xi);P.setFormatTime=mt(9,"videojs.setFormatTime","videojs.time.setFormatTime",nf);P.resetFormatTime=mt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",af);P.parseUrl=mt(9,"videojs.parseUrl","videojs.url.parseUrl",hu);P.isCrossOrigin=mt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ia);P.EventTarget=rt;P.any=uu;P.on=st;P.one=ea;P.off=Ne;P.trigger=ps;P.xhr=Id;P.TextTrack=fr;P.AudioTrack=cf;P.VideoTrack=df;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{P[i]=function(){return J.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Kh[i].apply(null,arguments)}});P.computedStyle=mt(9,"videojs.computedStyle","videojs.dom.computedStyle",os);P.dom=Kh;P.fn=WS;P.num=P1;P.str=QS;P.url=u1;P.Error=ix;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class sx{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class An extends P.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new sx(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;ss&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;ts,i.qualityLevels.VERSION=zf,s},Gf=function(i){return rx(this,P.obj.merge({},i))};P.registerPlugin("qualityLevels",Gf);Gf.VERSION=zf;/*! @name @videojs/http-streaming @version 3.14.2 @license Apache-2.0 */const Xe=Bn,wn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,ct=i=>P.log.debug?P.log.debug.bind(P,"VHS:",`${i} >`):function(){};function se(...i){const e=P.obj||P;return(e.merge||e.mergeOptions).apply(e,i)}function Re(...i){const e=P.time||P;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function nx(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-s}) +`}return e}const bt=1/30,St=bt*3,Wf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s=e})},Yr=function(i,e){return Wf(i,function(t){return t-bt>=e})},ax=function(i){if(i.length<2)return Re();const e=[];for(let t=1;t{const e=[];if(!i||!i.length)return"";for(let t=0;t "+i.end(t));return e.join(", ")},ux=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},mi=i=>{const e=[];for(let t=0;tn)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},Pu=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},So=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),Xf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Yf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Qf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Xf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},cx=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Pu(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},dx=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r"u"&&(e=i.mediaSequence+i.segments.length),e"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return x.Infinity}return Jf(i,e,t)},Ys=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n0)for(let d=l-1;d>=0;d--){const m=o[d];if(a+=m.duration,n){if(a<0)continue}else if(a+bt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Ys({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:d})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let d=l;d<0;d++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let d=l;dbt,T=a===0,E=y&&a+bt>=0;if(!((T||E)&&d!==o.length-1)){if(n){if(a>0)continue}else if(a-bt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Ys({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:d})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},tp=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Lu=function(i){return i.excludeUntil&&i.excludeUntil===1/0},na=function(i){const e=tp(i);return!i.disabled&&!e},px=function(i){return i.disabled},mx=function(i){for(let e=0;e{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>na(s)?(s.attributes.BANDWIDTH||0)!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Hc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},yr=i=>{if(!i||!i.playlists||!i.playlists.length)return Hc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;eMd(n))||Hc(i,n=>Ou(t,n))))return!1}return!0};var Ye={liveEdgeDelay:Qf,duration:Zf,seekable:hx,getMediaInfoForTime:fx,isEnabled:na,isDisabled:px,isExcluded:tp,isIncompatible:Lu,playlistEnd:ep,isAes:mx,hasAttribute:ip,estimateSegmentRequestTime:gx,isLowestEnabledRendition:xo,isAudioOnly:yr,playlistMatch:Ou,segmentDurationWithParts:Pu};const{log:sp}=P,Ki=(i,e)=>`${i}-${e}`,rp=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,yx=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new Ob;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(d=>a.addParser(d)),r.forEach(d=>a.addTagMapper(d)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(d){o.hasOwnProperty(d)&&delete o[d]}),o.segments&&o.segments.forEach(function(d){["parts","preloadHints"].forEach(function(m){d.hasOwnProperty(m)&&delete d[m]})})),!o.targetDuration){let d=10;o.segments&&o.segments.length&&(d=o.segments.reduce((m,y)=>Math.max(m,y.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${d}`}),o.targetDuration=d}const l=Xf(o);if(l.length&&!o.partTargetDuration){const d=l.reduce((m,y)=>Math.max(m,y.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${d}`}),sp.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.")),o.partTargetDuration=d}return o},_s=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},np=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},_x=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];np({playlist:t,id:Ki(e,t.uri)}),t.resolvedUri=Xe(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||sp.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},vx=i=>{_s(i,e=>{e.uri&&(e.resolvedUri=Xe(i.uri,e.uri))})},Tx=(i,e)=>{const t=Ki(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:x.location.href,resolvedUri:x.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},ap=(i,e,t=rp)=>{i.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let l=0;l(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime(){const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!n||s;if(t&&n)a.error=ve({},t),a.errorType=P.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=P.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=P.Error.NetworkRequestTimeout;else if(o){const l=s?P.Error.NetworkBodyParserFailed:P.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:bx}=P,Sx=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=Yf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new x.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},xx=(i,e)=>{if(!i)return e;const t=se(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o{!i.resolvedUri&&i.uri&&(i.resolvedUri=Xe(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Xe(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Xe(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Xe(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Xe(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Xe(e,t.uri))})},lp=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;si===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Eo=(i,e,t=cp)=>{const s=se(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=lp(e);const n=se(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{up(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let m=0;m{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Gc=(i,e,t)=>{if(!i)return;const s=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;s.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:s}};class ji extends bx{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ct("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new zc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Xe(this.main.uri,e.uri);this.llhls&&(t=Sx(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Ti({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return yx({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(s){this.error=s,this.error.metadata={errorType:P.Error.StreamingHlsPlaylistParserError,error:s}}}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:s}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:s,manifestString:e});a.lastRequest=Date.now(),np({playlist:a,uri:s,id:r});const o=Eo(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Co(this.media(),!!o)),n.parsedPlaylist=Gc(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),x.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new zc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(x.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=x.setTimeout(this.media.bind(this,e,!1),o);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Co(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=wn(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,s);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=x.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=x.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,s)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:s.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:s.responseText,code:2,metadata:Ti({requestType:s.requestType,request:s,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=wn(this.src,s),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:s.responseText,url:this.src});e.parsedPlaylist=Gc(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,ap(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=lp(s),s.segments.forEach(r=>{up(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||x.location.href;this.main=Tx(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const d=this.createCloneURI_(a.resolvedUri,e),m=Ki(r,d),y=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,y);s.playlists[n]=T,s.playlists[m]=T,s.playlists[d]=T}else s.playlists.splice(n,1);delete s.playlists[l],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((d,m)=>{const y=s.playlists[d.id],T=y.id,E=y.resolvedUri;delete s.playlists[T],delete s.playlists[E]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Ki(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=l,s.playlists[a]=l,s.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=ve({},l);const d=r.mediaGroups[n][t][o],m=this.createCloneURI_(l.resolvedUri,e);d.resolvedUri=m,d.uri=m,d.playlists=[],l.playlists.forEach((y,T)=>{const E=r.playlists[y.id],D=rp(n,t,o),_=Ki(t,D);if(E&&!r.playlists[_]){const A=this.createClonePlaylist_(E,_,e),w=A.resolvedUri;r.playlists[_]=A,r.playlists[w]=A}d.playlists[T]=this.createClonePlaylist_(y,_,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),se(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const Do=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},Cx=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},Dx=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},dp=function(){const i=function e(t,s){t=se({timeout:45e3},t);const r=e.beforeRequest||P.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||P.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||P.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(P.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=P.Vhs.xhr.original===!0?P.xhr:P.Vhs.xhr,l=Cx(n,t);n.delete(r);const d=o(l||t,function(y,T){return Dx(a,d,y,T),Do(d,y,T,s)}),m=d.abort;return d.abort=function(){return d.aborted=!0,m.apply(d,arguments)},d.uri=t.uri,d.requestType=t.requestType,d.requestTime=Date.now(),d};return i.original=!0,i},Ax=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=x.BigInt(i.offset)+x.BigInt(i.length)-x.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},Ao=function(i){const e={};return i.byterange&&(e.Range=Ax(i.byterange)),e},wx=function(i,e){return i.start(e)+"-"+i.end(e)},kx=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},Ix=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},hp=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];Fd(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},kn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},fp=function(i){return i.resolvedUri},pp=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;app(i),Lx=i=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},Nx=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,Mx=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(to?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Ye.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},Bx=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;nt){if(i>t+r.duration*mp)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Fx=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Ux=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=Bx(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=Rx(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},gp=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Ux(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=Mx(i,e);if(!o)return a({message:`${i} was not found in the stream`});const l=o.segment,d=Fx(l.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+d),n.one("seeked",()=>{gp({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=l.start+d,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),s(m)},Ja=(i,e)=>{if(i.readyState===4)return e()},qx=(i,e,t,s)=>{let r=[],n,a=!1;const o=function(y,T,E,D){return T.abort(),a=!0,t(y,T,E,D)},l=function(y,T){if(a)return;if(y)return y.metadata=Ti({requestType:s,request:T,error:y}),o(y,T,"",r);const E=T.responseText.substring(r&&r.byteLength||0,T.responseText.length);if(r=zb(r,Ud(E,!0)),n=n||qs(r),r.length<10||n&&r.lengtho(y,T,"",r));const D=Zo(r);return D==="ts"&&r.length<188?Ja(T,()=>o(y,T,"",r)):!D&&r.length<376?Ja(T,()=>o(y,T,"",r)):o(null,T,D,r)},m=e({uri:i,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:T,loaded:E}){return Do(y,null,{statusCode:y.status},l)})}},function(y,T){return Do(m,y,T,l)});return m},{EventTarget:jx}=P,Wc=function(i,e){if(!cp(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Hx=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=hS(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return ap(n,e,Vx),n},zx=(i,e)=>{_s(i,(t,s,r,n)=>{(!e.mediaGroups[s][r]||!(n in e.mediaGroups[s][r]))&&delete i.mediaGroups[s][r][n]})},Gx=(i,e,t)=>{let s=!0,r=se(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const d=n.playlists[0].id,m=Eo(r,n.playlists[0],Wc);m&&(r=m,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[d],s=!1)}}),zx(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Wx=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Kc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=qn(n);if(!e[a])break;const o=e[a].sidxInfo;Wx(o,n)&&(t[a]=e[a])}}return t},Kx=(i,e)=>{let s=Kc(i.playlists,e);return _s(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;s=se(s,Kc(l,e))}}),s};class wo extends jx{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ct("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&qn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=x.setTimeout(()=>s(!1),0);return}const n=wn(e.sidx.resolvedUri),a=(l,d)=>{if(this.requestErrored_(l,d,t))return;const m=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=d;let T;try{T=_S(z(d.response).subarray(8))}catch(E){E.metadata=Ti({requestType:y,request:d,parseFailure:!0}),this.requestErrored_(E,d,t);return}return m[r]={sidxInfo:e.sidx,sidx:T},Yo(e,T,e.sidx.resolvedUri),s(!0)},o="dash-sidx";this.request=qx(n,this.vhs_.xhr,(l,d,m,y)=>{if(l)return a(l,d);if(!m||m!=="mp4"){const D=m||"unknown";return a({status:d.status,message:`Unsupported ${D} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},d)}const{offset:T,length:E}=e.sidx.byterange;if(y.length>=E+T)return a(l,{response:y.subarray(T,T+E),status:d.status,uri:d.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Ao({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},x.clearTimeout(this.minimumUpdatePeriodTimeout_),x.clearTimeout(this.mediaRequest_),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(x.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){x.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=x.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=x.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(s,r)=>{if(s){const{requestType:a}=r;s.metadata=Ti({requestType:a,request:r,error:s})}if(this.requestErrored_(s,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=wn(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=fS(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Xe(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s){const{requestType:a}=r;return this.error.metadata=Ti({requestType:a,request:r,error:s}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let s;try{s=Hx({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:P.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(s=Gx(e,s,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=s||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||s&&s.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(s),s){const{duration:n,endList:a}=s,o=[];s.playlists.forEach(d=>{o.push({id:d.id,bandwidth:d.attributes.BANDWIDTH,resolution:d.attributes.RESOLUTION,codecs:d.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!s}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(x.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=x.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Kx(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=x.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Co(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Ie={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Xx=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t-1):!1},this.trigger=function(c){var f,h,p,g;if(f=u[c],!!f)if(arguments.length===2)for(p=f.length,h=0;h"u")){for(u in H)H.hasOwnProperty(u)&&(H[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);ee=new Uint8Array([105,115,111,109]),ie=new Uint8Array([97,118,99,49]),Fe=new Uint8Array([0,0,0,1]),Te=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]),It=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]),ti={video:Te,audio:It},ri=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),si=new Uint8Array([0,0,0,0,0,0,0,0]),vr=new Uint8Array([0,0,0,0,0,0,0,0]),Fu=vr,Uu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),$u=vr,ii=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var c=[],f=0,h,p,g;for(h=1;h>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},m=function(){return o(H.ftyp,ee,Fe,ee,ie)},B=function(u){return o(H.hdlr,ti[u])},y=function(u){return o(H.mdat,u)},k=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=u.samplerate&255),o(H.mdhd,c)},R=function(u){return o(H.mdia,k(u),B(u.type),E(u))},T=function(u){return o(H.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},E=function(u){return o(H.minf,u.type==="video"?o(H.vmhd,ii):o(H.smhd,si),l(),q(u))},D=function(u,c){for(var f=[],h=c.length;h--;)f[h]=ce(c[h]);return o.apply(null,[H.moof,T(u)].concat(f))},_=function(u){for(var c=u.length,f=[];c--;)f[c]=O(u[c]);return o.apply(null,[H.moov,w(4294967295)].concat(f).concat(A(u)))},A=function(u){for(var c=u.length,f=[];c--;)f[c]=Z(u[c]);return o.apply(null,[H.mvex].concat(f))},w=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&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 o(H.mvhd,c)},V=function(u){var c=u.samples||[],f=new Uint8Array(4+c.length),h,p;for(p=0;p>>8),g.push(h[b].byteLength&255),g=g.concat(Array.prototype.slice.call(h[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(S=[H.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]),o(H.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([h.length],g,[p.length],v))),o(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var C=f.sarRatio[0],I=f.sarRatio[1];S.push(o(H.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(I&4278190080)>>24,(I&16711680)>>16,(I&65280)>>8,I&255])))}return o.apply(null,S)},c=function(f){return o(H.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]),d(f))}}(),L=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.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,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(H.tkhd,c)},ce=function(u){var c,f,h,p,g,v,b;return c=o(H.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(u.baseMediaDecodeTime/a),b=Math.floor(u.baseMediaDecodeTime%a),f=o(H.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,u.type==="audio"?(h=oe(u,g),o(H.traf,c,f,h)):(p=V(u),h=oe(u,p.length+g),o(H.traf,c,f,h,p))},O=function(u){return u.duration=u.duration||4294967295,o(H.trak,L(u),R(u))},Z=function(u){var c=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),o(H.trex,c)},function(){var u,c,f;f=function(h,p){var g=0,v=0,b=0,S=0;return h.length&&(h[0].duration!==void 0&&(g=1),h[0].size!==void 0&&(v=2),h[0].flags!==void 0&&(b=4),h[0].compositionTimeOffset!==void 0&&(S=8)),[0,0,g|v|b|S,1,(h.length&4278190080)>>>24,(h.length&16711680)>>>16,(h.length&65280)>>>8,h.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(h,p){var g,v,b,S,C,I;for(S=h.samples||[],p+=20+16*S.length,b=f(S,p),v=new Uint8Array(b.length+S.length*16),v.set(b),g=b.length,I=0;I>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(H.trun,v)},u=function(h,p){var g,v,b,S,C,I;for(S=h.samples||[],p+=20+8*S.length,b=f(S,p),g=new Uint8Array(b.length+S.length*8),g.set(b),v=b.length,I=0;I>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(H.trun,g)},oe=function(h,p){return h.type==="audio"?u(h,p):c(h,p)}}();var h_={ftyp:m,mdat:y,moof:D,moov:_,initSegment:function(u){var c=m(),f=_(u),h;return h=new Uint8Array(c.byteLength+f.byteLength),h.set(c),h.set(f,c.byteLength),h}},f_=function(u){var c,f,h=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,h.byteLength=0,c=0;c1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},g_=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},qu=function(u,c){var f=g_();return f.dataOffset=c,f.compositionTimeOffset=u.pts-u.dts,f.duration=u.duration,f.size=4*u.length,f.size+=u.byteLength,u.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},y_=function(u,c){var f,h,p,g,v,b=c||0,S=[];for(f=0;fbr.ONE_SECOND_IN_TS/2))){for(C=E_()[u.samplerate],C||(C=c[0].data),I=0;I=f?u:(c.minSegmentDts=1/0,u.filter(function(h){return h.dts>=f?(c.minSegmentDts=Math.min(c.minSegmentDts,h.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},w_=function(u){var c,f,h=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Pt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Pt.prototype.addText=function(u){this.rows[this.rowIdx]+=u},Pt.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var Er=function(u,c,f){this.serviceNum=u,this.text="",this.currentWindow=new Pt(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Er.prototype.init=function(u,c){this.startPts=u;for(var f=0;f<8;f++)this.windows[f]=new Pt(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Er.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},Er.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var ue=function(u){u=u||{},ue.prototype.init.call(this);var c=this,f=u.captionServices||{},h={},p;Object.keys(f).forEach(g=>{p=f[g],/^SERVICE/.test(g)&&(h[g]=p.encoding)}),this.serviceEncodings=h,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};ue.prototype=new pa,ue.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ue.prototype.add708Bytes=function(u){var c=u.ccData,f=c>>>8,h=c&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(h)},ue.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,f=null,h=null,p=0,g=c[p++];for(u.seq=g>>6,u.sizeCode=g&63;p>5,h=g&31,f===7&&h>0&&(g=c[p++],f=g),this.pushServiceBlock(f,p,h),h>0&&(p+=h-1)},ue.prototype.pushServiceBlock=function(u,c,f){var h,p=c,g=this.current708Packet.data,v=this.services[u];for(v||(v=this.initService(u,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(N=[b,S],u++):N=[b],c.textDecoder_&&!h)I=c.textDecoder_.decode(new Uint8Array(N));else if(p){const F=$(N);I=String.fromCharCode(parseInt(F,16))}else I=j_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(u)),C.pendingNewLine=!1,C.addText(I),u},ue.prototype.multiByteCharacter=function(u,c){var f=this.current708Packet.data,h=f[u+1],p=f[u+2];return xr(h)&&xr(p)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},ue.prototype.setCurrentWindow=function(u,c){var f=this.current708Packet.data,h=f[u],p=h&7;return c.setCurrentWindow(p),u},ue.prototype.defineWindow=function(u,c){var f=this.current708Packet.data,h=f[u],p=h&7;c.setCurrentWindow(p);var g=c.currentWindow;return h=f[++u],g.visible=(h&32)>>5,g.rowLock=(h&16)>>4,g.columnLock=(h&8)>>3,g.priority=h&7,h=f[++u],g.relativePositioning=(h&128)>>7,g.anchorVertical=h&127,h=f[++u],g.anchorHorizontal=h,h=f[++u],g.anchorPoint=(h&240)>>4,g.rowCount=h&15,h=f[++u],g.columnCount=h&63,h=f[++u],g.windowStyle=(h&56)>>3,g.penStyle=h&7,g.virtualRowCount=g.rowCount+1,u},ue.prototype.setWindowAttributes=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.winAttr;return h=f[++u],p.fillOpacity=(h&192)>>6,p.fillRed=(h&48)>>4,p.fillGreen=(h&12)>>2,p.fillBlue=h&3,h=f[++u],p.borderType=(h&192)>>6,p.borderRed=(h&48)>>4,p.borderGreen=(h&12)>>2,p.borderBlue=h&3,h=f[++u],p.borderType+=(h&128)>>5,p.wordWrap=(h&64)>>6,p.printDirection=(h&48)>>4,p.scrollDirection=(h&12)>>2,p.justify=h&3,h=f[++u],p.effectSpeed=(h&240)>>4,p.effectDirection=(h&12)>>2,p.displayEffect=h&3,u},ue.prototype.flushDisplayed=function(u,c){for(var f=[],h=0;h<8;h++)c.windows[h].visible&&!c.windows[h].isEmpty()&&f.push(c.windows[h].getText());c.endPts=u,c.text=f.join(` + +`),this.pushCaption(c),c.startPts=u},ue.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},ue.prototype.displayWindows=function(u,c){var f=this.current708Packet.data,h=f[++u],p=this.getPts(u);this.flushDisplayed(p,c);for(var g=0;g<8;g++)h&1<>4,p.offset=(h&12)>>2,p.penSize=h&3,h=f[++u],p.italics=(h&128)>>7,p.underline=(h&64)>>6,p.edgeType=(h&56)>>3,p.fontStyle=h&7,u},ue.prototype.setPenColor=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.penColor;return h=f[++u],p.fgOpacity=(h&192)>>6,p.fgRed=(h&48)>>4,p.fgGreen=(h&12)>>2,p.fgBlue=h&3,h=f[++u],p.bgOpacity=(h&192)>>6,p.bgRed=(h&48)>>4,p.bgGreen=(h&12)>>2,p.bgBlue=h&3,h=f[++u],p.edgeRed=(h&48)>>4,p.edgeGreen=(h&12)>>2,p.edgeBlue=h&3,u},ue.prototype.setPenLocation=function(u,c){var f=this.current708Packet.data,h=f[u],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,h=f[++u],p.row=h&15,h=f[++u],p.column=h&63,u},ue.prototype.reset=function(u,c){var f=this.getPts(u);return this.flushDisplayed(f,c),this.initService(c.serviceNum,u)};var V_={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},Cr=function(u){return u===null?"":(u=V_[u]||u,String.fromCharCode(u))},Dr=14,H_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ni=function(){for(var u=[],c=Dr+1;c--;)u.push({text:"",indent:0,offset:0});return u},fe=function(u,c){fe.prototype.init.call(this),this.field_=u||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var h,p,g,v,b;if(h=f.ccData&32639,h===this.lastControlCode_){this.lastControlCode_=null;return}if((h&61440)===4096?this.lastControlCode_=h:h!==this.PADDING_&&(this.lastControlCode_=null),g=h>>>8,v=h&255,h!==this.PADDING_)if(h===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(h===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=f.pts;else if(h===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(h===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(h===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(h===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(h===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(h===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=ni();else if(h===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ni();else if(h===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(g,v))g=(g&3)<<8,b=Cr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=Cr(g|v),this[this.mode_](f.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(v&14)===14&&this.addFormatting(f.pts,["i"]),(v&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var S=H_.indexOf(h&7968);if(this.mode_==="rollUp"&&(S-this.rollUpRows_+1<0&&(S=this.rollUpRows_-1),this.setRollUp(f.pts,S)),S!==this.row_&&S>=0&&S<=14&&(this.clearFormatting(f.pts),this.row_=S),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(h&16)===16){const C=(h&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=Cr(g),b+=Cr(v),this[this.mode_](f.pts,b),this.column_+=b.length)}};fe.prototype=new pa,fe.prototype.flushDisplayed=function(u){const c=h=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+h+"."})},f=[];this.displayed_.forEach((h,p)=>{if(h&&h.text&&h.text.length){try{h.text=h.text.trim()}catch{c(p)}h.text.length&&f.push({text:h.text,line:p+1,position:10+Math.min(70,h.indent*10)+h.offset*2.5})}else h==null&&c(p)}),f.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:f,stream:this.name_})},fe.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_=Dr,this.rollUpRows_=2,this.formatting_=[]},fe.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},fe.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(u,c){return u>=this.BASE_&&u=64&&c<=127},fe.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},fe.prototype.isNormalChar=function(u){return u>=32&&u<=127},fe.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=Dr,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=ni(),this.displayed_=ni()),c!==void 0&&c!==this.row_)for(var f=0;f"},"");this[this.mode_](u,f)},fe.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,h){return f+""},"");this.formatting_=[],this[this.mode_](u,c)}},fe.prototype.popOn=function(u,c){var f=this.nonDisplayed_[this.row_].text;f+=c,this.nonDisplayed_[this.row_].text=f},fe.prototype.rollUp=function(u,c){var f=this.displayed_[this.row_].text;f+=c,this.displayed_[this.row_].text=f},fe.prototype.shiftRowsUp_=function(){var u;for(u=0;uc&&(f=-1);Math.abs(c-u)>W_;)u+=f*G_;return u},ga=function(u){var c,f;ga.prototype.init.call(this),this.type_=u||Ku,this.push=function(h){if(h.type==="metadata"){this.trigger("data",h);return}this.type_!==Ku&&h.type!==this.type_||(f===void 0&&(f=h.dts),h.dts=ma(h.dts,f),h.pts=ma(h.pts,f),c=h.dts,this.trigger("data",h))},this.flush=function(){f=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ga.prototype=new z_;var Xu={TimestampRolloverStream:ga,handleRollover:ma},K_=(u,c,f)=>{if(!u)return-1;for(var h=f;h";u.data[0]===kr.Utf8&&(f=wr(u.data,0,c),!(f<0)&&(u.mimeType=Ts(u.data,c,f),c=f+1,u.pictureType=u.data[c],c++,h=wr(u.data,0,c),!(h<0)&&(u.description=vs(u.data,c,h),c=h+1,u.mimeType===p?u.url=Ts(u.data,c,u.data.length):u.pictureData=u.data.subarray(c,u.data.length))))},"T*":function(u){u.data[0]===kr.Utf8&&(u.value=vs(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var c;u.data[0]===kr.Utf8&&(c=wr(u.data,0,1),c!==-1&&(u.description=vs(u.data,1,c),u.value=vs(u.data,c+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=Ts(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var c;u.data[0]===kr.Utf8&&(c=wr(u.data,0,1),c!==-1&&(u.description=vs(u.data,1,c),u.url=Ts(u.data,c+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var c;for(c=0;c>>2;G*=4,G+=F[7]&3,I.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=I.timeStamp,b.dts=I.timeStamp),this.trigger("timestamp",I)}b.frames.push(I),S+=10,S+=C}while(S>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",u(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",u(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=dt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=dt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},xs.prototype=new ya,xs.STREAM_TYPES={h264:27,adts:15},Lr=function(){var u=this,c=!1,f={data:[],size:0},h={data:[],size:0},p={data:[],size:0},g,v=function(S,C){var I;const N=S[0]<<16|S[1]<<8|S[2];C.data=new Uint8Array,N===1&&(C.packetLength=6+(S[4]<<8|S[5]),C.dataAlignmentIndicator=(S[6]&4)!==0,I=S[7],I&192&&(C.pts=(S[9]&14)<<27|(S[10]&255)<<20|(S[11]&254)<<12|(S[12]&255)<<5|(S[13]&254)>>>3,C.pts*=4,C.pts+=(S[13]&6)>>>1,C.dts=C.pts,I&64&&(C.dts=(S[14]&14)<<27|(S[15]&255)<<20|(S[16]&254)<<12|(S[17]&255)<<5|(S[18]&254)>>>3,C.dts*=4,C.dts+=(S[18]&6)>>>1)),C.data=S.subarray(9+S[8]))},b=function(S,C,I){var N=new Uint8Array(S.size),$={type:C},F=0,G=0,K=!1,Ae;if(!(!S.data.length||S.size<9)){for($.trackId=S.data[0].pid,F=0;F>5,S=((c[p+6]&3)+1)*1024,C=S*sv/Zu[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Zu[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),f++,p+=g}typeof I=="number"&&(this.skipWarn_(I,p),I=null),c=c.subarray(p)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Or.prototype=new iv;var rv=Or,el;el=function(u){var c=u.byteLength,f=0,h=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+h},this.loadWord=function(){var p=u.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(u.subarray(p,p+v)),f=new DataView(g.buffer).getUint32(0),h=v*8,c-=v},this.skipBits=function(p){var g;h>p?(f<<=p,h-=p):(p-=h,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),f<<=p,h-=p)},this.readBits=function(p){var g=Math.min(h,p),v=f>>>32-g;return h-=g,h>0?f<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return f<<=p,h-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var nv=el,tl=t,av=nv,Rr,Es,il;Es=function(){var u=0,c,f;Es.prototype.init.call(this),this.push=function(h){var p;f?(p=new Uint8Array(f.byteLength+h.data.byteLength),p.set(f),p.set(h.data,f.byteLength),f=p):f=h.data;for(var g=f.byteLength;u3&&this.trigger("data",f.subarray(u+3)),f=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Es.prototype=new tl,il={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Rr=function(){var u=new Es,c,f,h,p,g,v,b;Rr.prototype.init.call(this),c=this,this.push=function(S){S.type==="video"&&(f=S.trackId,h=S.pts,p=S.dts,u.push(S))},u.on("data",function(S){var C={trackId:f,pts:h,dts:p,data:S,nalUnitTypeCode:S[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(S.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(S.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),u.on("done",function(){c.trigger("done")}),u.on("partialdone",function(){c.trigger("partialdone")}),u.on("reset",function(){c.trigger("reset")}),u.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},b=function(S,C){var I=8,N=8,$,F;for($=0;$>4;return f=f>=0?f:0,p?f+20:f+10},rl=function(u,c){return u.length-c<10||u[c]!==73||u[c+1]!==68||u[c+2]!==51?c:(c+=sl(u,c),rl(u,c))},lv=function(u){var c=rl(u,0);return u.length>=c+2&&(u[c]&255)===255&&(u[c+1]&240)===240&&(u[c+1]&22)===16},nl=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},cv=function(u,c,f){var h,p="";for(h=c;h>5,h=u[c+4]<<3,p=u[c+3]&6144;return p|h|f},fv=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":u[c]&!0&&(u[c+1]&240)===240?"audio":null},pv=function(u){for(var c=0;c+5>>2]}return null},mv=function(u){var c,f,h,p;c=10,u[5]&64&&(c+=4,c+=nl(u.subarray(10,14)));do{if(f=nl(u.subarray(c+4,c+8)),f<1)return null;if(p=String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3]),p==="PRIV"){h=u.subarray(c+10,c+f+10);for(var g=0;g>>2;return S*=4,S+=b[7]&3,S}break}}c+=10,c+=f}while(c=3;){if(u[p]===73&&u[p+1]===68&&u[p+2]===51){if(u.length-p<10||(h=al.parseId3TagSize(u,p),p+h>u.length))break;v={type:"timed-metadata",data:u.subarray(p,p+h)},this.trigger("data",v),p+=h;continue}else if((u[p]&255)===255&&(u[p+1]&240)===240){if(u.length-p<7||(h=al.parseAdtsSize(u,p),p+h>u.length))break;b={type:"audio",data:u.subarray(p,p+h),pts:c,dts:c},this.trigger("data",b),p+=h;continue}p++}g=u.length-p,g>0?u=u.subarray(p):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Nr.prototype=new gv;var yv=Nr,_v=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],vv=_v,Tv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],bv=Tv,Mr=t,Cs=h_,Ds=b_,Br=I_,ht=N_,Lt=tv,Fr=he,ol=rv,Sv=ov.H264Stream,xv=yv,Ev=ba.isLikelyAacData,Cv=he.ONE_SECOND_IN_TS,Sa=vv,xa=bv,As,Di,Ur,ai,Dv=function(u,c){c.stream=u,this.trigger("log",c)},ul=function(u,c){for(var f=Object.keys(c),h=0;h=-C&&N<=S&&(!$||I>N)&&($=G,I=N)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var S,C,I,N,$,F,G,K;for($=b.byteLength,F=b.nalCount,G=b.duration,S=C=0;SI.pts){S++;continue}C++,$-=N.byteLength,F-=N.nalCount,G-=N.duration}return C===0?b:C===b.length?null:(K=b.slice(C),K.byteLength=$,K.duration=G,K.nalCount=F,K.pts=K[0].pts,K.dts=K[0].dts,K)},this.alignGopsAtEnd_=function(b){var S,C,I,N,$,F;for(S=p.length-1,C=b.length-1,$=null,F=!1;S>=0&&C>=0;){if(I=p[S],N=b[C],I.pts===N.pts){F=!0;break}if(I.pts>N.pts){S--;continue}S===p.length-1&&($=C),C--}if(!F&&$===null)return null;var G;if(F?G=C:G=$,G===0)return b;var K=b.slice(G),Ae=K.reduce(function(nt,ui){return nt.byteLength+=ui.byteLength,nt.duration+=ui.duration,nt.nalCount+=ui.nalCount,nt},{byteLength:0,duration:0,nalCount:0});return K.byteLength=Ae.byteLength,K.duration=Ae.duration,K.nalCount=Ae.nalCount,K.pts=K[0].pts,K.dts=K[0].dts,K},this.alignGopsWith=function(b){p=b}},As.prototype=new Mr,ai=function(u,c){this.numberOfTracks=0,this.metadataStream=c,u=u||{},typeof u.remux<"u"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.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.content||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 Mr,ai.prototype.flush=function(u){var c=0,f={captions:[],captionStreams:{},metadata:[],info:{}},h,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,xa.forEach(function(S){f.info[S]=this.videoTrack[S]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,Sa.forEach(function(S){f.info[S]=this.audioTrack[S]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?f.type=this.pendingTracks[0].type:f.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Cs.initSegment(this.pendingTracks),f.initSegment=new Uint8Array(g.byteLength),f.initSegment.set(g),f.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ai.prototype.setRemux=function(u){this.remuxTracks=u},Ur=function(u){var c=this,f=!0,h,p;Ur.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Lt.MetadataStream,g.aacStream=new xv,g.audioTimestampRolloverStream=new Lt.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Lt.TimestampRolloverStream("timed-metadata"),g.adtsStream=new ol,g.coalesceStream=new ai(u,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Di(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ul(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Lt.MetadataStream,g.packetStream=new Lt.TransportPacketStream,g.parseStream=new Lt.TransportParseStream,g.elementaryStream=new Lt.ElementaryStream,g.timestampRolloverStream=new Lt.TimestampRolloverStream,g.adtsStream=new ol,g.h264Stream=new Sv,g.captionStream=new Lt.CaptionStream(u),g.coalesceStream=new ai(u,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!h&&v.tracks[b].type==="video"?(h=v.tracks[b],h.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);h&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new As(h,u),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(S){p&&!u.keepOriginalTimestamps&&(p.timelineStartInfo=S,g.audioSegmentStream.setEarliestDts(S.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(S){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(S)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Di(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!h})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ul(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ht.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),h&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),h.timelineStartInfo.dts=void 0,h.timelineStartInfo.pts=void 0,ht.clearDtsInfo(h),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;u.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){h&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(f){var v=Ev(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(g)},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()}},Ur.prototype=new Mr;var Av={Transmuxer:Ur,VideoSegmentStream:As,AudioSegmentStream:Di,AUDIO_PROPERTIES:Sa,VIDEO_PROPERTIES:xa,generateSegmentTimingInfo:Ea},wv=function(u){return u>>>0},kv=function(u){return("00"+u.toString(16)).slice(-2)},$r={toUnsigned:wv,toHexString:kv},Iv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3]),c},cl=Iv,Pv=$r.toUnsigned,Lv=cl,dl=function(u,c){var f=[],h,p,g,v,b;if(!c.length)return null;for(h=0;h1?h+p:u.byteLength,g===c[0]&&(c.length===1?f.push(u.subarray(h+8,v)):(b=dl(u.subarray(h+8,v),c.slice(1)),b.length&&(f=f.concat(b)))),h=v;return f},hl=dl,Ov=$r.toUnsigned,Rv=n.getUint64,Nv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=Rv(u.subarray(4)):c.baseMediaDecodeTime=Ov(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},fl=Nv,Mv=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},Bv=Mv,pl=Bv,Fv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},f=new DataView(u.buffer,u.byteOffset,u.byteLength),h=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,S=c.flags[1]&8,C=f.getUint32(4),I=8,N;for(h&&(c.dataOffset=f.getInt32(I),I+=4),p&&C&&(N={flags:pl(u.subarray(I,I+4))},I+=4,g&&(N.duration=f.getUint32(I),I+=4),v&&(N.size=f.getUint32(I),I+=4),S&&(c.version===1?N.compositionTimeOffset=f.getInt32(I):N.compositionTimeOffset=f.getUint32(I),I+=4),c.samples.push(N),C--);C--;)N={},g&&(N.duration=f.getUint32(I),I+=4),v&&(N.size=f.getUint32(I),I+=4),b&&(N.flags=pl(u.subarray(I,I+4)),I+=4),S&&(c.version===1?N.compositionTimeOffset=f.getInt32(I):N.compositionTimeOffset=f.getUint32(I),I+=4),c.samples.push(N);return c},ml=Fv,Uv=function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),f={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:c.getUint32(4)},h=f.flags[2]&1,p=f.flags[2]&2,g=f.flags[2]&8,v=f.flags[2]&16,b=f.flags[2]&32,S=f.flags[0]&65536,C=f.flags[0]&131072,I;return I=8,h&&(I+=4,f.baseDataOffset=c.getUint32(12),I+=4),p&&(f.sampleDescriptionIndex=c.getUint32(I),I+=4),g&&(f.defaultSampleDuration=c.getUint32(I),I+=4),v&&(f.defaultSampleSize=c.getUint32(I),I+=4),b&&(f.defaultSampleFlags=c.getUint32(I)),S&&(f.durationIsEmpty=!0),!h&&C&&(f.baseDataOffsetIsMoof=!0),f},gl=Uv,ws;typeof window<"u"?ws=window:typeof i<"u"?ws=i:typeof self<"u"?ws=self:ws={};var yl=ws,$v=Gu.discardEmulationPreventionBytes,qv=Wu.CaptionStream,ks=hl,jv=fl,Vv=ml,Hv=gl,_l=yl,zv=function(u,c){for(var f=u,h=0;h0?jv($[0]).baseMediaDecodeTime:0,G=ks(S,["trun"]),K,Ae;c===N&&G.length>0&&(K=Wv(G,F,I),Ae=Gv(b,K,N),p[N]||(p[N]={seiNals:[],logs:[]}),p[N].seiNals=p[N].seiNals.concat(Ae.seiNals),p[N].logs=p[N].logs.concat(Ae.logs))}),p},Xv=function(u,c,f){var h;if(c===null)return null;h=Kv(u,c);var p=h[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:f}},Yv=function(){var u=!1,c,f,h,p,g,v;this.isInitialized=function(){return u},this.init=function(b){c=new qv,u=!0,v=b?b.isPartial:!1,c.on("data",function(S){S.startTime=S.startPts/p,S.endTime=S.endPts/p,g.captions.push(S),g.captionStreams[S.stream]=!0}),c.on("log",function(S){g.logs.push(S)})},this.isNewInit=function(b,S){return b&&b.length===0||S&&typeof S=="object"&&Object.keys(S).length===0?!1:h!==b[0]||p!==S[h]},this.parse=function(b,S,C){var I;if(this.isInitialized()){if(!S||!C)return null;if(this.isNewInit(S,C))h=S[0],p=C[h];else if(h===null||!p)return f.push(b),null}else return null;for(;f.length>0;){var N=f.shift();this.parse(N,S,C)}return I=Xv(b,h,p),I&&I.logs&&(g.logs=g.logs.concat(I.logs)),I===null||!I.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(I.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(S){c.push(S)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],h=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Qv=Yv,Jv=function(u){for(var c=0,f=String.fromCharCode(u[c]),h="";f!=="\0";)h+=f,c++,f=String.fromCharCode(u[c]);return h+=f,h},Zv={uint8ToCString:Jv},qr=Zv.uint8ToCString,eT=n.getUint64,tT=function(u){var c=4,f=u[0],h,p,g,v,b,S,C,I;if(f===0){h=qr(u.subarray(c)),c+=h.length,p=qr(u.subarray(c)),c+=p.length;var N=new DataView(u.buffer);g=N.getUint32(c),c+=4,b=N.getUint32(c),c+=4,S=N.getUint32(c),c+=4,C=N.getUint32(c),c+=4}else if(f===1){var N=new DataView(u.buffer);g=N.getUint32(c),c+=4,v=eT(u.subarray(c)),c+=8,S=N.getUint32(c),c+=4,C=N.getUint32(c),c+=4,h=qr(u.subarray(c)),c+=h.length,p=qr(u.subarray(c)),c+=p.length}I=new Uint8Array(u.subarray(c,u.byteLength));var $={scheme_id_uri:h,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:S,id:C,message_data:I};return sT(f,$)?$:void 0},iT=function(u,c,f,h){return u||u===0?u/c:h+f/c},sT=function(u,c){var f=c.scheme_id_uri!=="\0",h=u===0&&vl(c.presentation_time_delta)&&f,p=u===1&&vl(c.presentation_time)&&f;return!(u>1)&&h||p},vl=function(u){return u!==void 0||u!==null},rT={parseEmsgBox:tT,scaleTime:iT},jr=$r.toUnsigned,Is=$r.toHexString,be=hl,Ai=cl,Ca=rT,nT=gl,aT=ml,oT=fl,uT=n.getUint64,Tl,bl,Sl,xl,El,Da,Cl,Aa=yl,lT=Qu.parseId3Frames;Tl=function(u){var c={},f=be(u,["moov","trak"]);return f.reduce(function(h,p){var g,v,b,S,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,S=jr(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,h[S]=jr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),h)},c)},bl=function(u,c){var f;f=be(c,["moof","traf"]);var h=f.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=jr(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),S=u[b]||9e4,C=be(g,["tfdt"])[0],I=new DataView(C.buffer,C.byteOffset,C.byteLength),N;C[0]===1?N=uT(C.subarray(4,12)):N=I.getUint32(4);let $;return typeof N=="bigint"?$=N/Aa.BigInt(S):typeof N=="number"&&!isNaN(N)&&($=N/S),$11?(p.codec+=".",p.codec+=Is(F[9]),p.codec+=Is(F[10]),p.codec+=Is(F[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(F=$.subarray(28),G=Ai(F.subarray(4,8)),G==="esds"&&F.length>20&&F[19]!==0?(p.codec+="."+Is(F[19]),p.codec+="."+Is(F[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var K=be(h,["mdia","mdhd"])[0];K&&(p.timescale=Da(K)),f.push(p)}),f},Cl=function(u,c=0){var f=be(u,["emsg"]);return f.map(h=>{var p=Ca.parseEmsgBox(new Uint8Array(h)),g=lT(p.message_data);return{cueTime:Ca.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:Ca.scaleTime(p.event_duration,p.timescale),frames:g}})};var wa={findBox:be,parseType:Ai,timescale:Tl,startTime:bl,compositionStartTime:Sl,videoTrackIds:xl,tracks:El,getTimescaleFromMediaHeader:Da,getEmsgID3:Cl},ka=Ar,Dl=function(u){var c=u[1]&31;return c<<=8,c|=u[2],c},Vr=function(u){return!!(u[1]&64)},Hr=function(u){var c=0;return(u[3]&48)>>>4>1&&(c+=u[4]+1),c},cT=function(u,c){var f=Dl(u);return f===0?"pat":f===c?"pmt":c?"pes":null},dT=function(u){var c=Vr(u),f=4+Hr(u);return c&&(f+=u[f]+1),(u[f+10]&31)<<8|u[f+11]},hT=function(u){var c={},f=Vr(u),h=4+Hr(u);if(f&&(h+=u[h]+1),!!(u[h+5]&1)){var p,g,v;p=(u[h+1]&15)<<8|u[h+2],g=3+p-4,v=(u[h+10]&15)<<8|u[h+11];for(var b=12+v;b=u.byteLength)return null;var h=null,p;return p=u[f+7],p&192&&(h={},h.pts=(u[f+9]&14)<<27|(u[f+10]&255)<<20|(u[f+11]&254)<<12|(u[f+12]&255)<<5|(u[f+13]&254)>>>3,h.pts*=4,h.pts+=(u[f+13]&6)>>>1,h.dts=h.pts,p&64&&(h.dts=(u[f+14]&14)<<27|(u[f+15]&255)<<20|(u[f+16]&254)<<12|(u[f+17]&255)<<5|(u[f+18]&254)>>>3,h.dts*=4,h.dts+=(u[f+18]&6)>>>1)),h},Ia=function(u){switch(u){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}},mT=function(u){for(var c=4+Hr(u),f=u.subarray(c),h=0,p=0,g=!1,v;p3&&(v=Ia(f[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},gT={parseType:cT,parsePat:dT,parsePmt:hT,parsePayloadUnitStartIndicator:Vr,parsePesType:fT,parsePesTime:pT,videoPacketContainsKeyFrame:mT},Al=Ar,wi=Xu.handleRollover,ne={};ne.ts=gT,ne.aac=ba;var oi=he.ONE_SECOND_IN_TS,Ue=188,gt=71,yT=function(u,c){for(var f=0,h=Ue,p,g;h=0;){if(u[h]===gt&&(u[p]===gt||p===u.byteLength)){switch(g=u.subarray(h,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),S=ne.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&S&&(C=ne.ts.parsePesTime(g),C&&(C.type="audio",f.audio.push(C),I=!0));break}if(I)break;h-=Ue,p-=Ue;continue}h--,p--}},_T=function(u,c,f){for(var h=0,p=Ue,g,v,b,S,C,I,N,$,F=!1,G={data:[],size:0};p=0;){if(u[h]===gt&&u[p]===gt){switch(g=u.subarray(h,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),S=ne.ts.parsePayloadUnitStartIndicator(g),b==="video"&&S&&(C=ne.ts.parsePesTime(g),C&&(C.type="video",f.video.push(C),F=!0));break}if(F)break;h-=Ue,p-=Ue;continue}h--,p--}},vT=function(u,c){if(u.audio&&u.audio.length){var f=c;(typeof f>"u"||isNaN(f))&&(f=u.audio[0].dts),u.audio.forEach(function(g){g.dts=wi(g.dts,f),g.pts=wi(g.pts,f),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi})}if(u.video&&u.video.length){var h=c;if((typeof h>"u"||isNaN(h))&&(h=u.video[0].dts),u.video.forEach(function(g){g.dts=wi(g.dts,h),g.pts=wi(g.pts,h),g.dtsTime=g.dts/oi,g.ptsTime=g.pts/oi}),u.firstKeyFrame){var p=u.firstKeyFrame;p.dts=wi(p.dts,h),p.pts=wi(p.pts,h),p.dtsTime=p.dts/oi,p.ptsTime=p.pts/oi}}},TT=function(u){for(var c=!1,f=0,h=null,p=null,g=0,v=0,b;u.length-v>=3;){var S=ne.aac.parseType(u,v);switch(S){case"timed-metadata":if(u.length-v<10){c=!0;break}if(g=ne.aac.parseId3TagSize(u,v),g>u.length){c=!0;break}p===null&&(b=u.subarray(v,v+g),p=ne.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(u.length-v<7){c=!0;break}if(g=ne.aac.parseAdtsSize(u,v),g>u.length){c=!0;break}h===null&&(b=u.subarray(v,v+g),h=ne.aac.parseSampleRate(b)),f++,v+=g;break;default:v++;break}if(c)return null}if(h===null||p===null)return null;var C=oi/h,I={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+f*1024*C,pts:p+f*1024*C}]};return I},bT=function(u){var c={pid:null,table:null},f={};yT(u,c);for(var h in c.table)if(c.table.hasOwnProperty(h)){var p=c.table[h];switch(p){case Al.H264_STREAM_TYPE:f.video=[],_T(u,c,f),f.video.length===0&&delete f.video;break;case Al.ADTS_STREAM_TYPE:f.audio=[],wl(u,c,f),f.audio.length===0&&delete f.audio;break}}return f},ST=function(u,c){var f=ne.aac.isLikelyAacData(u),h;return f?h=TT(u):h=bT(u),!h||!h.audio&&!h.video?null:(vT(h,c),h)},xT={inspect:ST,parseAudioPes_:wl};const ET=function(u,c){c.on("data",function(f){const h=f.initSegment;f.initSegment={data:h.buffer,byteOffset:h.byteOffset,byteLength:h.byteLength};const p=f.data;f.data=p.buffer,u.postMessage({action:"data",segment:f,byteOffset:p.byteOffset,byteLength:p.byteLength},[f.data])}),c.on("done",function(f){u.postMessage({action:"done"})}),c.on("gopInfo",function(f){u.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:h})}),c.on("audioSegmentTimingInfo",function(f){const h={start:{decode:he.videoTsToSeconds(f.start.dts),presentation:he.videoTsToSeconds(f.start.pts)},end:{decode:he.videoTsToSeconds(f.end.dts),presentation:he.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(h.prependedContentDuration=he.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:h})}),c.on("id3Frame",function(f){u.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){u.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){u.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he.videoTsToSeconds(f.start),end:he.videoTsToSeconds(f.end)}})}),c.on("log",function(f){u.postMessage({action:"log",log:f})})};class kl{constructor(c,f){this.options=f||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Av.Transmuxer(this.options),ET(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new Qv,this.captionParser.init());const f=new Uint8Array(c.data,c.byteOffset,c.byteLength),h=this.captionParser.parse(f,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:f.buffer},[f.buffer])}probeMp4StartTime({timescales:c,data:f}){const h=wa.startTime(c,f);this.self.postMessage({action:"probeMp4StartTime",startTime:h,data:f},[f.buffer])}probeMp4Tracks({data:c}){const f=wa.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:f,data:c},[c.buffer])}probeEmsgID3({data:c,offset:f}){const h=wa.getEmsgID3(c,f);this.self.postMessage({action:"probeEmsgID3",id3Frames:h,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:f}){const h=typeof f=="number"&&!isNaN(f)?f*he.ONE_SECOND_IN_TS:void 0,p=xT.inspect(c,h);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const f=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(f)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const f=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he.secondsToVideoTs(f)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(he.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new kl(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new kl(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var Jx=_p(Qx);const Zx=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(y.videoFrameDtsTime=l),typeof d<"u"&&(y.videoFramePtsTime=d),t(y)},eE=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},tE=(i,e)=>{e.gopInfo=i.data.gopInfo},bp=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:E,onDone:D,onEndedTimeline:_,onTransmuxerLog:A,isEndOfTimeline:w,segment:O,triggerSegmentEventFn:L}=i,R={buffer:[]};let k=w;const B=q=>{e.currentTransmux===i&&(q.data.action==="data"&&Zx(q,R,a),q.data.action==="trackinfo"&&o(q.data.trackInfo),q.data.action==="gopInfo"&&tE(q,R),q.data.action==="audioTimingInfo"&&l(q.data.audioTimingInfo),q.data.action==="videoTimingInfo"&&d(q.data.videoTimingInfo),q.data.action==="videoSegmentTimingInfo"&&m(q.data.videoSegmentTimingInfo),q.data.action==="audioSegmentTimingInfo"&&y(q.data.audioSegmentTimingInfo),q.data.action==="id3Frame"&&T([q.data.id3Frame],q.data.id3Frame.dispatchType),q.data.action==="caption"&&E(q.data.caption),q.data.action==="endedtimeline"&&(k=!1,_()),q.data.action==="log"&&A(q.data.log),q.data.type==="transmuxed"&&(k||(e.onmessage=null,eE({transmuxedData:R,callback:D}),Sp(e))))},V=()=>{const q={message:"Received an error message from the transmuxer worker",metadata:{errorType:P.Error.StreamingFailedToTransmuxSegment,segmentInfo:hi({segment:O})}};D(null,q)};if(e.onmessage=B,e.onerror=V,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const q=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:O}),e.postMessage({action:"push",data:q,byteOffset:X,byteLength:t.byteLength},[q])}w&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},Sp=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():bp(i.currentTransmux))},Xc=(i,e)=>{i.postMessage({action:e}),Sp(i)},xp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Xc(e,i);return}e.transmuxQueue.push(Xc.bind(null,e,i))},iE=i=>{xp("reset",i)},sE=i=>{xp("endTimeline",i)},Ep=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,bp(i);return}i.transmuxer.transmuxQueue.push(i)},rE=i=>{const e=new Jx;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Za={reset:iE,endTimeline:sE,transmux:Ep,createTransmuxer:rE};const Qs=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=ve({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ko=i=>{i.forEach(e=>{e.abort()})},nE=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),aE=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Ru=(i,e)=>{const{requestType:t}=e,s=Ti({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:xt.TIMEOUT,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:xt.ABORTED,xhr:e,metadata:s}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:xt.FAILURE,xhr:e,metadata:s}:null},Yc=(i,e,t,s)=>(r,n)=>{const a=n.response,o=Ru(r,n);if(o)return t(o,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:xt.FAILURE,xhr:n},i);const l=new DataView(a),d=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let y=0;y{const t=Zo(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:xt.FAILURE,metadata:{mediaType:r}})}Qs({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},oE=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(s,r)=>{const n=Ru(s,r);if(n)return e(n,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Cp(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},uE=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:s})=>(r,n)=>{const a=Ru(r,n);if(a)return e(a,i);s({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!n.responseText?n.response:Xx(n.responseText.substring(i.lastReachedChar||0));return i.stats=nE(n),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},lE=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{const D=i.map&&i.map.tracks||{},_=!!(D.audio&&D.video);let A=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let O=s.bind(null,i,"video","start");const L=s.bind(null,i,"video","end"),R=()=>Ep({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:k=>{k.type=k.type==="combined"?"video":k.type,m(i,k)},onTrackInfo:k=>{t&&(_&&(k.isMuxed=!0),t(i,k))},onAudioTimingInfo:k=>{A&&typeof k.start<"u"&&(A(k.start),A=null),w&&typeof k.end<"u"&&w(k.end)},onVideoTimingInfo:k=>{O&&typeof k.start<"u"&&(O(k.start),O=null),L&&typeof k.end<"u"&&L(k.end)},onVideoSegmentTimingInfo:k=>{const B={pts:{start:k.start.presentation,end:k.end.presentation},dts:{start:k.start.decode,end:k.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:B}),r(k)},onAudioSegmentTimingInfo:k=>{const B={pts:{start:k.start.pts,end:k.end.pts},dts:{start:k.start.dts,end:k.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:B}),n(k)},onId3:(k,B)=>{a(i,k,B)},onCaptions:k=>{o(i,[k])},isEndOfTimeline:l,onEndedTimeline:()=>{d()},onTransmuxerLog:T,onDone:(k,B)=>{y&&(k.type=k.type==="combined"?"video":k.type,E({type:"segmenttransmuxingcomplete",segment:i}),y(B,i,k))},segment:i,triggerSegmentEventFn:E});Qs({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:k=>{i.bytes=e=k.data;const B=k.result;B&&(t(i,{hasAudio:B.hasAudio,hasVideo:B.hasVideo,isMuxed:_}),t=null),R()}})},Dp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let D=new Uint8Array(e);if(OS(D)){i.isFmp4=!0;const{tracks:_}=i.map,A={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(A.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(A.videoCodec=_.video.codec),_.video&&_.audio&&(A.isMuxed=!0),t(i,A);const w=(O,L)=>{m(i,{data:D,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),O&&O.length&&o(i,O),y(null,i,{})};Qs({action:"probeMp4StartTime",timescales:i.map.timescales,data:D,transmuxer:i.transmuxer,callback:({data:O,startTime:L})=>{e=O.buffer,i.bytes=D=O,A.hasAudio&&!A.isMuxed&&s(i,"audio","start",L),A.hasVideo&&s(i,"video","start",L),Qs({action:"probeEmsgID3",data:D,transmuxer:i.transmuxer,offset:L,callback:({emsgData:R,id3Frames:k})=>{if(e=R.buffer,i.bytes=D=R,!_.video||!R.byteLength||!i.transmuxer){w(void 0,k);return}Qs({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:D,timescales:i.map.timescales,trackIds:[_.video.id],callback:B=>{e=B.data.buffer,i.bytes=D=B.data,B.logs.forEach(function(V){T(se(V,{stream:"mp4CaptionParser"}))}),w(B.captions,k)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=Zo(D)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}lE({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})},Ap=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s,segment:r,doneFn:n},a){const o=d=>{if(d.data.source===i){s.removeEventListener("message",o);const m=d.data.decrypted;a(new Uint8Array(m.bytes,m.byteOffset,m.byteLength))}};s.onerror=()=>{const d="An error occurred in the decryption worker",m=hi({segment:r}),y={message:d,metadata:{error:new Error(d),errorType:P.Error.StreamingFailedToDecryptSegment,segmentInfo:m,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(y,r)},s.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(hp({source:i,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},cE=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),Ap({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:y},D=>{e.bytes=D,E({type:"segmentdecryptioncomplete",segment:e}),Dp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})})},dE=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let D=0,_=!1;return(A,w)=>{if(!_){if(A)return _=!0,ko(i),y(A,w);if(D+=1,D===i.length){const O=function(){if(w.encryptedBytes)return cE({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E});Dp({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m,doneFn:y,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return E({type:"segmentdecryptionstart",segment:w}),Ap({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key,segment:w,doneFn:y},L=>{w.map.bytes=L,E({type:"segmentdecryptioncomplete",segment:w}),Cp(w,R=>{if(R)return ko(i),y(R,w);O()})});O()}}}},hE=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},fE=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=se(i.stats,aE(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},pE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D,doneFn:_,onTransmuxerLog:A,triggerSegmentEventFn:w})=>{const O=[],L=dE({activeXhrs:O,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D,doneFn:_,onTransmuxerLog:A,triggerSegmentEventFn:w});if(s.key&&!s.key.bytes){const q=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&q.push(s.map.key);const X=se(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),ce=Yc(s,q,L,w),Z={uri:s.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:Z});const oe=i(X,ce);O.push(oe)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const oe=se(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),H=Yc(s,[s.map.key],L,w),ee={uri:s.map.key.resolvedUri};w({type:"segmentkeyloadstart",segment:s,keyInfo:ee});const Fe=i(oe,H);O.push(Fe)}const X=se(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Ao(s.map),requestType:"segment-media-initialization"}),ce=oE({segment:s,finishProcessingFn:L,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const Z=i(X,ce);O.push(Z)}const R=se(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Ao(s),requestType:"segment"}),k=uE({segment:s,finishProcessingFn:L,responseType:R.responseType,triggerSegmentEventFn:w});w({type:"segmentloadstart",segment:s});const B=i(R,k);B.addEventListener("progress",fE({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:E,dataFn:D})),O.push(B);const V={};return O.forEach(q=>{q.addEventListener("loadend",hE({loadendState:V,abortFn:r}))}),()=>ko(O)},mE=ct("CodecUtils"),gE=function(i){const e=i.attributes||{};if(e.CODECS)return _t(e.CODECS)},wp=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},yE=(i,e)=>{if(!wp(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},In=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Nd(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){mE(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},Qc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Js=function(i,e){const t=e.attributes||{},s=In(gE(e)||[]);if(wp(i,e)&&!s.audio&&!yE(i,e)){const r=In(Nb(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},Qr=ct("PlaylistSelector"),Jc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},Pn=function(i,e){if(!i)return"";const t=x.getComputedStyle(i);return t?t[e]:""},Xi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Nu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||x.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||x.Number.MAX_VALUE,t-s},_E=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||x.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||x.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let kp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;Ye.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(k=>{let B;const V=k.attributes&&k.attributes.RESOLUTION&&k.attributes.RESOLUTION.width,q=k.attributes&&k.attributes.RESOLUTION&&k.attributes.RESOLUTION.height;return B=k.attributes&&k.attributes.BANDWIDTH,B=B||x.Number.MAX_VALUE,{bandwidth:B,width:V,height:q,playlist:k}});Xi(l,(k,B)=>k.bandwidth-B.bandwidth),l=l.filter(k=>!Ye.isIncompatible(k.playlist));let d=l.filter(k=>Ye.isEnabled(k.playlist));d.length||(d=l.filter(k=>!Ye.isDisabled(k.playlist)));const m=d.filter(k=>k.bandwidth*Ie.BANDWIDTH_VARIANCEk.bandwidth===y.bandwidth)[0];if(r===!1){const k=T||d[0]||l[0];if(k&&k.playlist){let B="sortedPlaylistReps";return T&&(B="bandwidthBestRep"),d[0]&&(B="enabledPlaylistReps"),Qr(`choosing ${Jc(k)} using ${B} with options`,a),k.playlist}return Qr("could not choose a playlist with options",a),null}const E=m.filter(k=>k.width&&k.height);Xi(E,(k,B)=>k.width-B.width);const D=E.filter(k=>k.width===t&&k.height===s);y=D[D.length-1];const _=D.filter(k=>k.bandwidth===y.bandwidth)[0];let A,w,O;_||(A=E.filter(k=>k.width>t||k.height>s),w=A.filter(k=>k.width===A[0].width&&k.height===A[0].height),y=w[w.length-1],O=w.filter(k=>k.bandwidth===y.bandwidth)[0]);let L;if(n.leastPixelDiffSelector){const k=E.map(B=>(B.pixelDiff=Math.abs(B.width-t)+Math.abs(B.height-s),B));Xi(k,(B,V)=>B.pixelDiff===V.pixelDiff?V.bandwidth-B.bandwidth:B.pixelDiff-V.pixelDiff),L=k[0]}const R=L||O||_||T||d[0]||l[0];if(R&&R.playlist){let k="sortedPlaylistReps";return L?k="leastPixelDiffRep":O?k="resolutionPlusOneRep":_?k="resolutionBestRep":T?k="bandwidthBestRep":d[0]&&(k="enabledPlaylistReps"),Qr(`choosing ${Jc(R)} using ${k} with options`,a),R.playlist}return Qr("could not choose a playlist with options",a),null};const Zc=function(){let i=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),kp(this.playlists.main,this.systemBandwidth,parseInt(Pn(this.tech_.el(),"width"),10)*i,parseInt(Pn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},vE=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&x.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),kp(this.playlists.main,e,parseInt(Pn(this.tech_.el(),"width"),10)*s,parseInt(Pn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},TE=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,d=e.playlists.filter(D=>!Ye.isIncompatible(D));let m=d.filter(Ye.isEnabled);m.length||(m=d.filter(D=>!Ye.isDisabled(D)));const T=m.filter(Ye.hasAttribute.bind(null,"BANDWIDTH")).map(D=>{const A=l.getSyncPoint(D,r,o,t)?1:2,O=Ye.estimateSegmentRequestTime(n,s,D)*A-a;return{playlist:D,rebufferingImpact:O}}),E=T.filter(D=>D.rebufferingImpact<=0);return Xi(E,(D,_)=>Nu(_.playlist,D.playlist)),E.length?E[0]:(Xi(T,(D,_)=>D.rebufferingImpact-_.rebufferingImpact),T[0]||null)},bE=function(){const i=this.playlists.main.playlists.filter(Ye.isEnabled);return Xi(i,(t,s)=>Nu(t,s)),i.filter(t=>!!Js(this.playlists.main,t).video)[0]||null},SE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Ip(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const xE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const d=n[s];d&&(a=d.label,o=d.language,l=d.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:l,label:a,language:o},!1).track}}},EE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},CE=function(i){Object.defineProperties(i.frame,{id:{get(){return P.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return P.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return P.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},DE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=x.WebKitDataCue||x.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||x.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const E=new r(y,y,T.value||T.url||T.data||"");E.frame=T,E.value=T,CE(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),d=Object.keys(l).sort((m,y)=>Number(m)-Number(y));d.forEach((m,y)=>{const T=l[m],E=isFinite(s)?s:m,D=Number(d[y+1])||E;T.forEach(_=>{_.endTime=D})})},AE={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},wE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),kE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=x.WebKitDataCue||x.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(wE.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:AE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},ed=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,P.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Vs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},IE=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},PE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*pi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},LE=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},OE=(i,e,t,s)=>{const r=Math.ceil((e-s)*pi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*pi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},RE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},Bs=1,ME=500,td=i=>typeof i=="number"&&isFinite(i),Jr=1/60,BE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,FE=(i,e,t)=>{let s=e-Ie.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Ni=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const E=typeof d=="number",D=i.segment.uri?"segment":"pre-segment",_=E?Yf({preloadSegment:s})-1:0;return`${D} [${n+l}/${n+y}]`+(E?` part [${d}/${_}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(E?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},id=i=>`${i}TimingInfo`,UE=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},$E=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),s=e&&t,r=s&&e.to!==t.to;return!!(s&&e.from!==-1&&t.from!==-1&&r)},qE=i=>{i&&(i.pause(),i.resetEverything(),i.load())},jE=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to{const e=i.pendingSegment_;if(!e)return;if(Io({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&$E(i.timelineChangeController_)){if(jE(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}qE(i)}},VE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=x.BigInt(n)-x.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+bt:!1,HE=(i,e)=>{if(e!=="hls")return null;const t=VE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=sd({segmentDuration:t,maxDuration:s*2}),n=sd({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. 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||n?{severity:r?"warn":"info",message:a}:null},hi=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),s=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:s}};class Po extends P.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ct(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)}),this.sourceUpdater_.on("codecschange",s=>{this.trigger(ve({type:"codecschange"},s))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",s=>{this.trigger(ve({type:"timelinechange"},s)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Kt(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Kt(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Za.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,x.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Za.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Re();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=kn(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=fp(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${Qa(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Za.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=OE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Vs(e,t,this.inbandTextTracks_[o]);Vs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&x.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=x.setTimeout(this.monitorBufferTick_.bind(this),ME)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:hi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Qa(e)||0,s=Iu(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=NE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=E+1):o.mediaIndex=this.mediaIndex+1}else{let T,E,D;const _=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${_}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const A=this.getSyncInfoFromMediaSequenceSync_(_);if(!A){const w="No sync info found while using media sequence sync";return this.error({message:w,metadata:{errorType:P.Error.StreamingFailedToSelectNextSegment,error:new Error(w)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${A.start} --> ${A.end})`),T=A.segmentIndex,E=A.partIndex,D=A.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const A=Ye.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:_,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=A.segmentIndex,E=A.partIndex,D=A.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${_}`:`currentTime ${_}`,o.mediaIndex=T,o.startOfSegment=D,o.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let d=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!d)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,d=l.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&d&&!m&&!d.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:d}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:d,independent:t},E=typeof l<"u"?l:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});const D=Qa(this.sourceUpdater_.audioBuffered());return typeof D=="number"&&(T.audioAppendStart=D-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=PE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return UE(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=Ye.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=ux(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=TE({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const d=n-a-o.rebufferingImpact;let m=.5;a<=bt&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||d{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:d}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),xE(m,this.vhs_.tech_,a),Vs(o,l,m[a]),EE({captionArray:d,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Io({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Io({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){Kt(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const 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[id(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.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,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=kn(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+mi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+mi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,d=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(l-o<=Bs&&m-d<=Bs){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${mi(n).join(", ")}, video buffer: ${mi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Bs;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Bs}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=x.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Bs*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===op){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:P.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const o=[r];let l=r.byteLength;s&&(o.unshift(s),l+=s.byteLength),n=SE({bytes:l,segments:o})}const a={segmentInfo:hi({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){Kt(this),this.loadQueue_.push(()=>{const t=ve({},e,{forceTimestampOffset:!0});ve(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting +${Ip(e.uri)} +${Ni(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=pE({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:d})=>{this.logger_(`${Ni(e)} logged from transmuxer stream ${d} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:d,trackInfo:m,timingInfo:y})=>{const E={segmentInfo:hi({segment:l})};d&&(E.keyInfo=d),m&&(E.trackInfo=m),y&&(E.timingInfo=y),this.trigger({type:o,metadata:E})}})}trimBackBuffer_(e){const t=FE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||d.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=BE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:hi({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=HE(e,this.sourceType_);if(t&&(t.severity==="warn"?P.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Ni(e)}`);return}this.logger_(`Appended ${Ni(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Ni(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},zE=["video","audio"],Lo=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},GE=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Yi("audio",e),Yi("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Lo(i,e))){if(s.type!==i){if(t=GE(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Yi(i,e);return}}},Lp=(i,e)=>{const t=e[`${i}Buffer`],s=Pp(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},vt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,et={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(vt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===op?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(vt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];vt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){P.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){P.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(vt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){P.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Pp(i),r=Qi(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Lp(i,e),!!vt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){P.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Qi(i);if(!vt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(d){l.errorType=P.Error.StreamingCodecsChangeError,l.error=d,d.metadata=l,t.error_=d,t.trigger("error"),P.log.warn(`Failed to changeType on ${e}Buffer`,d)}}},tt=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Yi(i,e)},rd=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=nx(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Yi(i,e)};class Op extends P.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Yi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ct("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=rd("video",this),this.onAudioUpdateEnd_=rd("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){tt({type:"mediaSource",sourceUpdater:this,action:et.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){tt({type:e,sourceUpdater:this,action:et.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){P.log.error("removeSourceBuffer is not supported!");return}tt({type:"mediaSource",sourceUpdater:this,action:et.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!P.browser.IS_FIREFOX&&x.MediaSource&&x.MediaSource.prototype&&typeof x.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return x.SourceBuffer&&x.SourceBuffer.prototype&&typeof x.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){P.log.error("changeType is not supported!");return}tt({type:e,sourceUpdater:this,action:et.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(tt({type:r,sourceUpdater:this,action:et.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return vt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Re()}videoBuffered(){return vt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Re()}buffered(){const e=vt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=vt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():ox(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Nt){tt({type:"mediaSource",sourceUpdater:this,action:et.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Nt){typeof e!="string"&&(e=void 0),tt({type:"mediaSource",sourceUpdater:this,action:et.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Nt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}tt({type:"audio",sourceUpdater:this,action:et.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Nt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}tt({type:"video",sourceUpdater:this,action:et.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(Lo("audio",this)||Lo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(tt({type:"audio",sourceUpdater:this,action:et.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(tt({type:"video",sourceUpdater:this,action:et.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&tt({type:"audio",sourceUpdater:this,action:et.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&tt({type:"video",sourceUpdater:this,action:et.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),zE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Lp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const nd=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),WE=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},ad=new Uint8Array(` + +`.split("").map(i=>i.charCodeAt(0)));class KE extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class XE extends Po{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Re();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Re([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=kn(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=ad.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(ad,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Vs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===xt.TIMEOUT&&this.handleTimeout_(),e.code===xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof x.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js"}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:P.Error.StreamingVttParserError,error:a}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new x.VTTCue(a.startTime,a.endTime,a.text):a)}),IE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof x.WebVTT!="function")throw new KE;typeof x.TextDecoder=="function"?t=new x.TextDecoder("utf8"):(t=x.WebVTT.StringDecoder(),s=!0);const r=new x.WebVTT.Parser(x,x.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{P.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=nd(a)),r.parse(a)}let n=e.bytes;s&&(n=nd(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/pi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(d=>{const m=d.endTime-d.startTime,y=this.handleRollover_(d.startTime+l,t.time);d.startTime=Math.max(y,0),d.endTime=Math.max(y+m,0)}),!s.syncInfo){const d=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(d,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*pi.ONE_SECOND_IN_TS;const r=t*pi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/pi.ONE_SECOND_IN_TS}}const YE=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},QE=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Rp{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,s){const r=new Map;let n=` +`,a=s,o=t;this.start_=a,e.forEach((l,d)=>{const m=this.storage_.get(o),y=a,T=y+l.duration,E=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),D=new od({start:y,end:T,appended:E,segmentIndex:d});l.syncInfo=D;let _=a;const A=(l.parts||[]).map((w,O)=>{const L=_,R=_+w.duration,k=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[O]&&m.partsSyncInfo[O].isAppended),B=new od({start:L,end:R,appended:k,segmentIndex:d,partIndex:O});return _=R,n+=`Media Sequence: ${o}.${O} | Range: ${L} --> ${R} | Appended: ${k} +`,w.syncInfo=B,B});r.set(o,new JE(D,A)),n+=`${Ip(l.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${E} +`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class ud extends Rp{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t){if(!this.storage_.size){const s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t)}}const ZE=86400,eo=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=So(e);r=r||0;for(let l=0;l{let n=null,a=null;r=r||0;const o=So(e);for(let l=0;l=E)&&(a=E,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class eC extends P.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Rp,s=new ud(t),r=new ud(t);this.mediaSequenceStorage_={main:t,audio:s,vtt:r},this.logger_=ct("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return eo.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:d}=o,{segmentIndex:m,time:y}=l;if(m<0)continue;const T=e.segments[m],E=y,D=E+T.duration;if(this.logger_(`Strategy: ${d}. Current time: ${r}. selected segment: ${m}. Time: [${E} -> ${D}]}`),r>=E&&r0&&(r.time*=-1),Math.abs(r.time+Ys({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;oZE){P.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||ol){let d;o<0?d=s.start-Ys({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):d=s.end+Ys({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:d,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class tC extends P.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){if(typeof t=="number"&&typeof s=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:s}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const iC=vp(Tp(function(){var i=function(){function _(){this.listeners={}}var A=_.prototype;return A.on=function(O,L){this.listeners[O]||(this.listeners[O]=[]),this.listeners[O].push(L)},A.off=function(O,L){if(!this.listeners[O])return!1;var R=this.listeners[O].indexOf(L);return this.listeners[O]=this.listeners[O].slice(0),this.listeners[O].splice(R,1),R>-1},A.trigger=function(O){var L=this.listeners[O];if(L)if(arguments.length===2)for(var R=L.length,k=0;k>7)*283)^R]=R;for(k=B=0;!O[k];k^=X||1,B=q[B]||1)for(oe=B^B<<1^B<<2^B<<3^B<<4,oe=oe>>8^oe&255^99,O[k]=oe,L[oe]=k,Z=V[ce=V[X=V[k]]],ee=Z*16843009^ce*65537^X*257^k*16843008,H=V[oe]*257^oe*16843008,R=0;R<4;R++)A[R][k]=H=H<<24^H>>>8,w[R][oe]=ee=ee<<24^ee>>>8;for(R=0;R<5;R++)A[R]=A[R].slice(0),w[R]=w[R].slice(0);return _};let s=null;class r{constructor(A){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let w,O,L;const R=this._tables[0][4],k=this._tables[1],B=A.length;let V=1;if(B!==4&&B!==6&&B!==8)throw new Error("Invalid aes key size");const q=A.slice(0),X=[];for(this._key=[q,X],w=B;w<4*B+28;w++)L=q[w-1],(w%B===0||B===8&&w%B===4)&&(L=R[L>>>24]<<24^R[L>>16&255]<<16^R[L>>8&255]<<8^R[L&255],w%B===0&&(L=L<<8^L>>>24^V<<24,V=V<<1^(V>>7)*283)),q[w]=q[w-B]^L;for(O=0;w;O++,w--)L=q[O&3?w:w-4],w<=4||O<4?X[O]=L:X[O]=k[0][R[L>>>24]]^k[1][R[L>>16&255]]^k[2][R[L>>8&255]]^k[3][R[L&255]]}decrypt(A,w,O,L,R,k){const B=this._key[1];let V=A^B[0],q=L^B[1],X=O^B[2],ce=w^B[3],Z,oe,H;const ee=B.length/4-2;let Fe,ie=4;const Te=this._tables[1],It=Te[0],ti=Te[1],ii=Te[2],si=Te[3],ri=Te[4];for(Fe=0;Fe>>24]^ti[q>>16&255]^ii[X>>8&255]^si[ce&255]^B[ie],oe=It[q>>>24]^ti[X>>16&255]^ii[ce>>8&255]^si[V&255]^B[ie+1],H=It[X>>>24]^ti[ce>>16&255]^ii[V>>8&255]^si[q&255]^B[ie+2],ce=It[ce>>>24]^ti[V>>16&255]^ii[q>>8&255]^si[X&255]^B[ie+3],ie+=4,V=Z,q=oe,X=H;for(Fe=0;Fe<4;Fe++)R[(3&-Fe)+k]=ri[V>>>24]<<24^ri[q>>16&255]<<16^ri[X>>8&255]<<8^ri[ce&255]^B[ie++],Z=V,V=q,q=X,X=ce,ce=Z}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(A){this.jobs.push(A),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(_){return _<<24|(_&65280)<<8|(_&16711680)>>8|_>>>24},o=function(_,A,w){const O=new Int32Array(_.buffer,_.byteOffset,_.byteLength>>2),L=new r(Array.prototype.slice.call(A)),R=new Uint8Array(_.byteLength),k=new Int32Array(R.buffer);let B,V,q,X,ce,Z,oe,H,ee;for(B=w[0],V=w[1],q=w[2],X=w[3],ee=0;ee{const O=_[w];T(O)?A[w]={bytes:O.buffer,byteOffset:O.byteOffset,byteLength:O.byteLength}:A[w]=O}),A};self.onmessage=function(_){const A=_.data,w=new Uint8Array(A.encrypted.bytes,A.encrypted.byteOffset,A.encrypted.byteLength),O=new Uint32Array(A.key.bytes,A.key.byteOffset,A.key.byteLength/4),L=new Uint32Array(A.iv.bytes,A.iv.byteOffset,A.iv.byteLength/4);new l(w,O,L,function(R,k){self.postMessage(D({source:A.source,decrypted:k}),[k.buffer])})}}));var sC=_p(iC);const rC=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Np=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Oo=(i,e)=>{e.activePlaylistLoader=i,i.load()},nC=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,Np(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),Oo(a.playlistLoader,r)}},aC=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},oC=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,d=n.lastTrack_;if(!(d&&a&&d.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,Np(s,n),!!o)){if(o.isMainPlaylist){if(!a||!d||a.id===d.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${d.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Oo(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Oo(o.playlistLoader,n)}},Ln={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}P.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;P.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},ld={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Ln[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Ln[i](i,t))}},uC={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:d}},mainPlaylistLoader:m}=e,y=yr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const E in a[i][T]){let D=a[i][T][E],_;if(y?(d(`AUDIO group '${T}' label '${E}' is a main playlist`),D.isMainPlaylist=!0,_=null):s==="vhs-json"&&D.playlists?_=new ji(D.playlists[0],t,n):D.resolvedUri?_=new ji(D.resolvedUri,t,n):D.playlists&&s==="dash"?_=new wo(D.playlists[0],t,n,m):_=null,D=se({id:E,playlistLoader:_},D),ld[i](i,D.playlistLoader,e),o[T].push(D),typeof l[E]>"u"){const A=new P.AudioTrack({id:E,kind:rC(D),enabled:!1,language:D.language,default:D.default,label:E});l[E]=A}}}r.on("error",Ln[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:d}},mainPlaylistLoader:m}=e;for(const y in o[i]){l[y]||(l[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let E=o[i][y][T],D;if(r==="hls")D=new ji(E.resolvedUri,s,a);else if(r==="dash"){if(!E.playlists.filter(A=>A.excludeUntil!==1/0).length)return;D=new wo(E.playlists[0],s,a,m)}else r==="vhs-json"&&(D=new ji(E.playlists?E.playlists[0]:E.resolvedUri,s,a));if(E=se({id:T,playlistLoader:D},E),ld[i](i,E.playlistLoader,e),l[y].push(E),typeof d[T]>"u"){const _=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;d[T]=_}}}n.on("error",Ln[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const l=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const d=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[m.instreamId]&&(m=se(m,d[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(se({id:o},l)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},Mp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&yr(e.main))for(let l=0;l"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},cC={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},dC=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},hC=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(d=>{uC[d](d,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(d=>{e[d].activeGroup=lC(d,i),e[d].activeTrack=cC[d](d,i),e[d].onGroupChanged=nC(d,i),e[d].onGroupChanging=aC(d,i),e[d].onTrackChanged=oC(d,i),e[d].getActiveGroup=dC(d,i)});const o=e.AUDIO.activeGroup();if(o){const d=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[d].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(d=>e[d].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const d in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[d])},fC=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Nt,activeTrack:Nt,getActiveGroup:Nt,onGroupChanged:Nt,onTrackChanged:Nt,lastTrack_:null,logger_:ct(`MediaGroups[${e}]`)}}),i};class cd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Xe(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class pC extends P.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new cd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ct("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Xe(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:s}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(a.status===429){const d=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${d} seconds.`),this.startTTLTimeout_(parseInt(d,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(d){const m={errorType:P.Error.StreamingContentSteeringParserError,error:d};this.trigger({type:"error",metadata:m})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new x.URL(e),s=new x.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(x.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new x.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=x.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){x.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new cd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Xe(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const mC=10;let Ot;const gC=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],yC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},_C=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return P.log.warn("We received no playlist to switch to. Please check your stream."),!1;const d=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return l(`${d} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!qi(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${d} as current playlist is live`),!0);const y=Iu(e,t),T=o?Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ie.MAX_BUFFER_LOW_WATER_LINE;if(aD)&&y>=r){let _=`${d} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(_+=` and next bandwidth > current bandwidth (${E} > ${D})`),l(_),!0}return l(`not ${d} as no switching criteria met`),!1};class vC extends P.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:d,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:D,experimentalUseMMS:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=e;(A===null||typeof A>"u")&&(A=1/0),Ot=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=d,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=fC(),_&&x.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new x.ManagedMediaSource,P.log("Using ManagedMediaSource")):x.MediaSource&&(this.mediaSource=new x.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=Re(),this.hasPlayed_=!1,this.syncController_=new eC(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new sC,this.sourceUpdater_=new Op(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new tC,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:D,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new wo(t,this.vhs_,se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new ji(t,this.vhs_,se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Po(se(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Po(se(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new XE(se(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((R,k)=>{function B(){r.off("vttjserror",V),R()}function V(){r.off("vttjsloaded",B),k()}r.one("vttjsloaded",B),r.one("vttjserror",V),r.addWebVttScript_()})}),e);const O=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new pC(this.vhs_.xhr,O),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),gC.forEach(R=>{this[R+"_"]=yC.bind(this,R)}),this.logger_=ct("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{const R=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-R,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=x.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(x.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const l=s[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let d=0;d{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;xo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),hC({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let s;if(this.enableLowInitialPlaylist&&(s=this.selectInitialPlaylist()),s||(s=this.selectPlaylist()),!s||!this.shouldSwitchToMedia_(s)||(this.initialMedia_=s,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),s=t.targetDuration*1.5*1e3;xo(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=s,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,s=>{this.player_.trigger(ve({},s))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Ot.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return _C({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const s=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:s.playlist,error:s})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const s=this.audioSegmentLoader_.pendingSegment_;if(!s||!s.segment||!s.segment.syncInfo)return;const r=s.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",s=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:mC}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const s=this.getCodecsOrExclude_();s&&this.sourceUpdater_.addOrChangeSourceBuffers(s)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(s=>{this.mainSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.audioSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))}),this.subtitleSegmentLoader_.on(s,r=>{this.player_.trigger(ve({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Ot.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=St;const o=a.end(a.length-1);return o-n<=St&&r-o<=St}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(na),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return P.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const D=this.pathwayAttribute_(e),_=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(D),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(D)},_);return}let E=!1;r.forEach(D=>{if(D===e)return;const _=D.excludeUntil;typeof _<"u"&&_!==1/0&&(E=!0,delete D.excludeUntil)}),E&&(P.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const d=t.internal?this.logger_:P.log.warn,m=t.message?" "+t.message:"";d(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=l.targetDuration/2*1e3||5*1e3,T=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=y;return this.switchMedia_(l,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=qi(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Ot.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Ot.Playlist.seekable(t,s,Ot.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Ot.Playlist.seekable(t,s,Ot.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;if(this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Re([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Js(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||Bb),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||zl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||zl,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(d,m)=>d?Gs(m):Ba(m),o={};let l;if(["video","audio"].forEach(function(d){if(r.hasOwnProperty(d)&&!a(e[d].isFmp4,r[d])){const m=e[d].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[d]),d==="audio"&&(l=m)}}),n&&l&&t.attributes.AUDIO){const d=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===d&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${d} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const d=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:d},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const d=[];if(["video","audio"].forEach(m=>{const y=(_t(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(_t(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&d.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),d.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${d.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Js(this.main,r),a=[];n.audio&&!Ba(n.audio)&&!Gs(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Ba(n.video)&&!Gs(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=In(_t(e)),n=Qc(r),a=r.video&&_t(r.video)[0]||null,o=r.audio&&_t(r.audio)[0]||null;Object.keys(s).forEach(l=>{const d=s[l];if(t.indexOf(d.id)!==-1||d.excludeUntil===1/0)return;t.push(d.id);const m=[],y=Js(this.mainPlaylistLoader_.main,d),T=Qc(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const E=y.video&&_t(y.video)[0]||null,D=y.audio&&_t(y.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${E.type}" !== "${a.type}"`),D&&o&&D.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${D.type}" !== "${o.type}"`)}m.length&&(d.excludeUntil=1/0,this.logger_(`excluding ${d.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),QE(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Ie.GOAL_BUFFER_LENGTH,s=Ie.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Ie.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Ie.BUFFER_LOW_WATER_LINE,s=Ie.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Ie.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Ie.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Ie.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){ed(this.inbandTextTracks_,"com.apple.streaming",this.tech_),kE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();ed(this.inbandTextTracks_,e,this.tech_),DE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,s=>{this.trigger(ve({},s))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],l=this.pathwayAttribute_(o),d=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!d&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&d&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=s.get(a);if(!l){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&l&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,P.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:WE(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const TC=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Lu(r),a=na(r);if(typeof s>"u")return a;s?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return s!==a&&!n&&(t(r),s?i.trigger({type:"renditionenabled",metadata:o}):i.trigger({type:"renditiondisabled",metadata:o})),s};class bC{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Js(r.main(),t),this.playlist=t,this.id=s,this.enabled=TC(e.playlists,t.id,n)}}const SC=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=yr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Lu(s)).map((s,r)=>new bC(i,s,s.id)):[]}},dd=["seeking","seeked","pause","playing","error"];class xC extends P.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=ct("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(m=>{l[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",l[m].reset),this.tech_.on(["seeked","seeking"],l[m].reset)});const d=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),d("off"))},this.clearSeekingAppendCheck_=()=>d("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),d("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(dd,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(dd,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",l[m].reset),this.tech_.off(["seeked","seeking"],l[m].reset)}),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&x.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=x.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=lx(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:mi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+St>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Re([this.lastRecordedTime,e]));const s={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:s}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const D=t.start(0);n=D+(D===t.end(0)?0:St)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${Kf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,d=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-bt)*2,T=[l,d];for(let D=0;D ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Yr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+St;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const EC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},Bp=function(i,e){let t=0,s=0;const r=se(EC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ge,i,{get(){return P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Ie[i]},set(e){if(P.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){P.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Ie[i]=e}})});const Up="videojs-vhs",$p=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),$p(i,e.playlists)};ge.canPlaySource=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const PC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=In(_t(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Qi(s.video),n=Qi(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return se(i,a)},LC=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),OC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=LC(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((d,m)=>{i.tech_.one("keysessioncreated",d)})),a.push(new Promise((d,m)=>{i.eme.initializeMediaKeys({keySystems:l},y=>{if(y){m(y);return}d()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},RC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=PC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(P.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},qp=()=>{if(!x.localStorage)return null;const i=x.localStorage.getItem(Up);if(!i)return null;try{return JSON.parse(i)}catch{return null}},NC=i=>{if(!x.localStorage)return!1;let e=qp();e=e?se(e,i):i;try{x.localStorage.setItem(Up,JSON.stringify(e))}catch{return!1}return e},MC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,jp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},Vp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Hp=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},zp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!U||!U.createElement)return!1;const i=U.createElement("video");return P.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!U||!U.createElement||!P.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(U.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return P.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){jp(ge.xhr,i)};ge.xhr.onResponse=function(i){Vp(ge.xhr,i)};ge.xhr.offRequest=function(i){Hp(ge.xhr,i)};ge.xhr.offResponse=function(i){zp(ge.xhr,i)};const BC=P.getComponent("Component");class Gp extends BC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ct("VhsHandler"),t.options_&&t.options_.playerId){const r=P.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(U,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=U.fullscreenElement||U.webkitFullscreenElement||U.mozFullScreenElement||U.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=se(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!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,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=qp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Ie.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ie.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=MC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=Bd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new vC(this.options_);const s=se({liveRangeSafeTimeDelta:St},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new xC(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=P.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=x.navigator.connection||x.navigator.mozConnection||x.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){P.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>mi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>mi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&NC({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{SC(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=x.URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),OC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=RC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=P.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{IC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{$p(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Fp,"mux.js":DC,"mpd-parser":AC,"m3u8-parser":wC,"aes-decrypter":kC}}version(){return this.constructor.version()}canChangeType(){return Op.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&x.URL.revokeObjectURL&&(x.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return $x({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return gp({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{jp(this.xhr,e)},this.xhr.onResponse=e=>{Vp(this.xhr,e)},this.xhr.offRequest=e=>{Hp(this.xhr,e)},this.xhr.offResponse=e=>{zp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(s=>{this.playlistController_.on(s,r=>{this.player_.trigger(ve({},r))})}),t.forEach(s=>{this.playbackWatcher_.on(s,r=>{this.player_.trigger(ve({},r))})})}}const On={name:"videojs-http-streaming",VERSION:Fp,canHandleSource(i,e={}){const t=se(P.options,e);return!t.vhs.experimentalUseMMS&&!Gs("avc1.4d400d,mp4a.40.2",!1)?!1:On.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=se(P.options,t);return e.vhs=new Gp(i,e,s),e.vhs.xhr=dp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Bd(i);if(!t)return"";const s=On.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(P.browser.IS_ANY_SAFARI||P.browser.IS_IOS),{overrideNative:s=t}=e;return s}},FC=()=>Gs("avc1.4d400d,mp4a.40.2",!0);FC()&&P.getTech("Html5").registerSourceHandler(On,0);P.VhsHandler=Gp;P.VhsSourceHandler=On;P.Vhs=ge;P.use||P.registerComponent("Vhs",ge);P.options.vhs=P.options.vhs||{};(!P.getPlugin||!P.getPlugin("reloadSourceOnError"))&&P.registerPlugin("reloadSourceOnError",CC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function Rn(){return Rn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var VC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new x.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),l=0;l"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(E,D){if(s.keySystem=a.keySystem,T=fd(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){E(a);return}T.getCertificate(o,function(_,A){if(_){D(_);return}y=A,E()})}).then(function(){return a.createMediaKeys()}).then(function(E){return WC({player:t,video:s,certificate:y,createdMediaKeys:E})}).catch(function(E){return E?Promise.reject(E):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var E=fd(s.keySystem,o.keySystems[s.keySystem]),D=E.getLicense;return GC({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?YC(D,d):null,removeSession:l,eventBus:d})})},Bu="com.apple.fps.1_0",JC=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=UC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),l=new Uint8Array(a,n,t.byteLength);l.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var d=new Uint16Array(a,n,s.length);d.set(s),n+=d.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},ZC=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,l=e.eventBus;return new Promise(function(d,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new x.WebKitMediaKeys(Bu))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",JC({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}l.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(E,D){if(l&&l.trigger("licenserequestattempted"),E){m(E);return}y.update(new Uint8Array(D))})}),y.addEventListener("webkitkeyadded",function(){d()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},eD=function(e){return function(t,s){var r=aa(t.emeHeaders,e.certificateHeaders);P.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},cs(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},tD=function(e,t){return qC($C(t))},iD=function(e){return function(t,s,r,n){var a=aa({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);P.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},cs(n,!0))}},sD=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Bu],o=a.getCertificate||eD(a),l=a.getContentId||tD,d=a.getLicense||iD(a);return new Promise(function(m,y){o(r,function(T,E){if(T){y(T);return}m(E)})}).then(function(m){return ZC({video:t,cert:m,initData:s,getLicense:d,options:r,contentId:l(r,s),eventBus:n})})},Vi="com.microsoft.playready",rD=function(e,t,s,r){var n=e.keySystems[Vi];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,l){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(l)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(l,d){if(r&&r.trigger("licenserequestattempted"),l){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(d))};n.getLicense?n.getLicense(e,s.message.buffer,a):Wp(n,s.message.buffer,e,a)},nD=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){rD(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},aD=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new x.MSMediaKeys(Vi))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}nD(e,t,s,r)},oD="3.11.2",uD=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function gd(i,e){if(i==null)return{};var t=gD(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var yD="1.14.0";const _D=P.getComponent("player");class vD extends _D{constructor(e,t,s){t=P.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}P.registerComponent("player",vD);const te=P;te.VERSION={pillarbox:yD,videojs:P.VERSION,[P.VhsSourceHandler.name]:P.VhsSourceHandler.VERSION,eme:P.getPlugin("eme").VERSION};te.options.enableSmoothSeeking=!0;te.options.fill=!0;te.options.html5={vhs:{useForcedSubtitles:!0}};te.options.liveTracker={trackingThreshold:120,liveTolerance:15};te.options.liveui=!0;te.options.playsinline=!0;te.options.responsive=!0;te.options.trackers={};class yd{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=Fi(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Mi={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},en={JPG:"jpg",WEBP:"webp",PNG:"png"},TD="https://il.srgssr.ch/images/";class bD{static scale({url:e,width:t=Mi.WIDTH_960,format:s=en.JPG}={},r=TD){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return en.JPG}static get PNG(){return en.PNG}static get WEBP(){return en.WEBP}static get WIDTH_240(){return Mi.WIDTH_240}static get WIDTH_320(){return Mi.WIDTH_320}static get WIDTH_480(){return Mi.WIDTH_480}static get WIDTH_960(){return Mi.WIDTH_960}static get WIDTH_1920(){return Mi.WIDTH_1920}}const SD={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class ar{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=ar.vendors[s.type];if(ar.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return SD}}const tn={AKAMAI:"AKAMAI",NONE:"NONE"};class bi{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return tn.AKAMAI}static hasToken(e){return e.some(t=>bi.isAkamai(t.tokenType))}static isAkamai(e){return tn.AKAMAI===e}static isNone(e){return tn.NONE===e}static get NONE(){return tn.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=bi.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((l,d)=>s.searchParams.set(d,l)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=bi.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const _d="emptied",vd="ended",Td="loadeddata",bd="loadstart",to="pause",xD="play",io="playing",Sd="ratechange",xd="seeking",so="timeupdate",Ed="waiting";class fi{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(_d,this.emptiedListener),this.player.off(vd,this.endedListener),this.player.off(bd,this.loadstartListener),this.player.off(Td,this.loadeddataListener),this.player.off(io,this.playListener),this.player.off(to,this.pauseListener),this.player.off(Sd,this.rateChangeListener),this.player.off(xd,this.seekingListener),this.player.off(so,this.timeUpdateListener),this.player.off(Ed,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=fi.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:fi.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[xD,to].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(_d,this.emptiedListener),this.player.on(vd,this.endedListener),this.player.on(bd,this.loadstartListener),this.player.on(Td,this.loadeddataListener),this.player.on(io,this.playListener),this.player.on(to,this.pauseListener),this.player.on(Sd,this.rateChangeListener),this.player.on(xd,this.seekingListener),this.player.on(so,this.timeUpdateListener),this.player.on(Ed,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&&ethis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===fi.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=fi.now()),this.mediaSession===0&&(this.mediaSession=fi.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),te.browser.IS_ANY_SAFARI?this.player.one(so,e):this.player.one(io,e)}}class Ce{constructor(e,{playerName:t="none",playerVersion:s="none",platform:r="Web",schemaVersion:n=1,heartbeatInterval:a=3e4,beaconUrl:o="https://monitoring.pillarbox.ch/api/events"}={}){this.player=e,this.playerName=t,this.playerVersion=s,this.platform=r,this.schemaVersion=n,this.heartbeatInterval=a,this.beaconUrl=o,this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=void 0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.tokenRequestTime=0,this.addListeners()}addListeners(){this.bindCallBacks(),this.player.on("loadstart",this.loadStart),this.player.on("loadeddata",this.loadedData),this.player.on("playing",this.playbackStart),this.player.on("pause",this.playbackStop),this.player.on("error",this.error),this.player.on(["playerreset","dispose","ended"],this.sessionStop),this.player.on(["waiting","stalled"],this.stalled),window.addEventListener("beforeunload",this.sessionStop)}bandwidth(){const e=this.player.tech(!0).vhs?this.player.tech(!0).vhs.stats:void 0;return e?e.bandwidth:void 0}bindCallBacks(){this.error=this.error.bind(this),this.loadedData=this.loadedData.bind(this),this.loadStart=this.loadStart.bind(this),this.playbackStart=this.playbackStart.bind(this),this.playbackStop=this.playbackStop.bind(this),this.stalled=this.stalled.bind(this),this.sessionStop=this.sessionStop.bind(this)}bufferDuration(){const e=this.player.buffered();let t=0;for(let s=0;ss==="metadata"&&t==="segment-metadata")||{};return e?e.value:void 0}currentResource(){let{bandwidth:e,uri:t}=this.currentRepresentation()||{};if(te.browser.IS_ANY_SAFARI){const{configuration:s}=Array.from(this.player.videoTracks()).find(r=>r.selected)||{};e=s?s.bitrate:void 0,t=this.player.currentSource().src}return{bitrate:e,url:t}}currentSourceMediaData(){return this.player.currentSource().mediaData?this.player.currentSource().mediaData:{}}error(){const e=this.player.error(),t=this.playbackPosition(),s=this.currentRepresentation(),r=s?s.uri:this.player.currentSource().src;this.player.hasStarted()||this.sendEvent("START",this.startEventData()),this.sendEvent("ERROR",we(we({log:JSON.stringify(e.metadata||te.log.history().slice(-15)),message:e.message,name:e.code},t),{},{url:r})),this.reset()}getDrmRequestDuration(){const e=Object.values(this.player.currentSource().keySystems||{}).map(s=>s.url);if(!e.length)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="xmlhttprequest"&&e.includes(r)).pop();return t&&t.duration}getMetadataInfo(e){const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes(e)).pop();return t?{name:t.name,duration:t.duration}:{}}getTokenRequestDuration(e){if(!e)return;const t=performance.getEntriesByType("resource").filter(({initiatorType:s,name:r})=>s==="fetch"&&r.includes("/akahd/token")).pop();return t&&t.duration}heartbeat(){this.heartbeatIntervalId=setInterval(()=>{this.sendEvent("HEARTBEAT",this.statusEventData())},this.heartbeatInterval)}isTrackerDisabled(){const e=this.player.currentSource();return Array.isArray(e.disableTrackers)?!!e.disableTrackers.find(t=>t.toLowerCase()===Ce.name.toLowerCase()):!!e.disableTrackers}loadedData(){this.sendEvent("START",this.startEventData()),this.sendEvent("HEARTBEAT",this.statusEventData()),this.heartbeat()}loadStart(){!Object.keys(this.currentSourceMediaData()).length&&this.currentSessionId&&(this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp()),this.loadStartTimestamp=Ce.timestamp()}mediaInfo(){return{asset_url:this.mediaAssetUrl,id:this.mediaId,metadata_url:this.mediaMetadataUrl,origin:this.mediaOrigin}}playbackDuration(){return this.lastPlaybackStartTimestamp?Ce.timestamp()+this.lastPlaybackDuration-this.lastPlaybackStartTimestamp:this.lastPlaybackDuration}playbackPosition(){const e=this.currentRepresentation(),t=Ce.secondsToMilliseconds(this.player.currentTime());let s;if(e&&(s=e.programDateTime),te.browser.IS_ANY_SAFARI){const r=Date.parse(this.player.$("video").getStartDate());s=isNaN(r)?void 0:r+t}return{position:t,position_timestamp:s}}playbackStart(){this.lastPlaybackStartTimestamp=Ce.timestamp()}playbackStop(){this.lastPlaybackDuration+=Ce.timestamp()-this.lastPlaybackStartTimestamp,this.lastPlaybackStartTimestamp=0}playerCurrentDimensions(){return this.player.currentDimensions()}playerInfo(){return{name:this.playerName,version:this.playerVersion,platform:this.platform}}qoeTimings(e,t){return{metadata:this.metadataRequestTime,asset:e,total:t-this.sessionStartTimestamp}}qosTimings(e){return{asset:e,drm:this.getDrmRequestDuration(),metadata:this.metadataRequestTime,token:this.tokenRequestTime}}removeListeners(){this.player.off("loadstart",this.loadStart),this.player.off("loadeddata",this.loadedData),this.player.off("playing",this.playbackStart),this.player.off("pause",this.playbackStop),this.player.off("error",this.error),this.player.off(["playerreset","dispose","ended"],this.sessionStop),this.player.off(["waiting","stalled"],this.stalled),window.removeEventListener("beforeunload",this.sessionStop)}removeTokenFromAssetUrl(e){if(e)try{const t=new URL(e);return t.searchParams.delete("hdnts"),t.href}catch{return}}reset(e){this.currentSessionId=void 0,this.lastPlaybackDuration=0,this.lastPlaybackStartTimestamp=0,this.lastStallCount=0,this.lastStallDuration=0,this.loadStartTimestamp=0,this.metadataRequestTime=0,this.mediaAssetUrl=void 0,this.mediaId=void 0,this.mediaMetadataUrl=void 0,this.mediaOrigin=void 0,this.sessionStartTimestamp=void 0,this.tokenRequestTime=0,clearInterval(this.heartbeatIntervalId),e&&!["ended","playerreset"].includes(e.type)&&this.removeListeners()}sendEvent(e,t={}){if(this.isTrackerDisabled()&&!this.currentSessionId||!this.currentSessionId)return;const s=JSON.stringify({event_name:e,session_id:this.currentSessionId,timestamp:Ce.timestamp(),version:this.schemaVersion,data:t});navigator.sendBeacon(this.beaconUrl,s)}sessionStart(){this.sessionStartTimestamp&&this.sessionStop(),this.sessionStartTimestamp=Ce.timestamp(),this.mediaId=this.player.currentSource().src||void 0}sessionStop(e){this.sendEvent("STOP",this.statusEventData()),this.reset(e)}stalled(){if(!this.player.hasStarted()||this.player.seeking()||this.isStalled)return;this.isStalled=!0;const e=Ce.timestamp(),t=()=>{const s=Ce.timestamp();this.isStalled=!1,this.lastStallCount+=1,this.lastStallDuration+=s-e};te.browser.IS_ANY_SAFARI?this.player.one("timeupdate",t):this.player.one("playing",t)}stallInfo(){return{count:this.lastStallCount,duration:this.lastStallDuration}}statusEventData(){const e=this.bandwidth(),t=this.bufferDuration(),{bitrate:s,url:r}=this.currentResource(),{droppedVideoFrames:n}=this.player.getVideoPlaybackQuality(),a=this.playbackDuration(),{position:o,position_timestamp:l}=this.playbackPosition(),d=isFinite(this.player.duration())?"On-demand":"Live",m=this.stallInfo();return{bandwidth:e,bitrate:s,buffered_duration:t,frame_drops:n,playback_duration:a,position:o,position_timestamp:l,stall:m,stream_type:d,url:r}}startEventData(){const e=Ce.timestamp(),t=this.loadStartTimestamp?e-this.loadStartTimestamp:0;return this.isTrackerDisabled()||(this.currentSessionId=Ce.sessionId()),this.mediaAssetUrl=this.removeTokenFromAssetUrl(this.player.currentSource().src),this.mediaMetadataUrl=this.getMetadataInfo(this.mediaId).name,this.metadataRequestTime=this.getMetadataInfo(this.mediaId).duration,this.mediaOrigin=window.location.href,this.tokenRequestTime=this.getTokenRequestDuration(this.currentSourceMediaData().tokenType),{browser:Ce.userAgent(),device:{id:Ce.deviceId()},media:this.mediaInfo(),player:this.playerInfo(),qoe_timings:this.qoeTimings(t,e),qos_timings:this.qosTimings(t),screen:this.playerCurrentDimensions()}}static sessionId(){return Ce.randomUUID()}static deviceId(){if(!localStorage)return;const e="pillarbox_device_id";let t=localStorage.getItem(e);return t||(t=Ce.randomUUID(),localStorage.setItem(e,t)),t}static randomUUID(){return crypto.randomUUID?crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static secondsToMilliseconds(e){return parseInt(e*1e3)}static timestamp(){return Date.now()}static userAgent(){return{user_agent:navigator.userAgent}}}class ED{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return we(we(we({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return we(we(we({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var Jp="Wiedergabe",Zp="Pause",em="Erneut abspielen",tm="Dauer",im="LIVE",sm="Geladen",rm="Status",nm="Vollbild",am="Stumm schalten",om="Ton einschalten",um="Untertitel",lm="Untertitel",cm="Kapitel",dm="Schließen",hm="Beschreibungen",fm="Schrift",pm="Weiß",mm="Schwarz",gm="Rot",ym="Grün",_m="Blau",vm="Gelb",Tm="Magenta",bm="Türkis",Sm="Hintergrund",xm="Fenster",Em="Durchsichtig",Cm="Undurchsichtig",Dm="Kein",Am="Erhoben",wm="Gedrückt",km="Uniform",Im="Zwanglos",Pm="Schreibschrift",Lm="Zurücksetzen",Om="Fertig",Rm="Farbe",Nm="Deckkraft",CD={Play:Jp,Pause:Zp,Replay:em,"Current Time":"Aktueller Zeitpunkt",Duration:tm,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:im,Loaded:sm,Progress:rm,Fullscreen:nm,"Exit Fullscreen":"Vollbildmodus beenden",Mute:am,Unmute:om,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:um,"subtitles off":"Untertitel aus",Captions:lm,"captions off":"Untertitel aus",Chapters:cm,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:dm,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:hm,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:fm,White:pm,Black:mm,Red:gm,Green:ym,Blue:_m,Yellow:vm,Magenta:Tm,Cyan:bm,Background:Sm,Window:xm,Transparent:Em,"Semi-Transparent":"Halbdurchsichtig",Opaque:Cm,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:Dm,Raised:Am,Depressed:wm,Uniform:km,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Im,Script:Pm,"Small Caps":"Small-Caps",Reset:Lm,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:Om,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Rm,Opacity:Nm,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},DD=Object.freeze({__proto__:null,Background:Sm,Black:mm,Blue:_m,Captions:lm,Casual:Im,Chapters:cm,Close:dm,Color:Rm,Cyan:bm,Depressed:wm,Descriptions:hm,Done:Om,Duration:tm,Fullscreen:nm,Green:ym,LIVE:im,Loaded:sm,Magenta:Tm,Mute:am,None:Dm,Opacity:Nm,Opaque:Cm,Pause:Zp,Play:Jp,Progress:rm,Raised:Am,Red:gm,Replay:em,Reset:Lm,Script:Pm,Subtitles:um,Text:fm,Transparent:Em,Uniform:km,Unmute:om,White:pm,Window:xm,Yellow:vm,default:CD}),Mm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",Bm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",Fm="Die Werbung wurde übersprungen.",Um="Dieser Inhalt ist nicht mehr verfügbar.",$m="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",qm="Dieser Inhalt steht aus publizistischen Gründen vorübergehend nicht zur Verfügung.",jm="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",Vm="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",Hm="Dieser Inhalt ist nicht verfügbar.",AD={AGERATING12:Mm,AGERATING18:Bm,COMMERCIAL:Fm,ENDDATE:Um,GEOBLOCK:$m,JOURNALISTIC:qm,LEGAL:jm,STARTDATE:Vm,UNKNOWN:Hm},wD=Object.freeze({__proto__:null,AGERATING12:Mm,AGERATING18:Bm,COMMERCIAL:Fm,ENDDATE:Um,GEOBLOCK:$m,JOURNALISTIC:qm,LEGAL:jm,STARTDATE:Vm,UNKNOWN:Hm,default:AD});te.addLanguage("de",we(we({},DD),wD));var zm="Play",Gm="Pause",Wm="Replay",Km="Duration",Xm="LIVE",Ym="Loaded",Qm="Progress",Jm="Fullscreen",Zm="Mute",eg="Unmute",tg="Subtitles",ig="Captions",sg="Chapters",rg="Descriptions",ng="Close",ag="Text",og="White",ug="Black",lg="Red",cg="Green",dg="Blue",hg="Yellow",fg="Magenta",pg="Cyan",mg="Background",gg="Window",yg="Transparent",_g="Opaque",vg="None",Tg="Raised",bg="Depressed",Sg="Uniform",xg="Casual",Eg="Script",Cg="Reset",Dg="Done",Ag="Color",wg="Opacity",kD={"Audio Player":"Audio Player","Video Player":"Video Player",Play:zm,Pause:Gm,Replay:Wm,"Current Time":"Current Time",Duration:Km,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:Xm,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:Ym,Progress:Qm,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:Jm,"Exit Fullscreen":"Exit Fullscreen",Mute:Zm,Unmute:eg,"Playback Rate":"Playback Rate",Subtitles:tg,"subtitles off":"subtitles off",Captions:ig,"captions off":"captions off",Chapters:sg,Descriptions:rg,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:ng,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:ag,White:og,Black:ug,Red:lg,Green:cg,Blue:dg,Yellow:hg,Magenta:fg,Cyan:pg,Background:mg,Window:gg,Transparent:yg,"Semi-Transparent":"Semi-Transparent",Opaque:_g,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:vg,Raised:Tg,Depressed:bg,Uniform:Sg,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:xg,Script:Eg,"Small Caps":"Small Caps",Reset:Cg,"restore all settings to the default values":"restore all settings to the default values",Done:Dg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:Ag,Opacity:wg,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},ID=Object.freeze({__proto__:null,Background:mg,Black:ug,Blue:dg,Captions:ig,Casual:xg,Chapters:sg,Close:ng,Color:Ag,Cyan:pg,Depressed:bg,Descriptions:rg,Done:Dg,Duration:Km,Fullscreen:Jm,Green:cg,LIVE:Xm,Loaded:Ym,Magenta:fg,Mute:Zm,None:vg,Opacity:wg,Opaque:_g,Pause:Gm,Play:zm,Progress:Qm,Raised:Tg,Red:lg,Replay:Wm,Reset:Cg,Script:Eg,Subtitles:tg,Text:ag,Transparent:yg,Uniform:Sg,Unmute:eg,White:og,Window:gg,Yellow:hg,default:kD}),kg="To protect children this content is only available between 8PM and 6AM.",Ig="To protect children this content is only available between 10PM and 5AM.",Pg="This commercial content is not available.",Lg="This content is not available anymore.",Og="This content is not available outside Switzerland.",Rg="This content is temporarily unavailable for journalistic reasons.",Ng="This content is not available due to legal restrictions.",Mg="This content is not available yet.",Bg="This content is not available.",PD={AGERATING12:kg,AGERATING18:Ig,COMMERCIAL:Pg,ENDDATE:Lg,GEOBLOCK:Og,JOURNALISTIC:Rg,LEGAL:Ng,STARTDATE:Mg,UNKNOWN:Bg},LD=Object.freeze({__proto__:null,AGERATING12:kg,AGERATING18:Ig,COMMERCIAL:Pg,ENDDATE:Lg,GEOBLOCK:Og,JOURNALISTIC:Rg,LEGAL:Ng,STARTDATE:Mg,UNKNOWN:Bg,default:PD});te.addLanguage("en",we(we({},ID),LD));var Fg="Lecture",Ug="Pause",$g="Revoir",qg="Durée",jg="EN DIRECT",Vg="Chargé",Hg="Progression",zg="Plein écran",Gg="Mettre en sourdine",Wg="Activer le son",Kg="Sous-titres",Xg="Sous-titres transcrits",Yg="Chapitres",Qg="Descriptions",Jg="Fermer",Zg="Texte",e0="Blanc",t0="Noir",i0="Rouge",s0="Vert",r0="Bleu",n0="Jaune",a0="Magenta",o0="Cyan",u0="Arrière-plan",l0="Fenêtre",c0="Transparent",d0="Opaque",h0="Aucun",f0="Élevé",p0="Enfoncé",m0="Uniforme",g0="Manuscrite",y0="Scripte",_0="Réinitialiser",v0="Terminé",T0="Couleur",b0="Opacité",OD={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:Fg,Pause:Ug,Replay:$g,"Current Time":"Temps actuel",Duration:qg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:jg,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:Vg,Progress:Hg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:zg,"Exit Fullscreen":"Fenêtré",Mute:Gg,Unmute:Wg,"Playback Rate":"Vitesse de lecture",Subtitles:Kg,"subtitles off":"Sous-titres désactivés",Captions:Xg,"captions off":"Sous-titres transcrits désactivés",Chapters:Yg,Descriptions:Qg,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:Jg,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:Zg,White:e0,Black:t0,Red:i0,Green:s0,Blue:r0,Yellow:n0,Magenta:a0,Cyan:o0,Background:u0,Window:l0,Transparent:c0,"Semi-Transparent":"Semi-transparent",Opaque:d0,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:h0,Raised:f0,Depressed:p0,Uniform:m0,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:g0,Script:y0,"Small Caps":"Petites capitales",Reset:_0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:v0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:T0,Opacity:b0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},RD=Object.freeze({__proto__:null,Background:u0,Black:t0,Blue:r0,Captions:Xg,Casual:g0,Chapters:Yg,Close:Jg,Color:T0,Cyan:o0,Depressed:p0,Descriptions:Qg,Done:v0,Duration:qg,Fullscreen:zg,Green:s0,LIVE:jg,Loaded:Vg,Magenta:a0,Mute:Gg,None:h0,Opacity:b0,Opaque:d0,Pause:Ug,Play:Fg,Progress:Hg,Raised:f0,Red:i0,Replay:$g,Reset:_0,Script:y0,Subtitles:Kg,Text:Zg,Transparent:c0,Uniform:m0,Unmute:Wg,White:e0,Window:l0,Yellow:n0,default:OD}),S0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",x0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",E0="Ce contenu n'est actuellement pas disponible.",C0="Ce contenu n'est plus disponible.",D0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",A0="Ce contenu est temporairement indisponible pour des raisons éditoriales.",w0="Pour des raisons juridiques, ce contenu n'est pas disponible.",k0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",I0="Ce contenu n'est actuellement pas disponible.",ND={AGERATING12:S0,AGERATING18:x0,COMMERCIAL:E0,ENDDATE:C0,GEOBLOCK:D0,JOURNALISTIC:A0,LEGAL:w0,STARTDATE:k0,UNKNOWN:I0},MD=Object.freeze({__proto__:null,AGERATING12:S0,AGERATING18:x0,COMMERCIAL:E0,ENDDATE:C0,GEOBLOCK:D0,JOURNALISTIC:A0,LEGAL:w0,STARTDATE:k0,UNKNOWN:I0,default:ND});te.addLanguage("fr",we(we({},RD),MD));var P0="Play",L0="Pausa",O0="Replay",R0="Durata",N0="LIVE",M0="Caricato",B0="Stato",F0="Schermo intero",U0="Disattiva l’audio",$0="Attiva l’audio",q0="Sottotitoli",j0="Sottotitoli non udenti",V0="Capitolo",H0="Descrizioni",z0="Chiudi",G0="Testo",W0="Bianco",K0="Nero",X0="Rosso",Y0="Verde",Q0="Blu",J0="Giallo",Z0="Magenta",ey="Ciano",ty="Sfondo",iy="Finestra",sy="Trasparente",ry="Opaco",ny="Nessuno",ay="Uniforme",oy="Reinizializza",uy="Fatto",ly="Colore",cy="Opacità",BD={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:P0,Pause:L0,Replay:O0,"Current Time":"Orario attuale",Duration:R0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:N0,Loaded:M0,Progress:B0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:F0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:U0,Unmute:$0,"Playback Rate":"Velocità di riproduzione",Subtitles:q0,"subtitles off":"Senza sottotitoli",Captions:j0,"captions off":"Senza sottotitoli non udenti",Chapters:V0,Descriptions:H0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:z0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:G0,White:W0,Black:K0,Red:X0,Green:Y0,Blue:Q0,Yellow:J0,Magenta:Z0,Cyan:ey,Background:ty,Window:iy,Transparent:sy,"Semi-Transparent":"Semi-Trasparente",Opaque:ry,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:ny,Uniform:ay,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:oy,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:uy,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:ly,Opacity:cy,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},FD=Object.freeze({__proto__:null,Background:ty,Black:K0,Blue:Q0,Captions:j0,Chapters:V0,Close:z0,Color:ly,Cyan:ey,Descriptions:H0,Done:uy,Duration:R0,Fullscreen:F0,Green:Y0,LIVE:N0,Loaded:M0,Magenta:Z0,Mute:U0,None:ny,Opacity:cy,Opaque:ry,Pause:L0,Play:P0,Progress:B0,Red:X0,Replay:O0,Reset:oy,Subtitles:q0,Text:G0,Transparent:sy,Uniform:ay,Unmute:$0,White:W0,Window:iy,Yellow:J0,default:BD}),dy="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",hy="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",fy="Questo contenuto commerciale non è disponibile.",py="Questo media non è più disponibile.",my="Questo media non è disponibile fuori dalla Svizzera.",gy="Questo contenuto è temporaneamente non disponibile per motivi editoriali.",yy="Il contenuto non è fruibile a causa di restrizioni legali.",_y="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",vy="Questo media non è disponibile.",UD={AGERATING12:dy,AGERATING18:hy,COMMERCIAL:fy,ENDDATE:py,GEOBLOCK:my,JOURNALISTIC:gy,LEGAL:yy,STARTDATE:_y,UNKNOWN:vy},$D=Object.freeze({__proto__:null,AGERATING12:dy,AGERATING18:hy,COMMERCIAL:fy,ENDDATE:py,GEOBLOCK:my,JOURNALISTIC:gy,LEGAL:yy,STARTDATE:_y,UNKNOWN:vy,default:UD});te.addLanguage("it",we(we({},FD),$D));var Ty="Laschar ir",by="Pausa",Sy="Mussar danovamain",xy="Durada",Ey="LIVE",Cy="Chargià",Dy="Progress",Ay="Entir visur",wy="Senza tun",ky="Cun tun",Iy="Suttitels",Py="Suttitels",Ly="Chapitels",Oy="Descripziuns",Ry="Serrar",Ny="Text",My="Alv",By="Nair",Fy="Cotschn",Uy="Verd",$y="Blau",qy="Mellen",jy="Magenta",Vy="Cyan",Hy="Fund",zy="Fanestra",Gy="Transparent",Wy="Betg transparent",Ky="Nagin",Xy="Auzà",Yy="Sbassà",Qy="Uniform",Jy="Sumbriva",Zy="Casual",e_="Script",t_="Da nov",i_="Fatg",s_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",r_="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",n_="Quest medium commerzial n'è betg disponibel.",a_="Quest cuntegn n'è betg pli disponibel.",o_="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",u_="Quest cuntegn na stat ad interim betg a disposiziun per motivs publicistics.",l_="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",c_="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",d_="Quest cuntegn n'è betg disponibel.",qD={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:Ty,Pause:by,Replay:Sy,"Current Time":"Temp actual",Duration:xy,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:Ey,Loaded:Cy,Progress:Dy,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:Ay,"Non-Fullscreen":"Betg entir visur",Mute:wy,Unmute:ky,"Playback Rate":"Tempo ",Subtitles:Iy,"subtitles off":"senza suttitels",Captions:Py,"captions off":"senza suttitels",Chapters:Ly,Descriptions:Oy,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:Ry,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:Ny,White:My,Black:By,Red:Fy,Green:Uy,Blue:$y,Yellow:qy,Magenta:jy,Cyan:Vy,Background:Hy,Window:zy,Transparent:Gy,"Semi-Transparent":"Mez transparent",Opaque:Wy,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Ky,Raised:Xy,Depressed:Yy,Uniform:Qy,Dropshadow:Jy,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Zy,Script:e_,"Small Caps":"Bustabs pitschens",Reset:t_,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:i_,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:s_,AGERATING18:r_,COMMERCIAL:n_,ENDDATE:a_,GEOBLOCK:o_,JOURNALISTIC:u_,LEGAL:l_,STARTDATE:c_,UNKNOWN:d_},jD=Object.freeze({__proto__:null,AGERATING12:s_,AGERATING18:r_,Background:Hy,Black:By,Blue:$y,COMMERCIAL:n_,Captions:Py,Casual:Zy,Chapters:Ly,Close:Ry,Cyan:Vy,Depressed:Yy,Descriptions:Oy,Done:i_,Dropshadow:Jy,Duration:xy,ENDDATE:a_,Fullscreen:Ay,GEOBLOCK:o_,Green:Uy,JOURNALISTIC:u_,LEGAL:l_,LIVE:Ey,Loaded:Cy,Magenta:jy,Mute:wy,None:Ky,Opaque:Wy,Pause:by,Play:Ty,Progress:Dy,Raised:Xy,Red:Fy,Replay:Sy,Reset:t_,STARTDATE:c_,Script:e_,Subtitles:Iy,Text:Ny,Transparent:Gy,UNKNOWN:d_,Uniform:Qy,Unmute:ky,White:My,Window:zy,Yellow:qy,default:qD});te.addLanguage("rm",we({},jD));const VD=["url","mimeType","keySystems"],HD=["src"];class Q{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&Q.createTextTrack(e,s).then(a=>{n.forEach(o=>{Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){Q.addRemoteTextTracks(e,t.subtitles),Q.addChapters(e,t.urn,t.chapters),Q.addBlockedSegments(e,t.blockedSegments),Q.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&Q.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&Q.createTextTrack(e,s).then(n=>{t.forEach(a=>{Q.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return Q.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return Fi(function*(){return bi.hasToken(e)?bi.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return ar.hasDrm(e)?e.map(s=>we(we({},s),ar.buildKeySystems(s.drmList))):e}static composeMainResources(e){return Q.composeAkamaiResources(Q.composeKeySystemsResources(Q.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=te.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,l=gd(r,VD);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:l}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new te.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new yd(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return Q.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=Q.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return Fi(function*(){Q.pillarboxMonitoring(e)&&Q.pillarboxMonitoring(e).sessionStart();const{src:s}=t,r=gd(t,HD),n=yield Q.getMediaComposition(s,Q.dataProvider(e)),a=yield Q.composeMainResources(n),o=Q.getMediaData(a);return Q.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=Q.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=Q.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return Fi(function*(){try{const r=yield Q.getSrcMediaObj(e,t);return Q.srgAnalytics(e),Q.updateTitleBar(e,r),Q.updatePoster(e,r),Q.blockingReason(e,r)?void 0:(Q.addTextTracks(e,r),s(null,r))}catch(r){return Q.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new fi(e,{debug:e.debug(),playerVersion:te.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static pillarboxMonitoring(e){if(e.options().trackers.pillarboxMonitoring!==!1){if(!e.options().trackers.pillarboxMonitoring){const t=new Ce(e,{debug:e.debug(),playerVersion:te.VERSION.pillarbox,playerName:"Pillarbox"});e.options({trackers:{pillarboxMonitoring:t}})}return e.options().trackers.pillarboxMonitoring}}static updatePoster(e,t,s=bD){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return Q.pillarboxMonitoring(e),Q.cuechangeEventProxy(e),{currentTime:t=>Q.handleCurrentTime(e,t),setCurrentTime:t=>Q.handleSetCurrentTime(e,t),setSource:function(){var t=Fi(function*(s,r){return Q.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}te.use("srgssr/urn",Q.middleware);te.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const zD="1.0.4",GD={"Skip credits":"Abspann überspringen","Skip intro":"Intro überspringen"},WD={"Skip credits":"Skip credits","Skip intro":"Skip intro"},KD={"Skip credits":"Passer","Skip intro":"Passer l’intro"},XD={"Skip credits":"Salta i credits","Skip intro":"Salta l'intro"},YD={"Skip credits":"Sursiglir credentials","Skip intro":"Sursiglir intro"};function _r(i,e){te.addLanguage(i,{...te.options.language[i]??{},...e})}_r("de",GD);_r("en",WD);_r("fr",KD);_r("it",XD);_r("rm",YD);const QD=te.getComponent("Button");class JD extends QD{constructor(t,s){super(t,s);La(this,"activeInterval");La(this,"onTimeIntervalChange_",({data:t})=>this.handleTimeIntervalChange(t));this.player().on("srgssr/interval",this.onTimeIntervalChange_)}dispose(){this.player().off("srgssr/interval",this.onTimeIntervalChange_),super.dispose()}buildCSSClass(){return`${super.buildCSSClass()} pbw-skip-button vjs-hidden vjs-visible-text`}handleClick(t){super.handleClick(t),this.player().currentTime(this.activeInterval.endTime)}handleTimeIntervalChange(t){if(this.activeInterval=t,!this.activeInterval){this.hide();return}const r=JSON.parse(this.activeInterval.text).type==="OPENING_CREDITS"?"Skip intro":"Skip credits";this.controlText(r),this.show()}static get VERSION(){return zD}}te.registerComponent("SkipButton",JD);const oa=new URLSearchParams(location.search),ZD=oa.has("debug"),eA=oa.get("ilHost")||void 0,tA=oa.get("language"),iA=oa.get("urn")||"urn:rts:video:14683290";window.player=te("player",{debug:ZD,language:tA,srgOptions:{dataProviderHost:eA},SkipButton:!0});player.src({src:iA,type:"srgssr/urn",disableTrackers:!0});window.player=player;window.pillarbox=te; diff --git a/pr-preview/pr-36/packages/skip-button/assets/index-BdVXP4qA.css b/pr-preview/pr-36/packages/skip-button/assets/index-BdVXP4qA.css new file mode 100644 index 0000000..a1f89c5 --- /dev/null +++ b/pr-preview/pr-36/packages/skip-button/assets/index-BdVXP4qA.css @@ -0,0 +1 @@ +.vjs-control.vjs-button.pbw-skip-button{position:absolute;bottom:5em;padding-left:1.333em;color:#fff;font-size:1.2em;background-color:#000000b3;cursor:pointer}.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen,.pillarbox-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button,.pillarbox-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:#2b333fb3;border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:#2b333fb3;position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text,.pillarbox-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-js *:not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled,.pillarbox-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:#000c}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{to{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-font,.vjs-text-track-settings .vjs-track-settings-controls{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display: grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-title,.vjs-title-bar-description{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-js>*:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js *:focus:not(.focus-visible),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000} diff --git a/pr-preview/pr-36/packages/skip-button/index.html b/pr-preview/pr-36/packages/skip-button/index.html new file mode 100644 index 0000000..7224383 --- /dev/null +++ b/pr-preview/pr-36/packages/skip-button/index.html @@ -0,0 +1,26 @@ + + + + + + + SkipButton Demo + + + + + + + + +