1import{a as Ef,b as Cf,c as wf}from"./chunk-DXAUS2P7.js";import{a as Oa,b as La}from"./chunk-YILWZMRN.js";import{c as xf,d as Sf}from"./chunk-GWJDHSDW.js";import{a as yf,b as vf,c as bf,d as Tf}from"./chunk-G763VCJM.js";import{e as _f}from"./chunk-XFUXQSHF.js";import{h as gf}from"./chunk-FROBIQNW.js";import{a as nf,d as af,g as of,k as lf}from"./chunk-5PDPWATV.js";import{a as uu}from"./chunk-T5HXKADR.js";import{b as mf}from"./chunk-XLMGLN3O.js";import"./chunk-OVMELZYD.js";import{$ as ff,P as hf,aa as pf,b as ou,ba as ka,ca as Ci,d as lu,h as uf,i as cf,ia as Pa,j as df}from"./chunk-Q4VTMGHU.js";import{c as ef,d as Ia,h as tf,j as rf,k as sf}from"./chunk-A7BDWSTM.js";import{j as Kh,l as Dr,m as Yh,n as Qh,p as Jh,q as Ei,u as Zh}from"./chunk-LEHGBLML.js";import{Ab as ct,Bb as Q,Cb as Vh,Da as Uh,Db as Ea,Eb as oi,Fb as Ji,Ga as $,Gb as $e,Hb as ze,Jb as Cr,K as Nh,Kb as Ge,L as br,La as su,Lb as Ca,M as ba,Mb as qe,Nb as ae,Ob as Ft,Pb as wr,Q as wt,Qb as qh,Ra as Si,Rb as jh,Sa as Ta,Sb as Hh,Tb as $h,V as _e,Va as xa,W as ye,Wb as wa,X as Bh,Xa as ot,Xb as zh,Y as Fh,Yb as Fs,Za as Bs,Zb as Ar,_a as Sa,da as yt,ec as Gh,gb as Nt,gc as Wh,hb as xr,ia as Tr,ib as Sr,lb as Z,mb as te,n as Ns,nb as ie,nc as Aa,ob as lt,pb as ut,pc as Xh,qb as Je,sb as nu,tb as au,ub as Er,vb as $t,vc as Da,wc as Us,zb as Bt}from"./chunk-XP4MA6QS.js";import{e as se,f as Ct}from"./chunk-OXVY4BEJ.js";var zt=se((tA,Rf)=>{"use strict";var Vs;typeof window<"u"?Vs=window:typeof global<"u"?Vs=global:typeof self<"u"?Vs=self:Vs={};Rf.exports=Vs});var du=se((iA,Nf)=>{"use strict";var Mf=Array.prototype.slice;Nf.exports=dT;function dT(i,e){for(("length"in i)||(i=[i]),i=Mf.call(i);i.length;){var t=i.shift(),r=e(t);if(r)return r;t.childNodes&&t.childNodes.length&&(i=Mf.call(t.childNodes).concat(i))}}});var Ff=se((rA,Bf)=>{"use strict";Bf.exports=Ir;function Ir(i,e){if(!(this instanceof Ir))return new Ir(i,e);this.data=i,this.nodeValue=i,this.length=i.length,this.ownerDocument=e||null}Ir.prototype.nodeType=8;Ir.prototype.nodeName="#comment";Ir.prototype.toString=function(){return"[object Comment]"}});var Vf=se((sA,Uf)=>{"use strict";Uf.exports=wi;function wi(i,e){if(!(this instanceof wi))return new wi(i);this.data=i||"",this.length=this.data.length,this.ownerDocument=e||null}wi.prototype.type="DOMTextNode";wi.prototype.nodeType=3;wi.prototype.nodeName="#text";wi.prototype.toString=function(){return this.data};wi.prototype.replaceData=function(e,t,r){var s=this.data,n=s.substring(0,e),a=s.substring(e+t,s.length);this.data=n+r+a,this.length=this.data.length}});var hu=se((nA,qf)=>{"use strict";qf.exports=hT;function hT(i){var e=this,t=i.type;i.target||(i.target=e),e.listeners||(e.listeners={});var r=e.listeners[t];if(r)return r.forEach(function(s){i.currentTarget=e,typeof s=="function"?s(i):s.handleEvent(i)});e.parentNode&&e.parentNode.dispatchEvent(i)}});var fu=se((aA,jf)=>{"use strict";jf.exports=fT;function fT(i,e){var t=this;t.listeners||(t.listeners={}),t.listeners[i]||(t.listeners[i]=[]),t.listeners[i].indexOf(e)===-1&&t.listeners[i].push(e)}});var pu=se((oA,Hf)=>{"use strict";Hf.exports=pT;function pT(i,e){var t=this;if(t.listeners&&t.listeners[i]){var r=t.listeners[i],s=r.indexOf(e);s!==-1&&r.splice(s,1)}}});var Wf=se((lA,Gf)=>{"use strict";Gf.exports=$f;var mT=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function $f(i){switch(i.nodeType){case 3:return mu(i.data);case 8:return"<!--"+i.data+"-->";default:return gT(i)}}function gT(i){var e=[],t=i.tagName;return i.namespaceURI==="http://www.w3.org/1999/xhtml"&&(t=t.toLowerCase()),e.push("<"+t+bT(i)+vT(i)),mT.indexOf(t)>-1?e.push(" />"):(e.push(">"),i.childNodes.length?e.push.apply(e,i.childNodes.map($f)):i.textContent||i.innerText?e.push(mu(i.textContent||i.innerText)):i.innerHTML&&e.push(i.innerHTML),e.push("</"+t+">")),e.join("")}function _T(i,e){var t=typeof i[e];return e==="style"&&Object.keys(i.style).length>0?!0:i.hasOwnProperty(e)&&(t==="string"||t==="boolean"||t==="number")&&e!=="nodeName"&&e!=="className"&&e!=="tagName"&&e!=="textContent"&&e!=="innerText"&&e!=="namespaceURI"&&e!=="innerHTML"}function yT(i){if(typeof i=="string")return i;var e="";
vendor: 4,222 bytes, line 1
1return Object.keys(i).forEach(function(t){var r=i[t];t=t.replace(/[A-Z]/g,function(s){return"-"+s.toLowerCase()}),e+=t+":"+r+";"}),e}function vT(i){var e=i.dataset,t=[];for(var r in e)t.push({name:"data-"+r,value:e[r]});return t.length?zf(t):""}function zf(i){var e=[];return i.forEach(function(t){var r=t.name,s=t.value;r==="style"&&(s=yT(s)),e.push(r+'="'+TT(s)+'"')}),e.length?" "+e.join(" "):""}function bT(i){var e=[];for(var t in i)_T(i,t)&&e.push({name:t,value:i[t]});for(var r in i._attributes)for(var s in i._attributes[r]){var n=i._attributes[r][s],a=(n.prefix?n.prefix+":":"")+s;e.push({name:a,value:n.value})}return i.className&&e.push({name:"class",value:i.className}),e.length?zf(e):""}function mu(i){var e="";return typeof i=="string"?e=i:i&&(e=i.toString()),e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function TT(i){return mu(i).replace(/"/g,""")}});var _u=se((uA,Kf)=>{"use strict";var gu=du(),xT=hu(),ST=fu(),ET=pu(),CT=Wf(),Xf="http://www.w3.org/1999/xhtml";Kf.exports=Se;function Se(i,e,t){if(!(this instanceof Se))return new Se(i);var r=t===void 0?Xf:t||null;this.tagName=r===Xf?String(i).toUpperCase():i,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=e||null,this.namespaceURI=r,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}Se.prototype.type="DOMElement";Se.prototype.nodeType=1;Se.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e};Se.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var r=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[r]=e,e.parentNode=this,t};Se.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e};Se.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var r=t==null?-1:this.childNodes.indexOf(t);return r>-1?this.childNodes.splice(r,0,e):this.childNodes.push(e),e.parentNode=this,e};Se.prototype.setAttributeNS=function(e,t,r){var s=null,n=t,a=t.indexOf(":");if(a>-1&&(s=t.substr(0,a),n=t.substr(a+1)),this.tagName==="INPUT"&&t==="type")this.type=r;else{var l=this._attributes[e]||(this._attributes[e]={});l[n]={value:r,prefix:s}}};Se.prototype.getAttributeNS=function(e,t){var r=this._attributes[e],s=r&&r[t]&&r[t].value;return this.tagName==="INPUT"&&t==="type"?this.type:typeof s!="string"?null:s};Se.prototype.removeAttributeNS=function(e,t){var r=this._attributes[e];r&&delete r[t]};Se.prototype.hasAttributeNS=function(e,t){var r=this._attributes[e];return!!r&&t in r};Se.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)};Se.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)};Se.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)};Se.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)};Se.prototype.removeEventListener=ET;Se.prototype.addEventListener=ST;Se.prototype.dispatchEvent=xT;Se.prototype.focus=function(){};Se.prototype.toString=function(){return CT(this)};Se.prototype.getElementsByClassName=function(e){var t=e.split(" "),r=[];return gu(this,function(s){if(s.nodeType===1){var n=s.className||"",a=n.split(" ");t.every(function(l){return a.indexOf(l)!==-1})&&r.push(s)}}),r};Se.prototype.getElementsByTagName=function(e){e=e.toLowerCase();var t=[];return gu(this.childNodes,function(r){r.nodeType===1&&(e==="*"||r.tagName.toLowerCase()===e)&&t.push(r)}),t};Se.prototype.contains=function(e){return gu(this,function(t){return e===t})||!1}});var Qf=se((cA,Yf)=>{"use strict";var yu=_u();Yf.exports=Gt;function Gt(i){if(!(this instanceof Gt))return new Gt;this.childNodes=[],this.parentNode=null,this.ownerDocument=i||null}Gt.prototype.type="DocumentFragment";Gt.prototype.nodeType=11;Gt.prototype.nodeName="#document-fragment";Gt.prototype.appendChild=yu.prototype.appendChild;Gt.prototype.replaceChild=yu.prototype.replaceChild;Gt.prototype.removeChild=yu.prototype.removeChild;Gt.prototype.toString=function(){return this.childNodes.map(function(e){return String(e)}).join("")}});var Zf=se((dA,Jf)=>{"use strict";
1Jf.exports=vu;function vu(i){}vu.prototype.initEvent=function(e,t,r){this.type=e,this.bubbles=t,this.cancelable=r};vu.prototype.preventDefault=function(){}});var tp=se((hA,ep)=>{"use strict";var wT=du(),AT=Ff(),DT=Vf(),qs=_u(),IT=Qf(),kT=Zf(),PT=hu(),OT=fu(),LT=pu();ep.exports=Fa;function Fa(){if(!(this instanceof Fa))return new Fa;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}var vt=Fa.prototype;vt.createTextNode=function(e){return new DT(e,this)};vt.createElementNS=function(e,t){var r=e===null?null:String(e);return new qs(t,this,r)};vt.createElement=function(e){return new qs(e,this)};vt.createDocumentFragment=function(){return new IT(this)};vt.createEvent=function(e){return new kT(e)};vt.createComment=function(e){return new AT(e,this)};vt.getElementById=function(e){e=String(e);var t=wT(this.childNodes,function(r){if(String(r.id)===e)return r});return t||null};vt.getElementsByClassName=qs.prototype.getElementsByClassName;vt.getElementsByTagName=qs.prototype.getElementsByTagName;vt.contains=qs.prototype.contains;vt.removeEventListener=LT;vt.addEventListener=OT;vt.dispatchEvent=PT});var rp=se((fA,ip)=>{"use strict";var RT=tp();ip.exports=new RT});var bu=se((pA,np)=>{"use strict";var sp=typeof global<"u"?global:typeof window<"u"?window:{},MT=rp(),js;typeof document<"u"?js=document:(js=sp["__GLOBAL_DOCUMENT_CACHE@4"],js||(js=sp["__GLOBAL_DOCUMENT_CACHE@4"]=MT));np.exports=js});var ap=se((mA,li)=>{"use strict";function Tu(){return li.exports=Tu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},li.exports.__esModule=!0,li.exports.default=li.exports,Tu.apply(null,arguments)}li.exports=Tu,li.exports.__esModule=!0,li.exports.default=li.exports});var lp=se((gA,op)=>{"use strict";op.exports=BT;var NT=Object.prototype.toString;function BT(i){if(!i)return!1;var e=NT.call(i);return e==="[object Function]"||typeof i=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)}});var dp=se((_A,cp)=>{"use strict";function FT(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t)return(t=t.call(i)).next.bind(t);if(Array.isArray(i)||(t=UT(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UT(i,e){if(i){if(typeof i=="string")return up(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 up(i,e)}}function up(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}var VT=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},e.addInterceptor=function(r,s){this.typeToInterceptorsMap_.has(r)||this.typeToInterceptorsMap_.set(r,new Set);var n=this.typeToInterceptorsMap_.get(r);return n.has(s)?!1:(n.add(s),!0)},e.removeInterceptor=function(r,s){var n=this.typeToInterceptorsMap_.get(r);return n&&n.has(s)?(n.delete(s),!0):!1},e.clearInterceptorsByType=function(r){var s=this.typeToInterceptorsMap_.get(r);return s?(this.typeToInterceptorsMap_.delete(r),this.typeToInterceptorsMap_.set(r,new Set),!0):!1},e.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},e.getForType=function(r){return this.typeToInterceptorsMap_.get(r)||new Set},e.execute=function(r,s){for(var n=this.getForType(r),a=FT(n),l;!(l=a()).done;){var h=l.value;try{s=h(s)}catch{}}return s},i}();cp.exports=VT});var fp=se((yA,hp)=>{"use strict";var qT=function(){function i(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var e=i.prototype;return e.getIsEnabled=function(){return this.enabled_},e.enable=function(){this.enabled_=!0},e.disable=function(){this.enabled_=!1},e.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},e.getMaxAttempts=function(){return this.maxAttempts_},e.setMaxAttempts=function(r){this.maxAttempts_=r},e.getDelayFactor=function(){return this.delayFactor_},e.setDelayFactor=function(r){this.delayFactor_=r},e.getFuzzFactor=function(){return this.fuzzFactor_},e.setFuzzFactor=function(r){this.fuzzFactor_=r},e.getInitialDelay=function(){return this.initialDelay_},e.setInitialDelay=function(r){this.initialDelay_=r},e.createRetry=function(r){var s=r===void 0?{}:r,n=s.maxAttempts,a=s.delayFactor,l=s.fuzzFactor,h=s.initialDelay;return new jT({maxAttempts:n||this.maxAttempts_,delayFactor:a||this.delayFactor_,fuzzFactor:l||this.fuzzFactor_,initialDelay:h||this.initialDelay_})},i}(),jT=function(){function i(t){this.maxAttempts_=t.maxAttempts,this.delayFactor_=t.delayFactor,this.fuzzFactor_=t.fuzzFactor,this.currentDelay_=t.initialDelay,this.currentAttempt_=1}var e=i.prototype;return e.moveToNextAttempt=function(){this.currentAttempt_++;var r=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+r},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var r=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return r+Math.random()*(s-r)},i}();hp.exports=qT});var mp=se((vA,pp)=>{"use strict";var HT=zt(),$T=function(e,t){return t===void 0&&(t=!1),function(r,s,n){if(r){e(r);return}if(s.statusCode>=400&&s.statusCode<=599){var a=n;if(t)if(HT.TextDecoder){var l=zT(s.headers&&s.headers["content-type"]);try{a=new TextDecoder(l).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 r=t.split("="),s=r[0],n=r[1];return s.trim()==="charset"?n.trim():e},"utf-8")}pp.exports=$T});var vp=se((bA,Su)=>{"use strict";var gp=zt(),GT=ap(),WT=lp(),_p=dp(),XT=fp();Oe.httpHandler=mp();Oe.requestInterceptorsStorage=new _p;Oe.responseInterceptorsStorage=new _p;
2Oe.retryManager=new XT;var KT=function(e){var t={};return e&&e.trim().split(` 3`).forEach(function(r){var s=r.indexOf(":"),n=r.slice(0,s).trim().toLowerCase(),a=r.slice(s+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Su.exports=Oe;Su.exports.default=Oe;Oe.XMLHttpRequest=gp.XMLHttpRequest||ZT;Oe.XDomainRequest="withCredentials"in new Oe.XMLHttpRequest?Oe.XMLHttpRequest:gp.XDomainRequest;YT(["get","put","post","patch","head","delete"],function(i){Oe[i==="delete"?"del":i]=function(e,t,r){return t=yp(e,t,r),t.method=i.toUpperCase(),xu(t)}});function YT(i,e){for(var t=0;t<i.length;t++)e(i[t])}function QT(i){for(var e in i)if(i.hasOwnProperty(e))return!1;return!0}function yp(i,e,t){var r=i;return WT(e)?(t=e,typeof i=="string"&&(r={uri:i})):r=GT({},e,{uri:i}),r.callback=t,r}function Oe(i,e,t){return e=yp(i,e,t),xu(e)}function xu(i){if(typeof i.callback>"u")throw new Error("callback argument missing");if(i.requestType&&Oe.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=Oe.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 r=!1,s=function(R,U,N){r||(r=!0,i.callback(R,U,N))};function n(){f.readyState===4&&!Oe.responseInterceptorsStorage.getIsEnabled()&&setTimeout(h,0)}function a(){var L=void 0;if(f.response?L=f.response:L=f.responseText||JT(f),A)try{L=JSON.parse(L)}catch{}return L}function l(L){if(clearTimeout(P),clearTimeout(i.retryTimeout),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,!_&&Oe.retryManager.getIsEnabled()&&i.retry&&i.retry.shouldRetry()){i.retryTimeout=setTimeout(function(){i.retry.moveToNextAttempt(),i.xhr=f,xu(i)},i.retry.getCurrentFuzzedDelay());return}if(i.requestType&&Oe.responseInterceptorsStorage.getIsEnabled()){var R={headers:k.headers||{},body:k.body,responseUrl:f.responseURL,responseType:f.responseType},U=Oe.responseInterceptorsStorage.execute(i.requestType,R);k.body=U.body,k.headers=U.headers}return s(L,k)}function h(){if(!_){var L;clearTimeout(P),clearTimeout(i.retryTimeout),i.useXDR&&f.status===void 0?L=200:L=f.status===1223?204:f.status;var R=k,U=null;if(L!==0?(R={body:a(),statusCode:L,method:E,headers:{},url:T,rawRequest:f},f.getAllResponseHeaders&&(R.headers=KT(f.getAllResponseHeaders()))):U=new Error("Internal XMLHttpRequest Error"),i.requestType&&Oe.responseInterceptorsStorage.getIsEnabled()){var N={headers:R.headers||{},body:R.body,responseUrl:f.responseURL,responseType:f.responseType},V=Oe.responseInterceptorsStorage.execute(i.requestType,N);R.body=V.body,R.headers=V.headers}return s(U,R,R.body)}}var f=i.xhr||null;f||(i.cors||i.useXDR?f=new Oe.XDomainRequest:f=new Oe.XMLHttpRequest);var g,_,T=f.url=i.uri||i.url,E=f.method=i.method||"GET",w=i.body||i.data,y=f.headers=i.headers||{},I=!!i.sync,A=!1,P,k={body:void 0,headers:{},statusCode:0,method:E,url:T,rawRequest:f};if("json"in i&&i.json!==!1&&(A=!0,y.accept||y.Accept||(y.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),w=JSON.stringify(i.json===!0?w:i.json))),f.onreadystatechange=n,f.onload=h,f.onerror=l,f.onprogress=function(){},f.onabort=function(){_=!0,clearTimeout(i.retryTimeout)},f.ontimeout=l,f.open(E,T,!I,i.username,i.password),I||(f.withCredentials=!!i.withCredentials),!I&&i.timeout>0&&(P=setTimeout(function(){if(!_){_=!0,f.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",l(L)}},i.timeout)),f.setRequestHeader)for(g in y)y.hasOwnProperty(g)&&f.setRequestHeader(g,y[g]);else if(i.headers&&!QT(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(f.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(f),f.send(w||null),f}function JT(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 ZT(){}});var wp=se((TA,Cp)=>{"use strict";var bp=bu(),Cu=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}}();
3function bt(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}bt.prototype=Cu(Error.prototype);bt.prototype.constructor=bt;bt.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function wu(i){function e(r,s,n,a){return(r|0)*3600+(s|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 $s(){this.values=Cu(null)}$s.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 r=0;r<t.length;++r)if(e===t[r]){this.set(i,e);break}},integer:function(i,e){/^-?\d+$/.test(e)&&this.set(i,parseInt(e,10))},percent:function(i,e){var t;return(t=e.match(/^([\d]{1,3})(\.[\d]*)?%$/))&&(e=parseFloat(e),e>=0&&e<=100)?(this.set(i,e),!0):!1}};function Hs(i,e,t,r){var s=r?i.split(r):[i];for(var n in s)if(typeof s[n]=="string"){var a=s[n].split(t);if(a.length===2){var l=a[0].trim(),h=a[1].trim();e(l,h)}}}function e2(i,e,t){var r=i;function s(){var l=wu(i);if(l===null)throw new bt(bt.Errors.BadTimeStamp,"Malformed timestamp: "+r);return i=i.replace(/^[^\sa-zA-Z-]+/,""),l}function n(l,h){var f=new $s;Hs(l,function(g,_){switch(g){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===_){f.set(g,t[T].region);break}break;case"vertical":f.alt(g,_,["rl","lr"]);break;case"line":var E=_.split(","),w=E[0];f.integer(g,w),f.percent(g,w)&&f.set("snapToLines",!1),f.alt(g,w,["auto"]),E.length===2&&f.alt("lineAlign",E[1],["start","center","end"]);break;case"position":E=_.split(","),f.percent(g,E[0]),E.length===2&&f.alt("positionAlign",E[1],["start","center","end"]);break;case"size":f.percent(g,_);break;case"align":f.alt(g,_,["start","center","end","left","right"]);break}},/:/,/\s/),h.region=f.get("region",null),h.vertical=f.get("vertical","");try{h.line=f.get("line","auto")}catch{}h.lineAlign=f.get("lineAlign","start"),h.snapToLines=f.get("snapToLines",!0),h.size=f.get("size",100);try{h.align=f.get("align","center")}catch{h.align=f.get("align","middle")}try{h.position=f.get("position","auto")}catch{h.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},h.align)}h.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},h.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=s(),a(),i.substr(0,3)!=="-->")throw new bt(bt.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+r);i=i.substr(3),a(),e.endTime=s(),a(),n(i,e)}var Eu=bp.createElement&&bp.createElement("textarea"),t2={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Tp={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)"},i2={v:"title",lang:"lang"},xp={rt:"ruby"};function Ep(i,e){function t(){if(!e)return null;function w(I){return e=e.substr(I.length),I}var y=e.match(/^([^<]*)(<[^>]*>?)?/);return w(y[1]?y[1]:y[2])}function r(w){return Eu.innerHTML=w,w=Eu.textContent,Eu.textContent="",w}function s(w,y){return!xp[y.localName]||xp[y.localName]===w.localName}function n(w,y){var I=t2[w];if(!I)return null;var A=i.document.createElement(I),P=i2[w];return P&&y&&(A[P]=y.trim()),A}for(var a=i.document.createElement("div"),l=a,h,f=[];(h=t())!==null;){if(h[0]==="<"){if(h[1]==="/"){f.length&&f[f.length-1]===h.substr(2).replace(">","")&&(f.pop(),l=l.parentNode);continue}var g=wu(h.substr(1,h.length-2)),_;if(g){_=i.document.createProcessingInstruction("timestamp",g),l.appendChild(_);continue}var T=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(_=n(T[1],T[3]),!_)||!s(l,_))continue;if(T[2]){var E=T[2].split(".");E.forEach(function(w){var y=/^bg_/.test(w),I=y?w.slice(3):w;if(Tp.hasOwnProperty(I)){var A=y?"background-color":"color",P=Tp[I];_.style[A]=P}}),_.className=E.join(" ")}f.push(T[1]),l.appendChild(_),l=_;continue}l.appendChild(i.document.createTextNode(r(h)))}return a}var Sp=[[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
3],[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 r2(i){for(var e=0;e<Sp.length;e++){var t=Sp[e];if(i>=t[0]&&i<=t[1])return!0}return!1}function s2(i){var e=[],t="",r;if(!i||!i.childNodes)return"ltr";function s(l,h){for(var f=h.childNodes.length-1;f>=0;f--)l.push(h.childNodes[f])}function n(l){if(!l||!l.length)return null;var h=l.pop(),f=h.textContent||h.innerText;if(f){var g=f.match(/^.*(\n|\r)/);return g?(l.length=0,g[0]):f}if(h.tagName==="ruby")return n(l);if(h.childNodes)return s(l,h),n(l)}for(s(e,i);t=n(e);)for(var a=0;a<t.length;a++)if(r=t.charCodeAt(a),r2(r))return"rtl";return"ltr"}function n2(i){if(typeof i.line=="number"&&(i.snapToLines||i.line>=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,r=0,s=0;s<t.length&&t[s]!==e;s++)t[s].mode==="showing"&&r++;return++r*-1}function Va(){}Va.prototype.applyStyles=function(i,e){e=e||this.div;for(var t in i)i.hasOwnProperty(t)&&(e.style[t]=i[t])};Va.prototype.formatStyle=function(i,e){return i===0?0:i+e};function Ua(i,e,t){Va.call(this),this.cue=e,this.cueDiv=Ep(i,e.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=i.document.createElement("div"),r={direction:s2(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:t.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var s=0;switch(e.positionAlign){case"start":case"line-left":s=e.position;break;case"center":s=e.position-e.size/2;break;case"end":case"line-right":s=e.position-e.size;break}e.vertical===""?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(e.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(e.size,"%")}),this.move=function(n){this.applyStyles({top:this.formatStyle(n.top,"px"),bottom:this.formatStyle(n.bottom,"px"),left:this.formatStyle(n.left,"px"),right:this.formatStyle(n.right,"px"),height:this.formatStyle(n.height,"px"),width:this.formatStyle(n.width,"px")})}}Ua.prototype=Cu(Va.prototype);Ua.prototype.constructor=Ua;function Ze(i){var e,t,r,s;if(i.div){t=i.div.offsetHeight,r=i.div.offsetWidth,s=i.div.offsetTop;var n=(n=i.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();i=i.div.getBoundingClientRect(),e=n?Math.max(n[0]&&n[0].height||0,i.height/n.length):0}this.left=i.left,this.right=i.right,this.top=i.top||s,this.height=i.height||t,this.bottom=i.bottom||s+(i.height||t),this.width=i.width||r,this.lineHeight=e!==void 0?e:i.lineHeight}Ze.prototype.move=function(i,e){switch(e=e!==void 0?e:this.lineHeight,i){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e;break}};Ze.prototype.overlaps=function(i){return this.left<i.right&&this.right>i.left&&this.top<i.bottom&&this.bottom>i.top};Ze.prototype.overlapsAny=function(i){for(var e=0;e<i.length;e++)if(this.overlaps(i[e]))return!0;return!1};Ze.prototype.within=function(i){return this.top>=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Ze.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.left<i.left;case"-x":return this.right>i.right;case"+y":return this.top<i.top;case"-y":return this.bottom>i.bottom}};Ze.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)),r=e*t;return r/(this.height*this.width)};Ze.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}};Ze.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,r=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var s={left:i.left,right:i.right,top:i.top||r,height:i.height||e,bottom:i.bottom||r+(i.height||e),width:i.width||t};return s};function a2(i,e,t,r){function s(I,A){for(var P,k=new Ze(I),L=1,R=0;R<A.length;R++){for(;I.overlapsOppositeAxis(t,A[R])||I.within(t)&&I.overlapsAny(r);)I.move(A[R]);if(I.within(t))return I;var U=I.intersectPercentage(t);L>U&&(P=new Ze(I),L=U),I=new Ze(k)}return P||k}var n=new Ze(e),a=e.cue,l=n2(a),h=[];if(a.snapToLines){var f;switch(a.vertical){case"":h=["+y","-y"],f="height";break;
3case"rl":h=["+x","-x"],f="width";break;case"lr":h=["-x","+x"],f="width";break}var g=n.lineHeight,_=g*Math.round(l),T=t[f]+g,E=h[0];Math.abs(_)>T&&(_=_<0?-1:1,_*=Math.ceil(T/g)*g),l<0&&(_+=a.vertical===""?t.height:t.width,h=h.reverse()),n.move(E,_)}else{var w=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":l-=w/2;break;case"end":l-=w;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(l,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(l,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(l,"%")});break}h=["+y","-x","+x","-y"],n=new Ze(e)}var y=s(n,h);e.move(y.toCSSCompatValues(t))}function kr(){}kr.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};kr.convertCueToDOMTree=function(i,e){return!i||!e?null:Ep(i,e)};var o2=.05,l2="sans-serif",u2="1.5%";kr.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var r=i.document.createElement("div");r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin=u2,t.appendChild(r);function s(g){for(var _=0;_<g.length;_++)if(g[_].hasBeenReset||!g[_].displayState)return!0;return!1}if(!s(e)){for(var n=0;n<e.length;n++)r.appendChild(e[n].displayState);return}var a=[],l=Ze.getSimpleBoxPosition(r),h=Math.round(l.height*o2*100)/100,f={font:h+"px "+l2};(function(){for(var g,_,T=0;T<e.length;T++)_=e[T],g=new Ua(i,_,f),r.appendChild(g.div),a2(i,g,l,a),_.displayState=g.div,a.push(Ze.getSimpleBoxPosition(g))})()};kr.Parser=function(i,e,t){t||(t=e,e={}),e||(e={}),this.window=i,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=t||new TextDecoder("utf8"),this.regionList=[]};kr.Parser.prototype={reportOrThrowError:function(i){if(i instanceof bt)this.onparsingerror&&this.onparsingerror(i);else throw i},parse:function(i){var e=this;i&&(e.buffer+=e.decoder.decode(i,{stream:!0}));function t(){for(var g=e.buffer,_=0;_<g.length&&g[_]!=="\r"&&g[_]!==` 4`;)++_;var T=g.substr(0,_);return g[_]==="\r"&&++_,g[_]===` 5`&&++_,e.buffer=g.substr(_),T}function r(g){var _=new $s;if(Hs(g,function(E,w){switch(E){case"id":_.set(E,w);break;case"width":_.percent(E,w);break;case"lines":_.integer(E,w);break;case"regionanchor":case"viewportanchor":var y=w.split(",");if(y.length!==2)break;var I=new $s;if(I.percent("x",y[0]),I.percent("y",y[1]),!I.has("x")||!I.has("y"))break;_.set(E+"X",I.get("x")),_.set(E+"Y",I.get("y"));break;case"scroll":_.alt(E,w,["up"]);break}},/=/,/\s/),_.has("id")){var T=new(e.vttjs.VTTRegion||e.window.VTTRegion);T.width=_.get("width",100),T.lines=_.get("lines",3),T.regionAnchorX=_.get("regionanchorX",0),T.regionAnchorY=_.get("regionanchorY",100),T.viewportAnchorX=_.get("viewportanchorX",0),T.viewportAnchorY=_.get("viewportanchorY",100),T.scroll=_.get("scroll",""),e.onregion&&e.onregion(T),e.regionList.push({id:_.get("id"),region:T})}}function s(g){var _=new $s;Hs(g,function(T,E){switch(T){case"MPEGT":_.integer(T+"S",E);break;case"LOCA":_.set(T+"L",wu(E));break}},/[^\d]:/,/,/),e.ontimestampmap&&e.ontimestampmap({MPEGTS:_.get("MPEGTS"),LOCAL:_.get("LOCAL")})}function n(g){g.match(/X-TIMESTAMP-MAP/)?Hs(g,function(_,T){switch(_){case"X-TIMESTAMP-MAP":s(T);break}},/=/):Hs(g,function(_,T){switch(_){case"Region":r(T);break}},/:/)}try{var a;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer))return this;a=t();var l=a.match(/^WEBVTT([ \t].*)?$/);if(!l||!l[0])throw new bt(bt.Errors.BadSignature);e.state="HEADER"}for(var h=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(h?h=!1:a=t(),e.state){case"HEADER":/:/.test(a)?n(a):a||(e.state="ID");continue;case"NOTE":a||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){e.state="NOTE";break}if(!a)continue;e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch{e.cue.align="middle"}if(e.state="CUE",a.indexOf("-->")===-1){e.cue.id=a;continue}case"CUE":try{e2(a,e.cue,e.regionList)}catch(g){e.reportOrThrowError(g),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(h=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` 6`),e.cue.text+=a.replace(/\u2028/g,` 7`).replace(/u2029/g,` 8`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(g){e.reportOrThrowError(g),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+=` 9 10`,i.parse()),i.state==="INITIAL")throw new bt(bt.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};Cp.exports=kr});var Ip=se((xA,Dp)=>{"use strict";
10var c2="auto",d2={"":1,lr:1,rl:1},h2={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function f2(i){if(typeof i!="string")return!1;var e=d2[i.toLowerCase()];return e?i.toLowerCase():!1}function Au(i){if(typeof i!="string")return!1;var e=h2[i.toLowerCase()];return e?i.toLowerCase():!1}function Ap(i,e,t){this.hasBeenReset=!1;var r="",s=!1,n=i,a=e,l=t,h=null,f="",g=!0,_="auto",T="start",E="auto",w="auto",y=100,I="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(A){r=""+A}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(A){s=!!A}},startTime:{enumerable:!0,get:function(){return n},set:function(A){if(typeof A!="number")throw new TypeError("Start time must be set to a number.");n=A,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(A){if(typeof A!="number")throw new TypeError("End time must be set to a number.");a=A,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(A){l=""+A,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(A){h=A,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(A){var P=f2(A);if(P===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=P,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return g},set:function(A){g=!!A,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return _},set:function(A){if(typeof A!="number"&&A!==c2)throw new SyntaxError("Line: an invalid number or illegal string was specified.");_=A,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(A){var P=Au(A);P?(T=P,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return E},set:function(A){if(A<0||A>100)throw new Error("Position must be between 0 and 100.");E=A,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return w},set:function(A){var P=Au(A);P?(w=P,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");y=A,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return I},set:function(A){var P=Au(A);if(!P)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");I=P,this.hasBeenReset=!0}}}),this.displayState=void 0}Ap.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};Dp.exports=Ap});var Pp=se((SA,kp)=>{"use strict";var p2={"":!0,up:!0};function m2(i){if(typeof i!="string")return!1;var e=p2[i.toLowerCase()];return e?i.toLowerCase():!1}function zs(i){return typeof i=="number"&&i>=0&&i<=100}function g2(){var i=100,e=3,t=0,r=100,s=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(l){if(!zs(l))throw new Error("Width must be between 0 and 100.");i=l}},lines:{enumerable:!0,get:function(){return e},set:function(l){if(typeof l!="number")throw new TypeError("Lines must be set to a number.");e=l}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(l){if(!zs(l))throw new Error("RegionAnchorX must be between 0 and 100.");r=l}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(l){if(!zs(l))throw new Error("RegionAnchorY must be between 0 and 100.");t=l}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(l){if(!zs(l))throw new Error("ViewportAnchorY must be between 0 and 100.");n=l}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(l){if(!zs(l))throw new Error("ViewportAnchorX must be between 0 and 100.");s=l}},scroll:{enumerable:!0,get:function(){return a}
10,set:function(l){var h=m2(l);h===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=h}}})}kp.exports=g2});var Lp=se((EA,Op)=>{"use strict";var ui=zt(),Zi=Op.exports={WebVTT:wp(),VTTCue:Ip(),VTTRegion:Pp()};ui.vttjs=Zi;ui.WebVTT=Zi.WebVTT;var _2=Zi.VTTCue,y2=Zi.VTTRegion,v2=ui.VTTCue,b2=ui.VTTRegion;Zi.shim=function(){ui.VTTCue=_2,ui.VTTRegion=y2};Zi.restore=function(){ui.VTTCue=v2,ui.VTTRegion=b2};ui.VTTCue||Zi.shim()});var Ws=se(Rr=>{"use strict";function L2(i,e,t){if(t===void 0&&(t=Array.prototype),i&&typeof t.find=="function")return t.find.call(i,e);for(var r=0;r<i.length;r++)if(Object.prototype.hasOwnProperty.call(i,r)){var s=i[r];if(e.call(void 0,s,r,i))return s}}function qu(i,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(i):i}function R2(i,e){if(i===null||typeof i!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t]);return i}var Hp=qu({HTML:"text/html",isHTML:function(i){return i===Hp.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),$p=qu({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(i){return i===$p.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Rr.assign=R2;Rr.find=L2;Rr.freeze=qu;Rr.MIME_TYPE=Hp;Rr.NAMESPACE=$p});var Ju=se(Di=>{"use strict";var Jp=Ws(),Wt=Jp.find,Xs=Jp.NAMESPACE;function M2(i){return i!==""}function N2(i){return i?i.split(/[\t\n\f\r ]+/).filter(M2):[]}function B2(i,e){return i.hasOwnProperty(e)||(i[e]=!0),i}function zp(i){if(!i)return[];var e=N2(i);return Object.keys(e.reduce(B2,{}))}function F2(i){return function(e){return i&&i.indexOf(e)!==-1}}function Qs(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function ht(i,e){var t=i.prototype;if(!(t instanceof e)){let s=function(){};var r=s;s.prototype=e.prototype,s=new s,Qs(t,s),i.prototype=t=s}t.constructor!=i&&(typeof i!="function"&&console.error("unknown Class:"+i),t.constructor=i)}var ft={},At=ft.ELEMENT_NODE=1,Nr=ft.ATTRIBUTE_NODE=2,za=ft.TEXT_NODE=3,Zp=ft.CDATA_SECTION_NODE=4,em=ft.ENTITY_REFERENCE_NODE=5,U2=ft.ENTITY_NODE=6,tm=ft.PROCESSING_INSTRUCTION_NODE=7,im=ft.COMMENT_NODE=8,rm=ft.DOCUMENT_NODE=9,sm=ft.DOCUMENT_TYPE_NODE=10,di=ft.DOCUMENT_FRAGMENT_NODE=11,V2=ft.NOTATION_NODE=12,We={},Ne={},UA=We.INDEX_SIZE_ERR=(Ne[1]="Index size error",1),VA=We.DOMSTRING_SIZE_ERR=(Ne[2]="DOMString size error",2),dt=We.HIERARCHY_REQUEST_ERR=(Ne[3]="Hierarchy request error",3),qA=We.WRONG_DOCUMENT_ERR=(Ne[4]="Wrong document",4),jA=We.INVALID_CHARACTER_ERR=(Ne[5]="Invalid character",5),HA=We.NO_DATA_ALLOWED_ERR=(Ne[6]="No data allowed",6),$A=We.NO_MODIFICATION_ALLOWED_ERR=(Ne[7]="No modification allowed",7),nm=We.NOT_FOUND_ERR=(Ne[8]="Not found",8),zA=We.NOT_SUPPORTED_ERR=(Ne[9]="Not supported",9),Gp=We.INUSE_ATTRIBUTE_ERR=(Ne[10]="Attribute in use",10),GA=We.INVALID_STATE_ERR=(Ne[11]="Invalid state",11),WA=We.SYNTAX_ERR=(Ne[12]="Syntax error",12),XA=We.INVALID_MODIFICATION_ERR=(Ne[13]="Invalid modification",13),KA=We.NAMESPACE_ERR=(Ne[14]="Invalid namespace",14),YA=We.INVALID_ACCESS_ERR=(Ne[15]="Invalid access",15);function Le(i,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Ne[i]),this.message=Ne[i],Error.captureStackTrace&&Error.captureStackTrace(this,Le);return t.code=i,e&&(this.message=this.message+": "+e),t}Le.prototype=Error.prototype;Qs(We,Le);function ci(){}ci.prototype={length:0,item:function(i){return i>=0&&i<this.length?this[i]:null},toString:function(i,e){for(var t=[],r=0;r<this.length;r++)Mr(this[r],t,i,e);return t.join("")},filter:function(i){return Array.prototype.filter.call(this,i)},indexOf:function(i){return Array.prototype.indexOf.call(this,i)}};function Br(i,e){this._node=i,this._refresh=e,$u(this)}function $u(i){var e=i._node._inc||i._node.ownerDocument._inc;if(i._inc!==e){var t=i._refresh(i._node);if(_m(i,"length",t.length),!i.$$length||t.length<i.$$length)for(var r=t.length;r in i;r++)Object.prototype.hasOwnProperty.call(i,r)&&delete i[r];Qs(t,i),i._inc=e}}Br.prototype.item=function(i){return $u(this),this[i]||null};ht(Br,ci);function Ga(){}function am(i,e){for(var t=i.length;t--;)if(i[t]===e)return t}function Wp(i,e,t,r){if(r?e[am(e,r)]=t:e[e.length++]=t,i){t.ownerElement=i;var s=i.ownerDocument;s&&(r&&um(s,i,r),q2(s,i,t))}}function Xp(i,e,t){var r=am(e,t);if(r>=0){for(var s=e.length-1;r<s;)e[r]=e[++r];
10if(e.length=s,i){var n=i.ownerDocument;n&&(um(n,i,t),t.ownerElement=null)}}else throw new Le(nm,new Error(i.tagName+"@"+t))}Ga.prototype={length:0,item:ci.prototype.item,getNamedItem:function(i){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==i)return t}},setNamedItem:function(i){var e=i.ownerElement;if(e&&e!=this._ownerElement)throw new Le(Gp);var t=this.getNamedItem(i.nodeName);return Wp(this._ownerElement,this,i,t),t},setNamedItemNS:function(i){var e=i.ownerElement,t;if(e&&e!=this._ownerElement)throw new Le(Gp);return t=this.getNamedItemNS(i.namespaceURI,i.localName),Wp(this._ownerElement,this,i,t),t},removeNamedItem:function(i){var e=this.getNamedItem(i);return Xp(this._ownerElement,this,e),e},removeNamedItemNS:function(i,e){var t=this.getNamedItemNS(i,e);return Xp(this._ownerElement,this,t),t},getNamedItemNS:function(i,e){for(var t=this.length;t--;){var r=this[t];if(r.localName==e&&r.namespaceURI==i)return r}return null}};function om(){}om.prototype={hasFeature:function(i,e){return!0},createDocument:function(i,e,t){var r=new Js;if(r.implementation=this,r.childNodes=new ci,r.doctype=t||null,t&&r.appendChild(t),e){var s=r.createElementNS(i,e);r.appendChild(s)}return r},createDocumentType:function(i,e,t){var r=new Ka;return r.name=i,r.nodeName=i,r.publicId=e||"",r.systemId=t||"",r}};function de(){}de.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(i,e){return Wa(this,i,e)},replaceChild:function(i,e){Wa(this,i,e,dm),e&&this.removeChild(e)},removeChild:function(i){return cm(this,i)},appendChild:function(i){return this.insertBefore(i,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(i){return Hu(this.ownerDocument||this,this,i)},normalize:function(){for(var i=this.firstChild;i;){var e=i.nextSibling;e&&e.nodeType==za&&i.nodeType==za?(this.removeChild(e),i.appendData(e.data)):(i.normalize(),i=e)}},isSupported:function(i,e){return this.ownerDocument.implementation.hasFeature(i,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&t[r]===i)return r}e=e.nodeType==Nr?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==Nr?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function lm(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}Qs(ft,de);Qs(ft,de.prototype);function Ks(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Ks(i,e))return!0;while(i=i.nextSibling)}function Js(){this.ownerDocument=this}function q2(i,e,t){i&&i._inc++;var r=t.namespaceURI;r===Xs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function um(i,e,t,r){i&&i._inc++;var s=t.namespaceURI;s===Xs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function zu(i,e,t){if(i&&i._inc){i._inc++;var r=e.childNodes;if(t)r[r.length++]=t;else{for(var s=e.firstChild,n=0;s;)r[n++]=s,s=s.nextSibling;r.length=n,delete r[r.length]}}}function cm(i,e){var t=e.previousSibling,r=e.nextSibling;return t?t.nextSibling=r:i.firstChild=r,r?r.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,zu(i.ownerDocument,i),e}function j2(i){return i&&(i.nodeType===de.DOCUMENT_NODE||i.nodeType===de.DOCUMENT_FRAGMENT_NODE||i.nodeType===de.ELEMENT_NODE)}function H2(i){return i&&(Xt(i)||Gu(i)||hi(i)||i.nodeType===de.DOCUMENT_FRAGMENT_NODE||i.nodeType===de.COMMENT_NODE||i.nodeType===de.PROCESSING_INSTRUCTION_NODE)}function hi(i){return i&&i.nodeType===de.DOCUMENT_TYPE_NODE}function Xt(i){return i&&i.nodeType===de.ELEMENT_NODE}function Gu(i){return i&&i.nodeType===de.TEXT_NODE}function Kp(i,e){var t=i.childNodes||[];if(Wt(t,Xt)||hi(e))return!1;var r=Wt(t,hi);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Yp(i,e){var t=i.childNodes||[];function r(n){return Xt(n)&&n!==e}if(Wt(t,r))return!1;var s=Wt(t,hi);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function $2(i,e,t){if(!j2(i))throw new Le(dt,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new Le(nm,"child not in parent");
vendor: 4,571 bytes, line 10
10if(!H2(e)||hi(e)&&i.nodeType!==de.DOCUMENT_NODE)throw new Le(dt,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function z2(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===de.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Xt);if(n.length>1||Wt(s,Gu))throw new Le(dt,"More than one element or text in fragment");if(n.length===1&&!Kp(i,t))throw new Le(dt,"Element in fragment can not be inserted before doctype")}if(Xt(e)&&!Kp(i,t))throw new Le(dt,"Only one element can be added and only after doctype");if(hi(e)){if(Wt(r,hi))throw new Le(dt,"Only one doctype is allowed");var a=Wt(r,Xt);if(t&&r.indexOf(a)<r.indexOf(t))throw new Le(dt,"Doctype can only be inserted before an element");if(!t&&a)throw new Le(dt,"Doctype can not be appended since element is present")}}function dm(i,e,t){var r=i.childNodes||[],s=e.childNodes||[];if(e.nodeType===de.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Xt);if(n.length>1||Wt(s,Gu))throw new Le(dt,"More than one element or text in fragment");if(n.length===1&&!Yp(i,t))throw new Le(dt,"Element in fragment can not be inserted before doctype")}if(Xt(e)&&!Yp(i,t))throw new Le(dt,"Only one element can be added and only after doctype");if(hi(e)){let h=function(f){return hi(f)&&f!==t};var l=h;if(Wt(r,h))throw new Le(dt,"Only one doctype is allowed");var a=Wt(r,Xt);if(t&&r.indexOf(a)<r.indexOf(t))throw new Le(dt,"Doctype can only be inserted before an element")}}function Wa(i,e,t,r){$2(i,e,t),i.nodeType===de.DOCUMENT_NODE&&(r||z2)(i,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===di){var n=e.firstChild;if(n==null)return e;var a=e.lastChild}else n=a=e;var l=t?t.previousSibling:i.lastChild;n.previousSibling=l,a.nextSibling=t,l?l.nextSibling=n:i.firstChild=n,t==null?i.lastChild=a:t.previousSibling=a;do{n.parentNode=i;var h=i.ownerDocument||i;Ys(n,h)}while(n!==a&&(n=n.nextSibling));return zu(i.ownerDocument||i,i),e.nodeType==di&&(e.firstChild=e.lastChild=null),e}function Ys(i,e){if(i.ownerDocument!==e){if(i.ownerDocument=e,i.nodeType===At&&i.attributes)for(var t=0;t<i.attributes.length;t++){var r=i.attributes.item(t);r&&(r.ownerDocument=e)}for(var s=i.firstChild;s;)Ys(s,e),s=s.nextSibling}}function G2(i,e){e.parentNode&&e.parentNode.removeChild(e),e.parentNode=i,e.previousSibling=i.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:i.firstChild=e,i.lastChild=e,zu(i.ownerDocument,i,e);var t=i.ownerDocument||i;return Ys(e,t),e}Js.prototype={nodeName:"#document",nodeType:rm,doctype:null,documentElement:null,_inc:1,insertBefore:function(i,e){if(i.nodeType==di){for(var t=i.firstChild;t;){var r=t.nextSibling;this.insertBefore(t,e),t=r}return i}return Wa(this,i,e),Ys(i,this),this.documentElement===null&&i.nodeType===At&&(this.documentElement=i),i},removeChild:function(i){return this.documentElement==i&&(this.documentElement=null),cm(this,i)},replaceChild:function(i,e){Wa(this,i,e,dm),Ys(i,this),e&&this.removeChild(e),Xt(i)&&(this.documentElement=i)},importNode:function(i,e){return gm(this,i,e)},getElementById:function(i){var e=null;return Ks(this.documentElement,function(t){if(t.nodeType==At&&t.getAttribute("id")==i)return e=t,!0}),e},getElementsByClassName:function(i){var e=zp(i);return new Br(this,function(t){var r=[];return e.length>0&&Ks(t.documentElement,function(s){if(s!==t&&s.nodeType===At){var n=s.getAttribute("class");if(n){var a=i===n;if(!a){var l=zp(n);a=e.every(F2(l))}a&&r.push(s)}}}),r})},createElement:function(i){var e=new rr;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new ci;var t=e.attributes=new Ga;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Ya;return i.ownerDocument=this,i.childNodes=new ci,i},createTextNode:function(i){var e=new Wu;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Xu;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new Ku;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Qu;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new Xa;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Yu;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new rr,r=e.split(":"),s=t.attributes=new Ga;return t.childNodes=new ci,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,s._ownerElement=t,t}
10,createAttributeNS:function(i,e){var t=new Xa,r=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,r.length==2?(t.prefix=r[0],t.localName=r[1]):t.localName=e,t}};ht(Js,de);function rr(){this._nsMap={}}rr.prototype={nodeType:At,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===di?this.insertBefore(i,null):G2(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 r=this.ownerDocument.createAttributeNS(i,e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Br(this,function(e){var t=[];return Ks(e,function(r){r!==e&&r.nodeType==At&&(i==="*"||r.tagName==i)&&t.push(r)}),t})},getElementsByTagNameNS:function(i,e){return new Br(this,function(t){var r=[];return Ks(t,function(s){s!==t&&s.nodeType===At&&(i==="*"||s.namespaceURI===i)&&(e==="*"||s.localName==e)&&r.push(s)}),r})}};Js.prototype.getElementsByTagName=rr.prototype.getElementsByTagName;Js.prototype.getElementsByTagNameNS=rr.prototype.getElementsByTagNameNS;ht(rr,de);function Xa(){}Xa.prototype.nodeType=Nr;ht(Xa,de);function Zs(){}Zs.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(Ne[dt])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var r=this.data.substring(0,i),s=this.data.substring(i+e);t=r+t+s,this.nodeValue=this.data=t,this.length=t.length}};ht(Zs,de);function Wu(){}Wu.prototype={nodeName:"#text",nodeType:za,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 r=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}};ht(Wu,Zs);function Xu(){}Xu.prototype={nodeName:"#comment",nodeType:im};ht(Xu,Zs);function Ku(){}Ku.prototype={nodeName:"#cdata-section",nodeType:Zp};ht(Ku,Zs);function Ka(){}Ka.prototype.nodeType=sm;ht(Ka,de);function hm(){}hm.prototype.nodeType=V2;ht(hm,de);function fm(){}fm.prototype.nodeType=U2;ht(fm,de);function Yu(){}Yu.prototype.nodeType=em;ht(Yu,de);function Ya(){}Ya.prototype.nodeName="#document-fragment";Ya.prototype.nodeType=di;ht(Ya,de);function Qu(){}Qu.prototype.nodeType=tm;ht(Qu,de);function pm(){}pm.prototype.serializeToString=function(i,e,t){return mm.call(i,e,t)};de.prototype.toString=mm;function mm(i,e){var t=[],r=this.nodeType==9&&this.documentElement||this,s=r.prefix,n=r.namespaceURI;if(n&&s==null){var s=r.lookupPrefix(n);if(s==null)var a=[{namespace:n,prefix:null}]}return Mr(this,t,i,e,a),t.join("")}function Qp(i,e,t){var r=i.prefix||"",s=i.namespaceURI;if(!s||r==="xml"&&s===Xs.XML||s===Xs.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===r)return a.namespace!==s}return!0}function ju(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,lm),'"')}function Mr(i,e,t,r,s){if(s||(s=[]),r)if(i=r(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case At:var n=i.attributes,a=n.length,A=i.firstChild,l=i.tagName;t=Xs.isHTML(i.namespaceURI)||t;var h=l;if(!t&&!i.prefix&&i.namespaceURI){for(var f,g=0;g<n.length;g++)if(n.item(g).name==="xmlns"){f=n.item(g).value;break}if(!f)for(var _=s.length-1;_>=0;_--){var T=s[_];
10if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var _=s.length-1;_>=0;_--){var T=s[_];if(T.namespace===i.namespaceURI){T.prefix&&(h=T.prefix+":"+l);break}}}e.push("<",h);for(var E=0;E<a;E++){var w=n.item(E);w.prefix=="xmlns"?s.push({prefix:w.localName,namespace:w.value}):w.nodeName=="xmlns"&&s.push({prefix:"",namespace:w.value})}for(var E=0;E<a;E++){var w=n.item(E);if(Qp(w,t,s)){var y=w.prefix||"",I=w.namespaceURI;ju(e,y?"xmlns:"+y:"xmlns",I),s.push({prefix:y,namespace:I})}Mr(w,e,t,r,s)}if(l===h&&Qp(i,t,s)){var y=i.prefix||"",I=i.namespaceURI;ju(e,y?"xmlns:"+y:"xmlns",I),s.push({prefix:y,namespace:I})}if(A||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(e.push(">"),t&&/^script$/i.test(l))for(;A;)A.data?e.push(A.data):Mr(A,e,t,r,s.slice()),A=A.nextSibling;else for(;A;)Mr(A,e,t,r,s.slice()),A=A.nextSibling;e.push("</",h,">")}else e.push("/>");return;case rm:case di:for(var A=i.firstChild;A;)Mr(A,e,t,r,s.slice()),A=A.nextSibling;return;case Nr:return ju(e,i.name,i.value);case za:return e.push(i.data.replace(/[<&>]/g,lm));case Zp:return e.push("<![CDATA[",i.data,"]]>");case im:return e.push("<!--",i.data,"-->");case sm:var P=i.publicId,k=i.systemId;if(e.push("<!DOCTYPE ",i.name),P)e.push(" PUBLIC ",P),k&&k!="."&&e.push(" ",k),e.push(">");else if(k&&k!=".")e.push(" SYSTEM ",k,">");else{var L=i.internalSubset;L&&e.push(" [",L,"]"),e.push(">")}return;case tm:return e.push("<?",i.target," ",i.data,"?>");case em:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function gm(i,e,t){var r;switch(e.nodeType){case At:r=e.cloneNode(!1),r.ownerDocument=i;case di:break;case Nr:t=!0;break}if(r||(r=e.cloneNode(!1)),r.ownerDocument=i,r.parentNode=null,t)for(var s=e.firstChild;s;)r.appendChild(gm(i,s,t)),s=s.nextSibling;return r}function Hu(i,e,t){var r=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=r[s]&&(r[s]=n)}switch(e.childNodes&&(r.childNodes=new ci),r.ownerDocument=i,r.nodeType){case At:var a=e.attributes,l=r.attributes=new Ga,h=a.length;l._ownerElement=r;for(var f=0;f<h;f++)r.setAttributeNode(Hu(i,a.item(f),!0));break;case Nr:t=!0}if(t)for(var g=e.firstChild;g;)r.appendChild(Hu(i,g,t)),g=g.nextSibling;return r}function _m(i,e,t){i[e]=t}try{if(Object.defineProperty){let i=function(e){switch(e.nodeType){case At:case di:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(i(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};W2=i,Object.defineProperty(Br.prototype,"length",{get:function(){return $u(this),this.$$length}}),Object.defineProperty(de.prototype,"textContent",{get:function(){return i(this)},set:function(e){switch(this.nodeType){case At:case di:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),_m=function(e,t,r){e["$$"+t]=r}}}catch{}var W2;Di.DocumentType=Ka;Di.DOMException=Le;Di.DOMImplementation=om;Di.Element=rr;Di.Node=de;Di.NodeList=ci;Di.XMLSerializer=pm});var vm=se(en=>{"use strict";var ym=Ws().freeze;en.XML_ENTITIES=ym({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});en.HTML_ENTITIES=ym
vendor: 35,739 bytes, lines 10-11
10({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` 11`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"})
vendor: 9,732 bytes, lines 11-13
11;en.entityMap=en.HTML_ENTITIES});var Am=se(ec=>{"use strict";var nn=Ws().NAMESPACE,Zu=/[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]/,bm=new RegExp("[\\-\\.0-9"+Zu.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Tm=new RegExp("^"+Zu.source+bm.source+"*(?::"+Zu.source+bm.source+"*)?$"),tn=0,Ii=1,Fr=2,rn=3,Ur=4,Vr=5,sn=6,Qa=7;function qr(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,qr)}qr.prototype=new Error;qr.prototype.name=qr.name;function Em(){}Em.prototype={parse:function(i,e,t){var r=this.domBuilder;r.startDocument(),Cm(e,e={}),X2(i,e,t,r,this.errorHandler),r.endDocument()}};function X2(i,e,t,r,s){function n(ne){if(ne>65535){ne-=65536;var ke=55296+(ne>>10),si=56320+(ne&1023);return String.fromCharCode(ke,si)}else return String.fromCharCode(ne)}function a(ne){var ke=ne.slice(1,-1);return Object.hasOwnProperty.call(t,ke)?t[ke]:ke.charAt(0)==="#"?n(parseInt(ke.substr(1).replace("x","0x"))):(s.error("entity not found:"+ne),ne)}function l(ne){if(ne>y){var ke=i.substring(y,ne).replace(/&#?\w+;/g,a);T&&h(y),r.characters(ke,0,ne-y),y=ne}}function h(ne,ke){for(;ne>=g&&(ke=_.exec(i));)f=ke.index,g=f+ke[0].length,T.lineNumber++;T.columnNumber=ne-f+1}for(var f=0,g=0,_=/.*(?:\r\n?|\n)|.*$/g,T=r.locator,E=[{currentNSMap:e}],w={},y=0;;){try{var I=i.indexOf("<",y);if(I<0){if(!i.substr(y).match(/^\s*$/)){var A=r.doc,P=A.createTextNode(i.substr(y));A.appendChild(P),r.currentElement=P}return}switch(I>y&&l(I),i.charAt(I+1)){case"/":var ee=i.indexOf(">",I+3),k=i.substring(I+2,ee).replace(/[ \t\n\r]+$/g,""),L=E.pop();ee<0?(k=i.substring(I+2).replace(/[\s<].*/,""),s.error("end tag name: "+k+" is not complete:"+L.tagName),ee=I+1+k.length):k.match(/\s</)&&(k=k.replace(/[\s<].*/,""),s.error("end tag name: "+k+" maybe not complete"),ee=I+1+k.length);var R=L.localNSMap,U=L.tagName==k,N=U||L.tagName&&L.tagName.toLowerCase()==k.toLowerCase();if(N){if(r.endElement(L.uri,L.localName,k),R)for(var V in R)Object.prototype.hasOwnProperty.call(R,V)&&r.endPrefixMapping(V);U||s.fatalError("end tag name: "+k+" is not match the current start tagName:"+L.tagName)}else E.push(L);ee++;break;case"?":T&&h(I),ee=Z2(i,I,r);break;case"!":T&&h(I),ee=J2(i,I,r,s);break;default:T&&h(I);var X=new wm,fe=E[E.length-1].currentNSMap,ee=K2(i,I,X,fe,a,s),me=X.length;if(!X.closed&&Q2(i,ee,X.tagName,w)&&(X.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),T&&me){for(var G=xm(T,{}),re=0;re<me;re++){var Ye=X[re];h(Ye.offset),Ye.locator=xm(T,{})}r.locator=G,Sm(X,r,fe)&&E.push(X),r.locator=T}else Sm(X,r,fe)&&E.push(X);nn.isHTML(X.uri)&&!X.closed?ee=Y2(i,ee,X.tagName,a,r):ee++}}catch(ne){if(ne instanceof qr)throw ne;s.error("element parse error: "+ne),ee=-1}ee>y?y=ee:l(Math.max(I,y)+1)}}function xm(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function K2(i,e,t,r,s,n){function a(E,w,y){t.attributeNames.hasOwnProperty(E)&&n.fatalError("Attribute "+E+" redefined"),t.addValue(E,w.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),y)}for(var l,h,f=++e,g=tn;;){var _=i.charAt(f);switch(_){case"=":if(g===Ii)l=i.slice(e,f),g=rn;else if(g===Fr)g=rn;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===rn||g===Ii)if(g===Ii&&(n.warning('attribute value must after "="'),l=i.slice(e,f)),e=f+1,f=i.indexOf(_,e),f>0)h=i.slice(e,f),a(l,h,e-1),g=Vr;else throw new Error("attribute value no end '"+_+"' match");else if(g==Ur)h=i.slice(e,f),a(l,h,e),n.warning('attribute "'+l+'" missed start quot('+_+")!!"),e=f+1,g=Vr;else throw new Error('attribute value must after "="');break;case"/":switch(g){case tn:t.setTagName(i.slice(e,f));case Vr:case sn:case Qa:g=Qa,t.closed=!0;case Ur:case Ii:break;case Fr:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),g==tn&&t.setTagName(i.slice(e,f)),f;case">":switch(g){case tn:t.setTagName(i.slice(e,f));case Vr:case sn:case Qa:break;case Ur:case Ii:h=i.slice(e,f),h.slice(-1)==="/"&&(t.closed=!0,h=h.slice(0,-1));case Fr:g===Fr&&(h=l),g==Ur?(n.warning('attribute "'+h+'" missed quot(")!'),a(l,h,e)):((!nn.isHTML(r[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),a(h,h,e));break;case rn:throw new Error("attribute value missed!!")}return f;case"\x80":_=" ";default:if(_<=" ")switch(g){case tn:t.setTagName(i.slice(e,f)),g=sn;break;case Ii:l=i.slice(e,f),g=Fr;break;case Ur:var h=i.slice(e,f);n.warning('attribute "'+h+'" missed quot(")!!'),a(l,h,e);case Vr:g=sn;break}else switch(g){case Fr:var T=t.tagName;(!nn.isHTML(r[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=f,g=Ii;break;case Vr:n.warning('attribute space is required"'+l+'"!!');case sn:g=Ii,e=f;break;case rn:g=Ur,e=f;break;case Qa:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Sm(i,e,t){for(var r=i.tagName,s=null,_=i.length;_--;){var n=i[_],a=n.qName,l=n.value,T=a.indexOf(":");if(T>0)var h=n.prefix=a.slice(0,T),f=a.slice(T+1),g=h==="xmlns"&&f;else f=a,h=null,g=a==="xmlns"&&"";n.localName=f,g!==!1&&(s==null&&(s={},Cm(t,t={})),t[g]=s[g]=l,n.uri=nn.XMLNS,e.startPrefixMapping(g,l))}for(var _=i.length;_--;){n=i[_];var h=n.prefix;h&&(h==="xml"&&(n.uri=nn.XML),h!=="xmlns"&&(n.uri=t[h||""]))}var T=r.indexOf(":");T>0?(h=i.prefix=r.slice(0,T),f=i.localName=r.slice(T+1)):(h=null,f=i.localName=r);var E=i.uri=t[h||""];if(e.startElement(E,f,r,i),i.closed){if(e.endElement(E,f,r),s)for(h in s)Object.prototype.hasOwnProperty.call(s,h)&&e.endPrefixMapping(h)}else return i.currentNSMap=t,i.localNSMap=s,!0}function Y2(i,e,t,r,s){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("</"+t+">",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(s.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,r),s.characters(a,0,a.length),n)}return e+1}function Q2(i,e,t,r){var s=r[t];return s==null&&(s=i.lastIndexOf("</"+t+">"),s<e&&(s=i.lastIndexOf("</"+t)),r[t]=s),s<e}function Cm(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function J2(i,e,t,r){var s=i.charAt(e+2);switch(s){case"-":if(i.charAt(e+3)==="-"){var n=i.indexOf("-->",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(r.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=e1(i,e),l=a.length;if(l>1&&/!doctype/i.test(a[0][0])){var h=a[1][0],f=!1,g=!1;l>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],g=l>4&&a[4][0]):/^system$/i.test(a[2][0])&&(g=a[3][0]));var _=a[l-1];return t.startDTD(h,f,g),t.endDTD(),_.index+_[0].length}}return-1}function Z2(i,e,t){var r=i.indexOf("?>",e);if(r){var s=i.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){var n=s[0].length;return t.processingInstruction(s[1],s[2]),r+2}else return-1}return-1}function wm(){this.attributeNames={}}wm.prototype={setTagName:function(i){if(!Tm.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Tm.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 e1(i,e){var t,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(i);t=s.exec(i);)if(r.push(t),t[1])return r}ec.XMLReader=Em;ec.ParseError=qr});var Rm=se(Za=>{"use strict";var t1=Ws(),i1=Ju(),Dm=vm(),Pm=Am(),r1=i1.DOMImplementation,Im=t1.NAMESPACE,s1=Pm.ParseError,n1=Pm.XMLReader;function Om(i){return i.replace(/\r[\n\u0085]/g,` 12`).replace(/[\r\u0085\u2028]/g,` 13`)}function Lm(i){this.options=i||{locator:{}}}Lm.prototype.parseFromString=function(i,e){var t=this.options,r=new n1,s=t.domBuilder||new an,n=t.errorHandler,a=t.locator,l=t.xmlns||{},h=/\/x?html?$/.test(e),f=h?Dm.HTML_ENTITIES:Dm.XML_ENTITIES;a&&s.setDocumentLocator(a),r.errorHandler=a1(n,s,a),r.domBuilder=t.domBuilder||s,h&&(l[""]=Im.HTML),l.xml=l.xml||Im.XML;var g=t.normalizeLineEndings||Om;return i&&typeof i=="string"?r.parse(g(i),l,f):r.errorHandler.error("invalid doc source"),s.doc};function a1(i,e,t){if(!i){if(e instanceof an)return e;i=e}var r={},s=i instanceof Function;t=t||{};function n(a){var l=i[a];!l&&s&&(l=i.length==2?function(h){i(a,h)}:i),r[a]=l&&function(h){l("[xmldom "+a+"] "+h+tc(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),r}function an(){this.cdata=!1}function jr(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}an.prototype={startDocument:function(){this.doc=new r1().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,r){var s=this.doc,n=s.createElementNS(i,t||e),a=r.length;Ja(this,n),this.currentElement=n,this.locator&&jr(this.locator,n);for(var l=0;l<a;l++){var i=r.getURI(l),h=r.getValue(l),t=r.getQName(l),f=s.createAttributeNS(i,t);this.locator&&jr(r.getLocator(l),f),f.value=f.nodeValue=h,n.setAttributeNode(f)}},endElement:function(i,e,t){var r=this.currentElement,s=r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&jr(this.locator,t),Ja(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=km.apply(this,arguments),i){if(this.cdata)var r
13=this.doc.createCDATASection(i);else var r=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(i)&&this.doc.appendChild(r),this.locator&&jr(this.locator,r)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=km.apply(this,arguments);var r=this.doc.createComment(i);this.locator&&jr(this.locator,r),Ja(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(i,e,t);this.locator&&jr(this.locator,s),Ja(this,s),this.doc.doctype=s}},warning:function(i){console.warn("[xmldom warning] "+i,tc(this.locator))},error:function(i){console.error("[xmldom error] "+i,tc(this.locator))},fatalError:function(i){throw new s1(i,this.locator)}};function tc(i){if(i)return` 14@`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function km(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=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){an.prototype[i]=function(){return null}});function Ja(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Za.__DOMHandler=an;Za.normalizeLineEndings=Om;Za.DOMParser=Lm});var Nm=se(eo=>{"use strict";var Mm=Ju();eo.DOMImplementation=Mm.DOMImplementation;eo.XMLSerializer=Mm.XMLSerializer;eo.DOMParser=Rm().DOMParser});var tg=se((aD,eg)=>{"use strict";var Zm=Math.pow(2,32),J1=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t<Number.MAX_SAFE_INTEGER?Number(t):t):e.getUint32(0)*Zm+e.getUint32(4)};eg.exports={getUint64:J1,MAX_UINT32:Zm}});var sg=se((oD,rg)=>{"use strict";var ig=tg().getUint64,Z1=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t={version:i[0],flags:new Uint8Array(i.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},r=12;t.version===0?(t.earliestPresentationTime=e.getUint32(r),t.firstOffset=e.getUint32(r+4),r+=8):(t.earliestPresentationTime=ig(i.subarray(r)),t.firstOffset=ig(i.subarray(r+8)),r+=16),r+=2;var s=e.getUint16(r);for(r+=2;s>0;r+=12,s--)t.references.push({referenceType:(i[r]&128)>>>7,referencedSize:e.getUint32(r)&2147483647,subsegmentDuration:e.getUint32(r+4),startsWithSap:!!(i[r+8]&128),sapType:(i[r+8]&112)>>>4,sapDeltaTime:e.getUint32(r+8)&268435455});return t};rg.exports=Z1});var yg=se((PD,_g)=>{"use strict";var cc=9e4,dc,hc,no,fc,pg,mg,gg;dc=function(i){return i*cc};hc=function(i,e){return i*e};no=function(i){return i/cc};fc=function(i,e){return i/e};pg=function(i,e){return dc(fc(i,e))};mg=function(i,e){return hc(no(i),e)};gg=function(i,e,t){return no(t?i:i-e)};_g.exports={ONE_SECOND_IN_TS:cc,secondsToVideoTs:dc,secondsToAudioTs:hc,videoTsToSeconds:no,audioTsToSeconds:fc,audioTsToVideoTs:pg,videoTsToAudioTs:mg,metadataTsToSeconds:gg}});function Cb(i,e){if(i&1){let t=$t();ut(0,"div",4)(1,"div",5),ct("click",function(s){_e(t);let n=Q();return n.onMenuClick(n.opcionesMenu.es_reglamentacion),ye(s.preventDefault())}),ae(2," REGLAMENTACI\xD3N "),Je(),ut(3,"div",5),ct("click",function(s){_e(t);let n=Q();return n.onMenuClick(n.opcionesMenu.es_informe),ye(s.preventDefault())}),ae(4," INFORME "),Je()()}if(i&2){let t=Q();$(),Ge("!border-l-red-700",t.menuActivo()===t.opcionesMenu.es_reglamentacion)("!bg-red-50",t.menuActivo()===t.opcionesMenu.es_reglamentacion)("opacity-50",!t.tieneReglamentacion())("pointer-events-none",!t.tieneReglamentacion()),$(2),Ge("!border-l-red-700",t.menuActivo()===t.opcionesMenu.es_informe)("!bg-red-50",t.menuActivo()===t.opcionesMenu.es_informe)("opacity-50",!t.tieneInformes())("pointer-events-none",!t.tieneInformes())}}var Ra=class i{opcionesMenu=Oa;tipoRecursoObj=La;expediente=Xh(null);menuClickeado=new Bs;menuActivo=yt(null);mostrarSubmenu=!0;constructor(){Aa(()=>{let e=this.expediente()})}ngOnInit(){this.onMenuClick(this.opcionesMenu.es_ley)}toggleSubmenu(){this.mostrarSubmenu=!this.mostrarSubmenu}onMenuClick(e){this.menuActivo.set(e),this.menuClickeado.emit(e)}tieneReglamentacion(){return this.expediente()?.recursos?.some(e=>e.tipoRecursoLeyItemMenu===3&&e.tipoRecursoObjeto===this.tipoRecursoObj.pdf)??
14!1}tieneInformes(){return this.expediente()?.recursos?.some(e=>e.tipoRecursoLeyItemMenu===4&&e.tipoRecursoObjeto===this.tipoRecursoObj.pdf)??!1}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Si({type:i,selectors:[["app-sidebar-visor"]],inputs:{expediente:[1,"expediente"]},outputs:{menuClickeado:"menuClickeado"},decls:25,vars:91,consts:[[1,"rounded-md","border","border-gray-200","bg-white/70"],[1,"flex","h-full","flex-col","gap-1","p-3"],[1,"mano","px-2","py-1","text-sm","text-[#6D6E71]","border-b","border-gray-200","border-l-4","border-l-transparent","hover:border-l-red-700","hover:bg-red-50",3,"click"],[1,"mano","px-2","py-1","text-sm","text-[#6D6E71]","border-l-4","border-l-transparent","hover:border-l-red-700","hover:bg-red-50",3,"click"],[1,"submenu"],[1,"mano","px-2","py-1","text-sm","text-[#6D6E71]","border-b","border-gray-200","border-l-4","border-l-transparent","hover:border-l-red-700","hover:bg-red-50","text-center",3,"click"]],template:function(t,r){if(t&1&&(ut(0,"aside",0)(1,"div",1)(2,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_ley),n.preventDefault()}),ae(3),Je(),ut(4,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_texto),n.preventDefault()}),ae(5,"TEXTO DE LA NORMA LEGAL CON MODIFICACIONES"),Je(),ut(6,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_ficha_tecnica),n.preventDefault()}),ae(7,"FICHA T\xC9CNICA"),Je(),ut(8,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_exp_proy_ley),n.preventDefault()}),ae(9),Je(),ut(10,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_transcripcion),n.preventDefault()}),ae(11,"TRANSCRIPCIONES"),Je(),ut(12,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_diario_debates),n.preventDefault()}),ae(13,"DIARIO DE LOS DEBATES"),Je(),ut(14,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_videoteca),n.preventDefault()}),ae(15,"VIDEOTECA"),Je(),ut(16,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_ficha_tecnica_quechua),n.preventDefault()}),ae(17,"FICHA T\xC9CNICA EN QUECHUA"),Je(),ut(18,"a",2),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_ficha_tecnica_leng_senas),n.preventDefault()}),ae(19,"FICHA T\xC9CNIA EN LENGUAJE DE SE\xD1AS"),Je(),ut(20,"a",3),ct("click",function(n){return r.onMenuClick(r.opcionesMenu.es_fe_erratas),n.preventDefault()}),ae(21,"F\xC9 DE ERRATAS"),Je(),ut(22,"div",2),ct("click",function(){return r.toggleSubmenu()}),ae(23," CONTROL POL\xCDTICO "),Je(),xr(24,Cb,5,16,"div",4),Je()()),t&2){let s,n,a,l,h,f,g,_,T,E,w,y,I,A,P,k,L,R,U,N,V,X;$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_ley)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_ley)("opacity-50",!(!((s=r.expediente())==null||s.menu==null)&&s.menu.esLey))("pointer-events-none",!(!((n=r.expediente())==null||n.menu==null)&&n.menu.esLey)),$(),Ft((a=r.expediente())==null||a.ley==null||a.ley.tipoNorma==null?null:a.ley.tipoNorma.toUpperCase()),$(),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_texto)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_texto)("opacity-50",!(!((l=r.expediente())==null||l.menu==null)&&l.menu.esTexto))("pointer-events-none",!(!((h=r.expediente())==null||h.menu==null)&&h.menu.esTexto)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica)("opacity-50",!(!((f=r.expediente())==null||f.menu==null)&&f.menu.esFichaTecnica))("pointer-events-none",!(!((g=r.expediente())==null||g.menu==null)&&g.menu.esFichaTecnica)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_exp_proy_ley)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_exp_proy_ley)("opacity-50",!(!((_=r.expediente())==null||_.menu==null)&&_.menu.esProyectoLey))("pointer-events-none",!(!((T=r.expediente())==null||T.menu==null)&&T.menu.esProyectoLey)),$(),wr("EXPEDIENTE DEL PROYECTO DE ",(E=r.expediente())==null||E.ley==null||E.ley.tipoNorma==null?null:E.ley.tipoNorma.toUpperCase()," "),$(),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_transcripcion)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_transcripcion)("opacity-50",!(!((w=r.expediente())==null||w.menu==null)&&w.menu.esTranscripcion))("pointer-events-none",!(!((y=r.expediente())==null||y.menu==null)&&y.menu.esTranscripcion)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_diario_debates)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_diario_debates)("opacity-50",!(!((I=r.expediente())==null||I.menu==null)&&I.menu.esDiarioDebates))("pointer-events-none",!(!((A=r.expediente())==null||A.menu==null)&&A.menu.esDiarioDebates)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_videoteca)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_videoteca)("opacity-50",!(!((P=r.expediente())==null||P.menu==null)&&P.menu.esVideoteca))("pointer-events-none",!(!((k=r.expediente())==null||k.menu==null)&&k.menu.esVideoteca)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica_quechua)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica_quechua)("opacity-50",!(!((L=r.expediente())==null||L.menu==null)&&L.menu.esFTecnicaQuechua))("pointer-events-none",!(!((R=r.expediente())==null||R.menu==null)&&R.menu.esFTecnicaQuechua)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica_leng_senas)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_ficha_tecnica_leng_senas)("opacity-50",!(!((U=r.expediente())==null||U.menu==null)&&U.menu.esFTecnicaLengSenas))("pointer-events-none",!(!((N=r.expediente())==null||N.menu==null)&&N.menu.esFTecnicaLengSenas)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_fe_erratas)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_fe_erratas)("opacity-50",!(!((V=r.expediente())==null||V.menu==null)&&V.menu.esFeErraras))("pointer-events-none",!(!((X=r.expediente())==null||X.menu==null)&&X.menu.esFeErraras)),$(2),Ge("!border-l-red-700",r.menuActivo()===r.opcionesMenu.es_reglamentacion||r.menuActivo()===r.opcionesMenu.es_informe)("!bg-red-50",r.menuActivo()===r.opcionesMenu.es_reglamentacion||r.menuActivo()===r.opcionesMenu.es_informe)("opacity-50",!r.tieneReglamentacion()&&!r.tieneInformes())("pointer-events-none",!r.tieneReglamentacion()&&!r.tieneInformes()),$(2),Sr(r.mostrarSubmenu?24:-1)}},dependencies:[Ei],styles:[".mano[_ngcontent-%COMP%]{cursor:pointer}"]})};var Na=class i{http=wt(Ia);base=uu.apiADLP.baseUrl;endPointObtenerExpediente=uu.apiADLP.endPoints.Expediente.ObtenerExpediente;obtenerExpediente(e){let t=new ef().set("numley",String(e)),r=`${this.base}/${this.endPointObtenerExpediente}`;return this.http.get(r,{params:t}).pipe(Ns(s=>{if(!s.status)throw new Error(s.mensaje||"");return s.data}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=br({token:i,factory:i.\u0275fac,providedIn:"root"})};var Af=` 15 .p-card { 16 background: dt('card.background'); 17 color: dt('card.color'); 18 box-shadow: dt('card.shadow');
19 border-radius: dt('card.border.radius'); 20 display: flex; 21 flex-direction: column; 22 } 23 24 .p-card-caption { 25 display: flex; 26 flex-direction: column; 27 gap: dt('card.caption.gap'); 28 } 29 30 .p-card-body { 31 padding: dt('card.body.padding'); 32 display: flex; 33 flex-direction: column; 34 gap: dt('card.body.gap'); 35 } 36 37 .p-card-title { 38 font-size: dt('card.title.font.size'); 39 font-weight: dt('card.title.font.weight'); 40 } 41 42 .p-card-subtitle { 43 color: dt('card.subtitle.color'); 44 } 45`;var wb=["header"],Ab=["title"],Db=["subtitle"],Ib=["content"],kb=["footer"],Pb=["*",[["p-header"]],[["p-footer"]]],Ob=["*","p-header","p-footer"];function Lb(i,e){i&1&&Er(0)}function Rb(i,e){if(i&1&&(te(0,"div"),Ea(1,1),ot(2,Lb,1,0,"ng-container",1),ie()),i&2){let t=Q();qe(t.cx("header")),$(2),Z("ngTemplateOutlet",t.headerTemplate||t._headerTemplate)}}function Mb(i,e){if(i&1&&(nu(0),ae(1),au()),i&2){let t=Q(2);$(),Ft(t.header)}}function Nb(i,e){i&1&&Er(0)}function Bb(i,e){if(i&1&&(te(0,"div"),ot(1,Mb,2,1,"ng-container",2)(2,Nb,1,0,"ng-container",1),ie()),i&2){let t=Q();qe(t.cx("title")),$(),Z("ngIf",t.header&&!t._titleTemplate&&!t.titleTemplate),$(),Z("ngTemplateOutlet",t.titleTemplate||t._titleTemplate)}}function Fb(i,e){if(i&1&&(nu(0),ae(1),au()),i&2){let t=Q(2);$(),Ft(t.subheader)}}function Ub(i,e){i&1&&Er(0)}function Vb(i,e){if(i&1&&(te(0,"div"),ot(1,Fb,2,1,"ng-container",2)(2,Ub,1,0,"ng-container",1),ie()),i&2){let t=Q();qe(t.cx("subtitle")),$(),Z("ngIf",t.subheader&&!t._subtitleTemplate&&!t.subtitleTemplate),$(),Z("ngTemplateOutlet",t.subtitleTemplate||t._subtitleTemplate)}}function qb(i,e){i&1&&Er(0)}function jb(i,e){i&1&&Er(0)}function Hb(i,e){if(i&1&&(te(0,"div"),Ea(1,2),ot(2,jb,1,0,"ng-container",1),ie()),i&2){let t=Q();qe(t.cx("footer")),$(2),Z("ngTemplateOutlet",t.footerTemplate||t._footerTemplate)}}var $b=` 46 ${Af} 47 48 .p-card { 49 display: block; 50 } 51`,zb={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},Df=(()=>{class i extends Pa{name="card";theme=$b;classes=zb;static \u0275fac=(()=>{let t;return function(s){return(t||(t=Tr(i)))(s||i)}})();static \u0275prov=br({token:i,factory:i.\u0275fac})}return i})();var Gb=(()=>{class i extends mf{header;subheader;set style(t){hf(this._style(),t)||this._style.set(t)}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=yt(null);_componentStyle=wt(Df);getBlockableElement(){return this.el.nativeElement.children[0]}templates;
51ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"header":this._headerTemplate=t.template;break;case"title":this._titleTemplate=t.template;break;case"subtitle":this._subtitleTemplate=t.template;break;case"content":this._contentTemplate=t.template;break;case"footer":this._footerTemplate=t.template;break;default:this._contentTemplate=t.template;break}})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Tr(i)))(s||i)}})();static \u0275cmp=Si({type:i,selectors:[["p-card"]],contentQueries:function(r,s,n){if(r&1&&(oi(n,ff,5),oi(n,pf,5),oi(n,wb,4),oi(n,Ab,4),oi(n,Db,4),oi(n,Ib,4),oi(n,kb,4),oi(n,ka,4)),r&2){let a;$e(a=ze())&&(s.headerFacet=a.first),$e(a=ze())&&(s.footerFacet=a.first),$e(a=ze())&&(s.headerTemplate=a.first),$e(a=ze())&&(s.titleTemplate=a.first),$e(a=ze())&&(s.subtitleTemplate=a.first),$e(a=ze())&&(s.contentTemplate=a.first),$e(a=ze())&&(s.footerTemplate=a.first),$e(a=ze())&&(s.templates=a)}},hostVars:5,hostBindings:function(r,s){r&2&&(Nt("data-pc-name","card"),Ca(s._style()),qe(s.cn(s.cx("root"),s.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[wa([Df]),xa],ngContentSelectors:Ob,decls:8,vars:9,consts:[[3,"class",4,"ngIf"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(r,s){r&1&&(Vh(Pb),ot(0,Rb,3,3,"div",0),te(1,"div"),ot(2,Bb,3,4,"div",0)(3,Vb,3,4,"div",0),te(4,"div"),Ea(5),ot(6,qb,1,0,"ng-container",1),ie(),ot(7,Hb,3,3,"div",0),ie()),r&2&&(Z("ngIf",s.headerFacet||s.headerTemplate||s._headerTemplate),$(),qe(s.cx("body")),$(),Z("ngIf",s.header||s.titleTemplate||s._titleTemplate),$(),Z("ngIf",s.subheader||s.subtitleTemplate||s._subtitleTemplate),$(),qe(s.cx("content")),$(2),Z("ngTemplateOutlet",s.contentTemplate||s._contentTemplate),$(),Z("ngIf",s.footerFacet||s.footerTemplate||s._footerTemplate))},dependencies:[Ei,Dr,Qh,Ci],encapsulation:2,changeDetection:0})}return i})(),kf=(()=>{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Ta({type:i});static \u0275inj=ba({imports:[Gb,Ci,Ci]})}return i})();var Pf=` 52 .p-slider { 53 display: block; 54 position: relative; 55 background: dt('slider.track.background'); 56 border-radius: dt('slider.track.border.radius'); 57 } 58 59 .p-slider-handle { 60 cursor: grab; 61 touch-action: none; 62 user-select: none; 63 display: flex; 64 justify-content: center; 65 align-items: center; 66 height: dt('slider.handle.height'); 67 width: dt('slider.handle.width'); 68 background: dt('slider.handle.background'); 69 border-radius: dt('slider.handle.border.radius'); 70 transition: 71 background dt('slider.transition.duration'), 72 color dt('slider.transition.duration'), 73 border-color dt('slider.transition.duration'), 74 box-shadow dt('slider.transition.duration'), 75 outline-color dt('slider.transition.duration'); 76 outline-color: transparent; 77 } 78 79 .p-slider-handle::before { 80 content: ''; 81 width: dt('slider.handle.content.width'); 82 height: dt('slider.handle.content.height'); 83 display: block; 84 background: dt('slider.handle.content.background'); 85 border-radius: dt('slider.handle.content.border.radius'); 86 box-shadow: dt('slider.handle.content.shadow'); 87 transition: background dt('slider.transition.duration'); 88 } 89 90 .p-slider:not(.p-disabled) .p-slider-handle:hover { 91 background: dt('slider.handle.hover.background'); 92 } 93 94 .p-slider:not(.p-disabled) .p-slider-handle:hover::before { 95 background: dt('slider.handle.content.hover.background'); 96 } 97 98 .p-slider-handle:focus-visible { 99 box-shadow: dt('slider.handle.focus.ring.shadow'); 100 outline: dt('slider.handle.focus.ring.width') dt('slider.handle.focus.ring.style') dt('slider.handle.focus.ring.color'); 101 outline-offset: dt('slider.handle.focus.ring.offset'); 102 } 103 104 .p-slider-range { 105 display: block; 106 background: dt('slider.range.background');
107 border-radius: dt('slider.track.border.radius'); 108 } 109 110 .p-slider.p-slider-horizontal { 111 height: dt('slider.track.size'); 112 } 113 114 .p-slider-horizontal .p-slider-range { 115 inset-block-start: 0; 116 inset-inline-start: 0; 117 height: 100%; 118 } 119 120 .p-slider-horizontal .p-slider-handle { 121 inset-block-start: 50%; 122 margin-block-start: calc(-1 * calc(dt('slider.handle.height') / 2)); 123 margin-inline-start: calc(-1 * calc(dt('slider.handle.width') / 2)); 124 } 125 126 .p-slider-vertical { 127 min-height: 100px; 128 width: dt('slider.track.size'); 129 } 130 131 .p-slider-vertical .p-slider-handle { 132 inset-inline-start: 50%; 133 margin-inline-start: calc(-1 * calc(dt('slider.handle.width') / 2)); 134 margin-block-end: calc(-1 * calc(dt('slider.handle.height') / 2)); 135 } 136 137 .p-slider-vertical .p-slider-range { 138 inset-block-end: 0; 139 inset-inline-start: 0; 140 width: 100%; 141 } 142`;var Wb=["sliderHandle"],Xb=["sliderHandleStart"],Kb=["sliderHandleEnd"],Yb=(i,e)=>
142({position:"absolute","inset-inline-start":i,width:e}),Qb=(i,e)=>({position:"absolute",bottom:i,height:e}),Jb=i=>({position:"absolute",height:i}),Zb=i=>({position:"absolute",width:i}),cu=(i,e)=>({position:"absolute","inset-inline-start":i,bottom:e});function eT(i,e){if(i&1&<(0,"span",7),i&2){let t=Q();qe(t.cx("range")),Z("ngStyle",Ar(4,Yb,t.offset!==null&&t.offset!==void 0?t.offset+"%":t.handleValues[0]+"%",t.diff?t.diff+"%":t.handleValues[1]-t.handleValues[0]+"%")),Nt("data-pc-section","range")}}function tT(i,e){if(i&1&<(0,"span",7),i&2){let t=Q();qe(t.cx("range")),Z("ngStyle",Ar(4,Qb,t.offset!==null&&t.offset!==void 0?t.offset+"%":t.handleValues[0]+"%",t.diff?t.diff+"%":t.handleValues[1]-t.handleValues[0]+"%")),Nt("data-pc-section","range")}}function iT(i,e){if(i&1&<(0,"span",7),i&2){let t=Q();qe(t.cx("range")),Z("ngStyle",Fs(4,Jb,t.handleValue+"%")),Nt("data-pc-section","range")}}function rT(i,e){if(i&1&<(0,"span",7),i&2){let t=Q();qe(t.cx("range")),Z("ngStyle",Fs(4,Zb,t.handleValue+"%")),Nt("data-pc-section","range")}}function sT(i,e){if(i&1){let t=$t();te(0,"span",8,0),Bt("touchstart",function(s){_e(t);let n=Q();return ye(n.onDragStart(s))})("touchmove",function(s){_e(t);let n=Q();return ye(n.onDrag(s))})("touchend",function(s){_e(t);let n=Q();return ye(n.onDragEnd(s))})("mousedown",function(s){_e(t);let n=Q();return ye(n.onMouseDown(s))})("keydown",function(s){_e(t);let n=Q();return ye(n.onKeyDown(s))}),ie()}if(i&2){let t=Q();qe(t.cx("handle")),Cr("transition",t.dragging?"none":null),Z("ngStyle",Ar(14,cu,t.orientation=="horizontal"?t.handleValue+"%":null,t.orientation=="vertical"?t.handleValue+"%":null))("pAutoFocus",t.autofocus),Nt("tabindex",t.$disabled()?null:t.tabindex)("aria-valuemin",t.min)("aria-valuenow",t.value)("aria-valuemax",t.max)("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("aria-orientation",t.orientation)("data-pc-section","handle")}}function nT(i,e){if(i&1){let t=$t();te(0,"span",9,1),Bt("keydown",function(s){_e(t);let n=Q();return ye(n.onKeyDown(s,0))})("mousedown",function(s){_e(t);let n=Q();return ye(n.onMouseDown(s,0))})("touchstart",function(s){_e(t);let n=Q();return ye(n.onDragStart(s,0))})("touchmove",function(s){_e(t);let n=Q();return ye(n.onDrag(s))})("touchend",function(s){_e(t);let n=Q();return ye(n.onDragEnd(s))}),ie()}if(i&2){let t=Q();qe(t.cn(t.cx("handle"),t.handleIndex==0&&"p-slider-handle-active")),Cr("transition",t.dragging?"none":null),Z("ngStyle",Ar(14,cu,t.rangeStartLeft,t.rangeStartBottom))("pAutoFocus",t.autofocus),Nt("tabindex",t.$disabled()?null:t.tabindex)("aria-valuemin",t.min)("aria-valuenow",t.value?t.value[0]:null)("aria-valuemax",t.max)("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("aria-orientation",t.orientation)("data-pc-section","startHandler")}}function aT(i,e){if(i&1){let t=$t();te(0,"span",10,2),Bt("keydown",function(s){_e(t);let n=Q();return ye(n.onKeyDown(s,1))})("mousedown",function(s){_e(t);let n=Q();return ye(n.onMouseDown(s,1))})("touchstart",function(s){_e(t);let n=Q();return ye(n.onDragStart(s,1))})("touchmove",function(s){_e(t);let n=Q();return ye(n.onDrag(s))})("touchend",function(s){_e(t);let n=Q();return ye(n.onDragEnd(s))}),ie()}if(i&2){let t=Q();qe(t.cn(t.cx("handle"),t.handleIndex==1&&"p-slider-handle-active")),Cr("transition",t.dragging?"none":null),Z("ngStyle",Ar(13,cu,t.rangeEndLeft,t.rangeEndBottom)),Nt("tabindex",t.$disabled()?null:t.tabindex)("aria-valuemin",t.min)("aria-valuenow",t.value?t.value[1]:null)("aria-valuemax",t.max)("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("aria-orientation",t.orientation)("data-pc-section","endHandler")}}var oT={handle:{position:"absolute"},range:{position:"absolute"}},lT={root:({instance:i})=>["p-slider p-component",{"p-disabled":i.$disabled(),"p-invalid":i.invalid(),"p-slider-horizontal":i.orientation==="horizontal","p-slider-vertical":i.orientation==="vertical","p-slider-animate":i.animate}],range:"p-slider-range",handle:"p-slider-handle"},Of=(()=>{class i extends Pa{name="slider";theme=Pf;classes=lT;inlineStyles=oT;static \u0275fac=(()=>{let t;return function(s){return(t||(t=Tr(i)))(s||i)}})();static \u0275prov=br({token:i,factory:i.\u0275fac})}return i})();var uT={provide:nf,useExisting:Nh(()=>Ba),multi:!0},Ba=(()=>{class i extends _f{animate;min=0;max=100;orientation="horizontal";step;range;styleClass;ariaLabel;ariaLabelledBy;tabindex=0;autofocus;onChange=new Bs;onSlideEnd=new Bs;sliderHandle;sliderHandleStart;sliderHandleEnd;_componentStyle=wt(Of);value;values;handleValue;handleValues=[];diff;offset;bottom;dragging;dragListener;mouseupListener;initX;initY;barWidth;barHeight;sliderHandleClick;handleIndex=0;startHandleValue;startx;starty;ngZone=wt(Sa);onHostClick(t){this.onBarClick(t)}onMouseDown(t,r){this.$disabled()||(this.dragging=!0,this.updateDomData(),this.sliderHandleClick=!0,this.range&&this.handleValues&&this.handleValues[0]===this.max?this.handleIndex=0:this.handleIndex=r,this.bindDragListeners(),t.target.focu
142s(),t.preventDefault(),this.animate&&lu(this.el.nativeElement,"p-slider-animate"))}onDragStart(t,r){if(!this.$disabled()){var s=t.changedTouches[0];this.startHandleValue=this.range?this.handleValues[r]:this.handleValue,this.dragging=!0,this.range&&this.handleValues&&this.handleValues[0]===this.max?this.handleIndex=0:this.handleIndex=r,this.orientation==="horizontal"?(this.startx=parseInt(s.clientX,10),this.barWidth=this.el.nativeElement.offsetWidth):(this.starty=parseInt(s.clientY,10),this.barHeight=this.el.nativeElement.offsetHeight),this.animate&&lu(this.el.nativeElement,"p-slider-animate"),t.preventDefault()}}onDrag(t){if(!this.$disabled()){var r=t.changedTouches[0],s=0;this.orientation==="horizontal"?s=Math.floor((parseInt(r.clientX,10)-this.startx)*100/this.barWidth)+this.startHandleValue:s=Math.floor((this.starty-parseInt(r.clientY,10))*100/this.barHeight)+this.startHandleValue,this.setValueFromHandle(t,s),t.preventDefault()}}onDragEnd(t){this.$disabled()||(this.dragging=!1,this.range?this.onSlideEnd.emit({originalEvent:t,values:this.values}):this.onSlideEnd.emit({originalEvent:t,value:this.value}),this.animate&&ou(this.el.nativeElement,"p-slider-animate"),t.preventDefault())}onBarClick(t){this.$disabled()||(this.sliderHandleClick||(this.updateDomData(),this.handleChange(t),this.range?this.onSlideEnd.emit({originalEvent:t,values:this.values}):this.onSlideEnd.emit({originalEvent:t,value:this.value})),this.sliderHandleClick=!1)}onKeyDown(t,r){switch(this.handleIndex=r,t.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(t,r),t.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(t,r),t.preventDefault();break;case"PageDown":this.decrementValue(t,r,!0),t.preventDefault();break;case"PageUp":this.incrementValue(t,r,!0),t.preventDefault();break;case"Home":this.updateValue(this.min,t),t.preventDefault();break;case"End":this.updateValue(this.max,t),t.preventDefault();break;default:break}}decrementValue(t,r,s=!1){let n;
142this.range?this.step?n=this.values[r]-this.step:n=this.values[r]-1:this.step?n=this.value-this.step:!this.step&&s?n=this.value-10:n=this.value-1,this.updateValue(n,t),t.preventDefault()}incrementValue(t,r,s=!1){let n;this.range?this.step?n=this.values[r]+this.step:n=this.values[r]+1:this.step?n=this.value+this.step:!this.step&&s?n=this.value+10:n=this.value+1,this.updateValue(n,t),t.preventDefault()}handleChange(t){let r=this.calculateHandleValue(t);this.setValueFromHandle(t,r)}bindDragListeners(){Zh(this.platformId)&&this.ngZone.runOutsideAngular(()=>{let t=this.el?this.el.nativeElement.ownerDocument:this.document;this.dragListener||(this.dragListener=this.renderer.listen(t,"mousemove",r=>{this.dragging&&this.ngZone.run(()=>{this.handleChange(r)})})),this.mouseupListener||(this.mouseupListener=this.renderer.listen(t,"mouseup",r=>{this.dragging&&(this.dragging=!1,this.ngZone.run(()=>{this.range?this.onSlideEnd.emit({originalEvent:r,values:this.values}):this.onSlideEnd.emit({originalEvent:r,value:this.value}),this.animate&&ou(this.el.nativeElement,"p-slider-animate")}))}))})}unbindDragListeners(){this.dragListener&&(this.dragListener(),this.dragListener=null),this.mouseupListener&&(this.mouseupListener(),this.mouseupListener=null)}setValueFromHandle(t,r){let s=this.getValueFromHandle(r);
142this.range?this.step?this.handleStepChange(s,this.values[this.handleIndex]):(this.handleValues[this.handleIndex]=r,this.updateValue(s,t)):this.step?this.handleStepChange(s,this.value):(this.handleValue=r,this.updateValue(s,t)),this.cd.markForCheck()}handleStepChange(t,r){let s=t-r,n=r,a=this.step;s<0?n=r+Math.ceil(t/a-r/a)*a:s>0&&(n=r+Math.floor(t/a-r/a)*a),this.updateValue(n),this.updateHandleValue()}get rangeStartLeft(){return this.isVertical()?null:this.handleValues[0]>100?"100%":this.handleValues[0]+"%"}get rangeStartBottom(){return this.isVertical()?this.handleValues[0]+"%":"auto"}get rangeEndLeft(){return this.isVertical()?null:this.handleValues[1]+"%"}get rangeEndBottom(){return this.isVertical()?this.handleValues[1]+"%":"auto"}isVertical(){return this.orientation==="vertical"}updateDomData(){let t=this.el.nativeElement.getBoundingClientRect();this.initX=t.left+uf(),this.initY=t.top+cf(),this.barWidth=this.el.nativeElement.offsetWidth,this.barHeight=this.el.nativeElement.offsetHeight}calculateHandleValue(t){return this.orientation==="horizontal"?df(this.el.nativeElement)?(this.initX+this.barWidth-t.pageX)*100/this.barWidth:(t.pageX-this.initX)*100/this.barWidth:(this.initY+this.barHeight-t.pageY)*100/this.barHeight}updateHandleValue(){this.range?(this.handleValues[0]=(this.values[0]<this.min?0:this.values[0]-this.min)*100/(this.max-this.min),this.handleValues[1]=(this.values[1]>this.max?100:this.values[1]-this.min)*100/(this.max-this.min)):this.value<this.min?this.handleValue=0:this.value>this.max?this.handleValue=100:this.handleValue=(this.value-this.min)*100/(this.max-this.min),this.step&&this.updateDiffAndOffset()}updateDiffAndOffset(){this.diff=this.getDiff(),this.offset=this.getOffset()}getDiff(){return Math.abs(this.handleValues[0]-this.handleValues[1])}getOffset(){return Math.min(this.handleValues[0],this.handleValues[1])}updateValue(t,r){if(this.range){let s=t;this.handleIndex==0?(s<this.min?(s=this.min,this.handleValues[0]=0):s>this.values[1]&&s>this.max&&(s=this.max,this.handleValues[0]=100),this.sliderHandleStart?.nativeElement.focus()):(s>this.max?(s=this.max,this.handleValues[1]=100,this.offset=this.handleValues[1]):s<this.min?(s=this.min,this.handleValues[1]=0):s<this.values[0]&&(this.offset=this.handleValues[1]),this.sliderHandleEnd?.nativeElement.focus()),this.step?this.updateHandleValue():this.updateDiffAndOffset(),this.values[this.handleIndex]=this.getNormalizedValue(s);let n=[this.minVal,this.maxVal];this.onModelChange(n),this.onChange.emit({event:r,values:this.values})}else t<this.min?(t=this.min,this.handleValue=0):t>this.max&&(t=this.max,this.handleValue=100),this.value=this.getNormalizedValue(t),this.onModelChange(this.value),this.onChange.emit({event:r,value:this.value}),this.sliderHandle?.nativeElement.focus();this.updateHandleValue()}getValueFromHandle(t){return(this.max-this.min)*(t/100)+this.min}getDecimalsCount(t){return t&&Math.floor(t)!==t&&t.toString().split(".")[1].length||0}getNormalizedValue(t){let r=this.getDecimalsCount(this.step);return r>0?+parseFloat(t.toString()).toFixed(r):Math.floor(t)}ngOnDestroy(){this.unbindDragListeners(),super.ngOnDestroy()}get minVal(){return Math.min(this.values[1],this.values[0])}get maxVal(){return Math.max(this.values[1],this.values[0])}writeControlValue(t){this.range?this.values=t||[0,0]:this.value=t||0,this.updateHandleValue(),this.updateDiffAndOffset(),this.cd.markForCheck()}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Tr(i)))(s||i)}})();static \u0275cmp=Si({type:i,selectors:[["p-slider"]],viewQuery:function(r,s){if(r&1&&(Ji(Wb,5),Ji(Xb,5),Ji(Kb,5)),r&2){let n;$e(n=ze())&&(s.sliderHandle=n.first),$e(n=ze())&&(s.sliderHandleStart=n.first),$e(n=ze())&&(s.sliderHandleEnd=n.first)}},hostVars:4,hostBindings:function(r,s){r&1&&Bt("click",function(a){return s.onHostClick(a)}),r&2&&(Nt("data-pc-name","slider")("data-pc-section","root"),qe(s.cn(s.cx("root"),s.styleClass)))},inputs:{animate:[2,"animate","animate",Da],min:[2,"min","min",Us],max:[2,"max","max",Us],orientation:"orientation",step:[2,"step","step",Us],range:[2,"range","range",Da],styleClass:"styleClass",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",tabindex:[2,"tabindex","tabindex",Us],autofocus:[2,"autofocus","autofocus",Da]},outputs:{onChange:"onChange",onSlideEnd:"onSlideEnd"},features:[wa([uT,Of]),xa],decls:7,vars:7,consts:[["sliderHandle",""],["sliderHandleStart",""],["sliderHandleEnd",""],[3,"class","ngStyle",4,"ngIf"],["role","slider",3,"class","transition","ngStyle","pAutoFocus","touchstart","touchmove","touchend","mousedown","keydown",4,"ngIf"],["role","slider",3,"transition","class","ngStyle","pAutoFocus","keydown","mousedown","touchstart","touchmove","touchend",4,"ngIf"],["role","slider",3,"transition","class","ngStyle","keydown","mousedown","touchstart","touchmove","touchend",4,"ngIf"],[3,"ngStyle"],["role","slider",3,"touchstart","touchmove","touchend","mousedown","keydown","ngStyle","pAutoFocus"],["role","slider",3,"keydown","mousedown","touchstart","touchmove","touchend","ngStyle","pAutoFocus"],["role","slider",3,"keydown","mousedown","touchstart","touchmove","touchend","ngStyle"]],template:function(r,s){r&1&&ot(0,eT,1,7,"span",3)(1,tT,1,7,"span",3)(2,iT,1,6,"span",3)(3,rT,1,6,"span",3)(4,sT,2,17,"span",4)(5,nT,2,17,"span",5)(6,aT,2,16,"span",6),r&2&&(Z("ngIf",s.range&&s.orientation=="horizontal"),$(),Z("ngIf",s.range&&s.orientation=="vertical"),$(),Z("ngIf",!s.range&&s.orientation=="vertical"),$(),Z("ngIf",!s.range&&s.orientation=="horizontal"),$(),Z("ngIf",!s.range),$(),Z("ngIf",s.range),$(),Z("ngIf",s.range))},dependencies:[Ei,Dr,Yh,gf,Ci],encapsulation:2,changeDetection:0})}return i})(),Lf=(()=>
142{class i{static \u0275fac=function(r){return new(r||i)};static \u0275mod=Ta({type:i});static \u0275inj=ba({imports:[Ba,Ci,Ci]})}return i})();var C=Ct(zt()),q=Ct(bu()),Cd=Ct(vp()),Ic=Ct(Lp());function we(){return we=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},we.apply(null,arguments)}var Pr=Ct(zt()),Rp="https://example.com",T2=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=Pr.default.location&&Pr.default.location.href||"");var r=/^\/\//.test(e),s=!Pr.default.location&&!/\/\//i.test(e);e=new Pr.default.URL(e,Pr.default.location||Rp);var n=new URL(t,e);return s?n.href.slice(Rp.length):r?n.href.slice(n.protocol.length):n.href},Or=T2;var qa=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(r,s){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(s)},e.off=function(r,s){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(s);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},e.trigger=function(r){var s=this.listeners[r];if(s)if(arguments.length===2)for(var n=s.length,a=0;a<n;++a)s[a].call(this,arguments[1]);else for(var l=Array.prototype.slice.call(arguments,1),h=s.length,f=0;f<h;++f)s[f].apply(this,l)},e.dispose=function(){this.listeners={}},e.pipe=function(r){this.on("data",function(s){r.push(s)})},i}();var Du=Ct(zt()),x2=function(e){return Du.default.atob?Du.default.atob(e):Buffer.from(e,"base64").toString("binary")};function Gs(i){for(var e=x2(i),t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var Pu=class extends qa{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(` 143`);t>-1;t=this.buffer.indexOf(` 144`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}},S2=" ",Iu=function(i){let 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},E2=function(){let t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},et=function(i){let e={};if(!i)return e;let t=i.split(E2()),r=t.length,s;for(;r--;)t[r]!==""&&(s=/([^=]*)=(.*)/.exec(t[r]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e},Mp=i=>{let e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t},Ou=class extends qa{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,r;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{let l=a(e);return l===e?n:n.concat([l])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){r={type:"tag",tagType:"inf"},t[1]&&(r.duration=parseFloat(t[1])),t[2]&&(r.title=t[2]),this.trigger("data",r);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"targetduration"},t[1]&&(r.duration=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"version"},t[1]&&(r.version=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"media-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){r={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(r.number=parseInt(t[1],10)),this.trigger("data",r);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){r={type:"tag",tagType:"playlist-type"},t[1]&&(r.playlistType=t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){r=we(Iu(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",r);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){r={type:"tag",tagType:"allow-cache"},t[1]&&(r.allowed=!/NO/.test(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(r={type:"tag",tagType:"map"},t[1]){let a=et(t[1]);a.URI&&(r.uri=a.URI),a.BYTERANGE&&(r.byterange=Iu(a.BYTERANGE))}this.trigger("data",r);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"stream-inf"},t[1]&&(r.attributes=et(t[1]),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=Mp(r.attributes.RESOLUTION)),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),r.attributes["PROGRAM-ID"]&&(r.attributes["PROGRAM-ID"]=parseInt(r.attributes["PROGRAM-ID"],10))),this.trigger("data",r);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){r={type:"tag",tagType:"media"},t[1]&&(r.attributes=et(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){r={type:"tag",tagType:"program-date-time"}
144,t[1]&&(r.dateTimeString=t[1],r.dateTimeObject=new Date(t[1])),this.trigger("data",r);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){r={type:"tag",tagType:"key"},t[1]&&(r.attributes=et(t[1]),r.attributes.IV&&(r.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(r.attributes.IV=r.attributes.IV.substring(2)),r.attributes.IV=r.attributes.IV.match(/.{8}/g),r.attributes.IV[0]=parseInt(r.attributes.IV[0],16),r.attributes.IV[1]=parseInt(r.attributes.IV[1],16),r.attributes.IV[2]=parseInt(r.attributes.IV[2],16),r.attributes.IV[3]=parseInt(r.attributes.IV[3],16),r.attributes.IV=new Uint32Array(r.attributes.IV))),this.trigger("data",r);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){r={type:"tag",tagType:"start"},t[1]&&(r.attributes=et(t[1]),r.attributes["TIME-OFFSET"]=parseFloat(r.attributes["TIME-OFFSET"]),r.attributes.PRECISE=/YES/.test(r.attributes.PRECISE)),this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out-cont"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-out"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){r={type:"tag",tagType:"cue-in"},t[1]?r.data=t[1]:r.data="",this.trigger("data",r);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"skip"},r.attributes=et(t[1]),r.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(r.attributes["SKIPPED-SEGMENTS"]=parseInt(r.attributes["SKIPPED-SEGMENTS"],10)),r.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(r.attributes["RECENTLY-REMOVED-DATERANGES"]=r.attributes["RECENTLY-REMOVED-DATERANGES"].split(S2)),this.trigger("data",r);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part"},r.attributes=et(t[1]),["DURATION"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),r.attributes.hasOwnProperty("BYTERANGE")&&(r.attributes.byterange=Iu(r.attributes.BYTERANGE)),this.trigger("data",r);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"server-control"},r.attributes=et(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=/YES/.test(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"part-inf"},r.attributes=et(t[1]),["PART-TARGET"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseFloat(r.attributes[a]))}),this.trigger("data",r);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"preload-hint"},r.attributes=et(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(r.attributes.hasOwnProperty(a)){r.attributes[a]=parseInt(r.attributes[a],10);let l=a==="BYTERANGE-LENGTH"?"length":"offset";r.attributes.byterange=r.attributes.byterange||{},r.attributes.byterange[l]=r.attributes[a],delete r.attributes[a]}}),this.trigger("data",r);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"rendition-report"},r.attributes=et(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){r.attributes.hasOwnProperty(a)&&(r.attributes[a]=parseInt(r.attributes[a],10))}),this.trigger("data",r);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){r={type:"tag",tagType:"daterange"},r.attributes=et(t[1]),["ID","CLASS"].forEach(function(l){r.attributes.hasOwnProperty(l)&&(r.attributes[l]=String(r.attributes[l]))}),["START-DATE","END-DATE"].forEach(function(l){r.attributes.hasOwnProperty(l)&&(r.attributes[l]=new Date(r.attributes[l]))}),["DURATION","PLANNED-DURATION"].forEach(function(l){r.attributes.hasOwnProperty(l)&&(r.attributes[l]=parseFloat(r.attributes[l]))}),["END-ON-NEXT"].forEach(function(l){r.attributes.hasOwnProperty(l)&&(r.attributes[l]=/YES/i.test(r.attributes[l]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(l){r.attributes.hasOwnProperty(l)&&(r.attributes[l]=r.attributes[l].toString(16))});let a=/^X-([A-Z]+-)+[A-Z]+$/;
144for(let l in r.attributes){if(!a.test(l))continue;let h=/[0-9A-Fa-f]{6}/g.test(r.attributes[l]),f=/^\d+(\.\d+)?$/.test(r.attributes[l]);r.attributes[l]=h?r.attributes[l].toString(16):f?parseFloat(r.attributes[l]):String(r.attributes[l])}this.trigger("data",r);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){r={type:"tag",tagType:"content-steering"},r.attributes=et(t[1]),this.trigger("data",r);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){r={type:"tag",tagType:"i-frame-playlist"},r.attributes=et(t[1]),r.attributes.URI&&(r.uri=r.attributes.URI),r.attributes.BANDWIDTH&&(r.attributes.BANDWIDTH=parseInt(r.attributes.BANDWIDTH,10)),r.attributes.RESOLUTION&&(r.attributes.RESOLUTION=Mp(r.attributes.RESOLUTION)),r.attributes["AVERAGE-BANDWIDTH"]&&(r.attributes["AVERAGE-BANDWIDTH"]=parseInt(r.attributes["AVERAGE-BANDWIDTH"],10)),r.attributes["FRAME-RATE"]&&(r.attributes["FRAME-RATE"]=parseFloat(r.attributes["FRAME-RATE"])),this.trigger("data",r);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){r={type:"tag",tagType:"define"},r.attributes=et(t[1]),this.trigger("data",r);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:r,segment:s}){typeof r!="function"&&(r=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:r(n),customType:t,segment:s}),!0})}addTagMapper({expression:e,map:t}){let r=s=>e.test(s)?t(s):s;this.tagMappers.push(r)}},C2=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Ai=function(i){let e={};
144return Object.keys(i).forEach(function(t){e[C2(t)]=i[t]}),e},ku=function(i){let{serverControl:e,targetDuration:t,partTargetDuration:r}=i;if(!e)return;let s="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",l=t&&t*3,h=r&&r*2;t&&!e.hasOwnProperty(n)&&(e[n]=l,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${l}).`})),l&&e[n]<l&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${l})`}),e[n]=l),r&&!e.hasOwnProperty(a)&&(e[a]=r*3,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),r&&e[a]<h&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${h}).`}),e[a]=h)},ja=class extends qa{constructor(e={}){super(),this.lineStream=new Pu,this.parseStream=new Ou,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;let t=this,r=[],s={},n,a,l=!1,h=function(){},f={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},g="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",_=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let T=0,E=0,w={};this.on("end",()=>{s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&a&&(s.key=a),!s.timeline&&typeof _=="number"&&(s.timeline=_),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(y){let I,A;if(t.manifest.definitions){for(let P in t.manifest.definitions)if(y.uri&&(y.uri=y.uri.replace(`{$${P}}`,t.manifest.definitions[P])),y.attributes)for(let k in y.attributes)typeof y.attributes[k]=="string"&&(y.attributes[k]=y.attributes[k].replace(`{$${P}}`,t.manifest.definitions[P]))}({tag(){({version(){y.version&&(this.manifest.version=y.version)},"allow-cache"(){this.manifest.allowCache=y.allowed,"allowed"in y||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){let P={};"length"in y&&(s.byterange=P,P.length=y.length,"offset"in y||(y.offset=T)),"offset"in y&&(s.byterange=P,P.offset=y.offset),T=P.offset+P.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"})),y.title&&(s.title=y.title),y.duration>0&&(s.duration=y.duration),y.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key(){if(!y.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(y.attributes.METHOD==="NONE"){a=null;return}if(!y.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(y.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:y.attributes};return}if(y.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:y.attributes.URI};return}if(y.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(y.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(y.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),y.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(y.attributes.KEYID&&y.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:y.attributes.KEYFORMAT,keyId:y.attributes.KEYID.substring(2)},pssh:Gs(y.attributes.URI.split(",")[1])};return}y.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:y.attributes.METHOD||"AES-128",uri:y.attributes.URI},typeof y.attributes.IV<"u"&&(a.iv=y.attributes.IV)},"media-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+y.number});return}this.manifest.mediaSequence=y.number},"discontinuity-sequence"(){if(!isFinite(y.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+y.number});return}this.manifest.discontinuitySequence=y.number,_=y.number},"playlist-type"(){if(!/VOD|EVENT/.test(y.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+y.playlist});return}this.manifest.playlistType=y.playlistType},map(){n={},y.uri&&(n.uri=y.uri),y.byterange&&(n.byterange=y.byterange),a&&(n.key=a)}
144,"stream-inf"(){if(this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||f,!y.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),we(s.attributes,y.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||f,!(y.attributes&&y.attributes.TYPE&&y.attributes["GROUP-ID"]&&y.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}let P=this.manifest.mediaGroups[y.attributes.TYPE];P[y.attributes["GROUP-ID"]]=P[y.attributes["GROUP-ID"]]||{},I=P[y.attributes["GROUP-ID"]],A={default:/yes/i.test(y.attributes.DEFAULT)},A.default?A.autoselect=!0:A.autoselect=/yes/i.test(y.attributes.AUTOSELECT),y.attributes.LANGUAGE&&(A.language=y.attributes.LANGUAGE),y.attributes.URI&&(A.uri=y.attributes.URI),y.attributes["INSTREAM-ID"]&&(A.instreamId=y.attributes["INSTREAM-ID"]),y.attributes.CHARACTERISTICS&&(A.characteristics=y.attributes.CHARACTERISTICS),y.attributes.FORCED&&(A.forced=/yes/i.test(y.attributes.FORCED)),I[y.attributes.NAME]=A},discontinuity(){_+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=y.dateTimeString,this.manifest.dateTimeObject=y.dateTimeObject),s.dateTimeString=y.dateTimeString,s.dateTimeObject=y.dateTimeObject;let{lastProgramDateTime:P}=this;this.lastProgramDateTime=new Date(y.dateTimeString).getTime(),P===null&&this.manifest.segments.reduceRight((k,L)=>(L.programDateTime=k-L.duration*1e3,L.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(y.duration)||y.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+y.duration});return}this.manifest.targetDuration=y.duration,ku.call(this,this.manifest)},start(){if(!y.attributes||isNaN(y.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:y.attributes["TIME-OFFSET"],precise:y.attributes.PRECISE}},"cue-out"(){s.cueOut=y.data},"cue-out-cont"(){s.cueOutCont=y.data},"cue-in"(){s.cueIn=y.data},skip(){this.manifest.skip=Ai(y.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",y.attributes,["SKIPPED-SEGMENTS"])},part(){l=!0;let P=this.manifest.segments.length,k=Ai(y.attributes);s.parts=s.parts||[],s.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=E),E=k.byterange.offset+k.byterange.length);let L=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${L} for segment #${P}`,y.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,U)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${U} lacks required attribute(s): LAST-PART`})})},"server-control"(){let P=this.manifest.serverControl=Ai(y.attributes);P.hasOwnProperty("canBlockReload")||(P.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ku.call(this,this.manifest),P.canSkipDateranges&&!P.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"(){let P=this.manifest.segments.length,k=Ai(y.attributes),L=k.type&&k.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=L?E:0,L&&(E=k.byterange.offset+k.byterange.length)));let R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${P}`,y.attributes,["TYPE","URI"]),!!k.type)for(let U=0;U<s.preloadHints.length-1;U++){let N=s.preloadHints[U];N.type&&N.type===k.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${R} for segment #${P} has the same TYPE ${k.type} as preload hint #${U}`})}},"rendition-report"(){let P=Ai(y.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(P);let k=this.manifest.renditionReports.length-1,L=["LAST-MSN","URI"];l&&L.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${k}`,y.attributes,L)},"part-inf"(){this.manifest.partInf=Ai(y.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",y.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ku.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Ai(y.attributes));let P=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${P}`,y.attributes,["ID","START-DATE"]);let k=this.manifest.dateRanges[P];k.endDate&&k.startDate&&new Date(k.endDate)<new Date(k.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),k.duration&&k.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),k.plannedDuration&&k.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});let L=!!k.endOnNext;if(L&&!k.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT
144=YES attribute must have a CLASS attribute"}),L&&(k.duration||k.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),k.duration&&k.endDate){let U=k.startDate.getTime()+k.duration*1e3;this.manifest.dateRanges[P].endDate=new Date(U)}if(!w[k.id])w[k.id]=k;else{for(let U in w[k.id])if(k[U]&&JSON.stringify(w[k.id][U])!==JSON.stringify(k[U])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}let R=this.manifest.dateRanges.findIndex(U=>U.id===k.id);this.manifest.dateRanges[R]=we(this.manifest.dateRanges[R],k),w[k.id]=we(w[k.id],k),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=Ai(y.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",y.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};let P=(k,L)=>{if(k in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${k}`});return}this.manifest.definitions[k]=L};if("QUERYPARAM"in y.attributes){if("NAME"in y.attributes||"IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}let k=this.params.get(y.attributes.QUERYPARAM);if(!k){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${y.attributes.QUERYPARAM}`});return}P(y.attributes.QUERYPARAM,decodeURIComponent(k));return}if("NAME"in y.attributes){if("IMPORT"in y.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in y.attributes)||typeof y.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${y.attributes.NAME}`});return}P(y.attributes.NAME,y.attributes.VALUE);return}if("IMPORT"in y.attributes){if(!this.mainDefinitions[y.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${y.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}P(y.attributes.IMPORT,this.mainDefinitions[y.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:y.attributes,uri:y.uri,timeline:_}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",y.attributes,["BANDWIDTH","URI"])}}[y.tagType]||h).call(t)},uri(){s.uri=y.uri,r.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),a&&(s.key=a),s.timeline=_,n&&(s.map=n),E=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){y.segment?(s.custom=s.custom||{},s.custom[y.customType]=y.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[y.customType]=y.data)}})[y.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,r){let s=[];r.forEach(function(n){t.hasOwnProperty(n)||s.push(n)}),s.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(` 145`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}};var er=Ct(zt()),tr={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},w2=["video","audio","text"],Np=["Video","Audio","Text"],Lu=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,r,s){var n=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(s).toString(16)).slice(-2);return"avc1."+n+"00"+a})};var Ut=function(e){e===void 0&&(e="");var t=e.split(","),r=[];return t.forEach(function(s){s=s.trim();var n;w2.forEach(function(a){var l=tr[a].exec(s.toLowerCase());if(!(!l||l.length<=1)){n=a;var h=s.substring(0,l[1].length),f=s.replace(h,"");r.push({type:h,details:f,mediaType:a})}}),n||r.push({type:s,details:"",mediaType:"unknown"})}),r},Bp=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var r=e.mediaGroups.AUDIO[t];if(!r)return null;for(var s in r){var n=r[s];if(n.default&&n.playlists)return Ut(n.playlists[0].attributes.CODECS)}return null};var Ru=function(e){return e===void 0&&(e=""),tr.audio.test(e.trim().toLowerCase())},A2=function(e){return e===void 0&&(e=""),tr.text.test(e.trim().toLowerCase())},ir=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Lu(n.trim())}),r="video";t.length===1&&Ru(t[0])?r="audio":t.length===1&&A2(t[0])&&(r="application");var s="mp4";return t.every(function(n){return tr.mp4.test(n)})?s="mp4":t.every(function(n){return tr.webm.test(n)})?s="webm":t.every(function(n){return tr.ogg.test(n)})&&(s="ogg"),r+"/"+s+';codecs="'+e+'"'}},Lr=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),er.default.MediaSource&&er.default.MediaSource.isTypeSupp
145orted&&er.default.MediaSource.isTypeSupported(ir(e))||t&&er.default.ManagedMediaSource&&er.default.ManagedMediaSource.isTypeSupported&&er.default.ManagedMediaSource.isTypeSupported(ir(e))||!1},Ha=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var r=0;r<Np.length;r++){var s=Np[r];if(tr["muxer"+s].test(t))return!0}return!1})},Mu="mp4a.40.2",Fp="avc1.4d400d";var D2=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,I2=/^application\/dash\+xml/i,Nu=function(e){return D2.test(e)?"hls":I2.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null};var Up=Ct(zt());var k2=function(e){return e.toString(2).length},P2=function(e){return Math.ceil(k2(e)/8)};var Fu=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},O2=function(e){return Fu(e)},z=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!O2(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))};var je=Up.default.BigInt||Number,Bu=[je("0x1"),je("0x100"),je("0x10000"),je("0x1000000"),je("0x100000000"),je("0x10000000000"),je("0x1000000000000"),je("0x100000000000000"),je("0x10000000000000000")],MA=function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"}();var Uu=function(e,t){var r=t===void 0?{}:t,s=r.signed,n=s===void 0?!1:s,a=r.le,l=a===void 0?!1:a;e=z(e);var h=l?"reduce":"reduceRight",f=e[h]?e[h]:Array.prototype[h],g=f.call(e,function(T,E,w){var y=l?w:Math.abs(w+1-e.length);return T+je(E)*Bu[y]},je(0));if(n){var _=Bu[e.length]/je(2)-je(1);g=je(g),g>_&&(g-=_,g-=_,g-=je(2))}return Number(g)},Vp=function(e,t){var r=t===void 0?{}:t,s=r.le,n=s===void 0?!1:s;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=je(e);for(var a=P2(e),l=new Uint8Array(new ArrayBuffer(a)),h=0;h<a;h++){var f=n?h:Math.abs(h+1-l.length);l[f]=Number(e/Bu[h]&je(255)),e<0&&(l[f]=Math.abs(~l[f]),l[f]-=h===0?1:2)}return l},Vu=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,z(e));try{return decodeURIComponent(escape(t))}catch{}return t},$a=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);return r},qp=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t=t.filter(function(l){return l&&(l.byteLength||l.length)&&typeof l!="string"}),t.length<=1)return z(t[0]);var s=t.reduce(function(l,h,f){return l+(h.byteLength||h.length)},0),n=new Uint8Array(s),a=0;return t.forEach(function(l){l=z(l),n.set(l,a),a+=l.byteLength}),n},ce=function(e,t,r){var s=r===void 0?{}:r,n=s.offset,a=n===void 0?0:n,l=s.mask,h=l===void 0?[]:l;e=z(e),t=z(t);var f=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&f.call(t,function(g,_){var T=h[_]?h[_]&e[a+_]:e[a+_];return g===T})};var tt=Ct(zt());var jp=function(e,t,r){t.forEach(function(s){for(var n in e.mediaGroups[s])for(var a in e.mediaGroups[s][n]){var l=e.mediaGroups[s][n][a];r(l,s,n,a)}})};var $m=Ct(Nm());var Bm=i=>!!i&&typeof i=="object",Be=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(r=>{Array.isArray(e[r])&&Array.isArray(t[r])?e[r]=e[r].concat(t[r]):Bm(e[r])&&Bm(t[r])?e[r]=Be(e[r],t[r]):e[r]=t[r]}),e),{}),zm=i=>Object.keys(i).map(e=>i[e]),o1=(i,e)=>{let t=[];for(let r=i;r<e;r++)t.push(r);return t},$r=i=>i.reduce((e,t)=>e.concat(t),[]),Gm=i=>{if(!i.length)return[];let e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},l1=(i,e)=>i.reduce((t,r,s)=>(r[e]&&t.push(s),t),[]),u1=(i,e)=>zm(i.reduce((t,r)=>(r.forEach(s=>{t[e(s)]=s}),t),{})),zr={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_
145NUMBER_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"},on=({baseUrl:i="",source:e="",range:t="",indexRange:r=""})=>{let s={uri:e,resolvedUri:Or(i||"",e)};if(t||r){let a=(t||r).split("-"),l=tt.default.BigInt?tt.default.BigInt(a[0]):parseInt(a[0],10),h=tt.default.BigInt?tt.default.BigInt(a[1]):parseInt(a[1],10);l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l)),h<Number.MAX_SAFE_INTEGER&&typeof h=="bigint"&&(h=Number(h));let f;typeof h=="bigint"||typeof l=="bigint"?f=tt.default.BigInt(h)-tt.default.BigInt(l)+tt.default.BigInt(1):f=h-l+1,typeof f=="bigint"&&f<Number.MAX_SAFE_INTEGER&&(f=Number(f)),s.byterange={length:f,offset:l}}return s},c1=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=tt.default.BigInt(i.offset)+tt.default.BigInt(i.length)-tt.default.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Fm=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),d1={static(i){let{duration:e,timescale:t=1,sourceDuration:r,periodDuration:s}=i,n=Fm(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof s=="number"?{start:0,end:s/a}:{start:0,end:r/a}},dynamic(i){let{NOW:e,clientOffset:t,availabilityStartTime:r,timescale:s=1,duration:n,periodStart:a=0,minimumUpdatePeriod:l=0,timeShiftBufferDepth:h=1/0}=i,f=Fm(i.endNumber),g=(e+t)/1e3,_=r+a,E=g+l-_,w=Math.ceil(E*s/n),y=Math.floor((g-_-h)*s/n),I=Math.floor((g-_)*s/n);return{start:Math.max(0,y),end:typeof f=="number"?f:Math.min(w,I)}}},h1=i=>e=>{let{duration:t,timescale:r=1,periodStart:s,startNumber:n=1}=i;return{number:n+e,duration:t/r,timeline:s,time:e*t}},rc=i=>{let{type:e,duration:t,timescale:r=1,periodDuration:s,sourceDuration:n}=i,{start:a,end:l}=d1[e](i),h=o1(a,l).map(h1(i));if(e==="static"){let f=h.length-1,g=typeof s=="number"?s:n;h[f].duration=g-t/r*f}return h},Wm=i=>{let{baseUrl:e,initialization:t={},sourceDuration:r,indexRange:s="",periodStart:n,presentationTime:a,number:l=0,duration:h}=i;if(!e)throw new Error(zr.NO_BASE_URL);let f=on({baseUrl:e,source:t.sourceURL,range:t.range}),g=on({baseUrl:e,source:e,indexRange:s});if(g.map=f,h){let _=rc(i);_.length&&(g.duration=_[0].duration,g.timeline=_[0].timeline)}else r&&(g.duration=r,g.timeline=n);return g.presentationTime=a||n,g.number=l,[g]},to=(i,e,t)=>{let r=i.sidx.map?i.sidx.map:null,s=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,l=a.offset+a.length,h=e.timescale,f=e.references.filter(I=>I.referenceType!==1),g=[],_=i.endList?"static":"dynamic",T=i.sidx.timeline,E=T,w=i.mediaSequence||0,y;typeof e.firstOffset=="bigint"?y=tt.default.BigInt(l)+e.firstOffset:y=l+e.firstOffset;for(let I=0;I<f.length;I++){let A=e.references[I],P=A.referencedSize,k=A.subsegmentDuration,L;typeof y=="bigint"?L=y+tt.default.BigInt(P)-tt.default.BigInt(1):L=y+P-1;let R=`${y}-${L}`,N=Wm({baseUrl:t,timescale:h,timeline:n,periodStart:T,presentationTime:E,number:w,duration:k,sourceDuration:s,indexRange:R,type:_})[0];r&&(N.map=r),g.push(N),typeof y=="bigint"?y+=tt.default.BigInt(P):y+=P,E+=k/h,w++}return i.segments=g,i},f1=["AUDIO","SUBTITLES"],p1=1/60,Xm=i=>u1(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),m1=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Um=i=>{let e=[];return jp(i,f1,(t,r,s,n)=>{e=e.concat(t.playlists||[])}),e},Vm=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,r)=>{t.number=i.mediaSequence+r})},g1=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(r=>{r.discontinuitySequence=t.findIndex(function({timeline:h}){return h===r.timeline});let s=m1(i,r.attributes.NAME);if(!s||r.sidx)return;let n=r.segments[0],a=s.segments.findIndex(function(h){return Math.abs(h.presentationTime-n.presentationTime)<p1});if(a===-1){Vm({playlist:r,mediaSequence:s.mediaSequence+s.segments.length}),r.segments[0].discontinuity=!0,r.discontinuityStarts.unshift(0),(!s.segments.length&&r.timeline>s.timeline||s.segments.length&&r.timeline>s.segments[s.segments.length-1].timeline)&&r.discontinuitySequence--;return}s.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,r.discontinuityStarts.unshift(0),r.discontinuitySequence--),Vm({playlist:r,mediaSequence:s.segments[a].number})})},_1=({oldManifest:i,newManifest:e})=>{let t=i.playlists.concat(Um(i)),r=e.playlists.concat(Um(e));return e.timelineStarts=Xm([i.timelineStarts,e.timelineStarts]),g1({oldPlaylists:t,newPlaylists:r,timelineStarts:e.timelineStarts}),e},ln=i=>i&&i.uri+"-"+c1(i.byterange),ic=i=>{let e=i.reduce(function(r,s){return r[s.attributes.baseUrl]||(r[s.attributes.baseUrl]=[]),r[s.attributes.baseUrl].push(s),r},{}),t=[];return Object.values(e).forEach(r=>{let s=zm(r.reduce((n,a)=>{let l=a.attributes.id+(a.attributes.lang||"");return n[l]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[l].segments.push(...a.segments)),a.attributes.contentProtection&&(n[l].attributes.contentProtection=a.attributes.contentProtection)):(n[l]=a,n[l].attributes.timelineStarts=[]),n[l].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(s)}),t.map(r=>(r.discontinuityStarts=l1(r.segments||[],"discontinuity"),r))},sc=(i,e)=>{let t=ln(i.sidx),r=t&&e[t]&&e[t].sidx;return r&&to(i,r,i.sidx.resolvedUri),i},y1=(i,e={})=>
145{if(!Object.keys(e).length)return i;for(let t in i)i[t]=sc(i[t],e);return i},v1=({attributes:i,segments:e,sidx:t,mediaSequence:r,discontinuitySequence:s,discontinuityStarts:n},a)=>{let l={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:s,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:r,segments:e};return i.contentProtection&&(l.contentProtection=i.contentProtection),i.serviceLocation&&(l.attributes.serviceLocation=i.serviceLocation),t&&(l.sidx=t),a&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l},b1=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:r,discontinuitySequence:s})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);let n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);let a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:r,discontinuitySequence:s,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},T1=(i,e={},t=!1)=>{let r,s=i.reduce((n,a)=>{let l=a.attributes.role&&a.attributes.role.value||"",h=a.attributes.lang||"",f=a.attributes.label||"main";if(h&&!a.attributes.label){let _=l?` (${l})`:"";f=`${a.attributes.lang}${_}`}n[f]||(n[f]={language:h,autoselect:!0,default:l==="main",playlists:[],uri:""});let g=sc(v1(a,t),e);return n[f].playlists.push(g),typeof r>"u"&&l==="main"&&(r=a,r.default=!0),n},{});if(!r){let n=Object.keys(s)[0];s[n].default=!0}return s},x1=(i,e={})=>i.reduce((t,r)=>{let s=r.attributes.label||r.attributes.lang||"text",n=r.attributes.lang||"und";return t[s]||(t[s]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[s].playlists.push(sc(b1(r),e)),t},{}),S1=i=>i.reduce((e,t)=>(t&&t.forEach(r=>{let{channel:s,language:n}=r;e[n]={autoselect:!1,default:!1,instreamId:s,language:n},r.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(e[n].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(e[n]["3D"]=r["3D"])}),e),{}),E1=({attributes:i,segments:e,sidx:t,discontinuityStarts:r})=>{let s={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:r,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(s.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(s.contentProtection=i.contentProtection),i.serviceLocation&&(s.attributes.serviceLocation=i.serviceLocation),t&&(s.sidx=t),s},C1=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",w1=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",A1=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",D1=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:r}){return r===t.timeline}),t.segments&&t.segments.forEach((r,s)=>{r.number=s})})},qm=i=>i?Object.keys(i).reduce((e,t)=>{let r=i[t];return e.concat(r.playlists)},[]):[],I1=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:r={},previousManifest:s,eventStream:n})=>{if(!i.length)return{};let{sourceDuration:a,type:l,suggestedPresentationDelay:h,minimumUpdatePeriod:f}=i[0].attributes,g=ic(i.filter(C1)).map(E1),_=ic(i.filter(w1)),T=ic(i.filter(A1)),E=i.map(L=>L.attributes.captionServices).filter(Boolean),w={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:y1(g,r)};f>=0&&(w.minimumUpdatePeriod=f*1e3),e&&(w.locations=e),t&&(w.contentSteering=t),l==="dynamic"&&(w.suggestedPresentationDelay=h),n&&n.length>0&&(w.eventStream=n);let y=w.playlists.length===0,I=_.length?T1(_,r,y):null,A=T.length?x1(T,r):null,P=g.concat(qm(I),qm(A)),k=P.map(({timelineStarts:L})=>L);return w.timelineStarts=Xm(k),D1(P,w.timelineStarts),I&&(w.mediaGroups.AUDIO.audio=I),A&&(w.mediaGroups.SUBTITLES.subs=A),E.length&&(w.mediaGroups["CLOSED-CAPTIONS"].cc=S1(E)),s?_1({oldManifest:s,newManifest:w}):w},k1=(i,e,t)=>{let{NOW:r,clientOffset:s,availabilityStartTime:n,timescale:a=1,periodStart:l=0,minimumUpdatePeriod:h=0}=i,f=(r+s)/1e3,g=n+l,T=f+h-g;return Math.ceil((T*a-e)/t)},Km=(i,e)=>{let{type:t,minimumUpdatePeriod:r=0,media:s="",sourceDuration:n,timescale:a=1,startNumber:l=1,peri
145odStart:h}=i,f=[],g=-1;for(let _=0;_<e.length;_++){let T=e[_],E=T.d,w=T.r||0,y=T.t||0;g<0&&(g=y),y&&y>g&&(g=y);let I;if(w<0){let k=_+1;k===e.length?t==="dynamic"&&r>0&&s.indexOf("$Number$")>0?I=k1(i,g,E):I=(n*a-g)/E:I=(e[k].t-g)/E}else I=w+1;let A=l+f.length+I,P=l+f.length;for(;P<A;)f.push({number:P,duration:E/a,time:g,timeline:h}),g+=E,P++}return f},P1=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,O1=i=>(e,t,r,s)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;let n=""+i[t];return t==="RepresentationID"||(r?s=parseInt(s,10):s=1,n.length>=s)?n:`${new Array(s-n.length+1).join("0")}${n}`},jm=(i,e)=>i.replace(P1,O1(e)),L1=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?rc(i):Km(i,e),R1=(i,e)=>{let t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=i,s=on({baseUrl:i.baseUrl,source:jm(r.sourceURL,t),range:r.range});return L1(i,e).map(a=>{t.Number=a.number,t.Time=a.time;let l=jm(i.media||"",t),h=i.timescale||1,f=i.presentationTimeOffset||0,g=i.periodStart+(a.time-f)/h;return{uri:l,timeline:a.timeline,duration:a.duration,resolvedUri:Or(i.baseUrl||"",l),map:s,number:a.number,presentationTime:g}})},M1=(i,e)=>{let{baseUrl:t,initialization:r={}}=i,s=on({baseUrl:t,source:r.sourceURL,range:r.range}),n=on({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=s,n},N1=(i,e)=>{let{duration:t,segmentUrls:r=[],periodStart:s}=i;if(!t&&!e||t&&e)throw new Error(zr.SEGMENT_TIME_UNSPECIFIED);let n=r.map(h=>M1(i,h)),a;return t&&(a=rc(i)),e&&(a=Km(i,e)),a.map((h,f)=>{if(n[f]){let g=n[f],_=i.timescale||1,T=i.presentationTimeOffset||0;return g.timeline=h.timeline,g.duration=h.duration,g.number=h.number,g.presentationTime=s+(h.time-T)/_,g}}).filter(h=>h)},B1=({attributes:i,segmentInfo:e})=>{let t,r;e.template?(r=R1,t=Be(i,e.template)):e.base?(r=Wm,t=Be(i,e.base)):e.list&&(r=N1,t=Be(i,e.list));let s={attributes:i};if(!r)return s;let n=r(t,e.segmentTimeline);if(t.duration){let{duration:a,timescale:l=1}=t;t.duration=a/l}else n.length?t.duration=n.reduce((a,l)=>Math.max(a,Math.ceil(l.duration)),0):t.duration=0;return s.attributes=t,s.segments=n,e.base&&t.indexRange&&(s.sidx=n[0],s.segments=[]),s},F1=i=>i.map(B1),Ce=(i,e)=>Gm(i.childNodes).filter(({tagName:t})=>t===e),un=i=>i.textContent.trim(),U1=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Hr=i=>{let l=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!l)return 0;let[h,f,g,_,T,E]=l.slice(1);return parseFloat(h||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(g||0)*86400+parseFloat(_||0)*3600+parseFloat(T||0)*60+parseFloat(E||0)},V1=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),Hm={mediaPresentationDuration(i){return Hr(i)},availabilityStartTime(i){return V1(i)/1e3},minimumUpdatePeriod(i){return Hr(i)},suggestedPresentationDelay(i){return Hr(i)},type(i){return i},timeShiftBufferDepth(i){return Hr(i)},start(i){return Hr(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return U1(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){let e=parseInt(i,10);return isNaN(e)?Hr(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}},Re=i=>i&&i.attributes?Gm(i.attributes).reduce((e,t)=>{let r=Hm[t.name]||Hm.DEFAULT;return e[t.name]=r(t.value),e},{}):{},q1={"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"},io=(i,e)=>e.length?$r(i.map(function(t){return e.map(function(r){let s=un(r),n=Or(t.baseUrl,s),a=Be(Re(r),{baseUrl:n});return n!==s&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,nc=i=>{let e=Ce(i,"SegmentTemplate")[0],t=Ce(i,"SegmentList")[0],r=t&&Ce(t,"SegmentURL").map(_=>Be({tag:"SegmentURL"},Re(_))),s=Ce(i,"SegmentBase")[0],n=t||e,a=n&&Ce(n,"SegmentTimeline")[0],l=t||s||e,h=l&&Ce(l,"Initialization")[0],f=e&&Re(e);f&&h?f.initialization=h&&Re(h):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});let g={template:f,segmentTimeline:a&&Ce(a,"S").map(_=>Re(_)),list:t&&Be(Re(t),{segmentUrls:r,initialization:Re(h)}),base:s&&Be(Re(s),{initialization:Re(h)})};return Object.keys(g).forEach(_=>{g[_]||delete g[_]}),g},j1=(i,e,t)=>r=>{let s=Ce(r,"BaseURL"),n=io(e,s),a=Be(i,Re(r)),l=nc(r);return n.map(h=>({segmentInfo:Be(t,l),attributes:Be(a,h)}))},H1=i=>i.reduce((e,t)=>
145{let r=Re(t);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());let s=q1[r.schemeIdUri];if(s){e[s]={attributes:r};let n=Ce(t,"cenc:pssh")[0];if(n){let a=un(n);e[s].pssh=a&&Gs(a)}}return e},{}),$1=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let r,s;return s=t,/^CC\d=/.test(t)?[r,s]=t.split("="):/^CC\d$/.test(t)&&(r=t),{channel:r,language:s}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){let[s,n=""]=t.split("=");r.channel=s,r.language=t,n.split(",").forEach(a=>{let[l,h]=a.split(":");l==="lang"?r.language=h:l==="er"?r.easyReader=Number(h):l==="war"?r.aspectRatio=Number(h):l==="3D"&&(r["3D"]=Number(h))})}else r.language=t;return r.channel&&(r.channel="SERVICE"+r.channel),r})},z1=i=>$r(Ce(i.node,"EventStream").map(e=>{let t=Re(e),r=t.schemeIdUri;return Ce(e,"Event").map(s=>{let n=Re(s),a=n.presentationTime||0,l=t.timescale||1,h=n.duration||0,f=a/l+i.attributes.start;return{schemeIdUri:r,value:t.value,id:n.id,start:f,end:f+h/l,messageData:un(s)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),G1=(i,e,t)=>r=>{let s=Re(r),n=io(e,Ce(r,"BaseURL")),a=Ce(r,"Role")[0],l={role:Re(a)},h=Be(i,s,l),f=Ce(r,"Accessibility")[0],g=$1(Re(f));g&&(h=Be(h,{captionServices:g}));let _=Ce(r,"Label")[0];if(_&&_.childNodes.length){let I=_.childNodes[0].nodeValue.trim();h=Be(h,{label:I})}let T=H1(Ce(r,"ContentProtection"));Object.keys(T).length&&(h=Be(h,{contentProtection:T}));let E=nc(r),w=Ce(r,"Representation"),y=Be(t,E);return $r(w.map(j1(h,n,y)))},W1=(i,e)=>(t,r)=>{let s=io(e,Ce(t.node,"BaseURL")),n=Be(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);let a=Ce(t.node,"AdaptationSet"),l=nc(t.node);return $r(a.map(G1(n,s,l)))},X1=(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;let t=Be({serverURL:un(i[0])},Re(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},K1=({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,Y1=(i,e={})=>{let{manifestUri:t="",NOW:r=Date.now(),clientOffset:s=0,eventHandler:n=function(){}}=e,a=Ce(i,"Period");if(!a.length)throw new Error(zr.INVALID_NUMBER_OF_PERIOD);let l=Ce(i,"Location"),h=Re(i),f=io([{baseUrl:t}],Ce(i,"BaseURL")),g=Ce(i,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=r,h.clientOffset=s,l.length&&(h.locations=l.map(un));let _=[];return a.forEach((T,E)=>{let w=Re(T),y=_[E-1];w.start=K1({attributes:w,priorPeriodAttributes:y?y.attributes:null,mpdType:h.type}),_.push({node:T,attributes:w})}),{locations:h.locations,contentSteeringInfo:X1(g,n),representationInfo:$r(_.map(W1(h,f))),eventStream:$r(_.map(z1))}},Ym=i=>{if(i==="")throw new Error(zr.DASH_EMPTY_MANIFEST);let e=new $m.DOMParser,t,r;try{t=e.parseFromString(i,"application/xml"),r=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(zr.DASH_INVALID_XML);return r},Q1=i=>{let e=Ce(i,"UTCTiming")[0];if(!e)return null;let t=Re(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(zr.UNSUPPORTED_UTC_TIMING_SCHEME)}return t};var Qm=(i,e={})=>{let t=Y1(Ym(i),e),r=F1(t.representationInfo);return I1({dashPlaylists:r,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Jm=i=>Q1(Ym(i));var l0=Ct(sg());var ex=z([73,68,51]),tx=function(e,t){t===void 0&&(t=0),e=z(e);var r=e[t+5],s=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(r&16)>>4;return n?s+20:s+10},sr=function i(e,t){return t===void 0&&(t=0),e=z(e),e.length-t<10||!ce(e,ex,{offset:t})?t:(t+=tx(e,t),i(e,t))};
145var fD=new Uint8Array([79,112,117,115,72,101,97,100]);var ag=function(e){return typeof e=="string"?$a(e):e},ax=function(e){return Array.isArray(e)?e.map(function(t){return ag(t)}):[ag(e)]},ac,og=function(e){e=z(e);for(var t=[],r=0;e.length>r;){var s=e[r],n=0,a=0;a++;var l=e[a];for(a++;l&128;)n=(l&127)<<7,l=e[a],a++;n+=l&127;for(var h=0;h<ac.length;h++){var f=ac[h],g=f.id,_=f.parser;if(s===g){t.push(_(e.subarray(a,a+n)));break}}r+=n+a}return t};ac=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(t.flags&128&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.flags&64){var r=e[t.size];t.url=Vu(e.subarray(t.size+1,t.size+1+r)),t.size+=r}return t.flags&32&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=og(e.subarray(t.size))||[],t}},{id:4,parser:function(e){var t={tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:og(e.subarray(13))};return t}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var lg=function i(e,t,r){r===void 0&&(r=!1),t=ax(t),e=z(e);var s=[];if(!t.length)return s;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,l=e.subarray(n+4,n+8);if(a===0)break;var h=n+a;if(h>e.length){if(r)break;h=e.length}var f=e.subarray(n+8,h);ce(l,t[0])&&(t.length===1?s.push(f):s.push.apply(s,i(f,t.slice(1),r))),n=h}return s};var cn={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])},oc=[128,64,32,16,8,4,2,1],ox=function(e){for(var t=1,r=0;r<oc.length&&!(e&oc[r]);r++)t++;return t},ro=function(e,t,r,s){r===void 0&&(r=!0),s===void 0&&(s=!1);var n=ox(e[t]),a=e.subarray(t,t+n);return r&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=oc[n-1]),{length:n,value:Uu(a,{signed:s}),bytes:a}},ug=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?Vp(e):e},lx=function(e){return Array.isArray(e)?e.map(function(t){return ug(t)}):[ug(e)]},ux=function i(e,t,r){if(r>=t.length)return t.length;var s=ro(t,r,!1);if(ce(e.bytes,s.bytes))return r;var n=ro(t,r+s.length);return i(e,t,r+n.length+n.value+s.length)},lc=function i(e,t){t=lx(t),e=z(e);var r=[];if(!t.length)return r;for(var s=0;s<e.length;){var n=ro(e,s,!1),a=ro(e,s+n.length),l=s+n.length+a.length;a.value===127&&(a.value=ux(n,e,l),a.value!==e.length&&(a.value-=l));var h=l+a.value>e.length?e.length:l+a.value,f=e.subarray(l,h);ce(t[0],n.bytes)&&(t.length===1?r.push(f):r=r.concat(i(f,t.slice(1))));var g=n.length+a.length+f.length;s+=g}return r};var cx=z([0,0,0,1]),dx=z([0,0,1]),hx=z([0,0,3]),fx=function(e){for(var t=[],r=1;r<e.length-2;)ce(e.subarray(r,r+3),hx)&&(t.push(r+2),r++),r++;if(t.length===0)return e;var s=e.length-t.length,n=new Uint8Array(s),a=0;for(r=0;r<s;a++,r++)a===t[0]&&(a++,t.shift()),n[r]=e[a];return n},cg=function(e,t,r,s){s===void 0&&(s=1/0),e=z(e),r=[].concat(r);for(var n=0,a,l=0;n<e.length&&(l<s||a);){var h=void 0;if(ce(e.subarray(n),cx)?h=4:ce(e.subarray(n),dx)&&(h=3),!h){n++;continue}if(l++,a)return fx(e.subarray(a,n));var f=void 0;t==="h264"?f=e[n+h]&31:t==="h265"&&(f=e[n+h]>>1&63),r.indexOf(f)!==-1&&(a=n+h),n+=h+(t==="h264"?1:2)}return e.subarray(0,0)},dg=function(e,t,r){return cg(e,"h264",t,r)},hg=function(e,t,r){return cg(e,"h265",t,r)};
145var it={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])},Gr={aac:function(e){var t=sr(e);return ce(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=sr(e);return ce(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=lc(e,[cn.EBML,cn.DocType])[0];return ce(t,it.webm)},mkv:function(e){var t=lc(e,[cn.EBML,cn.DocType])[0];return ce(t,it.matroska)},mp4:function(e){if(Gr["3gp"](e)||Gr.mov(e))return!1;if(ce(e,it.mp4,{offset:4})||ce(e,it.fmp4,{offset:4})||ce(e,it.moof,{offset:4})||ce(e,it.moov,{offset:4}))return!0},mov:function(e){return ce(e,it.mov,{offset:4})},"3gp":function(e){return ce(e,it["3gp"],{offset:4})},ac3:function(e){var t=sr(e);return ce(e,it.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=sr(e);return ce(e,it.flac,{offset:t})},ogg:function(e){return ce(e,it.ogg)},avi:function(e){return ce(e,it.riff)&&ce(e,it.avi,{offset:8})},wav:function(e){return ce(e,it.riff)&&ce(e,it.wav,{offset:8})},h264:function(e){return dg(e,7,3).length},h265:function(e){return hg(e,[32,33],3).length}},uc=Object.keys(Gr).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);uc.forEach(function(i){var e=Gr[i];Gr[i]=function(t){return e(z(t))}});var px=Gr,so=function(e){e=z(e);for(var t=0;t<uc.length;t++){var r=uc[t];if(px[r](e))return r}return""},fg=function(e){return lg(e,["moof"]).length>0};var Mi=Ct(yg());var kc="8.23.4",fi={},Bi=function(i,e){return fi[i]=fi[i]||[],e&&(fi[i]=fi[i].concat(e)),fi[i]},mx=function(i,e){Bi(i,e)},u0=function(i,e){let t=Bi(i).indexOf(e);return t<=-1?!1:(fi[i]=fi[i].slice(),fi[i].splice(t,1),!0)},gx=function(i,e){Bi(i,[].concat(e).map(t=>{let r=(...s)=>(u0(i,r),t(...s));return r}))},mo={prefixed:!0},ho=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],vg=ho[0],pn;for(let i=0;i<ho.length;i++)if(ho[i][1]in q.default){pn=ho[i];break}if(pn){for(let i=0;i<pn.length;i++)mo[vg[i]]=pn[i];mo.prefixed=pn[0]!==vg[0]}var pt=[],_x=(i,e,t)=>(r,s,n)=>{let a=e.levels[s],l=new RegExp(`^(${a})$`),h=i;if(r!=="log"&&n.unshift(r.toUpperCase()+":"),t&&(h=`%c${i}`,n.unshift(t)),n.unshift(h+":"),pt){pt.push([].concat(n));let g=pt.length-1e3;pt.splice(0,g>0?g:0)}if(!C.default.console)return;let f=C.default.console[r];!f&&r==="debug"&&(f=C.default.console.info||C.default.console.log),!(!f||!a||!l.test(r))&&f[Array.isArray(n)?"apply":"call"](C.default.console,n)};function Pc(i,e=":",t=""){let r="info",s;function n(...a){s("log",r,a)}return s=_x(i,n,t),n.createLogger=(a,l,h)=>{let f=l!==void 0?l:e,g=h!==void 0?h:t,_=`${i} ${f} ${a}`;return Pc(_,f,g)},n.createNewLogger=(a,l,h)=>Pc(a,l,h),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);r=a}return r},n.history=()=>pt?[].concat(pt):[],n.history.filter=a=>(pt||[]).filter(l=>new RegExp(`.*${a}.*`).test(l[0])),n.history.clear=()=>{pt&&(pt.length=0)},n.history.disable=()=>{pt!==null&&(pt.length=0,pt=null)},n.history.enable=()=>{pt===null&&(pt=[])},n.error=(...a)=>s("error",r,a),n.warn=(...a)=>s("warn",r,a),n.debug=(...a)=>s("debug",r,a),n}var J=Pc("VIDEOJS"),c0=J.createLogger,yx=Object.prototype.toString,d0=function(i){return ti(i)?Object.keys(i):[]};
145function Qr(i,e){d0(i).forEach(t=>e(i[t],t))}function h0(i,e,t=0){return d0(i).reduce((r,s)=>e(r,i[s],s),t)}function ti(i){return!!i&&typeof i=="object"}function as(i){return ti(i)&&yx.call(i)==="[object Object]"&&i.constructor===Object}function pe(...i){let e={};return i.forEach(t=>{t&&Qr(t,(r,s)=>{if(!as(r)){e[s]=r;return}as(e[s])||(e[s]={}),e[s]=pe(e[s],r)})}),e}function f0(i={}){let e=[];for(let t in i)if(i.hasOwnProperty(t)){let r=i[t];e.push(r)}return e}function _l(i,e,t,r=!0){let s=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){let a=t();return s(a),a}};return r&&(n.set=s),Object.defineProperty(i,e,n)}var vx=Object.freeze({__proto__:null,each:Qr,reduce:h0,isObject:ti,isPlain:as,merge:pe,values:f0,defineLazyProperty:_l}),wd=!1,p0=null,qt=!1,m0,g0=!1,Jr=!1,Zr=!1,ii=!1,Ad=null,yl=null,bx=!!(C.default.cast&&C.default.cast.framework&&C.default.cast.framework.CastReceiverContext),_0=null,go=!1,vl=!1,_o=!1,bl=!1,yo=!1,vo=!1,bo=!1,Tn=!!(ps()&&("ontouchstart"in C.default||C.default.navigator.maxTouchPoints||C.default.DocumentTouch&&C.default.document instanceof C.default.DocumentTouch)),ki=C.default.navigator&&C.default.navigator.userAgentData;ki&&ki.platform&&ki.brands&&(qt=ki.platform==="Android",Jr=!!ki.brands.find(i=>i.brand==="Microsoft Edge"),Zr=!!ki.brands.find(i=>i.brand==="Chromium"),ii=!Jr&&Zr,Ad=yl=(ki.brands.find(i=>i.brand==="Chromium")||{}).version||null,vl=ki.platform==="Windows");if(!Zr){let i=C.default.navigator&&C.default.navigator.userAgent||"";wd=/iPod/i.test(i),p0=function(){let e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),qt=/Android/i.test(i),m0=function(){let e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;let t=e[1]&&parseFloat(e[1]),r=e[2]&&parseFloat(e[2]);return t&&r?parseFloat(e[1]+"."+e[2]):t||null}(),g0=/Firefox/i.test(i),Jr=/Edg/i.test(i),Zr=/Chrome/i.test(i)||/CriOS/i.test(i),ii=!Jr&&Zr,Ad=yl=function(){let e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),_0=function(){let e=/MSIE\s(\d+)\.\d/.exec(i),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),yo=/Tizen/i.test(i),vo=/Web0S/i.test(i),bo=yo||vo,go=/Safari/i.test(i)&&!ii&&!qt&&!Jr&&!bo,vl=/Windows/i.test(i),_o=/iPad/i.test(i)||go&&Tn&&!/iPhone/i.test(i),bl=/iPhone/i.test(i)&&!_o}var Xe=bl||_o||wd,Tl=(go||Xe)&&!ii,y0=Object.freeze({__proto__:null,get IS_IPOD(){return wd},get IOS_VERSION(){return p0},get IS_ANDROID(){return qt},get ANDROID_VERSION(){return m0},get IS_FIREFOX(){return g0},get IS_EDGE(){return Jr},get IS_CHROMIUM(){return Zr},get IS_CHROME(){return ii},get CHROMIUM_VERSION(){return Ad},get CHROME_VERSION(){return yl},IS_CHROMECAST_RECEIVER:bx,get IE_VERSION(){return _0},get IS_SAFARI(){return go},get IS_WINDOWS(){return vl},get IS_IPAD(){return _o},get IS_IPHONE(){return bl},get IS_TIZEN(){return yo},get IS_WEBOS(){return vo},get IS_SMART_TV(){return bo},TOUCH_ENABLED:Tn,IS_IOS:Xe,IS_ANY_SAFARI:Tl});function bg(i){return typeof i=="string"&&!!i.trim()}function Tx(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ps(){return q.default===C.default.document}function ms(i){return ti(i)&&i.nodeType===1}function v0(){try{return C.default.parent!==C.default.self}catch{return!0}}function b0(i){return function(e,t){if(!bg(e))return q.default[i](null);bg(t)&&(t=q.default.querySelector(t));let r=ms(t)?t:q.default;return r[i]&&r[i](e)}}function K(i="div",e={},t={},r){let s=q.default.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){let a=e[n];n==="textContent"?$i(s,a):(s[n]!==a||n==="tabIndex")&&(s[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){s.setAttribute(n,t[n])}),r&&Dd(s,r),s}function $i(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function Oc(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function gn(i,e){return Tx(e),i.classList.contains(e)}function ur(i,...e){return i.classList.add(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),i}function xl(i,...e){return i?(i.classList.remove(...e.reduce((t,r)=>t.concat(r.split(/\s+/)),[])),i):(J.warn("removeClass was called with an element that doesn't exist"),null)}function T0(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEac
145h(r=>i.classList.toggle(r,t)),i}function x0(i,e){Object.getOwnPropertyNames(e).forEach(function(t){let r=e[t];r===null||typeof r>"u"||r===!1?i.removeAttribute(t):i.setAttribute(t,r===!0?"":r)})}function Li(i){let e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){let r=i.attributes;for(let s=r.length-1;s>=0;s--){let n=r[s].name,a=r[s].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function S0(i,e){return i.getAttribute(e)}function os(i,e,t){i.setAttribute(e,t)}function Sl(i,e){i.removeAttribute(e)}function E0(){q.default.body.focus(),q.default.onselectstart=function(){return!1}}function C0(){q.default.onselectstart=function(){return!0}}function ls(i){if(i&&i.getBoundingClientRect&&i.parentNode){let e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(r=>{e[r]!==void 0&&(t[r]=e[r])}),t.height||(t.height=parseFloat(us(i,"height"))),t.width||(t.width=parseFloat(us(i,"width"))),t}}function xn(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};let e=i.offsetWidth,t=i.offsetHeight,r=0,s=0;for(;i.offsetParent&&i!==q.default[mo.fullscreenElement];)r+=i.offsetLeft,s+=i.offsetTop,i=i.offsetParent;return{left:r,top:s,width:e,height:t}}function El(i,e){let t={x:0,y:0};if(Xe){let g=i;for(;g&&g.nodeName.toLowerCase()!=="html";){let _=us(g,"transform");
145if(/^matrix/.test(_)){let T=_.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(_)){let T=_.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&C.default.WebKitCSSMatrix){let T=C.default.getComputedStyle(g.assignedSlot.parentElement).transform,E=new C.default.WebKitCSSMatrix(T);t.x+=E.m41,t.y+=E.m42}g=g.parentNode||g.host}}let r={},s=xn(e.target),n=xn(i),a=n.width,l=n.height,h=e.offsetY-(n.top-s.top),f=e.offsetX-(n.left-s.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,h=e.changedTouches[0].pageY+n.top,Xe&&(f-=t.x,h-=t.y)),r.y=1-Math.max(0,Math.min(1,h/l)),r.x=Math.max(0,Math.min(1,f/a)),r}function w0(i){return ti(i)&&i.nodeType===3}function Cl(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function A0(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),ms(e)||w0(e))return e;if(typeof e=="string"&&/\S/.test(e))return q.default.createTextNode(e)}).filter(e=>e)}function Dd(i,e){return A0(e).forEach(t=>i.appendChild(t)),i}function D0(i,e){return Dd(Cl(i),e)}function Sn(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)}var Fi=b0("querySelector"),I0=b0("querySelectorAll");function us(i,e){if(!i||!e)return"";if(typeof C.default.getComputedStyle=="function"){let t;try{t=C.default.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function k0(i){[...q.default.styleSheets].forEach(e=>{try{let t=[...e.cssRules].map(s=>s.cssText).join(""),r=q.default.createElement("style");r.textContent=t,i.document.head.appendChild(r)}catch{let r=q.default.createElement("link");r.rel="stylesheet",r.type=e.type,r.media=e.media.mediaText,r.href=e.href,i.document.head.appendChild(r)}})}var P0=Object.freeze({__proto__:null,isReal:ps,isEl:ms,isInFrame:v0,createEl:K,textContent:$i,prependTo:Oc,hasClass:gn,addClass:ur,removeClass:xl,toggleClass:T0,setAttributes:x0,getAttributes:Li,getAttribute:S0,setAttribute:os,removeAttribute:Sl,blockTextSelection:E0,unblockTextSelection:C0,getBoundingClientRect:ls,findPosition:xn,getPointerPosition:El,isTextNode:w0,emptyEl:Cl,normalizeContent:A0,appendContent:Dd,insertContent:D0,isSingleLeftClick:Sn,$:Fi,$$:I0,computedStyle:us,copyStyleSheetsToWindow:k0}),O0=!1,Lc,xx=function(){if(Lc.options.autoSetup===!1)return;let i=Array.prototype.slice.call(q.default.getElementsByTagName("video")),e=Array.prototype.slice.call(q.default.getElementsByTagName("audio")),t=Array.prototype.slice.call(q.default.getElementsByTagName("video-js")),r=i.concat(e,t);if(r&&r.length>0)for(let s=0,n=r.length;s<n;s++){let a=r[s];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Lc(a);else{Rc(1);break}}else O0||Rc(1)};function Rc(i,e){ps()&&(e&&(Lc=e),C.default.setTimeout(xx,i))}function Mc(){O0=!0,C.default.removeEventListener("load",Mc)}ps()&&(q.default.readyState==="complete"?Mc():C.default.addEventListener("load",Mc));var L0=function(i){let e=q.default.createElement("style");return e.className=i,e},R0=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e},st=new WeakMap,Sx=3,Ex=Sx;function kt(){return Ex++}function Tg(i,e){if(!st.has(i))return;let t=st.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&st.delete(i)}function Id(i,e,t,r){t.forEach(function(s){i(e,s,r)})}function wl(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){let r=i||C.default.event;i={};let s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(let n in r)s.includes(n)||n==="returnValue"&&r.preventDefault||(i[n]=r[n]);if(i.target||(i.target=i.srcElement||q.default),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){r.preventDefault&&r.preventDefault(),i.returnValue=!1,r.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),i.cancelBubble=!0,r.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){let n=q.default.documentElement,a=q.default.body;i.pageX=i.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}var ao,Cx=function(){if(typeof ao!="boolean"){ao=!1;try{let i=Object.defineProperty({},"passive",{get(){ao=!0}});C.default.addEventListener("test",null,i),C.default.removeEventListener("test",null,i)}catch{}}return ao},wx=["touchstart","touchmove"];function St(i,e,t){if(Array.isArray(e))return Id(St,i,e,t);st.has(i)||st.set(i,{});let r=st.get(i);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),t.guid||(t.guid=kt()),r.handlers[e].push(t),r.dispatcher||(r.disabled=!1,r.dispatcher=function(s,n){if(r.disabled)return;s=wl(s);let a=r.handlers[s.type];if(a){let l=a.slice(0);for(let h=0,f=l.length;h<f&&!s.isImmediatePropagationStopped();h++)try{l[h].call(i,s,n)}catch(g){J.error(g)}}}),r.handlers[e].length===1)if(i.addEventListener){let s=!1;Cx()&&wx.indexOf(e)>-1&&(s={passive:!0}),i.addEventListener(e,r.dispatcher,s)}else i.attachEvent&&i.attachEvent("on"+e,r.dispatcher)}function Ke(i,e,t){if(!st.has(i))return;let r=st.get(i);if(!r.handlers)return;if(Array.isArray(e))return Id(Ke,i,e,t);let s=function(a,l){r.handlers[l]=[],Tg(a,l)};if(e===void 0){for(let a in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},a)&&s(i,a);return}let n=r.handlers[e];if(n){if(!t){s(i,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);Tg(i,e)}}function gs(i,e,t){let r=st.has(i)?st.get(i):{},s=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=wl(e),r.dispatcher&&r.dispatcher.call(i,e,t),s&&!e.isPropagationStopped()&&e.bubbles===!0)gs.call(null,s,e,t);else if(!s&&!e.defaultPrevented&&e.target&&e.target[e.type]){st.has(e.target)||st.set(e.target,{});let n=st.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Al(i,e,t){if(Array.isArray(e))return Id(Al,i,e,t);let r=function(){Ke(i,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||kt(),St(i,e,r)}function kd(i,e,t){let r=function(){Ke(i,e,r),t.apply(this,arguments)};r.guid=t.guid=t.guid||kt(),St(i,e,r)}var Ax=Object.freeze({__proto__:null,fixEvent:wl,on:St,off:Ke,trigger:gs,one:Al,any:kd}),Pt=30,ve=function(i,e,t){e.guid||(e.guid=kt());let r=e.bind(i);return r.guid=t?t+"_"+e.guid:e.guid,r},ri=function(i,e){let t=C.default.performance.now();return function(...s){let n=C.default.performance.now();n-t>=e&&(i(...s),t=n)}},M0=function(i,e,t,r=C.default){let s,n=()=>{r.clearTimeout(s),s=null},a=function(){let l=this,h=arguments,f=function(){s=null,f=null,t||i.apply(l,h)};!s&&t&&i.apply(l,h),r.clearTimeout(s),s=r.setTimeout(f,e)};return a.cancel=n,a},Dx=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Pt,bind_:ve,throttle:ri,debounce:M0}),dn,nt=class{on(e,t){let r=this.addEventListener;this.addEventListener=()=>{}
145,St(this,e,t),this.addEventListener=r}off(e,t){Ke(this,e,t)}one(e,t){let r=this.addEventListener;this.addEventListener=()=>{},Al(this,e,t),this.addEventListener=r}any(e,t){let r=this.addEventListener;this.addEventListener=()=>{},kd(this,e,t),this.addEventListener=r}trigger(e){let t=e.type||e;typeof e=="string"&&(e={type:t}),e=wl(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),gs(this,e)}queueTrigger(e){dn||(dn=new Map);let t=e.type||e,r=dn.get(this);r||(r=new Map,dn.set(this,r));let s=r.get(t);r.delete(t),C.default.clearTimeout(s);let n=C.default.setTimeout(()=>{r.delete(t),r.size===0&&(r=null,dn.delete(this)),this.trigger(e)},0);r.set(t,n)}};nt.prototype.allowedEvents_={};nt.prototype.addEventListener=nt.prototype.on;nt.prototype.removeEventListener=nt.prototype.off;nt.prototype.dispatchEvent=nt.prototype.trigger;var Dl=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,mi=i=>i instanceof nt||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),Ix=(i,e)=>{mi(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},Nc=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,To=(i,e,t)=>{if(!i||!i.nodeName&&!mi(i))throw new Error(`Invalid target for ${Dl(e)}#${t}; must be a DOM node or evented object.`)},N0=(i,e,t)=>{if(!Nc(i))throw new Error(`Invalid event type for ${Dl(e)}#${t}; must be a non-empty string or array.`)},B0=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Dl(e)}#${t}; must be a function.`)},pc=(i,e,t)=>{let r=e.length<3||e[0]===i||e[0]===i.eventBusEl_,s,n,a;return r?(s=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(s=e[0],n=e[1],a=e[2]),To(s,i,t),N0(n,i,t),B0(a,i,t),a=ve(i,a),{isTargetingSelf:r,target:s,type:n,listener:a}},nr=(i,e,t,r)=>{To(i,i,e),i.nodeName?Ax[e](i,t,r):i[e](t,r)},kx={on(...i){let{isTargetingSelf:e,target:t,type:r,listener:s}=pc(this,i,"on");if(nr(t,"on",r,s),!e){let n=()=>this.off(t,r,s);n.guid=s.guid;let a=()=>this.off("dispose",n);a.guid=s.guid,nr(this,"on","dispose",n),nr(t,"on","dispose",a)}},one(...i){let{isTargetingSelf:e,target:t,type:r,listener:s}=pc(this,i,"one");if(e)nr(t,"one",r,s);else{let n=(...a)=>{this.off(t,r,n),s.apply(null,a)};n.guid=s.guid,nr(t,"one",r,n)}},any(...i){let{isTargetingSelf:e,target:t,type:r,listener:s}=pc(this,i,"any");if(e)nr(t,"any",r,s);else{let n=(...a)=>{this.off(t,r,n),s.apply(null,a)};n.guid=s.guid,nr(t,"any",r,n)}},off(i,e,t){if(!i||Nc(i))Ke(this.eventBusEl_,i,e);else{let r=i,s=e;To(r,this,"off"),N0(s,this,"off"),B0(t,this,"off"),t=ve(this,t),this.off("dispose",t),r.nodeName?(Ke(r,s,t),Ke(r,"dispose",t)):mi(r)&&(r.off(s,t),r.off("dispose",t))}},trigger(i,e){To(this.eventBusEl_,this,"trigger");let t=i&&typeof i!="string"?i.type:i;if(!Nc(t))throw new Error(`Invalid event type for ${Dl(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return gs(this.eventBusEl_,i,e)}};function Pd(i,e={}){let{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_=K("span",{className:"vjs-event-bus"});return Object.assign(i,kx),i.eventedCallbacks&&i.eventedCallbacks.forEach(r=>{r()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(r){r&&st.has(r)&&st.delete(r)}),C.default.setTimeout(()=>{i.eventBusEl_=null},0)}),i}var Px={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Qr(i,(t,r)=>{this.state[r]!==t&&(e=e||{},e[r]={from:this.state[r],to:t}),this.state[r]=t}),e&&mi(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function F0(i,e){return Object.assign(i,Px),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&mi(i)&&i.on("statechanged",i.handleStateChanged),i}var _n=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},Ie=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},U0=function(i,e){return Ie(i)===Ie(e)},Ox=Object.freeze({__proto__:null,toLowerCase:_n,toTitleCase:Ie,titleCaseEquals:U0}),F=class i{constructor(e,t,r){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=pe({},this.options_),t=this.options_=pe(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let s=e&&e.id&&e.id()||"no_player";this.id_=`${s}_component_${kt()}`}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(s=>this.addClass(s)),["on","off","one","any","trigger"].forEach(s=>{this[s]=void 0}),t.evented!==!1&&(Pd(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),F0(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(r),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_=pe(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,r){return K(e,t,r)}localize(e,t,r=e){let s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[s],l=s&&s.split("-")[0],h=n&&n[l],f=r;return a&&a[e]?f=a[e]:h&&h[e]&&(f=h[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(g,_){let T=t[_-1],E=T;return typeof T>"u"&&(E=g),E})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}
145getDescendant(...e){e=e.reduce((r,s)=>r.concat(s),[]);let t=this;for(let r=0;r<e.length;r++)if(t=t.getChild(e[r]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let r="http://www.w3.org/2000/svg",s=K("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=q.default.createElementNS(r,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");let a=q.default.createElementNS(r,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),s.appendChild(n),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},r=this.children_.length){let s,n;if(typeof e=="string"){n=Ie(e);let a=t.componentClass||n;t.name=n;let l=i.getComponent(a);if(!l)throw new Error(`Component ${a} does not exist`);if(typeof l!="function")return null;s=new l(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(r,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),n=n||s.name&&Ie(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[_n(n)]=s),typeof s.el=="function"&&s.el()){let a=null;this.children_[r+1]&&(this.children_[r+1].el_?a=this.children_[r+1].el_:ms(this.children_[r+1])&&(a=this.children_[r+1])),this.contentEl().insertBefore(s.el(),a)}return s}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let s=this.children_.length-1;s>=0;s--)if(this.children_[s]===e){t=!0,this.children_.splice(s,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ie(e.name())]=null,this.childNameIndex_[_n(e.name())]=null;let r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t=this.options_,r=a=>{let l=a.name,h=a.opts;if(t[l]!==void 0&&(h=t[l]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;let f=this.addChild(l,h);f&&(this[l]=f)},s,n=i.getComponent("Tech");Array.isArray(e)?s=e:s=Object.keys(e),s.concat(Object.keys(this.options_).filter(function(a){return!s.some(function(l){return typeof l=="string"?a===l:a===l.name})})).map(a=>{let l,h;return typeof a=="string"?(l=a,h=e[l]||this.options_[l]||{}):(l=a.name,h=a),{name:l,opts:h}}).filter(a=>{let l=i.getComponent(a.opts.componentClass||Ie(a.name));return l&&!n.isTech(l)}).forEach(r)}}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(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Fi(e,t||this.contentEl())}$$(e,t){return I0(e,t||this.contentEl())}hasClass(e){return gn(this.el_,e)}addClass(...e){ur(this.el_,...e)}removeClass(...e){xl(this.el_,...e)}toggleClass(e,t){T0(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 S0(this.el_,e)}setAttribute(e,t){os(this.el_,e,t)}removeAttribute(e){Sl(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,r){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",r||this.trigger("componentresize");return}if(!this.el_)return 0;let s=this.el_.style[e],n=s.indexOf("px");return parseInt(n!==-1?s.slice(0,n):this.el_["offset"+Ie(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)){let r=`offset${Ie(e)}`;t=this.el_[r]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){let 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},r={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:r}}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,r=10,s=200,n;this.on("touchstart",function(l){l.touches.length===1&&(t={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=C.default.performance.now(),n=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)n=!1;else if(t){let h=l.touches[0].pageX-t.pageX,f=l.touches[0].pageY-t.pageY;Math.sqrt(h*h+f*f)>r&&(n=!1)}});let a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(l){t=null,n===!0&&C.default.performance.now()-e<s&&(l.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let e=ve(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});let r=function(s){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",r),this.on("touchcancel",r)}setTimeout(e,t){var r;return e=ve(this,e),this.clearTimersOnDispose_(),r=C.default.setTimeout(()=>{this.setTimeoutIds_.has(r)&&this.setTimeoutIds_.delete(r),e()},t),this.setTimeoutIds_.add(r),r}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),C.default.clearTimeout(e)),e}setInterval(e,t){e=ve(this,e),this.clearTimersOnDispose_();let r=C.default.setInterval(e,t);return this.setIntervalIds_.add(r),r}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),C.default.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=ve(this,e),t=C.default.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=ve(this,t);let r=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,r),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),C.default.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
145h(([e,t])=>{this[e].forEach((r,s)=>this[t](s))}),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){let a=C.default.getComputedStyle(n,null),l=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(l)}function r(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||C.default.getComputedStyle(n).height==="0px"||C.default.getComputedStyle(n).width==="0px")}function s(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;let a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(q.default.documentElement.clientWidth||C.default.innerWidth)||a.y<0||a.y>(q.default.documentElement.clientHeight||C.default.innerHeight))return!1;let l=q.default.elementFromPoint(a.x,a.y);for(;l;){if(l===n)return!0;if(l.parentNode)l=l.parentNode;else return!1}}return e||(e=this.el()),!!(s(e)&&r(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.`);let r=i.getComponent("Tech"),s=r&&r.isTech(t),n=i===t||i.prototype.isPrototypeOf(t.prototype);if(s||!n){let l;throw s?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error(`Illegal component, "${e}"; ${l}.`)}e=Ie(e),i.components_||(i.components_={});let a=i.getComponent("Player");if(e==="Player"&&a&&a.players){let l=a.players,h=Object.keys(l);if(l&&h.length>0){for(let f=0;f<h.length;f++)if(l[h[f]]!==null)throw new Error("Can not register Player component after player has been created.")}}return i.components_[e]=t,i.components_[_n(e)]=t,t}static getComponent(e){if(!(!e||!i.components_))return i.components_[e]}};F.registerComponent("Component",F);function Lx(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 xg(i,e,t,r){return Lx(i,r,t.length-1),t[r][e]}function mc(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:xg.bind(null,"start",0,i),end:xg.bind(null,"end",1,i)},C.default.Symbol&&C.default.Symbol.iterator&&(e[C.default.Symbol.iterator]=()=>(i||[]).values()),e}function Vt(i,e){return Array.isArray(i)?mc(i):i===void 0||e===void 0?mc():mc([[i,e]])}var V0=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),r=Math.floor(i/60%60),s=Math.floor(i/3600),n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(s=r=t="-"),s=s>0||a>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",t=t<10?"0"+t:t,s+r+t},Od=V0;function q0(i){Od=i}function j0(){Od=V0}function hr(i,e=i){return Od(i,e)}var Rx=Object.freeze({__proto__:null,createTimeRanges:Vt,createTimeRange:Vt,setFormatTime:q0,resetFormatTime:j0,formatTime:hr});function H0(i,e){let t=0,r,s;if(!e)return 0;(!i||!i.length)&&(i=Vt(0,0));for(let n=0;n<i.length;n++)r=i.start(n),s=i.end(n),s>e&&(s=e),t+=s-r;return t/e}function De(i){if(i instanceof De)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:ti(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=De.defaultMessages[this.code]||"")}De.prototype.code=0;De.prototype.message="";De.prototype.status=null;De.prototype.metadata=null;De.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];De.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."};De.MEDIA_ERR_CUSTOM=0;De.prototype.MEDIA_ERR_CUSTOM=0;De.MEDIA_ERR_ABORTED=1;De.prototype.MEDIA_ERR_ABORTED=1;De.MEDIA_ERR_NETWORK=2;De.prototype.MEDIA_ERR_NETWORK=2;De.MEDIA_ERR_DECODE=3;De.prototype.MEDIA_ERR_DECODE=3;De.MEDIA_ERR_SRC_NOT_SUPPORTED=4;De.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;De.MEDIA_ERR_ENCRYPTED=5;De.prototype.MEDIA_ERR_ENCRYPTED=5;function yn(i){return i!=null&&typeof i.then=="function"}function Qt(i){yn(i)&&i.then(null,e=>{})}var Bc=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,r,s)=>(i[r]&&(t[r]=i[r]),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}})})},Mx=function(i){let e=i.$$("track"),t=Array.prototype.map.call(e,s=>s.track);return Array.prototype.map.call(e,function(s){let n=Bc(s.track);return s.src&&(n.src=s.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(s){return t.indexOf(s)===-1}).map(Bc))}
145,Nx=function(i,e){return i.forEach(function(t){let r=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(s=>r.addCue(s))}),e.textTracks()},Fc={textTracksToJson:Mx,jsonToTextTracks:Nx,trackToJson:Bc},gc="vjs-modal-dialog",Ui=class extends F{constructor(e,t){super(e,t),this.handleKeyDown_=r=>this.handleKeyDown(r),this.close_=r=>this.close(r),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=K("div",{className:`${gc}-content`},{role:"document"}),this.descEl_=K("p",{className:`${gc}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),$i(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`${gc} 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}let 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;let 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"){let t=this.closeable_=!!e,r=this.getChild("closeButton");if(t&&!r){let s=this.contentEl_;this.contentEl_=this.el_,r=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=s,this.on(r,"close",this.close_)}!t&&r&&(this.off(r,"close",this.close_),this.removeChild(r),r.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}
145fillWith(e){let t=this.contentEl(),r=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,r.removeChild(t),this.empty(),D0(t,e),this.trigger("modalfill"),s?r.insertBefore(t,s):r.appendChild(t);let n=this.getChild("closeButton");n&&r.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Cl(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){let e=q.default.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;let t=this.focusableEls_(),r=this.el_.querySelector(":focus"),s;for(let n=0;n<t.length;n++)if(r===t[n]){s=n;break}q.default.activeElement===this.el_&&(s=0),e.shiftKey&&s===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&s===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof C.default.HTMLAnchorElement||t instanceof C.default.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof C.default.HTMLInputElement||t instanceof C.default.HTMLSelectElement||t instanceof C.default.HTMLTextAreaElement||t instanceof C.default.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof C.default.HTMLIFrameElement||t instanceof C.default.HTMLObjectElement||t instanceof C.default.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};Ui.prototype.options_={pauseOnOpen:!0,temporary:!0};F.registerComponent("ModalDialog",Ui);var _i=class extends nt{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},mi(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let r=0,s=this.length;r<s;r++)if(this[r]===e){t=this[r],t.off&&t.off(),this.tracks_.splice(r,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let r=0,s=this.length;r<s;r++){let n=this[r];if(n.id===e){t=n;break}}return t}};_i.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(let i in _i.prototype.allowedEvents_)_i.prototype["on"+i]=null;var _c=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)},xo=class extends _i{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){_c(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&_c(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,_c(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)}},yc=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)},So=class extends _i{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){yc(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&yc(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,yc(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)}},En=class extends _i{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}},Uc=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,r=e.length;t<r;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}
145),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let r=0,s=this.trackElements_.length;r<s;r++)if(e===this.trackElements_[r].track){t=this.trackElements_[r];break}return t}removeTrackElement_(e){for(let t=0,r=this.trackElements_.length;t<r;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},Eo=class i{constructor(e){i.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,r=0,s=e.length;this.cues_=e,this.length_=e.length;let n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<s)for(r=t;r<s;r++)n.call(this,r)}getCueById(e){let t=null;for(let r=0,s=this.length;r<s;r++){let n=this[r];if(n.id===e){t=n;break}}return t}},Bx={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Fx={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ux={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Sg={disabled:"disabled",hidden:"hidden",showing:"showing"},Cn=class extends nt{constructor(e={}){super();let t={id:e.id||"vjs_track_"+kt(),kind:e.kind||"",language:e.language||""},r=e.label||"";for(let s in t)Object.defineProperty(this,s,{get(){return t[s]},set(){}});Object.defineProperty(this,"label",{get(){return r},set(s){s!==r&&(r=s,this.trigger("labelchange"))}})}},Ld=function(i){return new URL(i,q.default.baseURI)},$0=function(i){return new URL(i,q.default.baseURI).href},Rd=function(i){if(typeof i=="string"){let t=i.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},Il=function(i,e=C.default.location){return Ld(i).origin!==e.origin},Vx=Object.freeze({__proto__:null,parseUrl:Ld,getAbsoluteURL:$0,getFileExtension:Rd,isCrossOrigin:Il}),Eg=function(i,e){let t=new C.default.WebVTT.Parser(C.default,C.default.vttjs,C.default.WebVTT.StringDecoder()),r=[];t.oncue=function(s){e.addCue(s)},t.onparsingerror=function(s){r.push(s)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),r.length>0&&(C.default.console&&C.default.console.groupCollapsed&&C.default.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),r.forEach(s=>J.error(s)),C.default.console&&C.default.console.groupEnd&&C.default.console.groupEnd()),t.flush()},Cg=function(i,e){let t={uri:i},r=Il(i);r&&(t.cors=r);let s=e.tech_.crossOrigin()==="use-credentials";s&&(t.withCredentials=s),(0,Cd.default)(t,ve(this,function(n,a,l){if(n)return J.error(n,a);e.loaded_=!0,typeof C.default.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type==="vttjserror"){J.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return Eg(l,e)}):Eg(l,e)}))},fr=class extends Cn{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");let t=pe(e,{kind:Ux[e.kind]||"subtitles",language:e.language||e.srclang||""}),r=Sg[t.mode]||"disabled",s=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(r="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;let n=new Eo(this.cues_),a=new Eo(this.activeCues_),l=!1;this.timeupdateHandler=ve(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});let h=()=>{this.stopTracking()};this.tech_.one("dispose",h),r!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return r},set(f){Sg[f]&&r!==f&&(r=f,!this.preload_&&r!=="disabled"&&this.cues.length===0&&Cg(this.src,this),this.stopTracking(),r!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}}
145,activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;let f=this.tech_.currentTime(),g=[];for(let _=0,T=this.cues.length;_<T;_++){let E=this.cues[_];E.startTime<=f&&E.endTime>=f&&g.push(E)}if(l=!1,g.length!==this.activeCues_.length)l=!0;else for(let _=0;_<g.length;_++)this.activeCues_.indexOf(g[_])===-1&&(l=!0);return this.activeCues_=g,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&Cg(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new C.default.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(let s in e)s in t||(t[s]=e[s]);t.id=e.id,t.originalCue_=e}let r=this.tech_.textTracks();for(let s=0;s<r.length;s++)r[s]!==this&&r[s].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Fc.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let r=this.cues_[t];if(r===e||r.originalCue_&&r.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};fr.prototype.allowedEvents_={cuechange:"cuechange"};var Co=class extends Cn{constructor(e={}){let t=pe(e,{kind:Fx[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"enabled",{get(){return r},set(s){typeof s!="boolean"||s===r||(r=s,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},wo=class extends Cn{constructor(e={}){let t=pe(e,{kind:Bx[e.kind]||""});super(t);let r=!1;Object.defineProperty(this,"selected",{get(){return r},set(s){typeof s!="boolean"||s===r||(r=s,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}},Vi=class i extends nt{constructor(e={}){super();let t,r=new fr(e);this.kind=r.kind,this.src=r.src,this.srclang=r.language,this.label=r.label,this.default=r.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return r}}}),t=i.NONE,r.addEventListener("loadeddata",()=>{t=i.LOADED,this.trigger({type:"load",target:this})})}};Vi.prototype.allowedEvents_={load:"load"};Vi.NONE=0;Vi.LOADING=1;Vi.LOADED=2;Vi.ERROR=3;var It={audio:{ListClass:xo,TrackClass:Co,capitalName:"Audio"},video:{ListClass:So,TrackClass:wo,capitalName:"Video"},text:{ListClass:En,TrackClass:fr,capitalName:"Text"}};Object.keys(It).forEach(function(i){It[i].getterName=`${i}Tracks`,It[i].privateName=`${i}Tracks_`});var cs={remoteText:{ListClass:En,TrackClass:fr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Uc,TrackClass:Vi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},rt=Object.assign({},It,cs);cs.names=Object.keys(cs);It.names=Object.keys(It);rt.names=[].concat(cs.names).concat(It.names);function qx(i,e,t,r,s={}){let n=i.textTracks();s.kind=e,t&&(s.label=t),r&&(s.language=r),s.tech=i;let a=new rt.text.TrackClass(s);return n.addTrack(a),a}var he=class i extends F{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=r=>this.onDurationChange(r),this.trackProgress_=r=>this.trackProgress(r),this.trackCurrentTime_=r=>this.trackCurrentTime(r),this.stopTrackingCurrentTime_=r=>this.stopTrackingCurrentTime(r),this.disposeSourceHandler_=r=>this.disposeSourceHandler(r),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),rt.names.forEach(r=>{let s=rt[r];e&&e[s.getterName]&&(this[s.privateName]=e[s.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(r=>{e[`native${r}Tracks`]===!1&&(this[`featuresNative${r}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 rt.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(ve(this,function(){let 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 Vt(0,0)}bufferedPercent(){return H0(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(It.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{let r=this[`${t}Tracks`]()||[],s=r.length;for(;s--;){let n=r[s];t==="text"&&this.removeRemoteTextTrack(n),r.removeTrack(n)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let r=e[t];this.removeRemoteTextTrack(r)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new De(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Vt(0,0):Vt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}
145initTrackListeners(){It.names.forEach(e=>{let t=It[e],r=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",r),s.addEventListener("addtrack",r),this.on("dispose",()=>{s.removeEventListener("removetrack",r),s.removeEventListener("addtrack",r)})})}addWebVttScript_(){if(!C.default.WebVTT)if(q.default.body.contains(this.el())){if(!this.options_["vtt.js"]&&as(Ic.default)&&Object.keys(Ic.default).length>0){this.trigger("vttjsloaded");return}let e=q.default.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}),C.default.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),r=l=>e.addTrack(l.track),s=l=>e.removeTrack(l.track);t.on("addtrack",r),t.on("removetrack",s),this.addWebVttScript_();let n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let l=0;l<e.length;l++){let h=e[l];h.removeEventListener("cuechange",n),h.mode==="showing"&&h.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",r),t.off("removetrack",s),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let l=0;l<e.length;l++)e[l].removeEventListener("cuechange",n)})}addTextTrack(e,t,r){if(!e)throw new Error("TextTrack kind is required but was not provided");return qx(this,e,t,r)}createRemoteTextTrack(e){let t=pe(e,{tech:this});return new cs.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let r=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(r.track)),r}removeRemoteTextTrack(e){let 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){let t=kt();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 i.canPlayType(e.type)}static isTech(e){return e.prototype instanceof i||e instanceof i||e===i}static registerTech(e,t){if(i.techs_||(i.techs_={}),!i.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ie(e),i.techs_[e]=t,i.techs_[_n(e)]=t,e!=="Tech"&&i.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(i.techs_&&i.techs_[e])return i.techs_[e];if(e=Ie(e),C.default&&C.default.videojs&&C.default.videojs[e])return J.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),C.default.videojs[e]}}};rt.names.forEach(function(i){let e=rt[i];he.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});he.prototype.featuresVolumeControl=!0;he.prototype.featuresMuteControl=!0;he.prototype.featuresFullscreenResize=!1;he.prototype.featuresPlaybackRate=!1;he.prototype.featuresProgressEvents=!1;he.prototype.featuresSourceset=!1;he.prototype.featuresTimeupdateEvents=!1;he.prototype.featuresNativeTextTracks=!1;he.prototype.featuresVideoFrameCallback=!1;he.withSourceHandlers=function(i){i.registerSourceHandler=function(t,r){let s=i.sourceHandlers;s||(s=i.sourceHandlers=[]),r===void 0&&(r=s.length),s.splice(r,0,t)},i.canPlayType=function(t){let r=i.sourceHandlers||[],s;for(let n=0;n<r.length;n++)if(s=r[n].canPlayType(t),s)return s;return""},i.selectSourceHandler=function(t,r){let s=i.sourceHandlers||[],n;for(let a=0;a<s.length;a++)if(n=s[a].canHandleSource(t,r),n)return s[a];return null},i.canPlaySource=function(t,r){let s=i.selectSourceHandler(t,r);return s?s.canHandleSource(t,r):""},["seekable","seeking","duration"].forEach(function(t){let r=this[t];typeof r=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let r=i.selectSourceHandler(t,this.options_);r||(i.nativeSourceHandler?r=i.nativeSourceHandler:J.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=r.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};F.registerComponent("Tech",he);he.registerTech("Tech",he);he.defaultTechOrder_=[];var cr={},Ao={},Do={};function jx(i,e){cr[i]=cr[i]||[],cr[i].push(e)}function Hx(i,e,t){i.setTimeout(()=>
145ar(e,cr[e.type],t,i),1)}function $x(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function zx(i,e,t){return i.reduceRight(Md(t),e[t]())}function Gx(i,e,t,r){return e[t](i.reduce(Md(t),r))}function wg(i,e,t,r=null){let s="call"+Ie(t),n=i.reduce(Md(s),r),a=n===Do,l=a?null:e[t](n);return Kx(i,t,l,a),l}var Wx={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Xx={setCurrentTime:1,setMuted:1,setVolume:1},Ag={play:1,pause:1};function Md(i){return(e,t)=>e===Do?Do:t[i]?t[i](e):e}function Kx(i,e,t,r){for(let s=i.length-1;s>=0;s--){let n=i[s];n[e]&&n[e](r,t)}}function Yx(i){Ao.hasOwnProperty(i.id())&&delete Ao[i.id()]}function Qx(i,e){let t=Ao[i.id()],r=null;if(t==null)return r=e(i),Ao[i.id()]=[[e,r]],r;for(let s=0;s<t.length;s++){let[n,a]=t[s];n===e&&(r=a)}return r===null&&(r=e(i),t.push([e,r])),r}function ar(i={},e=[],t,r,s=[],n=!1){let[a,...l]=e;if(typeof a=="string")ar(i,cr[a],t,r,s,n);else if(a){let h=Qx(r,a);if(!h.setSource)return s.push(h),ar(i,l,t,r,s,n);h.setSource(Object.assign({},i),function(f,g){if(f)return ar(i,l,t,r,s,n);s.push(h),ar(g,i.type===g.type?l:cr[g.type],t,r,s,n)})}else l.length?ar(i,l,t,r,s,n):n?t(i,s):ar(i,cr["*"],t,r,s,!0)}var Jx={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Io=function(i=""){let e=Rd(i);return Jx[e.toLowerCase()]||""},Zx=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;let t=i.cache_.sources.filter(s=>s.src===e);if(t.length)return t[0].type;let r=i.$$("source");for(let s=0;s<r.length;s++){let n=r[s];if(n.type&&n.src&&n.src===e)return n.type}return Io(e)},z0=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=z0(t),Array.isArray(t)?e=e.concat(t):ti(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[Dg({src:i})]:ti(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[Dg(i)]:i=[];return i};function Dg(i){if(!i.type){let e=Io(i.src);e&&(i.type=e)}return i}var eS=`<svg xmlns="http://www.w3.org/2000/svg"> 146 <defs> 147 <symbol viewBox="0 0 48 48" id="vjs-icon-play"> 148 <path d="M16 10v28l22-14z"></path> 149 </symbol> 150 <symbol viewBox="0 0 48 48" id="vjs-icon-pause"> 151 <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path> 152 </symbol> 153 <symbol viewBox="0 0 48 48" id="vjs-icon-audio"> 154 <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path> 155 </symbol> 156 <symbol viewBox="0 0 48 48" id="vjs-icon-captions"> 157 <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path> 158 </symbol> 159 <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles"> 160 <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path> 161 </symbol> 162 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter"> 163 <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path> 164 </symbol> 165 <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit"> 166 <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path> 167 </symbol> 168 <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle"> 169 <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 170 </symbol> 171 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute"> 172 <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path> 173 </symbol> 174 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low"> 175 <path d="M14 18v12h8l10 10V8L22 18h-8z"></path> 176 </symbol> 177 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium"> 178 <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path> 179 </symbol> 180 <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
181 <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path> 182 </symbol> 183 <symbol viewBox="0 0 48 48" id="vjs-icon-spinner"> 184 <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path> 185 </symbol> 186 <symbol viewBox="0 0 24 24" id="vjs-icon-hd"> 187 <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path> 188 </symbol> 189 <symbol viewBox="0 0 48 48" id="vjs-icon-chapters"> 190 <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path> 191 </symbol> 192 <symbol viewBox="0 0 40 40" id="vjs-icon-downloading"> 193 <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path> 194 </symbol> 195 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download"> 196 <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path> 197 </symbol> 198 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done"> 199 <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path> 200 </symbol> 201 <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off"> 202 <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path> 203 </symbol> 204 <symbol viewBox="0 0 48 48" id="vjs-icon-share"> 205 <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path> 206 </symbol> 207 <symbol viewBox="0 0 48 48" id="vjs-icon-cog"> 208 <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path> 209 </symbol> 210 <symbol viewBox="0 0 48 48" id="vjs-icon-square"> 211 <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path> 212 </symbol> 213 <symbol viewBox="0 0 48 48" id="vjs-icon-circle"> 214 <circle cx="24" cy="24" r="20"></circle> 215 </symbol> 216 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline"> 217 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path> 218 </symbol> 219 <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle"> 220 <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path> 221 </symbol> 222 <symbol viewBox="0 0 48 48" id="vjs-icon-cancel"> 223 <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path> 224 </symbol> 225 <symbol viewBox="0 0 48 48" id="vjs-icon-replay"> 226 <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-
2267.16 16-16-7.16-16-16-16z"></path> 227 </symbol> 228 <symbol viewBox="0 0 48 48" id="vjs-icon-repeat"> 229 <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path> 230 </symbol> 231 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5"> 232 <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path> 233 </symbol> 234 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10"> 235 <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path> 236 </symbol> 237 <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30"> 238 <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path> 239 </symbol> 240 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5"> 241 <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path> 242 </symbol> 243 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10"> 244 <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path> 245 </symbol> 246 <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30"> 247 <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path> 248 </symbol> 249 <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description"> 250 <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g> 251 </symbol> 252 <symbol viewBox="0 0 48 48" id="vjs-icon-next-item"> 253 <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path> 254 </symbol> 255 <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item"> 256 <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path> 257 </symbol>
258 <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle"> 259 <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path> 260 </symbol> 261 <symbol viewBox="0 0 48 48" id="vjs-icon-cast"> 262 <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path> 263 </symbol> 264 <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter"> 265 <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path> 266 </symbol> 267 <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit"> 268 <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path> 269 <path fill="none" d="M-1-3h24v24H-1z"></path> 270 </symbol> 271 <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook"> 272 <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path> 273 </symbol> 274 <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin"> 275 <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path> 276 </symbol> 277 <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter"> 278 <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/> 279 </symbol> 280 <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr"> 281 <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path> 282 </symbol> 283 <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest"> 284 <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path> 285 </symbol> 286 </defs> 287</svg>`,Ig=yo?10009:vo?461:8,Wr={codes:{play:415,pause:19,ff:417,rw:412,back:Ig},names:{415:"play",19:"pause",417:"ff",412:"rw",[Ig]:"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]){let e=this.codes[i.code];return this.names[e]}return null}},kg=5,Vc=class 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){let t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let r=t.key.substring(5).toLowerCase();this.move(r)}else if(Wr.isEventKey(t,"play")||Wr.isEventKey(t,"pause")||Wr.isEventKey(t,"ff")||Wr.isEventKey(t,"rw")){t.preventDefault();let r=Wr.getEventName(t);this.performMediaAction_(r)}else Wr.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()+kg);break;case"rw":this.userSeek_(this.player_.currentTime()-kg);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){let t=e.relatedTarget,r=null,s=this.getCurrentComponent(e.target);t&&(r=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!r||!t)&&(s&&s.name()==="CloseButton"?this.refocusComponent():(this.pause(),s&&s.el()&&(this.lastFocusedComponent_=s)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsF
287ocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function r(s){for(let n of s)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&r(n.children_)}return e.children_.forEach(s=>{if(s.hasOwnProperty("el_"))if(s.getIsFocusable&&s.getIsAvailableToBeFocused&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())){t.push(s);return}else s.hasOwnProperty("children_")&&s.children_.length>0?r(s.children_):s.hasOwnProperty("items")&&s.items.length>0?r(s.items):this.findSuitableDOMChild(s)&&t.push(s);if(s.name_==="ErrorDisplay"&&s.opened_){let n=s.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((l,h)=>{t.push({name:()=>"ModalButton"+(h+1),el:()=>l,getPositions:()=>{let f=l.getBoundingClientRect(),g={x:f.x,y:f.y,width:f.width,height:f.height,top:f.top,right:f.right,bottom:f.bottom,left:f.left},_={x:f.left+f.width/2,y:f.top+f.height/2,width:0,height:0,top:f.top+f.height/2,right:f.left+f.width/2,bottom:f.top+f.height/2,left:f.left+f.width/2};return{boundingClientRect:g,center:_}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:f=>!0,focus:()=>l.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(r){if(e.getIsFocusable(r)&&e.getIsAvailableToBeFocused(r))return r;for(let s=0;s<r.children.length;s++){let n=r.children[s],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length){for(let r of this.focusableComponents)if(r.el()===t)return r}}add(e){let t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let r=t.getPositions(),s=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(r.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(r.center,s,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focu
287sedComponent:t})}findBestCandidate_(e,t,r){let s=1/0,n=null;for(let a of t){let l=a.getPositions().center,h=this.calculateDistance_(e,l,r);h<s&&(s=h,n=a)}return n}isInDirection_(e,t,r){switch(r){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,r){let s=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),a;switch(r){case"right":case"left":a=s+n*100;break;case"up":a=n*2+s*.5;break;case"down":a=n*5+s;break;default:a=s+n}return a}searchForTrackSelect_(){let e=this;for(let t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}},qc=class extends F{constructor(e,t,r){let s=pe({createEl:!1},t);if(super(e,s,r),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){let l=Ie(a[n]),h=he.getTech(l);if(l||(h=F.getComponent(l)),h&&h.isSupported()){e.loadTech_(l);break}}else e.src(t.playerOptions.sources)}};F.registerComponent("MediaLoader",qc);var ds=class extends F{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=r=>this.handleMouseOver(r),this.handleMouseOut_=r=>this.handleMouseOut(r),this.handleClick_=r=>this.handleClick(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.emitTapEvents(),this.enable()}createEl(e="div",t={},r={}){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.`),r=Object.assign({role:"button"},r),this.tabIndex_=t.tabIndex;let s=K(e,t,r);return this.player_.options_.experimentalSvgIcons||s.appendChild(K("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=K("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";let r=this.localize(e);this.controlText_=e,$i(this.controlTextEl_,r),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",r)}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)}};F.registerComponent("ClickableComponent",ds);var wn=class extends ds{constructor(e,t){super(e,t),this.update(),this.update_=r=>this.update(r),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return K("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){let 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(K("picture",{className:"vjs-poster",tabIndex:-1},{},K("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()?Qt(this.player_.play()):this.player_.pause())}};wn.prototype.crossorigin=wn.prototype.crossOrigin;F.registerComponent("PosterImage",wn);var Dt="#222",Pg="#ccc",tS={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',
287script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function vc(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 Kt(i,e,t){try{i.style[e]=t}catch{return}}function Og(i){return i?`${i}px`:""}var jc=class extends F{constructor(e,t,r){super(e,t,r);let s=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",s),e.on("userinactive",s),e.on("texttrackchange",s),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(ve(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);let a=C.default.screen.orientation||C.default,l=C.default.screen.orientation?"change":"orientationchange";a.addEventListener(l,n),e.on("dispose",()=>a.removeEventListener(l,n));let h=this.options_.playerOptions.tracks||[];for(let f=0;f<h.length;f++)this.player_.addRemoteTextTrack(h[f],!0);this.preselectTrack()}))}preselectTrack(){let e={captions:1,subtitles:1},t=this.player_.textTracks(),r=this.player_.cache_.selectedLanguage,s,n,a;for(let l=0;l<t.length;l++){let h=t[l];r&&r.enabled&&r.language&&r.language===h.language&&h.kind in e?h.kind===r.kind?a=h:a||(a=h):r&&!r.enabled?(a=null,s=null,n=null):h.default&&(h.kind==="descriptions"&&!s?s=h:h.kind in e&&!n&&(n=h))}a?a.mode="showing":n?n.mode="showing":s&&(s.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof C.default.WebVTT=="function"&&C.default.WebVTT.processCues(C.default,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let a=[];for(let l=0;l<e.length;++l){let h=e[l];h.mode==="showing"&&a.push(h)}this.updateForTrack(a);return}let r=null,s=null,n=e.length;for(;n--;){let a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?r=a:s=a)}if(s?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):r&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(r)),!C.default.CSS.supports("inset","10px")){let a=this.el_,l=a.querySelectorAll(".vjs-text-track-cue"),h=this.player_.controlBar.el_.getBoundingClientRect().height,f=this.player_.el_.getBoundingClientRect().height;a.style="",Kt(a,"position","relative"),Kt(a,"height",f-h+"px"),Kt(a,"top","unset"),bo?Kt(a,"bottom",f+"px"):Kt(a,"bottom","0px"),l.length>0&&l.forEach(g=>{if(g.style.inset){let _=g.style.inset.split(" ");_.length===3&&Object.assign(g.style,{top:_[0],right:_[1],bottom:_[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!C.default.CSS.supports("inset-inline: 10px"))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),r=e/t,s=this.player_.videoWidth()/this.player_.videoHeight(),n=0,a=0;Math.abs(r-s)>.1&&(r>s?n=Math.round((e-t*s)/2):a=Math.round((t-e/s)/2)),Kt(this.el_,"insetInline",Og(n)),Kt(this.el_,"insetBlock",Og(a))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),r=e.activeCues,s=r.length;for(;s--;){let n=r[s];if(!n)continue;let a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Kt(a.firstChild,"color",vc(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Kt(a.firstChild,"backgroundColor",vc(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Kt(a,"backgroundColor",vc(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Dt}, 2px 2px 4px ${Dt}, 2px 2px 5px ${Dt}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Dt}, 2px 2px ${Dt}, 3px 3px ${Dt}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Pg}, 0 1px ${Pg}, -1px -1px ${Dt}, 0 -1px ${Dt}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Dt}, 0 0 4px ${Dt}, 0 0 4px ${Dt}, 0 0 4px ${Dt}`)),t.fontPercent&&t.fontPercent!==1){let l=C.default.parseFloat(a.style.fontSize);a.style.fontSize=l*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=tS[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof C.default.WebVTT!="function"||e.every(r=>!r.activeCues))return;let t=[];for(let r=0;r<e.length;++r){let s=e[r];for(let n=0;n<s.activeCues.length;++n)t.push(s.activeCues[n])}C.default.WebVTT.processCues(C.default,t,this.el_);for(let r=0;r<e.length;++r){let s=e[r];for(let n=0;n<s.activeCues.length;++n){let a=s.activeCues[n].displayState;ur(a,"vjs-text-track-cue","vjs-text-track-cue-"+(s.language?s.language:r)),s.language&&os(a,"lang",s.language)}this.player_.textTrackSettings&&this.updateDisplayState(s)}}};F.registerComponent("TextTrackDisplay",jc);var Hc=class extends F{createEl(){let e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"
287Video Player"),r=K("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(r),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}};F.registerComponent("LoadingSpinner",Hc);var Ve=class extends ds{createEl(e,t={},r={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),r=Object.assign({type:"button"},r);let s=K(e,t,r);return this.player_.options_.experimentalSvgIcons||s.appendChild(K("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){let r=this.constructor.name;return J.warn(`Adding an actionable (user controllable) child to a Button (${r}) is not supported; use a ClickableComponent instead.`),F.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}};F.registerComponent("Button",Ve);var ko=class extends Ve{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",r=>this.handleMouseDown(r))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){let t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){Qt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}let r=this.player_.getChild("controlBar"),s=r&&r.getChild("playToggle");if(!s){this.player_.tech(!0).focus();return}let n=()=>s.focus();yn(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};ko.prototype.controlText_="Play Video";F.registerComponent("BigPlayButton",ko);var $c=class extends Ve{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)}};F.registerComponent("CloseButton",$c);var Po=class extends Ve{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",r=>this.handlePlay(r)),this.on(e,"pause",r=>this.handlePause(r)),t.replay&&this.on(e,"ended",r=>this.handleEnded(r))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Qt(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))}};Po.prototype.controlText_="Play";F.registerComponent("PlayToggle",Po);var qi=class extends F{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],r=>this.update(r)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),r=K("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\xA0`},{role:"presentation"});return t.appendChild(r),this.contentEl_=K("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=hr(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_=q.default.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};qi.prototype.labelText_="Time";qi.prototype.controlText_="Time";F.registerComponent("TimeDisplay",qi);var An=class extends qi{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}};An.prototype.labelText_="Current Time";An.prototype.controlText_="Current Time";F.registerComponent("CurrentTimeDisplay",An);var Dn=class extends qi{constructor(e,t){super(e,t);let r=s=>this.updateContent(s);this.on(e,"durationchange",r),this.on(e,"loadstart",r),this.on(e,"loadedmetadata",r)}buildCSSClass(){return"vjs-duration"}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}};Dn.prototype.labelText_="Duration";Dn.prototype.controlText_="Duration";F.registerComponent("DurationDisplay",Dn);var zc=class extends F{createEl(){let e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),r=super.createEl("span",{textContent:"/"});
287return t.appendChild(r),e.appendChild(t),e}};F.registerComponent("TimeDivider",zc);var In=class extends qi{constructor(e,t){super(e,t),this.on(e,"durationchange",r=>this.updateContent(r))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(K("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)}};In.prototype.labelText_="Remaining Time";In.prototype.controlText_="Remaining Time";F.registerComponent("RemainingTimeDisplay",In);var Gc=class extends F{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",r=>this.updateShowing(r))}createEl(){let e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=K("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(K("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\xA0`})),this.contentEl_.appendChild(q.default.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()}};F.registerComponent("LiveDisplay",Gc);var Oo=class extends Ve{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=r=>this.updateLiveEdgeStatus(r),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=K("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()}};Oo.prototype.controlText_="Seek to live, currently playing live";F.registerComponent("SeekToLive",Oo);function $n(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var iS=Object.freeze({__proto__:null,clamp:$n}),kn=class extends F{constructor(e,t){super(e,t),this.handleMouseDown_=r=>this.handleMouseDown(r),this.handleMouseUp_=r=>this.handleMouseUp(r),this.handleKeyDown_=r=>this.handleKeyDown(r),this.handleClick_=r=>this.handleClick(r),this.handleMouseMove_=r=>this.handleMouseMove(r),this.update_=r=>this.update(r),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;let 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={},r={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),r=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},r),super.createEl(e,t,r)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!ii&&e.preventDefault(),E0(),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){let t=this.bar.el_.ownerDocument;C0(),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;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{let t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number($n(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=El(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,r=t&&t.enabled,s=t&&t.horizontalSeek;r?s&&e.key==="ArrowLeft"||!s&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):s&&e.key==="ArrowRight"||!s&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}};F.registerComponent("Slider",kn);var bc=(i,e)=>$n(i/e*100,0,100).toFixed(2)+"%",Wc=class extends F{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",r=>this.update(r))}createEl(){let e=super.createEl("div",{className:"vjs-load-progress"}),t=K("span",{className:"vjs-control-text"}),r=K("span",{textContent:this.localize("Loaded")}),s=q.default.createTextNode(": ");return this.percentageEl_=K("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(r),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let t=this.player_.liveTracker,r=this.player_.buffered(),s=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,l=bc(n,s);this.percent_!==l&&(this.el_.style.width=l,$i(this.percentageEl_,l),this.percent_=l);for(let h=0;h<r.length;h++){let f=r.start(h),g=r.end(h),_=a[h];_||(_=this.el_.appendChild(K()),a[h]=_),!(_.dataset.start===f&&_.dataset.end===g)&&(_.dataset.start=f,_.dataset.end=g,_.style.left=bc(f,n),_.style.width=bc(g-f,n))}for(let h=a.length;h>r.length;h--)this.el_.removeChild(a[h-1]);a.length=r.length})}};F.registerComponent("LoadProgressBar",Wc);var Xc=class extends F{constructor(e,t){super(e,t),this.update=ri(ve(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,r){let s=xn(this.el_),n=ls(this.player_.el()),a=e.width*t;if(!n||!s)return;let l=e.left-n.left+a,h=e.width-a+(n.right-e.right);h||(h=e.width-a,l=a);let f=s.width/2;l<f?f+=f-l:h<f&&(f=h),f<0?f=0:f>s.width&&(f=s.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(r)}write(e){$i(this.el_,e)}updateTime(e,t,r,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n,a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let l=this.player_.liveTracker.liveWindow(),h=l-t*l;n=(h<1?"":"-")+hr(h,l)}else n=hr(r,a);this.update(e,t,n),s&&s()})}};F.registerComponent("TimeTooltip",Xc);var Pn=class extends F{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=ri(ve(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,r){let s=this.getChild("timeTooltip");if(!s)return;let n=r&&r.target&&typeof r.target.pendingSeekTime=="function"?r.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,n)}};Pn.prototype.options_={children:[]};!Xe&&!qt&&Pn.prototype.options_.children.push("timeTooltip");F.registerComponent("PlayProgressBar",Pn);var Lo=class extends F{constructor(e,t){super(e,t),this.update=ri(ve(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){let r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,()=>{this.el_.style.left=`${e.width*t}px`})}};Lo.prototype.options_={children:["timeTooltip"]};F.registerComponent("MouseTimeDisplay",Lo);var Ro=class i extends kn{constructor(e,t){t=pe(i.prototype.options_,t),t.children=[...t.children];let r=e.options_.disableSeekWhileScrubbingOnMobile&&(Xe||qt)||e.options_.disableSeekWhileScrubbingOnSTV;(!Xe&&!qt||r)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=r,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=ve(this,this.update),this.update=ri(this.update_,Pt),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 q.default&&"visibilityState"in q.default&&this.on(q.default,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){q.default.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,Pt))}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(q.default.visibilityState==="hidden")return;
287let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let r=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker,n=this.player_.duration();s&&s.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==r||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[hr(r,n),hr(n,n)],"{1} of {2}")),this.currentTime_=r,this.duration_=n),this.bar&&this.bar.update(ls(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){let t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();let e=this.getCurrentTime_(),t,r=this.player_.liveTracker;return r&&r.isLive()?(t=(e-r.seekableStart())/r.liveWindow(),r.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Sn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Sn(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let r,s=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())r=s*this.player_.duration(),r===this.player_.duration()&&(r=r-.1);else{if(s>=.99){n.seekToLiveEdge();return}let a=n.seekableStart(),l=n.liveCurrentTime();if(r=a+s*n.liveWindow(),r>=l&&(r=l),r<=a&&(r=a+.1),r===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(r):this.userSeek_(r),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();let e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Qt(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let 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();let r=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in q.default&&"visibilityState"in q.default&&this.off(q.default,"visibilitychange",this.toggleVisibility_),super.dispose()}};Ro.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12};F.registerComponent("SeekBar",Ro);var Mo=class extends F{constructor(e,t){super(e,t),this.handleMouseMove=ri(ve(this,this.handleMouseMove),Pt),this.throttledHandleMouseSeek=ri(ve(this,this.handleMouseSeek),Pt),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.handleMouseDownHandler_=r=>this.handleMouseDown(r),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){let t=this.getChild("seekBar");if(!t)return;let r=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!r&&!s)return;let n=t.el(),a=xn(n),l=El(n,e).x;l=$n(l,0,1),s&&s.update(a,l),r&&r.update(a,t.getProgress())}handleMouseSeek(e){let t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}
287disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Qt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let 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){let t=this.el_.ownerDocument,r=this.getChild("seekBar");r&&r.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){let t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}};Mo.prototype.options_={children:["seekBar"]};F.registerComponent("ProgressControl",Mo);var No=class extends Ve{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],r=>this.handlePictureInPictureChange(r)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],r=>this.handlePictureInPictureEnabledChange(r)),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(){q.default.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in C.default?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 q.default.exitPictureInPicture=="function"&&super.show()}};No.prototype.controlText_="Picture-in-Picture";F.registerComponent("PictureInPictureToggle",No);var Bo=class extends Ve{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",r=>this.handleFullscreenChange(r)),q.default[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()}};Bo.prototype.controlText_="Fullscreen";F.registerComponent("FullscreenToggle",Bo);var rS=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")})},Kc=class extends F{createEl(){let e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}};
287F.registerComponent("VolumeLevel",Kc);var Yc=class extends F{constructor(e,t){super(e,t),this.update=ri(ve(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,r,s){if(!r){let n=ls(this.el_),a=ls(this.player_.el()),l=e.width*t;if(!a||!n)return;let h=e.left-a.left+l,f=e.width-l+(a.right-e.right),g=n.width/2;h<g?g+=g-h:f<g&&(g=f),g<0?g=0:g>n.width&&(g=n.width),this.el_.style.right=`-${g}px`}this.write(`${s}%`)}write(e){$i(this.el_,e)}updateVolume(e,t,r,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,r,s.toFixed(0)),n&&n()})}};F.registerComponent("VolumeLevelTooltip",Yc);var Fo=class extends F{constructor(e,t){super(e,t),this.update=ri(ve(this,this.update),Pt)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,r){let s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,r,s,()=>{r?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};Fo.prototype.options_={children:["volumeLevelTooltip"]};F.registerComponent("MouseVolumeLevelDisplay",Fo);var hs=class extends kn{constructor(e,t){super(e,t),this.on("slideractive",r=>this.updateLastVolume_(r)),this.on(e,"volumechange",r=>this.updateARIAAttributes(r)),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){Sn(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild("mouseVolumeLevelDisplay");if(t){let r=this.el(),s=ls(r),n=this.vertical(),a=El(r,e);a=n?a.y:a.x,a=$n(a,0,1),t.update(s,a,n)}Sn(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){let 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_(){let e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}};hs.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Xe&&!qt&&hs.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");hs.prototype.playerEvent="volumechange";F.registerComponent("VolumeBar",hs);var Uo=class extends F{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||as(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),rS(this,e),this.throttledHandleMouseMove=ri(ve(this,this.handleMouseMove),Pt),this.handleMouseUpHandler_=r=>this.handleMouseUp(r),this.on("mousedown",r=>this.handleMouseDown(r)),this.on("touchstart",r=>this.handleMouseDown(r)),this.on("mousemove",r=>this.handleMouseMove(r)),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){let 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){let 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)}};Uo.prototype.options_={children:["volumeBar"]};
287F.registerComponent("VolumeControl",Uo);var sS=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")})},Vo=class extends Ve{constructor(e,t){super(e,t),sS(this,e),this.on(e,["loadstart","volumechange"],r=>this.update(r))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),r=this.player_.lastVolume_();if(t===0){let s=r<.1?.1:r;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon("volume-high"),Xe&&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),xl(this.el_,[0,1,2,3].reduce((r,s)=>r+`${s?" ":""}vjs-vol-${s}`,"")),ur(this.el_,`vjs-vol-${t}`)}updateControlText_(){let t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};Vo.prototype.controlText_="Mute";F.registerComponent("MuteToggle",Vo);var qo=class extends F{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||as(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=r=>this.handleKeyPress(r),this.on(e,["loadstart"],r=>this.volumePanelState_(r)),this.on(this.muteToggle,"keyup",r=>this.handleKeyPress(r)),this.on(this.volumeControl,"keyup",r=>this.handleVolumeControlKeyUp(r)),this.on("keydown",r=>this.handleKeyPress(r)),this.on("mouseover",r=>this.handleMouseOver(r)),this.on("mouseout",r=>this.handleMouseOut(r)),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(q.default,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Ke(q.default,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};qo.prototype.options_={children:["muteToggle","volumeControl"]};F.registerComponent("VolumePanel",qo);var jo=class extends Ve{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(){let 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;let t=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()?r.seekableEnd():this.player_.duration(),n;t+this.skipTime<=s?n=t+this.skipTime:n=s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}};jo.prototype.controlText_="Skip Forward";F.registerComponent("SkipForward",jo);var Ho=class extends Ve{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}
287 seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let 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){let t=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()&&r.seekableStart(),n;s&&t-this.skipTime<=s?n=s:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}};Ho.prototype.controlText_="Skip Backward";F.registerComponent("SkipBackward",Ho);var $o=class extends F{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",r=>this.handleKeyDown(r)),this.boundHandleBlur_=r=>this.handleBlur(r),this.boundHandleTapClick_=r=>this.handleTapClick(r)}addEventListenerForItem(e){e instanceof F&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof F&&(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){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||"ul";this.contentEl_=K(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),St(t,"click",function(r){r.preventDefault(),r.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||q.default.activeElement;if(!this.children().some(r=>r.el()===t)){let r=this.menuButton_;r&&r.buttonPressed_&&t!==r.el().firstChild&&r.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let r=t.filter(s=>s.el()===e.target)[0];if(!r)return;r.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){let 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())}};F.registerComponent("Menu",$o);var On=class extends F{constructor(e,t={}){super(e,t),this.menuButton_=new Ve(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let r=Ve.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+r,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let s=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),St(q.default,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){let 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(){let e=new $o(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=K("li",{className:"vjs-menu-title",textContent:Ie(this.options_.title),tabIndex:-1}),r=new F(this.player_,{el:t});e.addItem(r)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";let t=Ve.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Ke(q.default,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Xe&&v0())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","fal
287se"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}};F.registerComponent("MenuButton",On);var Ln=class extends On{constructor(e,t){let r=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!r)return;let s=ve(this,this.update);r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),r.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s),r.removeEventListener("labelchange",s)})}};F.registerComponent("TrackButton",Ln);var pr=class extends ds{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,r){this.nonIconControl=!0;let s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),r),n=K("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}};F.registerComponent("MenuItem",pr);var mr=class extends pr{constructor(e,t){let r=t.track,s=e.textTracks();t.label=r.label||r.language||"Unknown",t.selected=r.mode==="showing",super(e,t),this.track=r,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let n=(...l)=>{this.handleTracksChange.apply(this,l)},a=(...l)=>{this.handleSelectedLanguageChange.apply(this,l)};if(e.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",a)}),s.onchange===void 0){let l;this.on(["tap","click"],function(){if(typeof C.default.Event!="object")try{l=new C.default.Event("change")}catch{}l||(l=q.default.createEvent("Event"),l.initEvent("change",!0,!0)),s.dispatchEvent(l)})}this.handleTracksChange()}handleClick(e){let t=this.track,r=this.player_.textTracks();if(super.handleClick(e),!!r)for(let s=0;s<r.length;s++){let n=r[s];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){let t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){let t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}};F.registerComponent("TextTrackMenuItem",mr);var zo=class extends mr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),r=!0;for(let s=0,n=t.length;s<n;s++){let a=t[s];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r!==this.isSelected_&&this.selected(r)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),r=!0;for(let s=0,n=t.length;s<n;s++){let a=t[s];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){r=!1;break}}r&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};F.registerComponent("OffTextTrackMenuItem",zo);var ji=class extends Ln{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=mr){let r;this.label_&&(r=`${this.label_} off`),e.push(new zo(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hideThreshold_+=1;let s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<s.length;n++){let a=s[n];if(this.kinds_.indexOf(a.kind)>-1){let l=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass(`vjs-${a.kind}-menu-item`),e.push(l)}}return e}};F.registerComponent("TextTrackButton",ji);var Go=class extends pr{constructor(e,t){let r=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=r,this.cue=s}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};F.registerComponent("ChaptersTrackMenuItem",Go);var Rn=class extends ji{constructor(e,t,r){super(e,t,r),this.setIcon("chapters"),this.selectCurrentItem_=()=>
287{this.items.forEach(s=>{s.selected(this.track_.activeCues[0]===s.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;let 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_){let 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";let t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let r=e[t];if(r.kind===this.kind_)return r}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ie(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];
287if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let r=0,s=t.length;r<s;r++){let n=t[r],a=new Go(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};Rn.prototype.kind_="chapters";Rn.prototype.controlText_="Chapters";F.registerComponent("ChaptersButton",Rn);var Mn=class extends ji{constructor(e,t,r){super(e,t,r),this.setIcon("audio-description");let s=e.textTracks(),n=ve(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",function(){s.removeEventListener("change",n)})}handleTracksChange(e){let t=this.player().textTracks(),r=!1;for(let s=0,n=t.length;s<n;s++){let a=t[s];if(a.kind!==this.kind_&&a.mode==="showing"){r=!0;break}}r?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};Mn.prototype.kind_="descriptions";Mn.prototype.controlText_="Descriptions";F.registerComponent("DescriptionsButton",Mn);var Nn=class extends ji{constructor(e,t,r){super(e,t,r),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};Nn.prototype.kind_="subtitles";Nn.prototype.controlText_="Subtitles";F.registerComponent("SubtitlesButton",Nn);var Bn=class extends mr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}};F.registerComponent("CaptionSettingsMenuItem",Bn);var Fn=class extends ji{constructor(e,t,r){super(e,t,r),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Bn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};Fn.prototype.kind_="captions";Fn.prototype.controlText_="Captions";F.registerComponent("CaptionsButton",Fn);var Wo=class extends mr{createEl(e,t,r){let s=super.createEl(e,t,r),n=s.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(K("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(K("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}};F.registerComponent("SubsCapsMenuItem",Wo);var Un=class extends ji{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Ie(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 Bn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Wo),e}};Un.prototype.kinds_=["captions","subtitles"];Un.prototype.controlText_="Subtitles";F.registerComponent("SubsCapsButton",Un);var Xo=class extends pr{constructor(e,t){let r=t.track,s=e.audioTracks();t.label=r.label||r.language||"Unknown",t.selected=r.enabled,super(e,t),this.track=r,this.addClass(`vjs-${r.kind}-menu-item`);let n=(...a)=>{this.handleTracksChange.apply(this,a)};s.addEventListener("change",n),this.on("dispose",()=>{s.removeEventListener("change",n)})}createEl(e,t,r){let s=super.createEl(e,t,r),n=s.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(K("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(K("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let t=this.player_.audioTracks();for(let r=0;r<t.length;r++){let s=t[r];s!==this.track&&(s.enabled=s===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};F.registerComponent("AudioTrackMenuItem",Xo);var Ko=class extends Ln{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;let t=this.player_.audioTracks();for(let r=0;r<t.length;r++){let s=t[r];e.push(new Xo(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e}};Ko.prototype.controlText_="Audio Track";F.registerComponent("AudioTrackButton",Ko);var Vn=class extends pr{constructor(e,t){let r=t.rate,s=parseFloat(r,10);t.label=r,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=r,this.rate=s,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}};Vn.prototype.contentElType="button";F.registerComponent("PlaybackRateMenuItem",Vn);var Yo=class extends On{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",r=>this.updateVisibility(r)),this.on(e,"ratechange",r=>this.updateLabel(r)),this.on(e,"playbackrateschange",r=>this.handlePlaybackRateschange(r))}createEl(){let e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=K("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(){let e=this.playbackRates(),t=[];for(let r=e.length-1;r>=0;r--)t.push(new Vn(this.player(),{rate:e[r]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let 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")}};Yo.prototype.controlText_="Playback Rate";F.registerComponent("PlaybackRateMenuButton",Yo);var Qo=class extends F{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},r={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,r)}};F.registerComponent("Spacer",Qo);var Qc=class extends Qo{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xA0"})}};F.registerComponent("CustomControlSpacer",Qc);var Jo=class extends F{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};Jo.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};F.registerComponent("ControlBar",Jo);var Zo=class extends Ui{constructor(e,t){super(e,t),this.on(e,"error",r=>{this.open(r)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):""}};Zo.prototype.options_=Object.assign({}
287,Ui.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});F.registerComponent("ErrorDisplay",Zo);var el=class extends F{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(),K("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{let r=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${kt()}`)+"-"+t[1].replace(/\W+/g,""),s=K("option",{id:r,value:this.localize(t[0]),textContent:this.localize(t[1])});return s.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${r}`),s}))}};F.registerComponent("TextTrackSelect",el);var gi=class extends F{constructor(e,t={}){super(e,t);let r=K("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(r);let s=this.options_.selects;for(let n of s){let a=this.options_.selectConfigs[n],l=a.className,h=a.id.replace("%s",this.options_.id_),f=null,g=`vjs_select_${kt()}`;if(this.options_.type==="colors"){f=K("span",{className:l});let T=K("label",{id:h,className:"vjs-label",textContent:this.localize(a.label)});T.setAttribute("for",g),f.appendChild(T)}let _=new el(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(_),this.options_.type==="colors"&&(f.appendChild(_.el()),this.el().appendChild(f))}}createEl(){return K("fieldset",{className:this.options_.className})}};F.registerComponent("TextTrackFieldset",gi);var tl=class extends F{constructor(e,t={}){super(e,t);let r=this.options_.textTrackComponentid,s=new gi(e,{id_:r,legendId:`captions-text-legend-${r}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);let n=new gi(e,{id_:r,legendId:`captions-background-${r}`,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);let a=new gi(e,{id_:r,legendId:`captions-window-${r}`,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 K("div",{className:"vjs-track-settings-colors"})}};F.registerComponent("TextTrackSettingsColors",tl);var il=class extends F{constructor(e,t={}){super(e,t);let r=this.options_.textTrackComponentid,s=new gi(e,{id_:r,legendId:`captions-font-size-${r}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);let n=new gi(e,{id_:r,legendId:`captions-edge-style-${r}`,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);let a=new gi(e,{id_:r,legendId:`captions-font-family-${r}`,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 K("div",{className:"vjs-track-settings-font"})}};F.registerComponent("TextTrackSettingsFont",il);var rl=class extends F{constructor(e,t={}){super(e,t);let r=new Ve(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);let s=this.localize("Done"),n=new Ve(e,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=s,this.addChild(n)}createEl(){return K("div",{className:"vjs-track-settings-controls"})}};F.registerComponent("TrackSettingsControls",rl);var Tc="vjs-text-track-settings",Lg=["#000","Black"],Rg=["#00F","Blue"],Mg=["#0FF","Cyan"],Ng=["#0F0","Green"],Bg=["#F0F","Magenta"],Fg=["#F00","Red"],Ug=["#FFF","White"],Vg=["#FF0","Yellow"],xc=["1","Opaque"],Sc=["0.5","Semi-Transparent"],qg=["0","Transparent"],Ri={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Lg,Ug,Fg,Ng,Rg,Vg,Bg,Mg],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[xc,Sc,qg],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ug,Lg,Fg,Ng,Rg,Vg,Bg,Mg],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:[xc,Sc],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:[qg,Sc,xc],className:"vjs-window-opacity vjs-opacity"}};Ri.windowColor.options=Ri.backgroundColor.options;function G0(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function nS(i,e){let t=i.options[i.options.selectedIndex].value;return G0(t,e)}function aS(i,e,t){if(e){for(let r=0;r<i.options.length;r++)if(G0(i.options[r].value,t)===e){i.selectedIndex=r;break}}}var Jc=class extends Ui{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=K("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new tl(e,{textTrackComponentid:this.id_,selectConfigs:Ri,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);let r=new il(e,{textTrackComponentid:this.id_,selectConfigs:Ri,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(r);let s=new rl(e);this.addChild(s)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Qr(Ri,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 h0(Ri,(e,t,r)=>{let s=nS(this.$(t.selector),t.parser);return s!==void 0&&(e[r]=s),e},{})}setValues(e){Qr(Ri,(t,r)=>{aS(this.$(t.selector),e[r],t.parser)})}setDefaults(){Qr(Ri,e=>{let t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(C.default.localStorage.getItem(Tc))}catch(t){J.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?C.default.localStorage.setItem(Tc,JSON.stringify(e)):C.default.localStorage.removeItem(Tc)}catch(t){J.warn(t)}}updateDisplay(){let e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};F.registerComponent("TextTrackSettings",Jc);var Zc=class extends F{constructor(e,t){let r=t.ResizeObserver||C.default.ResizeObserver;t.ResizeObserver===null&&(r=!1);let s=pe({createEl:!r,reportTouchActivity:!1},t);super(e,s),this.ResizeObserver=t.ResizeObserver||C.default.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=M0(()=>{this.resizeHandler()},100,!1,this),r?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el(
287))):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let n=this.debouncedHandler_,a=this.unloadListener_=function(){Ke(this,"resize",n),Ke(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()}};F.registerComponent("ResizeManager",Zc);var oS={trackingThreshold:20,liveTolerance:15},ed=class extends F{constructor(e,t){let r=pe(oS,t,{createEl:!1});super(e,r),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=s=>this.handlePlay(s),this.handleFirstTimeupdate_=s=>this.handleFirstTimeupdate(s),this.handleSeeked_=s=>this.handleSeeked(s),this.seekToLiveEdge_=s=>this.seekToLiveEdge(s),this.reset_(),this.on(this.player_,"durationchange",s=>this.handleDurationchange(s)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(C.default.performance.now().toFixed(4)),r=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+r;let s=this.liveCurrentTime(),n=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===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_,Pt),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(){let 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(){let e=this.player_.seekable(),t=[],r=e?e.length:0;for(;r--;)t.push(e.end(r));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],r=e?e.length:0;for(;r--;)t.push(e.start(r));return t.length?t.sort()[0]:0}liveWindow(){let 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(){let 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()}};F.registerComponent("LiveTracker",ed);var td=class extends F{constructor(e,t){super(e,t),this.on("statechanged",r=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:K("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${kt()}`}),description:K("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${kt()}`})},K("div",{className:"vjs-title-bar"},{},f0(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(s=>{let n=this.state[s],a=this.els[s],l=r[s];Cl(a),n&&$i(a,n),t&&(t.removeAttribute(l),n&&t.setAttribute(l,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}};F.registerComponent("TitleBar",td);var lS={initialDisplay:4e3,position:[],takeFocus:!1},id=class extends Ve{constructor(e,t){t=pe(lS,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],r=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){let e=K("button",{},{type:"button",class:this.buildCSSClass()},K("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()}};F.registerComponent("TransientButton",id);var rd=i=>{let e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;let t=i.$$("source"),r=[],s="";if(!t.length)return!1;for(let n=0;n<t.length;n++){let a=t[n].src;a&&r.indexOf(a)===-1&&r.push(a)}return r.length?(r.length===1&&(s=r[0]),i.triggerSourceset(s),!0):!1},uS=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){let e=q.default.createElement(this.nodeName.toLowerCase());e.innerHTML=i;let t=q.default.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",C.default.Element.prototype.appendChild.call(this,t),this.innerHTML}}),W0=(i,e)=>{let t={};for(let r=0;r<i.length&&(t=Object.getOwnPropertyDescriptor(i[r],e),!(t&&t.set&&t.get));r++);return t.enumerable=!0,t.configurable=!0,t},cS=i=>W0([i.el(),C.default.HTMLMediaElement.prototype,C.default.Element.prototype,uS],"innerHTML"),jg=function(i){let e=i.el();if(e.resetSourceWatch_)return;let t={},r=cS(i),s=n=>(...a)=>{let l=n.apply(e,a);return rd(i),l};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=s(t[n]))}),Object.defineProperty(e,"innerHTML",pe(r,{set:s(r.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",r)},i.one("sourceset",e.resetSourceWatch_)},dS=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?$0(C.default.Element.prototype.getAttribute.call(this,"src")):""},set(i){return C.default.Element.prototype.setAttribute.call(this,"src",i),i}}),hS=i=>
287W0([i.el(),C.default.HTMLMediaElement.prototype,dS],"src"),fS=function(i){if(!i.featuresSourceset)return;let e=i.el();if(e.resetSourceset_)return;let t=hS(i),r=e.setAttribute,s=e.load;Object.defineProperty(e,"src",pe(t,{set:n=>{let a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{let l=r.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),l},e.load=()=>{let n=s.call(e);return rd(i)||(i.triggerSourceset(""),jg(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):rd(i)||jg(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=s,e.setAttribute=r,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}},H=class i extends he{constructor(e,t){super(e,t);let r=e.source,s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",r&&(this.el_.currentSrc!==r.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(r):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let n=this.el_.childNodes,a=n.length,l=[];for(;a--;){let h=n[a];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),!s&&!this.el_.hasAttribute("crossorigin")&&Il(h.src)&&(s=!0)):l.push(h))}for(let h=0;h<l.length;h++)this.el_.removeChild(l[h])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&J.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used. 288This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Tn||bl)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){fS(this)}restoreMetadataTracksInIOSNativePlayer_(){let e=this.textTracks(),t,r=()=>{t=[];for(let n=0;n<e.length;n++){let a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};r(),e.addEventListener("change",r),this.on("dispose",()=>e.removeEventListener("change",r));let s=()=>{for(let n=0;n<t.length;n++){let a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",r),e.removeEventListener("change",s),e.addEventListener("change",s)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",r),e.addEventListener("change",r),e.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let r=e.toLowerCase();this[`${r}TracksListeners_`]&&Object.keys(this[`${r}TracksListeners_`]).forEach(s=>{this.el()[`${r}Tracks`].removeEventListener(s,this[`${r}TracksListeners_`][s])}),this[`featuresNative${e}Tracks`]=!t,this[`${r}TracksListeners_`]=null,this.proxyNativeTracksForType_(r)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){let t=It[e],r=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!r||!r.addEventListener)return;let n={change:l=>{let h={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(h),e==="text"&&this[cs.remoteText.getterName]().trigger(h)},addtrack(l){s.addTrack(l.track)},removetrack(l){s.removeTrack(l.track)}},a=function(){let l=[];for(let h=0;h<s.length;h++){let f=!1;for(let g=0;g<r.length;g++)if(r[g]===s[h]){f=!0;break}f||l.push(s[h])}for(;l.length;)s.removeTrack(l.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(l=>{let h=n[l];r.addEventListener(l,h),this.on("dispose",f=>r.removeEventListener(l,h))}),this.on("loadstart",a),this.on("dispose",l=>this.off("loadstart",a))}proxyNativeTracks_(){It.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if
288(e){let r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),i.disposeMediaElement(e),e=r}else{e=q.default.createElement("video");let r=this.options_.tag&&Li(this.options_.tag),s=pe({},r);(!Tn||this.options_.nativeControlsForTouch!==!0)&&delete s.controls,x0(e,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&os(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=["loop","muted","playsinline","autoplay"];for(let r=0;r<t.length;r++){let s=t[r],n=this.options_[s];typeof n<"u"&&(n?os(e,s,s):Sl(e,s),e[s]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let r=!1,s=function(){r=!0};this.on("loadstart",s);let n=function(){r||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",n),r||this.trigger("loadstart")});return}let t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(r){this.trigger(r)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Tl?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&&qt&&ii&&this.el_.currentTime===0){let 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;let 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(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Qt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return J.error("Invalid source URL."),!1;let r={src:e};t&&(r.type=t);let s=K("source",{},r);return this.el_.appendChild(s),!0}removeSourceElement(e){if(!e)return J.error("Source URL is required to remove the source element."),!1;let t=this.el_.querySelectorAll("source");for(let r of t)if(r.src===e)return this.el_.removeChild(r),!0;return J.warn(`No matching source element found with src: ${e}`),!1}reset(){i.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,r):super.addTextTrack(e,t,r)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=q.default.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){let r=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(r),r}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$("track"),r=t.length;for(;r--;)(e===t[r]||e===t[r].track)&&this.el().removeChild(t[r])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();let e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),C.default.performance&&(e.creationTime=C.default.performance.now()),e}};_l(H,"TEST_VID",function(){if(!ps())return;let i=q.default.createElement("video"),e=q.default.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});H.isSupported=function(){try{H.TEST_VID.volume=.5}catch{return!1}
288return!!(H.TEST_VID&&H.TEST_VID.canPlayType)};H.canPlayType=function(i){return H.TEST_VID.canPlayType(i)};H.canPlaySource=function(i,e){return H.canPlayType(i.type)};H.canControlVolume=function(){try{let i=H.TEST_VID.volume;H.TEST_VID.volume=i/2+.1;let e=i!==H.TEST_VID.volume;return e&&Xe?(C.default.setTimeout(()=>{H&&H.prototype&&(H.prototype.featuresVolumeControl=i!==H.TEST_VID.volume)}),!1):e}catch{return!1}};H.canMuteVolume=function(){try{let i=H.TEST_VID.muted;return H.TEST_VID.muted=!i,H.TEST_VID.muted?os(H.TEST_VID,"muted","muted"):Sl(H.TEST_VID,"muted","muted"),i!==H.TEST_VID.muted}catch{return!1}};H.canControlPlaybackRate=function(){if(qt&&ii&&yl<58)return!1;try{let i=H.TEST_VID.playbackRate;return H.TEST_VID.playbackRate=i/2+.1,i!==H.TEST_VID.playbackRate}catch{return!1}};H.canOverrideAttributes=function(){try{let i=()=>{};Object.defineProperty(q.default.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(q.default.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(q.default.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(q.default.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};H.supportsNativeTextTracks=function(){return Tl||Xe&&ii};H.supportsNativeVideoTracks=function(){return!!(H.TEST_VID&&H.TEST_VID.videoTracks)};H.supportsNativeAudioTracks=function(){return!!(H.TEST_VID&&H.TEST_VID.audioTracks)};H.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]){_l(H.prototype,i,()=>H[e](),!0)});H.prototype.featuresVolumeControl=H.canControlVolume();H.prototype.movingMediaElementInDOM=!Xe;H.prototype.featuresFullscreenResize=!0;H.prototype.featuresProgressEvents=!0;H.prototype.featuresTimeupdateEvents=!0;H.prototype.featuresVideoFrameCallback=!!(H.TEST_VID&&H.TEST_VID.requestVideoFrameCallback);H.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{}}()}};H.resetMediaElement=function(i){if(!i)return;let e=i.querySelectorAll("source"),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){H.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){H.prototype["set"+Ie(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){H.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){H.prototype["set"+Ie(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){H.prototype[i]=function(){return this.el_[i]()}});he.withSourceHandlers(H);H.nativeSourceHandler={};H.nativeSourceHandler.canPlayType=function(i){try{return H.TEST_VID.canPlayType(i)}catch{return""}};H.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return H.nativeSourceHandler.canPlayType(i.type);if(i.src){let t=Rd(i.src);return H.nativeSourceHandler.canPlayType(`video/${t}`)}return""};H.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src
288)};H.nativeSourceHandler.dispose=function(){};H.registerSourceHandler(H.nativeSourceHandler);he.registerTech("Html5",H);var X0=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ec={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},sd=["tiny","xsmall","small","medium","large","xlarge","huge"],fo={};sd.forEach(i=>{let e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;fo[i]=`vjs-layout-${e}`});var pS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},be=class i extends F{constructor(e,t,r){if(e.id=e.id||t.id||`vjs_video_${kt()}`,t=Object.assign(i.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,r),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=c0(this.id_),this.fsApi_=mo,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&&Li(e),this.language(this.options_.language),t.languages){let a={};Object.getOwnPropertyNames(t.languages).forEach(function(l){a[l.toLowerCase()]=t.languages[l]}),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(),Pd(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(St(q.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let s=pe(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let l=new C.default.DOMParser().parseFromString(eS,"image/svg+xml");if(l.querySelector("parsererror"))J.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let f=l.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new Vc(this),this.addClass("vjs-spatial-navigation-enabled")),Tn&&this.addClass("vjs-touch-enabled"),Xe||this.addClass("vjs-workinghover"),i.players[this.id_]=this;let n=kc.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"),Ke(q.default,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ke(q.default,"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),Yx(this),rt.names.forEac
288h(e=>{let t=rt[e],r=this[t.getterName]();r&&r.off&&r.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,r=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";r?t=this.el_=e.parentNode:s||(t=this.el_=super.createEl("div"));let n=Li(e);if(s){for(t=this.el_=e,e=this.tag=q.default.createElement("video");t.children.length;)e.appendChild(t.firstChild);gn(t,"video-js")||ur(t,"video-js"),t.appendChild(e),r=this.playerElIngest_=t,Object.keys(t).forEach(h=>{try{e[h]=t[h]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",ii&&vl&&(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(h){s&&h==="class"||t.setAttribute(h,n[h]),s&&e.setAttribute(h,n[h])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");let a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>y0[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),C.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=L0("vjs-styles-dimensions");let h=Fi(".vjs-styles-defaults"),f=Fi("head");f.insertBefore(this.styleEl_,h?h.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let l=e.getElementsByTagName("a");for(let h=0;h<l.length;h++){let f=l.item(h);ur(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!r&&e.parentNode.insertBefore(t,e),Oc(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){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){let r=e+"_";if(t===void 0)return this[r]||0;if(t===""||t==="auto"){this[r]=void 0,this.updateStyleEl_();return}let s=parseFloat(t);if(isNaN(s)){J.error(`Improper value "${t}" supplied for for ${e}`);return}this[r]=s,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,mi(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Ix(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(C.default.VIDEOJS_NO_DYNAMIC_STYLE===!0){let l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(l>=0&&(f.width=l),h>=0&&(f.height=h));return}let e,t,r,s;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?r=this.aspectRatio_:this.videoWidth()>0?r=this.videoWidth()+":"+this.videoHeight():r="16:9";let n=r.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())?s="dimensions-"+this.id():s=this.id()+"-dimensions",this.addClass(s),R0(this.styleEl_,` 289 .${s} { 290 width: ${e}px; 291 height: ${t}px; 292 } 293 294 .${s}.vjs-fluid:not(.vjs-audio-only-mode) { 295 padding-top: ${a*100}%; 296 } 297 `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let r=Ie(e),s=e.charAt(0).toLowerCase()+e.slice(1);r!=="Html5"&&this.tag&&(he.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);let a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_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};
297rt.names.forEach(h=>{let f=rt[h];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[s]),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);let l=he.getTech(e);if(!l)throw new Error(`No Tech named '${r}' exists! '${r}' should be registered using videojs.registerTech()'`);this.tech_=new l(a),this.tech_.ready(ve(this,this.handleTechReady_),!0),Fc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),X0.forEach(h=>{this.on(this.tech_,h,f=>this[`handleTech${Ie(h)}_`](f))}),Object.keys(Ec).forEach(h=>{this.on(this.tech_,h,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ec[h]}_`].bind(this),event:f});return}this[`handleTech${Ec[h]}_`](f)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,f)=>this.handleTechFullscreenChange_(h,f)),this.on(this.tech_,"fullscreenerror",(h,f)=>this.handleTechFullscreenError_(h,f)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>
297this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(r!=="Html5"||!this.tag)&&Oc(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){rt.names.forEach(e=>{let t=rt[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Fc.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. 298See https://github.com/videojs/video.js/issues/2617 for more info. 299`),this.tech_}version(){return{"video.js":kc}}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;let t=()=>{let s=this.muted();this.muted(!0);let n=()=>{this.muted(s)};this.playTerminatedQueue_.push(n);let a=this.play();if(yn(a))return a.catch(l=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${l||""}`)})},r;if(e==="any"&&!this.muted()?(r=this.play(),yn(r)&&(r=r.catch(t))):e==="muted"&&!this.muted()?r=t():r=this.play(),!!yn(r))return r.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,r="";typeof t!="string"&&(t=e.src,r=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!r&&(r=Zx(this,t)),this.cache_.source=pe({},e,{src:t,type:r});let s=this.cache_.sources.filter(h=>h.src&&h.src===t),n=[],a=this.$$("source"),l=[];for(let h=0;h<a.length;h++){let f=Li(a[h]);n.push(f),f.src&&f.src===t&&l.push(f.src)}l.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n),r=this.currentSource().src,s=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==r)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;let 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
299=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let 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()?Qt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),r=>r.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!q.default.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let r=this.el(),s=q.default[this.fsApi_.fullscreenElement]===r;!s&&r.matches&&(s=r.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}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_(){let 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 Xx)return Gx(this.middleware_,this.tech_,e,t);if(e in Ag)return wg(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(r){throw J(r),r}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Wx)return zx(this.middleware_,this.tech_,e);if(e in Ag)return wg(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=Qt){this.playCallbacks_.push(e);let t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),r=!!(Tl||Xe);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&&r&&this.load();return}let s=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(r){r(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Vt(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=Vt(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Vt(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 H0(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),r=e.end(e.length-1);return r>t&&(r=t),r}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){let 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();let t=this;return new Promise((r,s)=>{function n(){t.off("fullscreenerror",l),t.off("fullscreenchange",a)}function a(){n(),r()}function l(f,g){n(),s(g)}t.one("fullscreenchange",a),t.one("fullscreenerror",l);let h=t.requestFullscreenHelper_(e);h&&(h.then(n,n),h.then(r,s))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){let r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),r}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,r)=>{function s(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){s(),t()}function a(h,f){s(),r(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);let l=e.exitFullscreenHelper_();l&&(l.then(s,s),l.then(t,r))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=q.default[this.fsApi_.exitFullscreen]();return e&&Qt(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=q.default.documentElement.style.overflow,St(q.default,"keydown",this.boundFullWindowOnEscKey_),q.default.documentElement.style.overflow="hidden",ur(q.default.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,Ke(q.default,"keydown",this.boundFullWindowOnEscKey_),q.default.documentElement.style.overflow=this.docOrigOverflow,xl(q.default.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&&C.default.documentPictureInPicture){let e=q.default.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(K("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),C.default.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(k0(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",r=>{let s=r.target.querySelector(".video-js");e.parentNode.replaceChild(s,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in q.default&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(C.default.documentPictureInPicture&&C.default.documentPictureInPicture.window)return C.default.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in q.default)return q.default.exitPictureInPicture()}handleKeyDown(e){let{userActions:t}=this.options_;!t||!t.hotkeys||(s=>{let n=s.tagName.toLowerCase();if(s.isContentEditable)return!0;let a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(s.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){let t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:r=a=>e.key.toLowerCase()==="f",muteKey:s=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();let a=F.getComponent("FullscreenToggle");q.default[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),F.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),F.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let r=0,s=this.options_.techOrder;r<s.length;r++){let n=s[r],a=he.getTech(n);if(a||(a=F.getComponent(n)),!a){J.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){let t=this.options_.techOrder.map(l=>[l,he.getTech(l)]).filter(([l,h])=>h?h.isSupported():(J.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(l,h,f){let g;return l.some(_=>h.some(T=>{if(g=f(_,T),g)return!0})),g},s,n=l=>(h,f)=>l(f,h),a=([l,h],f)=>{if(h.canPlaySource(f,this.options_[l.toLowerCase()]))return{source:f,tech:l}};return this.options_.sourceOrder?s=r(e,t,n(a)):s=r(t,e,a),s||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let r=z0(e);if(!r.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),Hx(this,r[0],(s,n)=>{if(this.middleware_=n,t||(this.cache_.sources=r),this.updateSourceCaches_(s),this.src_(s)){if(r.length>1)return this.handleSrc_(r.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}$x(n,this.tech_)}),r.length>1){let s=()=>{this.error(null),this.handleSrc_(r.slice(1),!0)},n=()=>{this.off("error",s)};this.one("error",s),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",s),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return t?U0(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{let e=this.play();Qt(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}),mi(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:r,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:n}=r||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update(
299))}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let 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){let 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(Bi("beforeerror").forEach(t=>{let r=t(this,e);if(!(ti(r)&&!Array.isArray(r)||typeof r=="string"||typeof r=="number"||r===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=r}),this.options_.suppressNotSupportedError&&e&&e.code===4){let 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 De(e),this.addClass("vjs-error"),J.error(`(CODE:${this.error_.code} ${De.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Bi("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,r,s=ve(this,this.reportUserActivity),n=function(_){(_.screenX!==t||_.screenY!==r)&&(t=_.screenX,r=_.screenY,s())},a=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},l=function(_){s(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",l),this.on("mouseleave",l);let h=this.getChild("controlBar");h&&!Xe&&!qt&&(h.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s);let f,g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);let _=this.options_.inactivityTimeout;_<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))};this.setInterval(g,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}
299defaultPlaybackRate(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_(){let 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");let e=this.children(),t=this.getChild("ControlBar"),r=t&&t.currentHeight();e.forEach(s=>{s!==t&&s.el_&&!s.hasClass("vjs-hidden")&&(s.hide(),this.audioOnlyCache_.hiddenChildren.push(s))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=r,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(r),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){let 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,r){if(this.tech_)return this.tech_.addTextTrack(e,t,r)}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(),mi(this)&&this.trigger("languagechange"))}languages(){return pe(i.prototype.options_.languages,this.languages_)}toJSON(){let e=pe(this.options_),t=e.tracks;e.tracks=[];for(let r=0;r<t.length;r++){let s=t[r];s=pe(s),s.player=void 0,e.tracks[r]=s}return e}createModal(e,t){t=t||{},t.content=e||"";let r=new Ui(this,t);return this.addChild(r),r.on("dispose",()=>{this.removeChild(r)}),r.open(),r}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let r=0;r<sd.length;r++){let s=sd[r],n=this.breakpoints_[s];if(t<=n){if(e===s)return;e&&this.removeClass(fo[e]),this.addClass(fo[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},pS,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;let t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return fo[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;let r=this.crossOrigin();this.reset(),this.cache_.media=pe(e);let{artist:s,artwork:n,description:a,poster:l,src:h,textTracks:f,title:g}=this.cache_.media;!n&&l&&(this.cache_.media.artwork=[{src:l,type:Io(l)}]),r&&this.crossOrigin(r),h&&this.src(h),l&&this.poster(l),Array.isArray(f)&&f.forEach(_=>this.addRemoteTextTrack(_,!1)),this.titleBar&&this.titleBar.update({title:g,description:a||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t=this.currentSources(),r=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),s={src:t,textTracks:r};return e&&(s.poster=e,s.artwork=[{src:s.poster,type:Io(s.poster)}]),s}return pe(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},r=Li(e),s=r["data-setup"];if(gn(e,"vjs-fill")&&(r.fill=!0),gn(e,"vjs-fluid")&&(r.fluid=!0),s!==null)try{Object.assign(r,JSON.parse(s||"{}"))}catch(n){J.error("data-setup",n)}if(Object.assign(t,r),e.hasChildNodes()){let n=e.childNodes;for(let a=0,l=n.length;a<l;a++){let h=n[a],f=h.nodeName.toLowerCase();f==="source"?t.sources.push(Li(h)):f==="track"&&t.tracks.push(Li(h))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};be.prototype.videoTracks=()=>{};be.prototype.audioTracks=()=>{};be.prototype.textTracks=()=>{};be.prototype.remoteTextTracks=()=>{};be.prototype.remoteTextTrackEls=()=>{};
299rt.names.forEach(function(i){let e=rt[i];be.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});be.prototype.crossorigin=be.prototype.crossOrigin;be.players={};var hn=C.default.navigator;be.prototype.options_={techOrder:he.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:hn&&(hn.languages&&hn.languages[0]||hn.userLanguage||hn.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1};X0.forEach(function(i){be.prototype[`handleTech${Ie(i)}_`]=function(){return this.trigger(i)}});F.registerComponent("Player",be);var po="plugin",es="activePlugins_",Kr={},sl=i=>Kr.hasOwnProperty(i),oo=i=>sl(i)?Kr[i]:void 0,K0=(i,e)=>{i[es]=i[es]||{},i[es][e]=!0},nl=(i,e,t)=>{let r=(t?"before":"")+"pluginsetup";i.trigger(r,e),i.trigger(r+":"+e.name,e)},mS=function(i,e){let t=function(){nl(this,{name:i,plugin:e,instance:null},!0);let r=e.apply(this,arguments);return K0(this,i),nl(this,{name:i,plugin:e,instance:r}),r};return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},Hg=(i,e)=>(e.prototype.name=i,function(...t){nl(this,{name:i,plugin:e,instance:null},!0);let r=new e(this,...t);return this[i]=()=>r,nl(this,r.getEventHash()),r}),Hi=(()=>{class i{constructor(t){if(this.constructor===i)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),Pd(this),delete this.trigger,F0(this,this.constructor.defaultState),K0(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(t={}){return t.name=this.name,t.plugin=this.constructor,t.instance=this,t}trigger(t,r={}){return gs(this.eventBusEl_,t,this.getEventHash(r))}handleStateChanged(t){}dispose(){let{name:t,player:r}=this;this.trigger("dispose"),this.off(),r.off("dispose",this.dispose),r[es][t]=!1,this.player=this.state=null,r[t]=Hg(t,Kr[t])}static isBasic(t){let r=typeof t=="string"?oo(t):t;return typeof r=="function"&&!i.prototype.isPrototypeOf(r.prototype)}static registerPlugin(t,r){if(typeof t!="string")throw new Error(`Illegal plugin name, "${t}", must be a string, was ${typeof t}.`);if(sl(t))J.warn(`A plugin named "${t}" already exists. You may want to avoid re-registering plugins!`);else if(be.prototype.hasOwnProperty(t))throw new Error(`Illegal plugin name, "${t}", cannot share a name with an existing player method!`);if(typeof r!="function")throw new Error(`Illegal plugin for "${t}", must be a function, was ${typeof r}.`);return Kr[t]=r,t!==po&&(i.isBasic(r)?be.prototype[t]=mS(t,r):be.prototype[t]=Hg(t,r)),r}static deregisterPlugin(t){if(t===po)throw new Error("Cannot de-register base plugin.");sl(t)&&(delete Kr[t],delete be.prototype[t])}static getPlugins(t=Object.keys(Kr)){let r;return t.forEach(s=>{let n=oo(s);n&&(r=r||{},r[s]=n)}),r}static getPluginVersion(t){let r=oo(t);return r&&r.VERSION||""}}return i.getPlugin=oo,i.BASE_PLUGIN_NAME=po,i})();Hi.registerPlugin(po,Hi);be.prototype.usingPlugin=function(i){return!!this[es]&&this[es][i]===!0};be.prototype.hasPlugin=function(i){return!!sl(i)};function gS(i,e){let t=!1;return function(...r){return t||J.warn(i),t=!0,e.apply(this,r)}}function jt(i,e,t,r){return gS(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,r)}var _S={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"},Y0=i=>i.indexOf("#")===0?i.slice(1):i;function O(i,e,t){let r=O.getPlayer(i);if(r)return e&&J.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&r.ready(t),r;let s=typeof i=="string"?Fi("#"+Y0(i)):i;
299if(!ms(s))throw new TypeError("The element or ID supplied is not valid. (videojs)");let a=("getRootNode"in s?s.getRootNode()instanceof C.default.ShadowRoot:!1)?s.getRootNode():s.ownerDocument.body;(!s.ownerDocument.defaultView||!a.contains(s))&&J.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),Bi("beforesetup").forEach(h=>{let f=h(s,pe(e));if(!ti(f)||Array.isArray(f)){J.error("please return an object in beforesetup hooks");return}e=pe(e,f)});let l=F.getComponent("Player");return r=new l(s,e,t),Bi("setup").forEach(h=>h(r)),r}O.hooks_=fi;O.hooks=Bi;O.hook=mx;O.hookOnce=gx;O.removeHook=u0;if(C.default.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ps()){let i=Fi(".vjs-styles-defaults");if(!i){i=L0("vjs-styles-defaults");let e=Fi("head");e&&e.insertBefore(i,e.firstChild),R0(i,` 300 .video-js { 301 width: 300px; 302 height: 150px; 303 } 304 305 .vjs-fluid:not(.vjs-audio-only-mode) { 306 padding-top: 56.25% 307 } 308 `)}}Rc(1,O);O.VERSION=kc;O.options=be.prototype.options_;O.getPlayers=()=>be.players;O.getPlayer=i=>{let e=be.players,t;if(typeof i=="string"){let r=Y0(i),s=e[r];if(s)return s;t=Fi("#"+r)}else t=i;if(ms(t)){let{player:r,playerId:s}=t;if(r||e[s])return r||e[s]}};O.getAllPlayers=()=>Object.keys(be.players).map(i=>be.players[i]).filter(Boolean);O.players=be.players;O.getComponent=F.getComponent;O.registerComponent=(i,e)=>(he.isTech(e)&&J.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),F.registerComponent.call(F,i,e));O.getTech=he.getTech;O.registerTech=he.registerTech;O.use=jx;Object.defineProperty(O,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(O.middleware,"TERMINATOR",{value:Do,writeable:!1,enumerable:!0});O.browser=y0;O.obj=vx;O.mergeOptions=jt(9,"videojs.mergeOptions","videojs.obj.merge",pe);O.defineLazyProperty=jt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",_l);O.bind=jt(9,"videojs.bind","native Function.prototype.bind",ve);O.registerPlugin=Hi.registerPlugin;O.deregisterPlugin=Hi.deregisterPlugin;O.plugin=(i,e)=>(J.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Hi.registerPlugin(i,e));O.getPlugins=Hi.getPlugins;O.getPlugin=Hi.getPlugin;O.getPluginVersion=Hi.getPluginVersion;O.addLanguage=function(i,e){return i=(""+i).toLowerCase(),O.options.languages=pe(O.options.languages,{[i]:e}),O.options.languages[i]};O.log=J;O.createLogger=c0;O.time=Rx;O.createTimeRange=jt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Vt);O.createTimeRanges=jt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Vt);O.formatTime=jt(9,"videojs.formatTime","videojs.time.formatTime",hr);O.setFormatTime=jt(9,"videojs.setFormatTime","videojs.time.setFormatTime",q0);O.resetFormatTime=jt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",j0);O.parseUrl=jt(9,"videojs.parseUrl","videojs.url.parseUrl",Ld);O.isCrossOrigin=jt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Il);O.EventTarget=nt;O.any=kd;O.on=St;O.one=Al;O.off=Ke;O.trigger=gs;O.xhr=Cd.default;O.TrackList=_i;O.TextTrack=fr;O.TextTrackList=En;O.AudioTrack=Co;O.AudioTrackList=xo;O.VideoTrack=wo;O.VideoTrackList=So;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{O[i]=function(){return J.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),P0[i].apply(null,arguments)}});O.computedStyle=jt(9,"videojs.computedStyle","videojs.dom.computedStyle",us);O.dom=P0;O.fn=Dx;O.num=iS;O.str=Ox;O.url=Vx;O.Error=_S;var nd=class{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(r){t.enabled_(r)}}),t}},fs=class extends O.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;let r=this.levels_.length;return t=new nd(e),""+r in this||Object.defineProperty(this,r,{get(){return this.levels_[r]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let r=0,s=this.length;r<s;r++)if(this[r]===e){t=this.levels_.splice(r,1)[0],this.selectedIndex_===r?this.selectedIndex_=-1:this.selectedIndex_>r&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,r=this.length;t<r;t++){let s=this[t];if(s.id===e)return s}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};fs.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(let i in fs.prototype.allowedEvents_)fs.prototype["on"+i]=null;var Q0="4.1.0",yS=function(i,e){let t=i.qualityLevels,r=new fs,s=function(){r.dispose(),i.qualityLevels=t,i.off("dispose",s)};return i.on("dispose",s),i.qualityLevels=()=>r,i.qualityLevels.VERSION=Q0,r},J0=function(i){return yS(this,O.obj.merge({},i))};O.registerPlugin("qualityLevels",J0);J0.VERSION=Q0;var mt=Or,al=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,Ot=i=>O.log.debug?O.log.debug.bind(O,"VHS:",`${i} >`):function(){};function oe(...i){let e=O.obj||O;return(e.merge||e.mergeOptions).apply(e,i)}
308function Ue(...i){let e=O.time||O;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function vS(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: 309`;for(let t=0;t<i.length;t++){let r=i.start(t),s=i.end(t);e+=`${r} --> ${s}. Duration (${s-r}) 310`}return e}var Jt=1/30,Zt=Jt*3,Z0=function(i,e){let t=[],r;if(i&&i.length)for(r=0;r<i.length;r++)e(i.start(r),i.end(r))&&t.push([i.start(r),i.end(r)]);return Ue(t)},Yr=function(i,e){return Z0(i,function(t,r){return t-Zt<=e&&r+Zt>=e})},lo=function(i,e){return Z0(i,function(t){return t-Jt>=e})},bS=function(i){if(i.length<2)return Ue();let e=[];for(let t=1;t<i.length;t++){let r=i.end(t-1),s=i.start(t);e.push([r,s])}return Ue(e)},TS=function(i,e){let t=null,r=null,s=0,n=[],a=[];if(!i||!i.length||!e||!e.length)return Ue();let l=i.length;for(;l--;)n.push({time:i.start(l),type:"start"}),n.push({time:i.end(l),type:"end"});for(l=e.length;l--;)n.push({time:e.start(l),type:"start"}),n.push({time:e.end(l),type:"end"});for(n.sort(function(h,f){return h.time-f.time}),l=0;l<n.length;l++)n[l].type==="start"?(s++,s===2&&(t=n[l].time)):n[l].type==="end"&&(s--,s===1&&(r=n[l].time)),t!==null&&r!==null&&(a.push([t,r]),t=null,r=null);return Ue(a)},e_=i=>{let e=[];
310if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},xS=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},lr=i=>{let e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},SS=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Cc=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Nd=function(i,e){let t=0;if(!i||!i.length)return t;for(let r=0;r<i.length;r++){let s=i.start(r),n=i.end(r);if(!(e>n)){if(e>s&&e<=n){t+=n-e;continue}t+=n-s}}return t},Bd=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(r){t+=r.duration}),(e.preloadHints||[]).forEach(function(r){r.type==="PART"&&(t+=i.partTargetDuration)}),t},ad=i=>(i.segments||[]).reduce((e,t,r)=>(t.parts?t.parts.forEach(function(s,n){e.push({duration:s.duration,segmentIndex:r,partIndex:n,part:s,segment:t})}):e.push({duration:t.duration,segmentIndex:r,partIndex:null,segment:t,part:null}),e),[]),t_=i=>{let e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},i_=({preloadSegment:i})=>{if(!i)return;let{parts:e,preloadHints:t}=i,r=(t||[]).reduce((s,n)=>s+(n.type==="PART"?1:0),0);return r+=e&&e.length?e.length:0,r},r_=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;let t=t_(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},ES=function(i,e){let t=0,r=e-i.mediaSequence,s=i.segments[r];if(s){if(typeof s.start<"u")return{result:s.start,precise:!0};if(typeof s.end<"u")return{result:s.end-s.duration,precise:!0}}for(;r--;){if(s=i.segments[r],typeof s.end<"u")return{result:t+s.end,precise:!0};if(t+=Bd(i,s),typeof s.start<"u")return{result:t+s.start,precise:!0}}return{result:t,precise:!1}},CS=function(i,e){let t=0,r,s=e-i.mediaSequence;for(;s<i.segments.length;s++){if(r=i.segments[s],typeof r.start<"u")return{result:r.start-t,precise:!0};if(t+=Bd(i,r),typeof r.end<"u")return{result:r.end-t,precise:!0}}return{result:-1,precise:!1}},s_=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;let r=ES(i,e);if(r.precise)return r.result;let s=CS(i,e);return s.precise?s.result:r.result+t},n_=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return C.default.Infinity}return s_(i,e,t)},vn=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:r}){let s=0;if(t>r&&([t,r]=[r,t]),t<0){for(let n=t;n<Math.min(0,r);n++)s+=i;t=0}for(let n=t;n<r;n++)s+=e[n].duration;return s},a_=function(i,e,t,r){if(!i||!i.segments)return null;if(i.endList)return n_(i);if(e===null)return null;e=e||0;let s=s_(i,i.mediaSequence+i.segments.length,e);return t&&(r=typeof r=="number"?r:r_(null,i),s-=r),Math.max(0,s)},wS=function(i,e,t){let s=e||0,n=a_(i,e,!0,t);return n===null?Ue():(n<s&&(n=s),Ue(s,n))},AS=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:r,startTime:s,exactManifestTimings:n}){let a=e-s,l=ad(i),h=0;for(let f=0;f<l.length;f++){let g=l[f];if(t===g.segmentIndex&&!(typeof r=="number"&&typeof g.partIndex=="number"&&r!==g.partIndex)){h=f;break}}if(a<0){if(h>0)for(let f=h-1;f>=0;f--){let g=l[f];if(a+=g.duration,n){if(a<0)continue}else if(a+Jt<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:s-vn({defaultDuration:i.targetDuration,durationList:l,startIndex:h,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e}}if(h<0){for(let f=h;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:e};h=0}for(let f=h;f<l.length;f++){let g=l[f];a-=g.duration;let _=g.duration>Jt,T=a===0,E=_&&a+Jt>=0;if(!((T||E)&&f!==l.length-1)){if(n){if(a>0)continue}else if(a-Jt>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:s+vn({defaultDuration:i.targetDuration,durationList:l,startIndex:h,endIndex:f})}}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:e}},o_=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Fd=function(i){return i.excludeUntil&&i.excludeUntil===1/0},kl=function(i){let e=o_(i);return!i.disabled&&!e},DS=function(i){return i.disabled},IS=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},l_=function(i,e){return e.attributes&&e.attributes[i]},kS=function(i,e,t,r=0){return l_("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-r*8)/e:NaN},od=(i,e)=>{if(i.playlists.length===1)return!0;let t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(r=>kl(r)?(r.attributes.BANDWIDTH||0)<t:!1).length===0},Ud=(i,e)=>!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),$g=function(i,e){let t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{},r=!1;for(let s in t){for(let n in t[s])if(r=e(t[s][n]),r)break;if(r)break}return!!r},zn=i=>{if(!i||!i.playlists||!i.playlists.length)return $g(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){let t=i.playlists[e],r=t.attributes&&t.attributes.CODECS;if(!(r&&r.split(",").every(n=>Ru(n))||$g(i,n=>Ud(t,n))))return!1}return!0},gt={liveEdgeDelay:r_,duration:n_,seekable:wS,getMediaInfoForTime:AS,isEnabled:kl,isDisabled:DS,isExcluded:o_,isIncompatible:Fd,playlistEnd:a_,isAes:IS,hasAttribute:l_,estimateSegmentRequestTime:kS,isLowestEnabledRendition:od,isAudioOnly:zn,playlistMatch:Ud,segmentDurationWithParts:Bd},{log:u_}=O,ts=(i,e)=>`${i}-${e}`,c_=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,PS=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:r=[],customTagMappers:s=[],llhls:n})=>{let a=new ja;i&&a.on("warn",i),e&&a.on("info",e),r.forEach(f=>
310a.addParser(f)),s.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();let l=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){l.hasOwnProperty(f)&&delete l[f]}),l.segments&&l.segments.forEach(function(f){["parts","preloadHints"].forEach(function(g){f.hasOwnProperty(g)&&delete f[g]})})),!l.targetDuration){let f=10;l.segments&&l.segments.length&&(f=l.segments.reduce((g,_)=>Math.max(g,_.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),l.targetDuration=f}let h=t_(l);if(h.length&&!l.partTargetDuration){let f=h.reduce((g,_)=>Math.max(g,_.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),u_.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.")),l.partTargetDuration=f}return l},_s=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(let r in i.mediaGroups[t])for(let s in i.mediaGroups[t][r]){let n=i.mediaGroups[t][r][s];e(n,t,r,s)}})},d_=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},OS=i=>{let e=i.playlists.length;for(;e--;){let t=i.playlists[e];d_({playlist:t,id:ts(e,t.uri)}),t.resolvedUri=mt(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||u_.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},LS=i=>{_s(i,e=>{e.uri&&(e.resolvedUri=mt(i.uri,e.uri))})},RS=(i,e)=>{let t=ts(0,e),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:C.default.location.href,resolvedUri:C.default.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return r.playlists[t]=r.playlists[0],r.playlists[e]=r.playlists[0],r},h_=(i,e,t=c_)=>{i.uri=e;for(let s=0;s<i.playlists.length;s++)if(!i.playlists[s].uri){let n=`placeholder-uri-${s}`;i.playlists[s].uri=n}let r=zn(i);_s(i,(s,n,a,l)=>{if(!s.playlists||!s.playlists.length){if(r&&n==="AUDIO"&&!s.uri)for(let h=0;h<i.playlists.length;h++){let f=i.playlists[h];if(f.attributes&&f.attributes.AUDIO&&f.attributes.AUDIO===a)return}s.playlists=[we({},s)]}
310s.playlists.forEach(function(h,f){let g=t(n,a,l,h),_=ts(f,g);h.uri?h.resolvedUri=h.resolvedUri||mt(i.uri,h.uri):(h.uri=f===0?g:_,h.resolvedUri=h.uri),h.id=h.id||_,h.attributes=h.attributes||{},i.playlists[h.id]=h,i.playlists[h.uri]=h})}),OS(i),LS(i)},ol=class{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;let[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;let[t]=e,r=t.startDate.getTime();this.trimProcessedDateRanges_(r),this.pendingDateRanges_=e.reduce((s,n)=>(s.set(n.id,n),s),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];let e={},t=[];this.pendingDateRanges_.forEach((r,s)=>{if(!this.processedDateRanges_.has(s)&&(r.startTime=r.startDate.getTime()/1e3-this.offset_,r.processDateRange=()=>this.processDateRange(r),t.push(r),!!r.class))if(e[r.class]){let n=e[r.class].push(r);r.classListIndex=n-1}else e[r.class]=[r],r.classListIndex=0});for(let r of t){let s=e[r.class]||[];r.endDate?r.endTime=r.endDate.getTime()/1e3-this.offset_:r.endOnNext&&s[r.classListIndex+1]?r.endTime=s[r.classListIndex+1].startTime:r.duration?r.endTime=r.startTime+r.duration:r.plannedDuration?r.endTime=r.startTime+r.plannedDuration:r.endTime=r.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((r,s)=>{r.startDate.getTime()<e&&this.processedDateRanges_.delete(s)})}},f_=22,dr=({requestType:i,request:e,error:t,parseFailure:r})=>{let s=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},l=s&&!n||r;if(t&&n)a.error=we({},t),a.errorType=O.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=O.Error.NetworkRequestAborted;else if(e.timedout)a.errorType=O.Error.NetworkRequestTimeout;else if(l){let h=r?O.Error.NetworkBodyParserFailed:O.Error.NetworkBadStatus;a.errorType=h,a.status=e.status,a.headers=e.headers}return a},MS=Ot("CodecUtils"),p_=function(i){let e=i.attributes||{};if(e.CODECS)return Ut(e.CODECS)},m_=(i,e)=>{let t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},NS=(i,e)=>{if(!m_(i,e))return!0;let t=e.attributes||{},r=i.mediaGroups.AUDIO[t.AUDIO];for(let s in r)if(!r[s].uri&&!r[s].playlists)return!0;return!1},qn=function(i){let e={};return i.forEach(({mediaType:t,type:r,details:s})=>{e[t]=e[t]||[],e[t].push(Lu(`${r}${s}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){MS(`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},zg=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},bn=function(i,e){let t=e.attributes||{},r=qn(p_(e)||[]);if(m_(i,e)&&!r.audio&&!NS(i,e)){let s=qn(Bp(i,t.AUDIO)||[]);s.audio&&(r.audio=s.audio)}return r},{EventTarget:BS}=O,FS=(i,e)=>{if(e.endList||!e.serverControl)return i;let t={};if(e.serverControl.canBlockReload){let{preloadSegment:r}=e,s=e.mediaSequence+e.segments.length;if(r){let n=r.parts||[],a=i_(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&s--}t._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){let r=new C.default.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(s){t.hasOwnProperty(s)&&r.searchParams.set(s,t[s])}),i=r.toString()}return i},US=(i,e)=>{if(!i)return e;let t=oe(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 r=0;r<e.parts.length;r++)i.parts&&i.parts[r]&&(t.parts[r]=oe(i.parts[r],e.parts[r]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},VS=(i,e,t)=>{let r=i.slice(),s=e.slice();t=t||0;let n=[],a;for(let l=0;l<s.length;l++){let h=r[l+t],f=s[l];h?(a=h.map||a,n.push(US(h,f))):(a&&!f.map&&(f.map=a),n.push(f))}return n},g_=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=mt(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=mt(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=mt(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=mt(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEac
310h(t=>{t.resolvedUri||(t.resolvedUri=mt(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=mt(e,t.uri))})},__=function(i){let e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let r=0;r<t.preloadHints.length;r++)if(t.preloadHints[r].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},y_=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,ld=(i,e,t=y_)=>{let r=oe(i,{}),s=r.playlists[e.id];if(!s||t(s,e))return null;e.segments=__(e);let n=oe(s,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,s.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=VS(s.segments,e.segments,e.mediaSequence-s.mediaSequence)}n.segments.forEach(a=>{g_(a,n.resolvedUri)});for(let a=0;a<r.playlists.length;a++)r.playlists[a].id===e.id&&(r.playlists[a]=n);return r.playlists[e.id]=n,r.playlists[e.uri]=n,_s(i,(a,l,h,f)=>{if(a.playlists)for(let g=0;g<a.playlists.length;g++)e.id===a.playlists[g].id&&(a.playlists[g]=n)}),r},ud=(i,e)=>{let t=i.segments||[],r=t[t.length-1],s=r&&r.parts&&r.parts[r.parts.length-1],n=s&&s.duration||r&&r.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500},Gg=(i,e,t)=>{if(!i)return;let r=[];return i.forEach(s=>{if(!s.attributes)return;let{BANDWIDTH:n,RESOLUTION:a,CODECS:l}=s.attributes;r.push({id:s.id,bandwidth:n,resolution:a,codecs:l})}),{type:e,isLive:t,renditions:r}},Ni=class extends BS{constructor(e,t,r={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ot("PlaylistLoader");let{withCredentials:s=!1}=r;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;let n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new ol,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;let e=this.media(),t=mt(this.main.uri,e.uri);this.llhls&&(t=FS(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(r,s)=>{if(this.request){if(r)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,r){let{uri:s,id:n}=t;this.request=null,r&&(this.state=r),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:dr({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{let r=PS({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});return!r.playlists||!r.playlists.length||this.excludeAudioOnlyVariants(r.playlists),r}catch(r){this.error=r,this.error.metadata={errorType:O.Error.StreamingHlsPlaylistParserError,error:r}}}excludeAudioOnlyVariants(e){let t=r=>{let s=r.attributes||{},{width:n,height:a}=s.RESOLUTION||{};if(n&&a)return!0;let l=p_(r)||[];return!!qn(l).video};e.some(t)&&e.forEach(r=>{t(r)||(r.excludeUntil=1/0)})}
310haveMetadata({playlistString:e,playlistObject:t,url:r,id:s}){this.request=null,this.state="HAVE_METADATA";let n={playlistInfo:{type:"media",uri:r}};this.trigger({type:"playlistparsestart",metadata:n});let a=t||this.parseManifest_({url:r,manifestString:e});a.lastRequest=Date.now(),d_({playlist:a,uri:r,id:s});let l=ld(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,l?(this.main=l,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(ud(this.media(),!!l)),n.parsedPlaylist=Gg(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),C.default.clearTimeout(this.mediaUpdateTimeout),C.default.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new ol,this.off()}stopRequest(){if(this.request){let 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(C.default.clearTimeout(this.finalRenditionTimeout),t){let l=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=C.default.setTimeout(this.media.bind(this,e,!1),l);return}let r=this.state,s=!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,s&&(this.trigger("mediachanging"),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(ud(e,!0)),!s)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;let 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"},(l,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=al(e.resolvedUri,h),l)return this.playlistRequestError(this.request,e,r);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),r==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(C.default.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&&(C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);let t=this.media();if(e){let r=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=C.default.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},r);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=C.default.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=C.default.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}
310let 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,r)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:r.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:r.responseText,code:2,metadata:dr({requestType:r.requestType,request:r,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=al(this.src,r),this.trigger({type:"playlistparsestart",metadata:e});let s=this.parseManifest_({manifestString:r.responseText,url:this.src});e.parsedPlaylist=Gg(s.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(s)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,h_(this.main,this.srcUri()),e.playlists.forEac
310h(r=>{r.segments=__(r),r.segments.forEach(s=>{g_(s,r.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}let t=this.srcUri()||C.default.location.href;this.main=RS(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){let r=this.main,s=e.ID,n=r.playlists.length;for(;n--;){let a=r.playlists[n];if(a.attributes["PATHWAY-ID"]===s){let l=a.resolvedUri,h=a.id;if(t){let f=this.createCloneURI_(a.resolvedUri,e),g=ts(s,f),_=this.createCloneAttributes_(s,a.attributes),T=this.createClonePlaylist_(a,g,e,_);r.playlists[n]=T,r.playlists[g]=T,r.playlists[f]=T}else r.playlists.splice(n,1);delete r.playlists[h],delete r.playlists[l]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let r=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||!r.mediaGroups[n][s])){for(let a in r.mediaGroups[n])if(a===s){for(let l in r.mediaGroups[n][a])r.mediaGroups[n][a][l].playlists.forEac
310h((f,g)=>{let _=r.playlists[f.id],T=_.id,E=_.resolvedUri;delete r.playlists[T],delete r.playlists[E]});delete r.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let r=this.main,s=r.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=ts(e.ID,n),l=this.createCloneAttributes_(e.ID,t.attributes),h=this.createClonePlaylist_(t,a,e,l);r.playlists[s]=h,r.playlists[a]=h,r.playlists[n]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,r=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||s.mediaGroups[n][t]))for(let a in s.mediaGroups[n]){if(a===r)s.mediaGroups[n][t]={};else continue;for(let l in s.mediaGroups[n][a]){let h=s.mediaGroups[n][a][l];s.mediaGroups[n][t][l]=we({},h);let f=s.mediaGroups[n][t][l],g=this.createCloneURI_(h.resolvedUri,e);f.resolvedUri=g,f.uri=g,f.playlists=[],h.playlists.forEach((_,T)=>{let E=s.playlists[_.id],w=c_(n,t,l),y=ts(t,w);if(E&&!s.playlists[y]){let I=this.createClonePlaylist_(E,y,e),A=I.resolvedUri;s.playlists[y]=I,s.playlists[A]=I}f.playlists[T]=this.createClonePlaylist_(_,y,e)})}}})}createClonePlaylist_(e,t,r,s){let n=this.createCloneURI_(e.resolvedUri,r),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),s&&(a.attributes=s),oe(e,a)}createCloneURI_(e,t){let r=new URL(e);r.hostname=t["URI-REPLACEMENT"].HOST;let s=t["URI-REPLACEMENT"].PARAMS;for(let n of Object.keys(s))r.searchParams.set(n,s[n]);return r.href}createCloneAttributes_(e,t){let r={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{t[s]&&(r[s]=e)}),r}getKeyIdSet(e){let t=new Set;if(!e||!e.contentProtection)return t;for(let r in e.contentProtection)if(e.contentProtection[r]&&e.contentProtection[r].attributes&&e.contentProtection[r].attributes.keyId){let s=e.contentProtection[r].attributes.keyId;t.add(s.toLowerCase())}return t}},cd=function(i,e,t,r){let s=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&s&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=s.byteLength||s.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&&(s||i.responseText)))),r(e,i)},qS=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(r=>{t=r(t)}),t},jS=(i,e,t,r)=>{!i||!i.size||i.forEach(s=>{s(e,t,r)})},v_=function(){let i=function e(t,r){t=oe({timeout:45e3},t);let s=e.beforeRequest||O.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||O.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||O.Vhs.xhr._responseCallbackSet;s&&typeof s=="function"&&(O.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));let l=O.Vhs.xhr.original===!0?O.xhr:O.Vhs.xhr,h=qS(n,t);n.delete(s);let f=l(h||t,function(_,T){return jS(a,f,_,T),cd(f,_,T,r)}),g=f.abort;return f.abort=function(){return f.aborted=!0,g.apply(f,arguments)},f.uri=t.uri,f.requestType=t.requestType,f.requestTime=Date.now(),f};return i.original=!0,i},HS=function(i){let e,t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=C.default.BigInt(i.offset)+C.default.BigInt(i.length)-C.default.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},dd=function(i){let e={};return i.byterange&&(e.Range=HS(i.byterange)),e},$S=function(i,e){return i.start(e)+"-"+i.end(e)},zS=function(i,e){let t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},GS=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},b_=function(i){let e={};
310return Object.keys(i).forEach(t=>{let r=i[t];Fu(r)?e[t]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:e[t]=r}),e},ll=function(i){let e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},T_=function(i){return i.resolvedUri},x_=i=>{let e=Array.prototype.slice.call(i),t=16,r="",s,n;for(let a=0;a<e.length/t;a++)s=e.slice(a*t,a*t+t).map(zS).join(""),n=e.slice(a*t,a*t+t).map(GS).join(""),r+=s+" "+n+` 311`;return r},WS=({bytes:i})=>x_(i),XS=i=>{let e="",t;for(t=0;t<i.length;t++)e+=$S(i,t)+" ";return e},KS=Object.freeze({__proto__:null,createTransferableMessage:b_,initSegmentId:ll,segmentKeyId:T_,hexDump:x_,tagDump:WS,textRanges:XS}),S_=.25,YS=(i,e)=>{if(!e.dateTimeObject)return null;let t=e.videoTimingInfo.transmuxerPrependedSeconds,s=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-s;return new Date(e.dateTimeObject.getTime()+n*1e3)},QS=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,JS=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let r=e.segments[0];if(t<new Date(r.dateTimeObject))return null;for(let h=0;h<e.segments.length-1;h++){r=e.segments[h];let f=new Date(e.segments[h+1].dateTimeObject);if(t<f)break}let s=e.segments[e.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?QS(s.videoTimingInfo):s.duration+s.duration*S_,l=new Date(n.getTime()+a*1e3);return t>l?null:(t>new Date(n)&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:gt.duration(e,e.mediaSequence+e.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},ZS=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,r;for(let n=0;n<e.segments.length&&(r=e.segments[n],t=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:t+r.duration,!(i<=t));n++);let s=e.segments[e.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+s.duration*S_)return null;r=s}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:t-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},eE=(i,e)=>{let t,r;try{t=new Date(i),r=new Date(e)}catch{}let s=t.getTime();return(r.getTime()-s)/1e3},tE=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},iE=({playlist:i,time:e=void 0,callback:t})=>{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"});let r=ZS(e,i);if(!r)return t({message:"valid programTime was not found"});if(r.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});let s={mediaSeconds:e},n=YS(e,r.segment);return n&&(s.programDateTime=n.toISOString()),t(null,s)},E_=({programTime:i,playlist:e,retryCount:t=2,seekTo:r,pauseAfterSeek:s=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!r)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(!tE(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});let l=JS(i,e);if(!l)return a({message:`${i} was not found in the stream`});let h=l.segment,f=eE(h.dateTimeObject,i);if(l.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});r(l.estimatedStart+f),n.one("seeked",()=>{E_({programTime:i,playlist:e,retryCount:t-1,seekTo:r,pauseAfterSeek:s,tech:n,callback:a})});return}let g=h.start+f,_=()=>a(null,n.currentTime());n.one("seeked",_),s&&n.pause(),r(g)},wc=(i,e)=>{if(i.readyState===4)return e()},rE=(i,e,t,r)=>{let s=[],n,a=!1,l=function(_,T,E,w){return T.abort(),a=!0,t(_,T,E,w)},h=function(_,T){if(a)return;if(_)return _.metadata=dr({requestType:r,request:T,error:_}),l(_,T,"",s);let E=T.responseText.substring(s&&s.byteLength||0,T.responseText.length);if(s=qp(s,$a(E,!0)),n=n||sr(s),s.length<10||n&&s.length<n+2)return wc(T,()=>l(_,T,"",s));let w=so(s);return w==="ts"&&s.length<188?wc(T,()=>l(_,T,"",s)):!w&&s.length<376?wc(T,()=>l(_,T,"",s)):l(null,T,w,s)},g=e({uri:i,beforeSend(_){_.overrideMimeType("text/plain;
311 charset=x-user-defined"),_.addEventListener("progress",function({total:T,loaded:E}){return cd(_,null,{statusCode:_.status},h)})}},function(_,T){return cd(g,_,T,h)});return g},{EventTarget:sE}=O,Wg=function(i,e){if(!y_(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<i.segments.length;t++){let r=i.segments[t],s=e.segments[t];if(r.uri!==s.uri)return!1;if(!r.byterange&&!s.byterange)continue;let n=r.byterange,a=s.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},nE=(i,e,t,r)=>{let s=r.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${s}`},aE=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:r,previousManifest:s})=>{let n=Qm(i,{manifestUri:e,clientOffset:t,sidxMapping:r,previousManifest:s});return h_(n,e,nE),n},oE=(i,e)=>{_s(i,(t,r,s,n)=>{(!e.mediaGroups[r][s]||!(n in e.mediaGroups[r][s]))&&delete i.mediaGroups[r][s][n]})},lE=(i,e,t)=>{let r=!0,s=oe(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){let a=e.playlists[n];if(a.sidx){let h=ln(a.sidx);t&&t[h]&&t[h].sidx&&to(a,t[h].sidx,a.sidx.resolvedUri)}let l=ld(s,a,Wg);l&&(s=l,r=!1)}return _s(e,(n,a,l,h)=>{if(n.playlists&&n.playlists.length){let f=n.playlists[0].id,g=ld(s,n.playlists[0],Wg);g&&(s=g,h in s.mediaGroups[a][l]||(s.mediaGroups[a][l][h]=n),s.mediaGroups[a][l][h].playlists[0]=s.playlists[f],r=!1)}}),oE(s,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(r=!1),r?null:s},uE=(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,Xg=(i,e)=>{let t={};for(let r in i){let n=i[r].sidx;if(n){let a=ln(n);if(!e[a])break;let l=e[a].sidxInfo;uE(l,n)&&(t[a]=e[a])}}return t},cE=(i,e)=>{let r=Xg(i.playlists,e);return _s(i,(s,n,a,l)=>{if(s.playlists&&s.playlists.length){let h=s.playlists;r=oe(r,Xg(h,e))}}),r},jn=class extends sE{constructor(e,t,r={},s){super(),this.isPaused_=!0,this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);let{withCredentials:n=!1}=r;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=r.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_=Ot("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,r){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},r&&(this.state=r),this.trigger("error"),!0}addSidxSegments_(e,t,r){let s=e.sidx&&ln(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=C.default.setTimeout(()=>r(!1),0);return}let n=al(e.sidx.resolvedUri),a=(h,f)=>{if(this.requestErrored_(h,f,t))return;let g=this.mainPlaylistLoader_.sidxMapping_,{requestType:_}=f,T;try{T=(0,l0.default)(z(f.response).subarray(8))}catch(E){E.metadata=dr({requestType:_,request:f,parseFailure:!0}),this.requestErrored_(E,f,t);return}return g[s]={sidxInfo:e.sidx,sidx:T},to(e,T,e.sidx.resolvedUri),r(!0)},l="dash-sidx";this.request=rE(n,this.vhs_.xhr,(h,f,g,_)=>{if(h)return a(h,f);if(!g||g!=="mp4"){let w=g||"unknown";return a({status:f.status,message:`Unsupported ${w} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},f)}let{offset:T,length:E}=e.sidx.byterange;if(_.length>=E+T)return a(h,{response:_.subarray(T,T+E),status:f.status,uri:f.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:dd({byterange:e.sidx.byterange})},a)},l)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},C.default.clearTimeout(this.minimumUpdatePeriodTimeout_),C.default.clearTimeout(this.mediaRequest_),C.default.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){let 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);let 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]}let r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,s=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(C.default.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,C.default.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let r=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=C.default.setTimeout(()=>this.load(),r);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")}
311start(){if(this.started=!0,!this.isMain_){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=C.default.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){let 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"},(r,s)=>{if(r){let{requestType:a}=s;r.metadata=dr({requestType:a,request:s,error:r})}if(this.requestErrored_(r,s)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});let n=s.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=al(this.mainPlaylistLoader_.srcUrl,s),n){this.handleMain_(),this.syncClientServerClock_(()=>e(s,n));return}return e(s,n)})}syncClientServerClock_(e){let t=Jm(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:mt(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(r,s)=>{if(!this.request)return;if(r){let{requestType:a}=s;return this.error.metadata=dr({requestType:a,request:s,error:r}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!s.responseHeaders||!s.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(s.responseHeaders.date):n=Date.parse(s.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_(){C.default.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let r;try{r=aE({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:O.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(r=lE(e,r,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=r||e;let s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||r&&r.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(r),r){let{duration:n,endList:a}=r,l=[];
311r.playlists.forEach(f=>{l.push({id:f.id,bandwidth:f.attributes.BANDWIDTH,resolution:f.attributes.RESOLUTION,codecs:f.attributes.CODECS})});let h={duration:n,isLive:!a,renditions:l};t.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!r}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(C.default.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){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=C.default.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_=cE(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,r=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,r=!this.media_||this.media_!==t[e];if(r?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let s=()=>{this.media().endList||(this.mediaUpdateTimeout=C.default.setTimeout(()=>{this.trigger("mediaupdatetimeout"),s()},ud(this.media(),!!r)))};s()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let t=this.mainPlaylistLoader_.main.eventStream.map(r=>({cueTime:r.start,frames:[{data:r.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let r in e.contentProtection){let s=e.contentProtection[r].attributes["cenc:default_KID"];s&&t.add(s.replace(/-/g,"").toLowerCase())}return t}}},Fe={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},dE=i=>{let e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},C_=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},hE=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{let t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},w_=function(i){return function(){let e=hE(i),t=C_(new Worker(e));t.objURL=e;let r=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),r.call(this)},t}},A_=function(i){return`var browserWorkerPolyFill = ${C_.toString()}; 312browserWorkerPolyFill(self); 313`+i},D_=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},fE=A_(D_(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var o={};this.on=function(u,c){o[u]||(o[u]=[]),o[u]=o[u].concat(c)},this.off=function(u,c){var d;return o[u]?(d=o[u].indexOf(c),o[u]=o[u].slice(),o[u].splice(d,1),d>-1):!1},this.trigger=function(u){var c,d,p,m;if(c=o[u],!!c)if(arguments.length===2)for(p=c.length,d=0;d<p;++d)c[d].call(this,arguments[1]);else{for(m=[],d=arguments.length,d=1;d<arguments.length;++d)m.push(arguments[d]);for(p=c.length,d=0;d<p;++d)c[d].apply(this,m)}},this.dispose=function(){o={}}}};e.prototype.pipe=function(o){return this.on("data",function(u){o.push(u)}),this.on("done",function(u){o.flush(u)}),this.on("partialdone",function(u){o.partialFlush(u)}),this.on("endedtimeline",function(u){o.endTimeline(u)}),this.on("reset",function(u){o.reset(u)}),o},e.prototype.push=function(o){this.trigger("data",o)},e.prototype.flush=function(o){this.trigger("done",o)},e.prototype.partialFlush=function(o){this.trigger("partialdone",o)},e.prototype.endTimeline=function(o){this.trigger("endedtimeline",o)},e.prototype.reset=function(o){this.trigger("reset",o)};var t=e,r=Math.pow(2,32),s=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c;return u.getBigUint64?(c=u.getBigUint64(0),c<Number.MAX_SAFE_INTEGER?
313Number(c):c):u.getUint32(0)*r+u.getUint32(4)},n={getUint64:s,MAX_UINT32:r},a=n.MAX_UINT32,l,h,f,g,_,T,E,w,y,I,A,P,k,L,R,U,N,V,X,fe,ee,me,G,re,Ye,ne,ke,si,zi,Gi,Wi,Xi,Gn,jd,Hd,$d;(function(){var o;if(G={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(o in G)G.hasOwnProperty(o)&&(G[o]=[o.charCodeAt(0),o.charCodeAt(1),o.charCodeAt(2),o.charCodeAt(3)]);re=new Uint8Array([105,115,111,109]),ne=new Uint8Array([97,118,99,49]),Ye=new Uint8Array([0,0,0,1]),ke=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]),si=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]),zi={video:ke,audio:si},Xi=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),Wi=new Uint8Array([0,0,0,0,0,0,0,0]),Gn=new Uint8Array([0,0,0,0,0,0,0,0]),jd=Gn,Hd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),$d=Gn,Gi=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),l=function(o){var u=[],c=0,d,p,m;for(d=1;d<arguments.length;d++)u.push(arguments[d]);for(d=u.length;d--;)c+=u[d].byteLength;for(p=new Uint8Array(c+8),m=new DataView(p.buffer,p.byteOffset,p.byteLength),m.setUint32(0,p.byteLength),p.set(o,4),d=0,c=8;d<u.length;d++)p.set(u[d],c),c+=u[d].byteLength;return p},h=function(){return l(G.dinf,l(G.dref,Xi))},f=function(o){return l(G.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,o.audioobjecttype<<3|o.samplingfrequencyindex>>>1,o.samplingfrequencyindex<<7|o.channelcount<<3,6,1,2]))},g=function(){return l(G.ftyp,re,Ye,re,ne)},U=function(o){return l(G.hdlr,zi[o])},_=function(o){return l(G.mdat,o)},R=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,o.duration>>>24&255,o.duration>>>16&255,o.duration>>>8&255,o.duration&255,85,196,0,0]);return o.samplerate&&(u[12]=o.samplerate>>>24&255,u[13]=o.samplerate>>>16&255,u[14]=o.samplerate>>>8&255,u[15]=o.samplerate&255),l(G.mdhd,u)},L=function(o){return l(G.mdia,R(o),U(o.type),E(o))},T=function(o){return l(G.mfhd,new Uint8Array([0,0,0,0,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255]))},E=function(o){return l(G.minf,o.type==="video"?l(G.vmhd,Gi):l(G.smhd,Wi),h(),V(o))},w=function(o,u){for(var c=[],d=u.length;d--;)c[d]=fe(u[d]);return l.apply(null,[G.moof,T(o)].concat(c))},y=function(o){for(var u=o.length,c=[];u--;)c[u]=P(o[u]);return l.apply(null,[G.moov,A(4294967295)].concat(c).concat(I(o)))},I=function(o){for(var u=o.length,c=[];u--;)c[u]=ee(o[u]);return l.apply(null,[G.mvex].concat(c))},A=function(o){var u=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return l(G.mvhd,u)},N=function(o){var u=o.samples||[],c=new Uint8Array(4+u.length),d,p;for(p=0;p<u.length;p++)d=u[p].flags,c[p+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return l(G.sdtp,c)},V=function(o){return l(G.stbl,X(o),l(G.stts,$d),l(G.stsc,jd),l(G.stsz,Hd),l(G.stco,Gn))},function(){var o,u;X=function(c){return l(G.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),c.type==="video"?o(c):u(c))},o=function(c){var d=c.sps||[],p=c.pps||[],m=[],v=[],b,x;for(b=0;b<d.length;b++)m.push((d[b].byteLength&65280)>>>8),m.push(d[b].byteLength&255),m=m.concat(Array.prototype.slice.call(d[b]));for(b=0;b<p.length;b++)v.push((p[b].byteLength&65280)>>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(x=[G.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,(c.width&65280)>>8,c.width&255,(c.height&65280)>>8,c.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]),l(G.avcC,new Uint8Array([1,c.profileIdc,c.profileCompatibility,c.levelIdc,255].concat([d.length],m,[p.length],v))),l(G.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],c.sarRatio){var S=c.sarRatio[0],D=c.sarRatio[1];x.push(l(G.pasp,new Uint8Array([(S&4278190080)>>24,(S&16711680)>>16,(S&65280)>>8,S&255,(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255])))}return l.apply(null,x)},u=function(c){return l(G.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(c.channelcount&65280)>>8,c.channelcount&255,(c.samplesize&65280)>>8,c.samplesize&255,0,0,0,0,(c.samplerate&65280)>>8,c.samplerate&255,0,0]),f(c))}}(),k=function(o){var u=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,0,(o.duration&4278190080)>>24,(o.duration&16711680)>>16,(o.duration&65280)>>8,o.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(o.width&65280)>>8,o.width&255,0,0,(o.height&65280)>>8,o.height&255,0,0]);return l(G.tkhd,u)},fe=function(o){var u,c,d,p,m,v,b;return u=l(G.tfhd,new Uint8Array([0,0,0,58,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(o.baseMediaDecodeTime/a),b=Math.floor(o.baseMediaDecodeTime%a),c=l(G.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])),m=92,o.type==="audio"?(d=me(o,m),l(G.traf,u,c,d)):(p=N(o),d=me(o,p.length+m),l(G.traf,u,c,d,p))},P=function(o){return o.duration=o.duration||4294967295,l(G.trak,k(o),L(o))},ee=function(o){var u=new Uint8Array([0,0,0,0,(o.id&4278190080)>>24,(o.id&16711680)>>16,(o.id&65280)>>8,o.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return o.type!=="video"&&(u[u.length-1]=0),l(G.trex,u)},function(){var o,u,c;c=function(d,p){var m=0,v=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(m=1),d[0].size!==void 0&&(v=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,m|v|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},u=function(d,p){var m,v,b,x,S,D;for(x=d.samples||[],p+=20+16*x.length,b=c(x,p),v=new Uint8Array(b.length+x.length*16),v.set(b),m=b.length,D=0;D<x.length;D++)S=x[D],v[m++]=(S.duration&4278190080)>>>24,v[m++]=(S.duration&16711680)>>>16,v[m++]=(S.duration&65280)>>>8,v[m++]=S.duration&255,v[m++]=(S.size&4278190080)>>>24,v[m++]=(S.size&16711680)>>>16,v[m++]=(S.size&65280)>>>8,v[m++]=S.size&255,v[m++]=S.flags.isLeading<<2|S.flags.dependsOn,v[m++]=S.flags.isDependedOn<<6|S.flags.hasRedundancy<<4|S.flags.paddingValue<<1|S.flags.isNonSyncSample,v[m++]=S.flags.degradationPriority&61440,v[m++]=S.flags.degradationPriority&15,v[m++]=(S.compositionTimeOffset&4278190080)>>>24,v[m++]=(S.compositionTimeOffset&16711680)>>>16,v[m++]=(S.compositionTimeOffset&65280)>>>8,v[m++]=S.compositionTimeOffset&255;return l(G.trun,v)},o=function(d,p){var m,v,b,x,S,D;for(x=d.samples||[],p+=20+8*x.length,b=c(x,p),m=new Uint8Array(b.length+x.length*8),m.set(b),v=b.length,D=0;D<x.length;D++)S=x[D],m[v++]=(S.duration&4278190080)>>>24,m[v++]=(S.duration&16711680)>>>16,m[v++]=(S.duration&65280)>>>8,m[v++]=S.duration&255,m[v++]=(S.size&4278190080)>>>24,m[v++]=(S.size&16711680)>>>16,m[v++]=(S.size&65280)>>>8,m[v++]=S.size&255;return l(G.trun,m)},me=function(d,p){return d.type==="audio"?o(d,p):u(d,p)}}();var Z_={ftyp:g,mdat:_,moof:w,moov:y,initSegment:function(o){var u=g(),c=y(o),d;return d=new Uint8Array(u.byteLength+c.byteLength),d.set(u),d.set(c,u.byteLength),d}},ey=function(o){var u,c,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,u=0;u<o.length;u++)c=o[u],c.nalUnitType==="access_unit_delimiter_rbsp"?(d.length&&(d.duration=c.dts-d.dts,p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d)),d=[c],d.byteLength=c.data.byteLength,d.pts=c.pts,d.dts=c.dts):(c.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(d.keyFrame=!0),d.duration=c.dts-d.dts,d.byteLength+=c.data.byteLength,d.push(c));return p.length&&(!d.duration||d.duration<=0)&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.length,p.duration+=d.duration,p.push(d),p},ty=function(o){var u,c,d=[],p=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=o[0].pts,d.dts=o[0].dts,p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=o[0].pts,p.dts=o[0].dts,u=0;u<o.length;u++)c=o[u],c.keyFrame?(d.length&&(p.push(d),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration),d=[c],d.nalCount=c.length,d.byteLength=c.byteLength,d.pts=c.pts,d.dts=c.dts,d.duration=c.duration):(d.duration+=c.duration,d.nalCount+=c.length,d.byteLength+=c.byteLength,d.push(c));return p.length&&d.duration<=0&&(d.duration=p[p.length-1].duration),p.byteLength+=d.byteLength,p.nalCount+=d.nalCount,p.duration+=d.duration,p.push(d),p},iy=function(o){var u;return!o[0][0].keyFrame&&o.length>1&&(u=o.shift(),o.byteLength-=u.byteLength,o.nalCount-=u.nalCount,o[0][0].dts=u.dts,o[0][0].pts=u.pts,o[0][0].duration+=u.duration),o},ry=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},zd=function(o,u){var c=ry();return c.dataOffset=u,c.compositionTimeOffset=o.pts-o.dts,c.duration=o.duration,c.size=4*o.length,c.size+=o.byteLength,o.keyFrame&&(c.flags.dependsOn=2,c.flags.isNonSyncSample=0),c},sy=function(o,u){var c,d,p,m,v,b=u||0,x=[];for(c=0;c<o.length;c++)for(m=o[c],d=0;d<m.length;d++)v=m[d],p=zd(v,b),b+=p.size,x.push(p);return x},ny=function(o){var u,c,d,p,m,v,b=0,x=o.byteLength,S=o.nalCount,D=x+4*S,M=new Uint8Array(D),j=new DataView(M.buffer);for(u=0;
313u<o.length;u++)for(p=o[u],c=0;c<p.length;c++)for(m=p[c],d=0;d<m.length;d++)v=m[d],j.setUint32(b,v.data.byteLength),b+=4,M.set(v.data,b),b+=v.data.byteLength;return M},ay=function(o,u){var c,d=u||0,p=[];return c=zd(o,d),p.push(c),p},oy=function(o){var u,c,d=0,p=o.byteLength,m=o.length,v=p+4*m,b=new Uint8Array(v),x=new DataView(b.buffer);for(u=0;u<o.length;u++)c=o[u],x.setUint32(d,c.data.byteLength),d+=4,b.set(c.data,d),d+=c.data.byteLength;return b},ly={groupNalsIntoFrames:ey,groupFramesIntoGops:ty,extendFirstKeyFrame:iy,generateSampleTable:sy,concatenateNalData:ny,generateSampleTableForFrame:ay,concatenateNalDataForFrame:oy},yi=[33,16,5,32,164,27],Pl=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],le=function(o){for(var u=[];o--;)u.push(0);return u},uy=function(o){return Object.keys(o).reduce(function(u,c){return u[c]=new Uint8Array(o[c].reduce(function(d,p){return d.concat(p)},[])),u},{})},Ol,cy=function(){if(!Ol){var o={96e3:[yi,[227,64],le(154),[56]],88200:[yi,[231],le(170),[56]],64e3:[yi,[248,192],le(240),[56]],48e3:[yi,[255,192],le(268),[55,148,128],le(54),[112]],44100:[yi,[255,192],le(268),[55,163,128],le(84),[112]],32e3:[yi,[255,192],le(268),[55,234],le(226),[112]],24e3:[yi,[255,192],le(268),[55,255,128],le(268),[111,112],le(126),[224]],16e3:[yi,[255,192],le(268),[55,255,128],le(268),[111,255],le(269),[223,108],le(195),[1,192]],12e3:[Pl,le(268),[3,127,248],le(268),[6,255,240],le(268),[13,255,224],le(268),[27,253,128],le(259),[56]],11025:[Pl,le(268),[3,127,248],le(268),[6,255,240],le(268),[13,255,224],le(268),[27,255,192],le(268),[55,175,128],le(108),[112]],8e3:[Pl,le(268),[3,121,16],le(47),[7]]};Ol=uy(o)}return Ol},Ll=9e4,Rl,Ml,Wn,Nl,Gd,Wd,Xd;Rl=function(o){return o*Ll},Ml=function(o,u){return o*u},Wn=function(o){return o/Ll},Nl=function(o,u){return o/u},Gd=function(o,u){return Rl(Nl(o,u))},Wd=function(o,u){return Ml(Wn(o),u)},Xd=function(o,u,c){return Wn(c?o:o-u)};var Te={ONE_SECOND_IN_TS:Ll,secondsToVideoTs:Rl,secondsToAudioTs:Ml,videoTsToSeconds:Wn,audioTsToSeconds:Nl,audioTsToVideoTs:Gd,videoTsToAudioTs:Wd,metadataTsToSeconds:Xd},dy=cy,Xn=Te,hy=function(o){var u,c,d=0;for(u=0;u<o.length;u++)c=o[u],d+=c.data.byteLength;return d},fy=function(o,u,c,d){var p,m=0,v=0,b=0,x=0,S,D,M;if(u.length&&(p=Xn.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),m=Math.ceil(Xn.ONE_SECOND_IN_TS/(o.samplerate/1024)),c&&d&&(v=p-Math.max(c,d),b=Math.floor(v/m),x=b*m),!(b<1||x>Xn.ONE_SECOND_IN_TS/2))){for(S=dy()[o.samplerate],S||(S=u[0].data),D=0;D<b;D++)M=u[0],u.splice(0,0,{data:S,dts:M.dts-m,pts:M.pts-m});return o.baseMediaDecodeTime-=Math.floor(Xn.videoTsToAudioTs(x,o.samplerate)),x}},py=function(o,u,c){return u.minSegmentDts>=c?o:(u.minSegmentDts=1/0,o.filter(function(d){return d.dts>=c?(u.minSegmentDts=Math.min(u.minSegmentDts,d.dts),u.minSegmentPts=u.minSegmentDts,!0):!1}))},my=function(o){var u,c,d=[];for(u=0;u<o.length;u++)c=o[u],d.push({size:c.data.byteLength,duration:1024});return d},gy=function(o){var u,c,d=0,p=new Uint8Array(hy(o));for(u=0;u<o.length;u++)c=o[u],p.set(c.data,d),d+=c.data.byteLength;return p},_y={prefixWithSilence:fy,trimAdtsFramesByEarliestDts:py,generateSampleTable:my,concatenateFrameData:gy},yy=Te.ONE_SECOND_IN_TS,vy=function(o,u){typeof u.pts=="number"&&(o.timelineStartInfo.pts===void 0&&(o.timelineStartInfo.pts=u.pts),o.minSegmentPts===void 0?o.minSegmentPts=u.pts:o.minSegmentPts=Math.min(o.minSegmentPts,u.pts),o.maxSegmentPts===void 0?o.maxSegmentPts=u.pts:o.maxSegmentPts=Math.max(o.maxSegmentPts,u.pts)),typeof u.dts=="number"&&(o.timelineStartInfo.dts===void 0&&(o.timelineStartInfo.dts=u.dts),o.minSegmentDts===void 0?o.minSegmentDts=u.dts:o.minSegmentDts=Math.min(o.minSegmentDts,u.dts),o.maxSegmentDts===void 0?o.maxSegmentDts=u.dts:o.maxSegmentDts=Math.max(o.maxSegmentDts,u.dts))},by=function(o){delete o.minSegmentDts,delete o.maxSegmentDts,delete o.minSegmentPts,delete o.maxSegmentPts},Ty=function(o,u){var c,d,p=o.minSegmentDts;return u||(p-=o.timelineStartInfo.dts),c=o.timelineStartInfo.baseMediaDecodeTime,c+=p,c=Math.max(0,c),o.type==="audio"&&(d=o.samplerate/yy,c*=d,c=Math.floor(c)),c}
313,xy={clearDtsInfo:by,calculateTrackBaseMediaDecodeTime:Ty,collectDtsInfo:vy},Kd=4,Sy=128,Ey=function(o){for(var u=0,c={payloadType:-1,payloadSize:0},d=0,p=0;u<o.byteLength&&o[u]!==Sy;){for(;o[u]===255;)d+=255,u++;for(d+=o[u++];o[u]===255;)p+=255,u++;if(p+=o[u++],!c.payload&&d===Kd){var m=String.fromCharCode(o[u+3],o[u+4],o[u+5],o[u+6]);if(m==="GA94"){c.payloadType=d,c.payloadSize=p,c.payload=o.subarray(u,u+p);break}else c.payload=void 0}u+=p,d=0,p=0}return c},Cy=function(o){return o.payload[0]!==181||(o.payload[1]<<8|o.payload[2])!==49||String.fromCharCode(o.payload[3],o.payload[4],o.payload[5],o.payload[6])!=="GA94"||o.payload[7]!==3?null:o.payload.subarray(8,o.payload.length-1)},wy=function(o,u){var c=[],d,p,m,v;if(!(u[0]&64))return c;for(p=u[0]&31,d=0;d<p;d++)m=d*3,v={type:u[m+2]&3,pts:o},u[m+2]&4&&(v.ccData=u[m+3]<<8|u[m+4],c.push(v));return c},Ay=function(o){for(var u=o.byteLength,c=[],d=1,p,m;d<u-2;)o[d]===0&&o[d+1]===0&&o[d+2]===3?(c.push(d+2),d+=2):d++;if(c.length===0)return o;p=u-c.length,m=new Uint8Array(p);var v=0;for(d=0;d<p;v++,d++)v===c[0]&&(v++,c.shift()),m[d]=o[v];return m},Yd={parseSei:Ey,parseUserData:Cy,parseCaptionPackets:wy,discardEmulationPreventionBytes:Ay,USER_DATA_REGISTERED_ITU_T_T35:Kd},Bl=t,Kn=Yd,at=function(o){o=o||{},at.prototype.init.call(this),this.parse708captions_=typeof o.parse708captions=="boolean"?o.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Ee(0,0),new Ee(0,1),new Ee(1,0),new Ee(1,1)],this.parse708captions_&&(this.cc708Stream_=new ge({captionServices:o.captionServices})),this.reset(),this.ccStreams_.forEach(function(u){u.on("data",this.trigger.bind(this,"data")),u.on("partialdone",this.trigger.bind(this,"partialdone")),u.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};at.prototype=new Bl,at.prototype.push=function(o){var u,c,d;if(o.nalUnitType==="sei_rbsp"&&(u=Kn.parseSei(o.escapedRBSP),!!u.payload&&u.payloadType===Kn.USER_DATA_REGISTERED_ITU_T_T35&&(c=Kn.parseUserData(u),!!c))){if(o.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(o.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}d=Kn.parseCaptionPackets(o.pts,c),this.captionPackets_=this.captionPackets_.concat(d),this.latestDts_!==o.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=o.dts}},at.prototype.flushCCStreams=function(o){this.ccStreams_.forEach(function(u){return o==="flush"?u.flush():u.partialFlush()},this)},at.prototype.flushStream=function(o){if(!this.captionPackets_.length){this.flushCCStreams(o);return}this.captionPackets_.forEach(function(u,c){u.presortIndex=c}),this.captionPackets_.sort(function(u,c){return u.pts===c.pts?u.presortIndex-c.presortIndex:u.pts-c.pts}),this.captionPackets_.forEach(function(u){u.type<2?this.dispatchCea608Packet(u):this.dispatchCea708Packet(u)},this),this.captionPackets_.length=0,this.flushCCStreams(o)},at.prototype.flush=function(){return this.flushStream("flush")},at.prototype.partialFlush=function(){return this.flushStream("partialFlush")},at.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(o){o.reset()})},at.prototype.dispatchCea608Packet=function(o){this.setsTextOrXDSActive(o)?this.activeCea608Channel_[o.type]=null:this.setsChannel1Active(o)?this.activeCea608Channel_[o.type]=0:this.setsChannel2Active(o)&&(this.activeCea608Channel_[o.type]=1),this.activeCea608Channel_[o.type]!==null&&this.ccStreams_[(o.type<<1)+this.activeCea608Channel_[o.type]].push(o)},at.prototype.setsChannel1Active=function(o){return(o.ccData&30720)===4096},at.prototype.setsChannel2Active=function(o){return(o.ccData&30720)===6144},at.prototype.setsTextOrXDSActive=function(o){return(o.ccData&28928)===256||(o.ccData&30974)===4138||(o.ccData&30974)===6186},at.prototype.dispatchCea708Packet=function(o){this.parse708captions_&&this.cc708Stream_.push(o)};var Dy={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Iy=function(o){var u=Dy[o]||o;return o&4096&&o===u?"":String.fromCharCode(u)},Yn=function(o){return 32<=o&&o<=127||160<=o&&o<=255},ni=function(o){this.windowNum=o,this.reset()};ni.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},ni.prototype.getText=function(){return this.rows.join(` 314`)},ni.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ni.prototype.newLine=function(o){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(o),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ni.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ni.prototype.addText=function(o){this.rows[this.rowIdx]+=o},ni.prototype.backspace=function(){if(!this.isEmpty()){var o=this.rows[this.rowIdx];this.rows[this.rowIdx]=o.substr(0,o.length-1)}};var Qn=function(o,u,c){this.serviceNum=o,this.text="",this.currentWindow=new ni(-1),this.windows=[],this.stream=c,typeof u=="string"&&this.createTextDecoder(u)};Qn.prototype.init=function(o,u){this.startPts=o;for(var c=0;c<8;c++)this.windows[c]=new ni(c),typeof u=="function"&&(this.windows[c].beforeRowOverflow=u)},Qn.prototype.setCurrentWindow=function(o){this.currentWindow=this.windows[o]}
314,Qn.prototype.createTextDecoder=function(o){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(o)}catch(u){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+o+" encoding. "+u})}};var ge=function(o){o=o||{},ge.prototype.init.call(this);var u=this,c=o.captionServices||{},d={},p;Object.keys(c).forEach(m=>{p=c[m],/^SERVICE/.test(m)&&(d[m]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(m){m.type===3?(u.new708Packet(),u.add708Bytes(m)):(u.current708Packet===null&&u.new708Packet(),u.add708Bytes(m))}};ge.prototype=new Bl,ge.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ge.prototype.add708Bytes=function(o){var u=o.ccData,c=u>>>8,d=u&255;this.current708Packet.ptsVals.push(o.pts),this.current708Packet.data.push(c),this.current708Packet.data.push(d)},ge.prototype.push708Packet=function(){var o=this.current708Packet,u=o.data,c=null,d=null,p=0,m=u[p++];for(o.seq=m>>6,o.sizeCode=m&63;p<u.length;p++)m=u[p++],c=m>>5,d=m&31,c===7&&d>0&&(m=u[p++],c=m),this.pushServiceBlock(c,p,d),d>0&&(p+=d-1)},ge.prototype.pushServiceBlock=function(o,u,c){var d,p=u,m=this.current708Packet.data,v=this.services[o];for(v||(v=this.initService(o,p));p<u+c&&p<m.length;p++)d=m[p],Yn(d)?p=this.handleText(p,v):d===24?p=this.multiByteCharacter(p,v):d===16?p=this.extendedCommands(p,v):128<=d&&d<=135?p=this.setCurrentWindow(p,v):152<=d&&d<=159?p=this.defineWindow(p,v):d===136?p=this.clearWindows(p,v):d===140?p=this.deleteWindows(p,v):d===137?p=this.displayWindows(p,v):d===138?p=this.hideWindows(p,v):d===139?p=this.toggleWindows(p,v):d===151?p=this.setWindowAttributes(p,v):d===144?p=this.setPenAttributes(p,v):d===145?p=this.setPenColor(p,v):d===146?p=this.setPenLocation(p,v):d===143?v=this.reset(p,v):d===8?v.currentWindow.backspace():d===12?v.currentWindow.clearText():d===13?v.currentWindow.pendingNewLine=!0:d===14?v.currentWindow.clearText():d===141&&p++},ge.prototype.extendedCommands=function(o,u){var c=this.current708Packet.data,d=c[++o];return Yn(d)&&(o=this.handleText(o,u,{isExtended:!0})),o},ge.prototype.getPts=function(o){return this.current708Packet.ptsVals[Math.floor(o/2)]},ge.prototype.initService=function(o,u){var d="SERVICE"+o,c=this,d,p;return d in this.serviceEncodings&&(p=this.serviceEncodings[d]),this.services[o]=new Qn(o,p,c),this.services[o].init(this.getPts(u),function(m){c.flushDisplayed(m,c.services[o])}),this.services[o]},ge.prototype.handleText=function(o,u,c){var d=c&&c.isExtended,p=c&&c.isMultiByte,m=this.current708Packet.data,v=d?4096:0,b=m[o],x=m[o+1],S=u.currentWindow,D,M;function j(B){return B.map(W=>("0"+(W&255).toString(16)).slice(-2)).join("")}if(p?(M=[b,x],o++):M=[b],u.textDecoder_&&!d)D=u.textDecoder_.decode(new Uint8Array(M));else if(p){let B=j(M);D=String.fromCharCode(parseInt(B,16))}else D=Iy(v|b);return S.pendingNewLine&&!S.isEmpty()&&S.newLine(this.getPts(o)),S.pendingNewLine=!1,S.addText(D),o},ge.prototype.multiByteCharacter=function(o,u){var c=this.current708Packet.data,d=c[o+1],p=c[o+2];return Yn(d)&&Yn(p)&&(o=this.handleText(++o,u,{isMultiByte:!0})),o},ge.prototype.setCurrentWindow=function(o,u){var c=this.current708Packet.data,d=c[o],p=d&7;return u.setCurrentWindow(p),o},ge.prototype.defineWindow=function(o,u){var c=this.current708Packet.data,d=c[o],p=d&7;u.setCurrentWindow(p);var m=u.currentWindow;return d=c[++o],m.visible=(d&32)>>5,m.rowLock=(d&16)>>4,m.columnLock=(d&8)>>3,m.priority=d&7,d=c[++o],m.relativePositioning=(d&128)>>7,m.anchorVertical=d&127,d=c[++o],m.anchorHorizontal=d,d=c[++o],m.anchorPoint=(d&240)>>4,m.rowCount=d&15,d=c[++o],m.columnCount=d&63,d=c[++o],m.windowStyle=(d&56)>>3,m.penStyle=d&7,m.virtualRowCount=m.rowCount+1,o},ge.prototype.setWindowAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],p=u.currentWindow.winAttr;return d=c[++o],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=c[++o],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=c[++o],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=c[++o],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,o},ge.prototype.flushDisplayed=function(o,u){for(var c=[],d=0;d<8;d++)u.windows[d].visible&&!u.windows[d].isEmpty()&&c.push(u.windows[d].getText());u.endPts=o,u.text=c.join(` 315 316`),this.pushCaption(u),u.startPts=o},ge.prototype.pushCaption=function(o){o.text!==""&&(this.trigger("data",{startPts:o.startPts,endPts:o.endPts,text:o.text,stream
316:"cc708_"+o.serviceNum}),o.text="",o.startPts=o.endPts)},ge.prototype.displayWindows=function(o,u){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible=1);return o},ge.prototype.hideWindows=function(o,u){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible=0);return o},ge.prototype.toggleWindows=function(o,u){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&(u.windows[m].visible^=1);return o},ge.prototype.clearWindows=function(o,u){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&u.windows[m].clearText();return o},ge.prototype.deleteWindows=function(o,u){var c=this.current708Packet.data,d=c[++o],p=this.getPts(o);this.flushDisplayed(p,u);for(var m=0;m<8;m++)d&1<<m&&u.windows[m].reset();return o},ge.prototype.setPenAttributes=function(o,u){var c=this.current708Packet.data,d=c[o],p=u.currentWindow.penAttr;return d=c[++o],p.textTag=(d&240)>>4,p.offset=(d&12)>>2,p.penSize=d&3,d=c[++o],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,o},ge.prototype.setPenColor=function(o,u){var c=this.current708Packet.data,d=c[o],p=u.currentWindow.penColor;return d=c[++o],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=c[++o],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=c[++o],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,o},ge.prototype.setPenLocation=function(o,u){var c=this.current708Packet.data,d=c[o],p=u.currentWindow.penLoc;return u.currentWindow.pendingNewLine=!0,d=c[++o],p.row=d&15,d=c[++o],p.column=d&63,o},ge.prototype.reset=function(o,u){var c=this.getPts(o);return this.flushDisplayed(c,u),this.initService(u.serviceNum,o)};var ky={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},Jn=function(o){return o===null?"":(o=ky[o]||o,String.fromCharCode(o))},Zn=14,Py=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ki=function(){for(var o=[],u=Zn+1;u--;)o.push({text:"",indent:0,offset:0});return o},Ee=function(o,u){Ee.prototype.init.call(this),this.field_=o||0,this.dataChannel_=u||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(c){var d,p,m,v,b;if(d=c.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),m=d>>>8,v=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(c.pts),this.flushDisplayed(c.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=c.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(c.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(c.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(c.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(c.pts),this.flushDisplayed(c.pts),this.shiftRowsUp_(),this.startPts_=c.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(c.pts),this.displayed_=Ki();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ki();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(c.pts),this.displayed_=Ki()),this.mode_="paintOn",this.startPts_=c.pts;else if(this.isSpecialCharacter(m,v))m=(m&3)<<8,b=Jn(m|v),this[this.mode_](c.pts,b),this.column_++;else if(this.isExtCharacter(m,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),m=(m&3)<<8,b=Jn(m|v),this[this.mode_](c.pts,b),this.column_++;else if(this.isMidRowCode(m,v))this.clearFormatting(c.pts),this[this.mode_](c.pts," "),this.column_++,(v&14)===14&&this.addFormatting(c.pts,["i"]),(v&1)===1&&this.addFormatting(c.pts,["u"]);else if(this.isOffsetControlCode(m,v)){let S=v&3;this.nonDisplayed_[this.row_].offset=S,this.column_+=S}else if(this.isPAC(m,v)){var x=Py.indexOf(d&7968);
316if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(c.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(c.pts),this.row_=x),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(c.pts,["u"]),(d&16)===16){let S=(d&14)>>1;this.column_=S*4,this.nonDisplayed_[this.row_].indent+=S}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(c.pts,["i"])}else this.isNormalChar(m)&&(v===0&&(v=null),b=Jn(m),b+=Jn(v),this[this.mode_](c.pts,b),this.column_+=b.length)}};Ee.prototype=new Bl,Ee.prototype.flushDisplayed=function(o){let u=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},c=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{u(p)}d.text.length&&c.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&u(p)}),c.length&&this.trigger("data",{startPts:this.startPts_,endPts:o,content:c,stream:this.name_})},Ee.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ki(),this.nonDisplayed_=Ki(),this.lastControlCode_=null,this.column_=0,this.row_=Zn,this.rollUpRows_=2,this.formatting_=[]},Ee.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},Ee.prototype.isSpecialCharacter=function(o,u){return o===this.EXT_&&u>=48&&u<=63},Ee.prototype.isExtCharacter=function(o,u){return(o===this.EXT_+1||o===this.EXT_+2)&&u>=32&&u<=63},Ee.prototype.isMidRowCode=function(o,u){return o===this.EXT_&&u>=32&&u<=47},Ee.prototype.isOffsetControlCode=function(o,u){return o===this.OFFSET_&&u>=33&&u<=35},Ee.prototype.isPAC=function(o,u){return o>=this.BASE_&&o<this.BASE_+8&&u>=64&&u<=127},Ee.prototype.isColorPAC=function(o){return o>=64&&o<=79||o>=96&&o<=127},Ee.prototype.isNormalChar=function(o){return o>=32&&o<=127},Ee.prototype.setRollUp=function(o,u){if(this.mode_!=="rollUp"&&(this.row_=Zn,this.mode_="rollUp",this.flushDisplayed(o),this.nonDisplayed_=Ki(),this.displayed_=Ki()),u!==void 0&&u!==this.row_)for(var c=0;c<this.rollUpRows_;c++)this.displayed_[u-c]=this.displayed_[this.row_-c],this.displayed_[this.row_-c]={text:"",indent:0,offset:0};u===void 0&&(u=this.row_),this.topRow_=u-this.rollUpRows_+1},Ee.prototype.addFormatting=function(o,u){this.formatting_=this.formatting_.concat(u);var c=u.reduce(function(d,p){return d+"<"+p+">"},"");this[this.mode_](o,c)},Ee.prototype.clearFormatting=function(o){if(this.formatting_.length){var u=this.formatting_.reverse().reduce(function(c,d){return c+"</"+d+">"},"");this.formatting_=[],this[this.mode_](o,u)}},Ee.prototype.popOn=function(o,u){var c=this.nonDisplayed_[this.row_].text;c+=u,this.nonDisplayed_[this.row_].text=c},Ee.prototype.rollUp=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c},Ee.prototype.shiftRowsUp_=function(){var o;for(o=0;o<this.topRow_;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.row_+1;o<Zn+1;o++)this.displayed_[o]={text:"",indent:0,offset:0};for(o=this.topRow_;o<this.row_;o++)this.displayed_[o]=this.displayed_[o+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ee.prototype.paintOn=function(o,u){var c=this.displayed_[this.row_].text;c+=u,this.displayed_[this.row_].text=c};var Qd={CaptionStream:at,Cea608Stream:Ee,Cea708Stream:ge},ea={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Oy=t,Ly=8589934592,Ry=4294967296,Jd="shared",Fl=function(o,u){var c=1;for(o>u&&(c=-1);Math.abs(u-o)>Ry;)o+=c*Ly;return o},Ul=function(o){var u,c;Ul.prototype.init.call(this),this.type_=o||Jd,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Jd&&d.type!==this.type_||(c===void 0&&(c=d.dts),d.dts=Fl(d.dts,c),d.pts=Fl(d.pts,c),u=d.dts,this.trigger("data",d))},this.flush=function(){c=u,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){c=void 0,u=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ul.prototype=new Oy;var Zd={TimestampRolloverStream:Ul,handleRollover:Fl},My=(o,u,c)=>{if(!o)return-1;for(var d=c;d<o.length;d++)if(o[d]===u)return d;return-1},Ny={typedArrayIndexOf:My},ta=Ny.typedArrayIndexOf,ia={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},eh=function(o,u,c){var d,p="";for(d=u;d<c;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},ys=function(o,u,c){return decodeURIComponent(eh(o,u,c))},vs=function(o,u,c){return unescape(eh(o,u,c))},bs=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Ts={APIC:function(o){var u=1,c,d,p="-->";o.data[0]===ia.Utf8&&(c=ta(o.data,0,u),!(c<0)&&(o.mimeType=vs(o.data,u,c),u=c+1,o.pictureType=
316o.data[u],u++,d=ta(o.data,0,u),!(d<0)&&(o.description=ys(o.data,u,d),u=d+1,o.mimeType===p?o.url=vs(o.data,u,o.data.length):o.pictureData=o.data.subarray(u,o.data.length))))},"T*":function(o){o.data[0]===ia.Utf8&&(o.value=ys(o.data,1,o.data.length).replace(/\0*$/,""),o.values=o.value.split("\0"))},TXXX:function(o){var u;o.data[0]===ia.Utf8&&(u=ta(o.data,0,1),u!==-1&&(o.description=ys(o.data,1,u),o.value=ys(o.data,u+1,o.data.length).replace(/\0*$/,""),o.data=o.value))},"W*":function(o){o.url=vs(o.data,0,o.data.length).replace(/\0.*$/,"")},WXXX:function(o){var u;o.data[0]===ia.Utf8&&(u=ta(o.data,0,1),u!==-1&&(o.description=ys(o.data,1,u),o.url=vs(o.data,u+1,o.data.length).replace(/\0.*$/,"")))},PRIV:function(o){var u;for(u=0;u<o.data.length;u++)if(o.data[u]===0){o.owner=vs(o.data,0,u);break}o.privateData=o.data.subarray(u+1),o.data=o.privateData}},By=function(o){var u,c,d=10,p=0,m=[];if(!(o.length<10||o[0]!==73||o[1]!==68||o[2]!==51)){p=bs(o.subarray(6,10)),p+=10;var v=o[5]&64;v&&(d+=4,d+=bs(o.subarray(10,14)),p-=bs(o.subarray(16,20)));do{if(u=bs(o.subarray(d+4,d+8)),u<1)break;c=String.fromCharCode(o[d],o[d+1],o[d+2],o[d+3]);var b={id:c,data:o.subarray(d+10,d+u+10)};b.key=b.id,Ts[b.id]?Ts[b.id](b):b.id[0]==="T"?Ts["T*"](b):b.id[0]==="W"&&Ts["W*"](b),m.push(b),d+=10,d+=u}while(d<p);return m}},th={parseId3Frames:By,parseSyncSafeInteger:bs,frameParsers:Ts},Fy=t,Uy=ea,vi=th,ra;ra=function(o){var u={descriptor:o&&o.descriptor},c=0,d=[],p=0,m;if(ra.prototype.init.call(this),this.dispatchType=Uy.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(m=0;m<u.descriptor.length;m++)this.dispatchType+=("00"+u.descriptor[m].toString(16)).slice(-2);this.push=function(v){var b,x,S,D,M,j;if(v.type==="timed-metadata"){if(v.dataAlignmentIndicator&&(p=0,d.length=0),d.length===0&&(v.data.length<10||v.data[0]!==73||v.data[1]!==68||v.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(d.push(v),p+=v.data.byteLength,d.length===1&&(c=vi.parseSyncSafeInteger(v.data.subarray(6,10)),c+=10),!(p<c)){for(b={data:new Uint8Array(c),frames:[],pts:d[0].pts,dts:d[0].dts},M=0;M<c;)b.data.set(d[0].data.subarray(0,c-M),M),M+=d[0].data.byteLength,p-=d[0].data.byteLength,d.shift();x=10,b.data[5]&64&&(x+=4,x+=vi.parseSyncSafeInteger(b.data.subarray(10,14)),c-=vi.parseSyncSafeInteger(b.data.subarray(16,20)));do{if(S=vi.parseSyncSafeInteger(b.data.subarray(x+4,x+8)),S<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(j=String.fromCharCode(b.data[x],b.data[x+1],b.data[x+2],b.data[x+3]),D={id:j,data:b.data.subarray(x+10,x+S+10)},D.key=D.id,vi.frameParsers[D.id]?vi.frameParsers[D.id](D):D.id[0]==="T"?vi.frameParsers["T*"](D):D.id[0]==="W"&&vi.frameParsers["W*"](D),D.owner==="com.apple.streaming.transportStreamTimestamp"){var B=D.data,W=(B[3]&1)<<30|B[4]<<22|B[5]<<14|B[6]<<6|B[7]>>>2;W*=4,W+=B[7]&3,D.timeStamp=W,b.pts===void 0&&b.dts===void 0&&(b.pts=D.timeStamp,b.dts=D.timeStamp),this.trigger("timestamp",D)}b.frames.push(D),x+=10,x+=S}while(x<c);this.trigger("data",b)}}}},ra.prototype=new Fy;var Vy=ra,Vl=t,ql=Qd,Lt=ea,qy=Zd.TimestampRolloverStream,sa,xs,na,gr=188,jl=71;sa=function(){var o=new Uint8Array(gr),u=0;sa.prototype.init.call(this),this.push=function(c){var d=0,p=gr,m;for(u?(m=new Uint8Array(c.byteLength+u),m.set(o.subarray(0,u)),m.set(c,u),u=0):m=c;p<m.byteLength;){if(m[d]===jl&&m[p]===jl){this.trigger("data",m.subarray(d,p)),d+=gr,p+=gr;continue}d++,p++}d<m.byteLength&&(o.set(m.subarray(d),0),u=m.byteLength-d)},this.flush=function(){u===gr&&o[0]===jl&&(this.trigger("data",o),u=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){u=0,this.trigger("reset")}},sa.prototype=new Vl,xs=function(){var o,u,c,d;xs.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,o=function(p,m){var v=0;m.payloadUnitStartIndicator&&(v+=p[v]+1),m.type==="pat"?u(p.subarray(v),m):c(p.subarray(v),m)},u=function(p,m){m.section_number=p[7],m.last_section_number=p[8],d.pmtPid=(p[10]&31)<<8|p[11],m.pmtPid=d.pmtPid},c=function(p,m){var v,b,x,S;if(p[5]&1){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},v=(p[1]&15)<<8|p[2],b=3+v-4,x=(p[10]&15)<<8|p[11],S=12+x;S<b;){var D=p[S],M=(p[S+1]&31)<<8|p[S+2];D===Lt.H264_STREAM_TYPE&&d.programMapTable.video===null?d.programMapTable.video=M:D===Lt.ADTS_STREAM_TYPE&&d.programMapTable.audio===null?d.programMapTable.audio=M:D===Lt.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][M]=D),S+=((p[S+3]&15)<<8|p[S+4])+5}m.programMapTable=d.programMapTable}},this.push=function(p){var m={},v=4;if(m.payloadUnitStartIndicator=!!(p[1]&64),m.pid=p[1]&31,m.pid<<=8,m.pid|=p[2],(p[3]&48)>>>4>1&&(v+=p[v]+1),m.pid===0)m.type="pat",o(p.subarray(v),m),this.trigger("data",m);else if(m.pid===this.pmtPid)for(m.type="pmt",o(p.subarray(v),m),this.trigger("data",m);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());
316else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,m]):this.processPes_(p,v,m)},this.processPes_=function(p,m,v){v.pid===this.programMapTable.video?v.streamType=Lt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=Lt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(m),this.trigger("data",v)}},xs.prototype=new Vl,xs.STREAM_TYPES={h264:27,adts:15},na=function(){var o=this,u=!1,c={data:[],size:0},d={data:[],size:0},p={data:[],size:0},m,v=function(x,S){var D;let M=x[0]<<16|x[1]<<8|x[2];S.data=new Uint8Array,M===1&&(S.packetLength=6+(x[4]<<8|x[5]),S.dataAlignmentIndicator=(x[6]&4)!==0,D=x[7],D&192&&(S.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,S.pts*=4,S.pts+=(x[13]&6)>>>1,S.dts=S.pts,D&64&&(S.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,S.dts*=4,S.dts+=(x[18]&6)>>>1)),S.data=x.subarray(9+x[8]))},b=function(x,S,D){var M=new Uint8Array(x.size),j={type:S},B=0,W=0,Y=!1,Me;if(!(!x.data.length||x.size<9)){for(j.trackId=x.data[0].pid,B=0;B<x.data.length;B++)Me=x.data[B],M.set(Me.data,W),W+=Me.data.byteLength;v(M,j),Y=S==="video"||j.packetLength<=x.size,(D||Y)&&(x.size=0,x.data.length=0),Y&&o.trigger("data",j)}};na.prototype.init.call(this),this.push=function(x){({pat:function(){},pes:function(){var S,D;switch(x.streamType){case Lt.H264_STREAM_TYPE:S=c,D="video";break;case Lt.ADTS_STREAM_TYPE:S=d,D="audio";break;case Lt.METADATA_STREAM_TYPE:S=p,D="timed-metadata";break;default:return}x.payloadUnitStartIndicator&&b(S,D,!0),S.data.push(x),S.size+=x.data.byteLength},pmt:function(){var S={type:"metadata",tracks:[]};m=x.programMapTable,m.video!==null&&S.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&S.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),u=!0,o.trigger("data",S)}})[x.type]()},this.reset=function(){c.size=0,c.data.length=0,d.size=0,d.data.length=0,this.trigger("reset")},this.flushStreams_=function(){b(c,"video"),b(d,"audio"),b(p,"timed-metadata")},this.flush=function(){if(!u&&m){var x={type:"metadata",tracks:[]};m.video!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.video,codec:"avc",type:"video"}),m.audio!==null&&x.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+m.audio,codec:"adts",type:"audio"}),o.trigger("data",x)}u=!1,this.flushStreams_(),this.trigger("done")}},na.prototype=new Vl;var ih={PAT_PID:0,MP2T_PACKET_LENGTH:gr,TransportPacketStream:sa,TransportParseStream:xs,ElementaryStream:na,TimestampRolloverStream:qy,CaptionStream:ql.CaptionStream,Cea608Stream:ql.Cea608Stream,Cea708Stream:ql.Cea708Stream,MetadataStream:Vy};for(var Hl in Lt)Lt.hasOwnProperty(Hl)&&(ih[Hl]=Lt[Hl]);var jy=ih,Hy=t,$y=Te.ONE_SECOND_IN_TS,aa,rh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];aa=function(o){var u,c=0;aa.prototype.init.call(this),this.skipWarn_=function(d,p){this.trigger("log",{level:"warn",message:`adts ski
316ping bytes ${d} to ${p} in frame ${c} outside syncword`})},this.push=function(d){var p=0,m,v,b,x,S;if(o||(c=0),d.type==="audio"){u&&u.length?(b=u,u=new Uint8Array(b.byteLength+d.data.byteLength),u.set(b),u.set(d.data,b.byteLength)):u=d.data;for(var D;p+7<u.length;){if(u[p]!==255||(u[p+1]&246)!==240){typeof D!="number"&&(D=p),p++;continue}if(typeof D=="number"&&(this.skipWarn_(D,p),D=null),v=(~u[p+1]&1)*2,m=(u[p+3]&3)<<11|u[p+4]<<3|(u[p+5]&224)>>5,x=((u[p+6]&3)+1)*1024,S=x*$y/rh[(u[p+2]&60)>>>2],u.byteLength-p<m)break;this.trigger("data",{pts:d.pts+c*S,dts:d.dts+c*S,sampleCount:x,audioobjecttype:(u[p+2]>>>6&3)+1,channelcount:(u[p+2]&1)<<2|(u[p+3]&192)>>>6,samplerate:rh[(u[p+2]&60)>>>2],samplingfrequencyindex:(u[p+2]&60)>>>2,samplesize:16,data:u.subarray(p+7+v,p+m)}),c++,p+=m}typeof D=="number"&&(this.skipWarn_(D,p),D=null),u=u.subarray(p)}},this.flush=function(){c=0,this.trigger("done")},this.reset=function(){u=void 0,this.trigger("reset")},this.endTimeline=function(){u=void 0,this.trigger("endedtimeline")}},aa.prototype=new Hy;var zy=aa,sh;sh=function(o){var u=o.byteLength,c=0,d=0;this.length=function(){return 8*u},this.bitsAvailable=function(){return 8*u+d},this.loadWord=function(){var p=o.byteLength-u,m=new Uint8Array(4),v=Math.min(4,u);if(v===0)throw new Error("no bytes available");m.set(o.subarray(p,p+v)),c=new DataView(m.buffer).getUint32(0),d=v*8,u-=v},this.skipBits=function(p){var m;d>p?(c<<=p,d-=p):(p-=d,m=Math.floor(p/8),p-=m*8,u-=m,this.loadWord(),c<<=p,d-=p)},this.readBits=function(p){var m=Math.min(d,p),v=c>>>32-m;return d-=m,d>0?c<<=m:u>0&&this.loadWord(),m=p-m,m>0?v<<m|this.readBits(m):v},this.skipLeadingZeros=function(){var p;for(p=0;p<d;++p)if((c&2147483648>>>p)!==0)return c<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Gy=sh,nh=t,Wy=Gy,oa,Ss,ah;Ss=function(){var o=0,u,c;Ss.prototype.init.call(this),this.push=function(d){var p;c?(p=new Uint8Array(c.byteLength+d.data.byteLength),p.set(c),p.set(d.data,c.byteLength),c=p):c=d.data;for(var m=c.byteLength;o<m-3;o++)if(c[o+2]===1){u=o+5;break}for(;u<m;)switch(c[u]){case 0:if(c[u-1]!==0){u+=2;break}else if(c[u-2]!==0){u++;break}o+3!==u-2&&this.trigger("data",c.subarray(o+3,u-2));do u++;while(c[u]!==1&&u<m);o=u-2,u+=3;break;case 1:if(c[u-1]!==0||c[u-2]!==0){u+=3;break}this.trigger("data",c.subarray(o+3,u-2)),o=u-2,u+=3;break;default:u+=3;break}c=c.subarray(o),u-=o,o=0},this.reset=function(){c=null,o=0,this.trigger("reset")},this.flush=function(){c&&c.byteLength>3&&this.trigger("data",c.subarray(o+3)),c=null,o=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ss.prototype=new nh,ah={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},oa=function(){var o=new Ss,u,c,d,p,m,v,b;oa.prototype.init.call(this),u=this,this.push=function(x){x.type==="video"&&(c=x.trackId,d=x.pts,p=x.dts,o.push(x))},o.on("data",function(x){var S={trackId:c,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(S.nalUnitTypeCode){case 5:S.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:S.nalUnitType="sei_rbsp",S.escapedRBSP=m(x.subarray(1));break;case 7:S.nalUnitType="seq_parameter_set_rbsp",S.escapedRBSP=m(x.subarray(1)),S.config=v(S.escapedRBSP);break;case 8:S.nalUnitType="pic_parameter_set_rbsp";break;case 9:S.nalUnitType="access_unit_delimiter_rbsp";break}u.trigger("data",S)}),o.on("done",function(){u.trigger("done")}),o.on("partialdone",function(){u.trigger("partialdone")}),o.on("reset",function(){u.trigger("reset")}),o.on("endedtimeline",function(){u.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},b=function(x,S){var D=8,M=8,j,B;for(j=0;j<x;j++)M!==0&&(B=S.readExpGolomb(),M=(D+B+256)%256),D=M===0?D:M},m=function(x){for(var S=x.byteLength,D=[],M=1,j,B;M<S-2;
316)x[M]===0&&x[M+1]===0&&x[M+2]===3?(D.push(M+2),M+=2):M++;if(D.length===0)return x;j=S-D.length,B=new Uint8Array(j);var W=0;for(M=0;M<j;W++,M++)W===D[0]&&(W++,D.shift()),B[M]=x[W];return B},v=function(x){var S=0,D=0,M=0,j=0,B,W,Y,Me,_t,xi,Ps,Os,Ls,Rs,va,xe=[1,1],Ms,Mt;if(B=new Wy(x),W=B.readUnsignedByte(),Me=B.readUnsignedByte(),Y=B.readUnsignedByte(),B.skipUnsignedExpGolomb(),ah[W]&&(_t=B.readUnsignedExpGolomb(),_t===3&&B.skipBits(1),B.skipUnsignedExpGolomb(),B.skipUnsignedExpGolomb(),B.skipBits(1),B.readBoolean()))for(va=_t!==3?8:12,Mt=0;Mt<va;Mt++)B.readBoolean()&&(Mt<6?b(16,B):b(64,B));if(B.skipUnsignedExpGolomb(),xi=B.readUnsignedExpGolomb(),xi===0)B.readUnsignedExpGolomb();else if(xi===1)for(B.skipBits(1),B.skipExpGolomb(),B.skipExpGolomb(),Ps=B.readUnsignedExpGolomb(),Mt=0;Mt<Ps;Mt++)B.skipExpGolomb();if(B.skipUnsignedExpGolomb(),B.skipBits(1),Os=B.readUnsignedExpGolomb(),Ls=B.readUnsignedExpGolomb(),Rs=B.readBits(1),Rs===0&&B.skipBits(1),B.skipBits(1),B.readBoolean()&&(S=B.readUnsignedExpGolomb(),D=B.readUnsignedExpGolomb(),M=B.readUnsignedExpGolomb(),j=B.readUnsignedExpGolomb()),B.readBoolean()&&B.readBoolean()){switch(Ms=B.readUnsignedByte(),Ms){case 1:xe=[1,1];break;case 2:xe=[12,11];break;case 3:xe=[10,11];break;case 4:xe=[16,11];break;case 5:xe=[40,33];break;case 6:xe=[24,11];break;case 7:xe=[20,11];break;case 8:xe=[32,11];break;case 9:xe=[80,33];break;case 10:xe=[18,11];break;case 11:xe=[15,11];break;case 12:xe=[64,33];break;case 13:xe=[160,99];break;case 14:xe=[4,3];break;case 15:xe=[3,2];break;case 16:xe=[2,1];break;case 255:{xe=[B.readUnsignedByte()<<8|B.readUnsignedByte(),B.readUnsignedByte()<<8|B.readUnsignedByte()];break}}xe&&xe[0]/xe[1]}return{profileIdc:W,levelIdc:Y,profileCompatibility:Me,width:(Os+1)*16-S*2-D*2,height:(2-Rs)*(Ls+1)*16-M*2-j*2,sarRatio:xe}}},oa.prototype=new nh;var Xy={H264Stream:oa,NalByteStream:Ss},Ky=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],oh=function(o,u){var c=o[u+6]<<21|o[u+7]<<14|o[u+8]<<7|o[u+9],d=o[u+5],p=(d&16)>>4;return c=c>=0?c:0,p?c+20:c+10},lh=function(o,u){return o.length-u<10||o[u]!==73||o[u+1]!==68||o[u+2]!==51?u:(u+=oh(o,u),lh(o,u))},Yy=function(o){var u=lh(o,0);return o.length>=u+2&&(o[u]&255)===255&&(o[u+1]&240)===240&&(o[u+1]&22)===16},uh=function(o){return o[0]<<21|o[1]<<14|o[2]<<7|o[3]},Qy=function(o,u,c){var d,p="";for(d=u;d<c;d++)p+="%"+("00"+o[d].toString(16)).slice(-2);return p},Jy=function(o,u,c){return unescape(Qy(o,u,c))},Zy=function(o,u){var c=(o[u+5]&224)>>5,d=o[u+4]<<3,p=o[u+3]&6144;return p|d|c},ev=function(o,u){return o[u]===73&&o[u+1]===68&&o[u+2]===51?"timed-metadata":o[u]&!0&&(o[u+1]&240)===240?"audio":null},tv=function(o){for(var u=0;u+5<o.length;){if(o[u]!==255||(o[u+1]&246)!==240){u++;continue}return Ky[(o[u+2]&60)>>>2]}return null},iv=function(o){var u,c,d,p;u=10,o[5]&64&&(u+=4,u+=uh(o.subarray(10,14)));do{if(c=uh(o.subarray(u+4,u+8)),c<1)return null;if(p=String.fromCharCode(o[u],o[u+1],o[u+2],o[u+3]),p==="PRIV"){d=o.subarray(u+10,u+c+10);for(var m=0;m<d.byteLength;m++)if(d[m]===0){var v=Jy(d,0,m);if(v==="com.apple.streaming.transportStreamTimestamp"){var b=d.subarray(m+1),x=(b[3]&1)<<30|b[4]<<22|b[5]<<14|b[6]<<6|b[7]>>>2;return x*=4,x+=b[7]&3,x}break}}u+=10,u+=c}while(u<o.byteLength);return null},$l={isLikelyAacData:Yy,parseId3TagSize:oh,parseAdtsSize:Zy,parseType:ev,parseSampleRate:tv,parseAacTimestamp:iv},rv=t,ch=$l,la;la=function(){var o=new Uint8Array,u=0;la.prototype.init.call(this),this.setTimestamp=function(c){u=c},this.push=function(c){var d=0,p=0,m,v,b,x;for(o.length?(x=o.length,o=new Uint8Array(c.byteLength+x),o.set(o.subarray(0,x)),o.set(c,x)):o=c;o.length-p>=3;){if(o[p]===73&&o[p+1]===68&&o[p+2]===51){if(o.length-p<10||(d=ch.parseId3TagSize(o,p),p+d>o.length))break;v={type:"timed-metadata",data:o.subarray(p,p+d)},this.trigger("data",v),p+=d;continue}else if((o[p]&255)===255&&(o[p+1]&240)===240){if(o.length-p<7||(d=ch.parseAdtsSize(o,p),p+d>o.length))break;b={type:"audio",data:o.subarray(p,p+d),pts:u,dts:u},this.trigger("data",b),p+=d;continue}p++}m=o.length-p,m>0?o=o.subarray(p):o=new Uint8Array},this.reset=function(){o=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){o=new Uint8Array,this.trigger("endedtimeline")}},la.prototype=new rv;var sv=la,nv=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],av=nv,ov=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],lv=ov,ua=t,Es=Z_,Cs=ly,ca=_y,Rt=xy,ai=jy,da=Te,dh=zy,uv=Xy.H264Stream,cv=sv,dv=$l.isLikelyAacData,hv=Te.ONE_SECOND_IN_TS,zl=av,Gl=lv,ws,_r,ha,Yi,fv=function(o,u){u.stream=o,this.trigger("log",u)},hh=function(o,u){for(var c=Object.keys(u),d=0;d<c.length;d++){var p=c[d];p==="headOfPipeline"||!u[p].on||u[p].on("log",fv.bind(o,p))}},fh=function(o,u){var c;if(o.length!==u.length)return!1;for(c=0;c<o.length;c++)if(o[c]!==u[c])return!1;return!0},Wl=function(o,u,c,d,p,m){var v=c-u,b=d-u,x=p-c;return{start:{dts:o,pts:o+v},end:{dts:o+b,pts:o+x},prependedContentDuration:m,baseMediaDecodeTime:o}};_r=function(o,u){var c=[],d,p=0,m=0,v=1/0;u=u||{},d=u.firstSequenceNumber||0,_r.prototype.init.call(this),this.push=function(b){Rt.collectDtsInfo(o,b),o&&zl.forEach(function(x){o[x]=b[x]}),c.push(b)},this.setEarliestDts=function(b){p=b},this.setVideoBaseMediaDecodeTime=function(b){v=b},this.setAudioAppendStart=function(b){m=b},this.flush=function(){var b,x,S,D,M,j,B;if(c.length===0){this.trigger("done","AudioSegmentStream");return}b=ca.trimAdtsFramesByEarliestDts(c,o,p),o.baseMediaDecodeTime=Rt.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),B=ca.prefixWithSilence(o,b,m,v),o.samples=ca.generateSampleTable(b),S=Es.mdat(ca.concatenateFrameData(b)),c=[],x=Es.moof(
316d,[o]),D=new Uint8Array(x.byteLength+S.byteLength),d++,D.set(x),D.set(S,x.byteLength),Rt.clearDtsInfo(o),M=Math.ceil(hv*1024/o.samplerate),b.length&&(j=b.length*M,this.trigger("segmentTimingInfo",Wl(da.audioTsToVideoTs(o.baseMediaDecodeTime,o.samplerate),b[0].dts,b[0].pts,b[0].dts+j,b[0].pts+j,B||0)),this.trigger("timingInfo",{start:b[0].pts,end:b[0].pts+j})),this.trigger("data",{track:o,boxes:D}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Rt.clearDtsInfo(o),c=[],this.trigger("reset")}},_r.prototype=new ua,ws=function(o,u){var c,d=[],p=[],m,v;u=u||{},c=u.firstSequenceNumber||0,ws.prototype.init.call(this),delete o.minPTS,this.gopCache_=[],this.push=function(b){Rt.collectDtsInfo(o,b),b.nalUnitType==="seq_parameter_set_rbsp"&&!m&&(m=b.config,o.sps=[b.data],Gl.forEach(function(x){o[x]=m[x]},this)),b.nalUnitType==="pic_parameter_set_rbsp"&&!v&&(v=b.data,o.pps=[b.data]),d.push(b)},this.flush=function(){for(var b,x,S,D,M,j,B=0,W,Y;d.length&&d[0].nalUnitType!=="access_unit_delimiter_rbsp";)d.shift();if(d.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(b=Cs.groupNalsIntoFrames(d),S=Cs.groupFramesIntoGops(b),S[0][0].keyFrame||(x=this.getGopForFusion_(d[0],o),x?(B=x.duration,S.unshift(x),S.byteLength+=x.byteLength,S.nalCount+=x.nalCount,S.pts=x.pts,S.dts=x.dts,S.duration+=x.duration):S=Cs.extendFirstKeyFrame(S)),p.length){var Me;if(u.alignGopsAtEnd?Me=this.alignGopsAtEnd_(S):Me=this.alignGopsAtStart_(S),!Me){this.gopCache_.unshift({gop:S.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Rt.clearDtsInfo(o),S=Me}Rt.collectDtsInfo(o,S),o.samples=Cs.generateSampleTable(S),M=Es.mdat(Cs.concatenateNalData(S)),o.baseMediaDecodeTime=Rt.calculateTrackBaseMediaDecodeTime(o,u.keepOriginalTimestamps),this.trigger("processedGopsInfo",S.map(function(_t){return{pts:_t.pts,dts:_t.dts,byteLength:_t.byteLength}})),W=S[0],Y=S[S.length-1],this.trigger("segmentTimingInfo",Wl(o.baseMediaDecodeTime,W.dts,W.pts,Y.dts+Y.duration,Y.pts+Y.duration,B)),this.trigger("timingInfo",{start:S[0].pts,end:S[S.length-1].pts+S[S.length-1].duration}),this.gopCache_.unshift({gop:S.pop(),pps:o.pps,sps:o.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),d=[],this.trigger("baseMediaDecodeTime",o.baseMediaDecodeTime),this.trigger("timelineStartInfo",o.timelineStartInfo),D=Es.moof(c,[o]),j=new Uint8Array(D.byteLength+M.byteLength),c++,j.set(D),j.set(M,D.byteLength),this.trigger("data",{track:o,boxes:j}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),d=[],this.gopCache_.length=0,p.length=0,this.trigger("reset")},this.resetStream_=function(){Rt.clearDtsInfo(o),m=void 0,v=void 0},this.getGopForFusion_=function(b){var x=45e3,S=1e4,D=1/0,M,j,B,W,Y;for(Y=0;Y<this.gopCache_.length;Y++)W=this.gopCache_[Y],B=W.gop,!(!(o.pps&&fh(o.pps[0],W.pps[0]))||!(o.sps&&fh(o.sps[0],W.sps[0])))&&(B.dts<o.timelineStartInfo.dts||(M=b.dts-B.dts-B.duration,M>=-S&&M<=x&&(!j||D>M)&&(j=W,D=M)));return j?j.gop:null},this.alignGopsAtStart_=function(b){var x,S,D,M,j,B,W,Y;for(j=b.byteLength,B=b.nalCount,W=b.duration,x=S=0;x<p.length&&S<b.length&&(D=p[x],M=b[S],D.pts!==M.pts);){if(M.pts>D.pts){x++;continue}S++,j-=M.byteLength,B-=M.nalCount,W-=M.duration}return S===0?b:S===b.length?null:(Y=b.slice(S),Y.byteLength=j,Y.duration=W,Y.nalCount=B,Y.pts=Y[0].pts,Y.dts=Y[0].dts,Y)},this.alignGopsAtEnd_=function(b){var x,S,D,M,j,B;for(x=p.length-1,S=b.length-1,j=null,B=!1;x>=0&&S>=0;){if(D=p[x],M=b[S],D.pts===M.pts){B=!0;break}if(D.pts>M.pts){x--;continue}x===p.length-1&&(j=S),S--}if(!B&&j===null)return null;var W;if(B?W=S:W=j,W===0)return b;var Y=b.slice(W),Me=Y.reduce(function(_t,xi){return _t.byteLength+=xi.byteLength,_t.duration+=xi.duration,_t.nalCount+=xi.nalCount,_t},{byteLength:0,duration:0,nalCount:0});return Y.byteLength=Me.byteLength,Y.duration=Me.duration,Y.nalCount=Me.nalCount,Y.pts=Y[0].pts,Y.dts=Y[0].dts,Y},this.alignGopsWith=function(b){p=b}},ws.prototype=new ua,Yi=function(o,u){this.numberOfTracks=0,this.metadataStream=u,o=o||{},typeof o.remux<"u"?this.remuxTracks=!!o.remux:this.remuxTracks=!0,typeof o.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=o.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Yi.prototype.init.call(this),this.push=function(c){if(c.content||c.text)return this.pendingCaptions.push(c);if(c.frames)return this.pendingMetadata.push(c);this.pendingTracks.push(c.track),this.pendingBytes+=c.boxes.byteLength,c.track.type==="video"&&(this.videoTrack=c.track,this.pendingBoxes.push(c.boxes)),c.track.type==="audio"&&(this.audioTrack=c.track,this.pendingBoxes.unshift(c.boxes))}},Yi.prototype=new ua,Yi.prototype.flush=function(o){var u=0,c={captions:[],captionStream
316s:{},metadata:[],info:{}},d,p,m,v=0,b;if(this.pendingTracks.length<this.numberOfTracks){if(o!=="VideoSegmentStream"&&o!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,Gl.forEach(function(x){c.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,zl.forEach(function(x){c.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?c.type=this.pendingTracks[0].type:c.type="combined",this.emittedTracks+=this.pendingTracks.length,m=Es.initSegment(this.pendingTracks),c.initSegment=new Uint8Array(m.byteLength),c.initSegment.set(m),c.data=new Uint8Array(this.pendingBytes),b=0;b<this.pendingBoxes.length;b++)c.data.set(this.pendingBoxes[b],u),u+=this.pendingBoxes[b].byteLength;for(b=0;b<this.pendingCaptions.length;b++)d=this.pendingCaptions[b],d.startTime=da.metadataTsToSeconds(d.startPts,v,this.keepOriginalTimestamps),d.endTime=da.metadataTsToSeconds(d.endPts,v,this.keepOriginalTimestamps),c.captionStreams[d.stream]=!0,c.captions.push(d);for(b=0;b<this.pendingMetadata.length;b++)p=this.pendingMetadata[b],p.cueTime=da.metadataTsToSeconds(p.pts,v,this.keepOriginalTimestamps),c.metadata.push(p);for(c.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",c),b=0;b<c.captions.length;b++)d=c.captions[b],this.trigger("caption",d);for(b=0;b<c.metadata.length;b++)p=c.metadata[b],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Yi.prototype.setRemux=function(o){this.remuxTracks=o},ha=function(o){var u=this,c=!0,d,p;ha.prototype.init.call(this),o=o||{},this.baseMediaDecodeTime=o.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="aac",m.metadataStream=new ai.MetadataStream,m.aacStream=new cv,m.audioTimestampRolloverStream=new ai.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new ai.TimestampRolloverStream("timed-metadata"),m.adtsStream=new dh,m.coalesceStream=new Yi(o,m.metadataStream),m.headOfPipeline=m.aacStream,m.aacStream.pipe(m.audioTimestampRolloverStream).pipe(m.adtsStream),m.aacStream.pipe(m.timedMetadataTimestampRolloverStream).pipe(m.metadataStream).pipe(m.coalesceStream),m.metadataStream.on("timestamp",function(v){m.aacStream.setTimestamp(v.timeStamp)}),m.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||m.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:u.baseMediaDecodeTime},codec:"adts",type:"audio"},m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new _r(p,o),m.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),hh(this,m)},this.setupTsPipeline=function(){var m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new ai.MetadataStream,m.packetStream=new ai.TransportPacketStream,m.parseStream=new ai.TransportParseStream,m.elementaryStream=new ai.ElementaryStream,m.timestampRolloverStream=new ai.TimestampRolloverStream,m.adtsStream=new dh,m.h264Stream=new uv,m.captionStream=new ai.CaptionStream(o),m.coalesceStream=new Yi(o,m.metadataStream),m.headOfPipeline=m.packetStream,m.packetStream.pipe(m.parseStream).pipe(m.elementaryStream).pipe(m.timestampRolloverStream),m.timestampRolloverStream.pipe(m.h264Stream),m.timestampRolloverStream.pipe(m.adtsStream),m.timestampRolloverStream.pipe(m.metadataStream).pipe(m.coalesceStream),m.h264Stream.pipe(m.captionStream).pipe(m.coalesceStream),m.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!d&&v.tracks[b].type==="video"?(d=v.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=u.baseMediaDecodeTime);d&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new ws(d,o),m.videoSegmentStream.on("log",u.getLogTrigger_("videoSegmentStream")),m.videoSegmentStream.on("timelineStartInfo",function(x){p&&!o.keepOriginalTimestamps&&(p.timelineStartInfo=x,m.audioSegmentStream.setEarliestDts(x.dts-u.baseMediaDecodeTime))}),m.videoSegmentStream.on("processedGopsInfo",u.trigger.bind(u,"gopInfo")),m.videoSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"videoSegmentTimingInfo")),m.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),m.videoSegmentStream.on("timingInfo",u.trigger.bind(u,"videoTimingInfo")),m.h264Stream.pipe(m.videoSegmentStream).pipe(m.coalesceStream)),p&&!m.audioSegmentStream&&(m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new _r(p,o),m.audioSegmentStream.on("log",u.getLogTrigger_("audioSegmentStream")),m.audioSegmentStream.on("timingInfo",u.trigger.bind(u,"audioTimingInfo")),m.audioSegmentStream.on("segmentTimingInfo",u.trigger.bind(u,"audioSegmentTimingInfo")),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream)),u.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("id3Frame",function(v){v.dispatchType=m.metadataStream.dispatchType,u.trigger("id3Frame",v)}),m.coalesceStream.on("caption",this.trigger.bind(this,"caption")),m.coalesceStream.on("done",this.trigger.bind(this,"done")),hh(this,m)},this.setBaseMediaDecodeTime=function(m){var v=this.transmuxPipeline_;o.keepOriginalTimestamps||(this.baseMediaDecodeTime=m),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,Rt.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),d&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,Rt.clearDtsInfo(d),v.captionStream.reset()),v.timestampRolloverStream&&v.t
316imestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(m){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(m)},this.setRemux=function(m){var v=this.transmuxPipeline_;o.remux=m,v&&v.coalesceStream&&v.coalesceStream.setRemux(m)},this.alignGopsWith=function(m){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(m)},this.getLogTrigger_=function(m){var v=this;return function(b){b.stream=m,v.trigger("log",b)}},this.push=function(m){if(c){var v=dv(m);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),c=!1}this.transmuxPipeline_.headOfPipeline.push(m)},this.flush=function(){c=!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()}},ha.prototype=new ua;var pv={Transmuxer:ha,VideoSegmentStream:ws,AudioSegmentStream:_r,AUDIO_PROPERTIES:zl,VIDEO_PROPERTIES:Gl,generateSegmentTimingInfo:Wl},mv=function(o){return o>>>0},gv=function(o){return("00"+o.toString(16)).slice(-2)},fa={toUnsigned:mv,toHexString:gv},_v=function(o){var u="";return u+=String.fromCharCode(o[0]),u+=String.fromCharCode(o[1]),u+=String.fromCharCode(o[2]),u+=String.fromCharCode(o[3]),u},Xl=_v,yv=fa.toUnsigned,vv=Xl,ph=function(o,u){var c=[],d,p,m,v,b;if(!u.length)return null;for(d=0;d<o.byteLength;)p=yv(o[d]<<24|o[d+1]<<16|o[d+2]<<8|o[d+3]),m=vv(o.subarray(d+4,d+8)),v=p>1?d+p:o.byteLength,m===u[0]&&(u.length===1?c.push(o.subarray(d+8,v)):(b=ph(o.subarray(d+8,v),u.slice(1)),b.length&&(c=c.concat(b)))),d=v;return c},pa=ph,bv=fa.toUnsigned,Tv=n.getUint64,xv=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4))};return u.version===1?u.baseMediaDecodeTime=Tv(o.subarray(4)):u.baseMediaDecodeTime=bv(o[4]<<24|o[5]<<16|o[6]<<8|o[7]),u},Kl=xv,Sv=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:u.getUint32(4)},d=c.flags[2]&1,p=c.flags[2]&2,m=c.flags[2]&8,v=c.flags[2]&16,b=c.flags[2]&32,x=c.flags[0]&65536,S=c.flags[0]&131072,D;return D=8,d&&(D+=4,c.baseDataOffset=u.getUint32(12),D+=4),p&&(c.sampleDescriptionIndex=u.getUint32(D),D+=4),m&&(c.defaultSampleDuration=u.getUint32(D),D+=4),v&&(c.defaultSampleSize=u.getUint32(D),D+=4),b&&(c.defaultSampleFlags=u.getUint32(D)),x&&(c.durationIsEmpty=!0),!d&&S&&(c.baseDataOffsetIsMoof=!0),c},Yl=Sv,mh=n.getUint64,Ev=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),references:[],referenceId:u.getUint32(4),timescale:u.getUint32(8)},d=12;c.version===0?(c.earliestPresentationTime=u.getUint32(d),c.firstOffset=u.getUint32(d+4),d+=8):(c.earliestPresentationTime=mh(o.subarray(d)),c.firstOffset=mh(o.subarray(d+8)),d+=16),d+=2;var p=u.getUint16(d);for(d+=2;p>0;d+=12,p--)c.references.push({referenceType:(o[d]&128)>>>7,referencedSize:u.getUint32(d)&2147483647,subsegmentDuration:u.getUint32(d+4),startsWithSap:!!(o[d+8]&128),sapType:(o[d+8]&112)>>>4,sapDeltaTime:u.getUint32(d+8)&268435455});return c},Cv=Ev,wv=function(o){return{isLeading:(o[0]&12)>>>2,dependsOn:o[0]&3,isDependedOn:(o[1]&192)>>>6,hasRedundancy:(o[1]&48)>>>4,paddingValue:(o[1]&14)>>>1,isNonSyncSample:o[1]&1,degradationPriority:o[2]<<8|o[3]}},Av=wv,gh=Av,Dv=function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},c=new DataView(o.buffer,o.byteOffset,o.byteLength),d=u.flags[2]&1,p=u.flags[2]&4,m=u.flags[1]&1,v=u.flags[1]&2,b=u.flags[1]&4,x=u.flags[1]&8,S=c.getUint32(4),D=8,M;for(d&&(u.dataOffset=c.getInt32(D),D+=4),p&&S&&(M={flags:gh(o.subarray(D,D+4))},D+=4,m&&(M.duration=c.getUint32(D),D+=4),v&&(M.size=c.getUint32(D),D+=4),x&&(u.version===1?M.compositionTimeOffset=c.getInt32(D):M.compositionTimeOffset=c.getUint32(D),D+=4),u.samples.push(M),S--);S--;)M={},m&&(M.duration=c.getUint32(D),D+=4),v&&(M.size=c.getUint32(D),D+=4),b&&(M.flags=gh(o.subarray(D,D+4)),D+=4),x&&(u.version===1?M.compositionTimeOffset=c.getInt32(D):M.compositionTimeOffset=c.getUint32(D),D+=4),u.samples.push(M);return u},_h=Dv,Iv=n,yh=Iv.getUint64,He,Ql,Et=function(o){return new Date(o*1e3-20828448e5)},As=Xl,kv=pa,Pv=function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c=[],d,p;for(d=0;d+4<o.length;d+=p){if(p=u.getUint32(d),d+=4,p<=0){c.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(o[d]&31){case 1:c.push("slice_layer_without_partitioning_rbsp");break;case 5:c.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:c.push("sei_rbsp");break;case 7:c.push("seq_parameter_set_rbsp");break;case 8:c.push("pic_parameter_set_rbsp");break;case 9:c.push("access_unit_delimiter_rbsp");break;default:c.push("UNKNOWN NAL - "+o[d]&31);break}}return c},bi={avc1:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength);return{dataReferenceIndex:u.getUint16(6),width:u.getUint16(24),height:u.getUint16(26),horizresolution:u.getUint16(28)+u.getUint16(30)/16,vertresolution:u.getUint16(32)+u.getUint16(34)/16,frameCount:u.getUint16(40),depth:u.getUint16(74),config:He(o.subarray(78,o.byteLength))}},avcC:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={configurationVersion:o[0],avcProfileIndication:o[1],profileCompatibility:o[2],avcLevelIndication:o[3],lengthSizeMinusOne:o[4]&3,sps:[],pps:[]},d=o[5]&31,p,m,v,b;for(v=6,b=0;b<d;b++)m=u.getUint16(v),v+=2,c.sps.push(new Uint8Array(o.subarray(v,v+m))),v+=m;for(p=o[v],v++,b=0;b<p;b++)m=u.getUint16(v),v+=2,c.pps.push(new Uint8Array(o.subarray(v,v+m))),v+=m;return c},btrt:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength);return{bufferSizeDB:u.getUint32(0),maxBitrate:u.getUint32(4),avgBitrate:u.getUint32(8)}},edts:function(u){return{boxes:He(u)}},elst:function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),d={version:c.getUint8(0),flags:new Uint8Array(u.subarray(1,4)),edits:[]},p=c.getUint32(4),m;
316for(m=8;p;p--)d.version===0?(d.edits.push({segmentDuration:c.getUint32(m),mediaTime:c.getInt32(m+4),mediaRate:c.getUint16(m+8)+c.getUint16(m+10)/(256*256)}),m+=12):(d.edits.push({segmentDuration:yh(u.subarray(m)),mediaTime:yh(u.subarray(m+8)),mediaRate:c.getUint16(m+16)+c.getUint16(m+18)/(256*256)}),m+=20);return d},esds:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),esId:o[6]<<8|o[7],streamPriority:o[8]&31,decoderConfig:{objectProfileIndication:o[11],streamType:o[12]>>>2&63,bufferSize:o[13]<<16|o[14]<<8|o[15],maxBitrate:o[16]<<24|o[17]<<16|o[18]<<8|o[19],avgBitrate:o[20]<<24|o[21]<<16|o[22]<<8|o[23],decoderConfigDescriptor:{tag:o[24],length:o[25],audioObjectType:o[26]>>>3&31,samplingFrequencyIndex:(o[26]&7)<<1|o[27]>>>7&1,channelConfiguration:o[27]>>>3&15}}}},ftyp:function(o){for(var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={majorBrand:As(o.subarray(0,4)),minorVersion:u.getUint32(4),compatibleBrands:[]},d=8;d<o.byteLength;)c.compatibleBrands.push(As(o.subarray(d,d+4))),d+=4;return c},dinf:function(o){return{boxes:He(o)}},dref:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),dataReferences:He(o.subarray(8))}},hdlr:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),handlerType:As(o.subarray(8,12)),name:""},d=8;for(d=24;d<o.byteLength;d++){if(o[d]===0){d++;break}c.name+=String.fromCharCode(o[d])}return c.name=decodeURIComponent(escape(c.name)),c},mdat:function(o){return{byteLength:o.byteLength,nals:Pv(o)}},mdhd:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d,p={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),language:""};return p.version===1?(c+=4,p.creationTime=Et(u.getUint32(c)),c+=8,p.modificationTime=Et(u.getUint32(c)),c+=4,p.timescale=u.getUint32(c),c+=8,p.duration=u.getUint32(c)):(p.creationTime=Et(u.getUint32(c)),c+=4,p.modificationTime=Et(u.getUint32(c)),c+=4,p.timescale=u.getUint32(c),c+=4,p.duration=u.getUint32(c)),c+=4,d=u.getUint16(c),p.language+=String.fromCharCode((d>>10)+96),p.language+=String.fromCharCode(((d&992)>>5)+96),p.language+=String.fromCharCode((d&31)+96),p},mdia:function(o){return{boxes:He(o)}},mfhd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),sequenceNumber:o[4]<<24|o[5]<<16|o[6]<<8|o[7]}},minf:function(o){return{boxes:He(o)}},mp4a:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={dataReferenceIndex:u.getUint16(6),channelcount:u.getUint16(16),samplesize:u.getUint16(18),samplerate:u.getUint16(24)+u.getUint16(26)/65536};return o.byteLength>28&&(c.streamDescriptor=He(o.subarray(28))[0]),c},moof:function(o){return{boxes:He(o)}},moov:function(o){return{boxes:He(o)}},mvex:function(o){return{boxes:He(o)}},mvhd:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4))};return d.version===1?(c+=4,d.creationTime=Et(u.getUint32(c)),c+=8,d.modificationTime=Et(u.getUint32(c)),c+=4,d.timescale=u.getUint32(c),c+=8,d.duration=u.getUint32(c)):(d.creationTime=Et(u.getUint32(c)),c+=4,d.modificationTime=Et(u.getUint32(c)),c+=4,d.timescale=u.getUint32(c),c+=4,d.duration=u.getUint32(c)),c+=4,d.rate=u.getUint16(c)+u.getUint16(c+2)/16,c+=4,d.volume=u.getUint8(c)+u.getUint8(c+1)/8,c+=2,c+=2,c+=2*4,d.matrix=new Uint32Array(o.subarray(c,c+9*4)),c+=9*4,c+=6*4,d.nextTrackId=u.getUint32(c),d},pdin:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),rate:u.getUint32(4),initialDelay:u.getUint32(8)}},sdtp:function(o){var u={version:o[0],flags:new Uint8Array(o.subarray(1,4)),samples:[]},c;for(c=4;c<o.byteLength;c++)u.samples.push({dependsOn:(o[c]&48)>>4,isDependedOn:(o[c]&12)>>2,hasRedundancy:o[c]&3});return u},sidx:Cv,smhd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),balance:o[4]+o[5]/256}},stbl:function(o){return{boxes:He(o)}},ctts:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),compositionOffsets:[]},d=u.getUint32(4),p;for(p=8;d;
316p+=8,d--)c.compositionOffsets.push({sampleCount:u.getUint32(p),sampleOffset:u[c.version===0?"getUint32":"getInt32"](p+4)});return c},stss:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4)),syncSamples:[]},d=u.getUint32(4),p;for(p=8;d;p+=4,d--)c.syncSamples.push(u.getUint32(p));return c},stco:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),chunkOffsets:[]},d=u.getUint32(4),p;for(p=8;d;p+=4,d--)c.chunkOffsets.push(u.getUint32(p));return c},stsc:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c=u.getUint32(4),d={version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleToChunks:[]},p;for(p=8;c;p+=12,c--)d.sampleToChunks.push({firstChunk:u.getUint32(p),samplesPerChunk:u.getUint32(p+4),sampleDescriptionIndex:u.getUint32(p+8)});return d},stsd:function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleDescriptions:He(o.subarray(8))}},stsz:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),sampleSize:u.getUint32(4),entries:[]},d;for(d=12;d<o.byteLength;d+=4)c.entries.push(u.getUint32(d));return c},stts:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c={version:o[0],flags:new Uint8Array(o.subarray(1,4)),timeToSamples:[]},d=u.getUint32(4),p;for(p=8;d;p+=8,d--)c.timeToSamples.push({sampleCount:u.getUint32(p),sampleDelta:u.getUint32(p+4)});return c},styp:function(o){return bi.ftyp(o)},tfdt:Kl,tfhd:Yl,tkhd:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength),c=4,d={version:u.getUint8(0),flags:new Uint8Array(o.subarray(1,4))};return d.version===1?(c+=4,d.creationTime=Et(u.getUint32(c)),c+=8,d.modificationTime=Et(u.getUint32(c)),c+=4,d.trackId=u.getUint32(c),c+=4,c+=8,d.duration=u.getUint32(c)):(d.creationTime=Et(u.getUint32(c)),c+=4,d.modificationTime=Et(u.getUint32(c)),c+=4,d.trackId=u.getUint32(c),c+=4,c+=4,d.duration=u.getUint32(c)),c+=4,c+=2*4,d.layer=u.getUint16(c),c+=2,d.alternateGroup=u.getUint16(c),c+=2,d.volume=u.getUint8(c)+u.getUint8(c+1)/8,c+=2,c+=2,d.matrix=new Uint32Array(o.subarray(c,c+9*4)),c+=9*4,d.width=u.getUint16(c)+u.getUint16(c+2)/65536,c+=4,d.height=u.getUint16(c)+u.getUint16(c+2)/65536,d},traf:function(o){return{boxes:He(o)}},trak:function(o){return{boxes:He(o)}},trex:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),trackId:u.getUint32(4),defaultSampleDescriptionIndex:u.getUint32(8),defaultSampleDuration:u.getUint32(12),defaultSampleSize:u.getUint32(16),sampleDependsOn:o[20]&3,sampleIsDependedOn:(o[21]&192)>>6,sampleHasRedundancy:(o[21]&48)>>4,samplePaddingValue:(o[21]&14)>>1,sampleIsDifferenceSample:!!(o[21]&1),sampleDegradationPriority:u.getUint16(22)}},trun:_h,"url ":function(o){return{version:o[0],flags:new Uint8Array(o.subarray(1,4))}},vmhd:function(o){var u=new DataView(o.buffer,o.byteOffset,o.byteLength);return{version:o[0],flags:new Uint8Array(o.subarray(1,4)),graphicsmode:u.getUint16(4),opcolor:new Uint16Array([u.getUint16(6),u.getUint16(8),u.getUint16(10)])}}};He=function(o){for(var u=0,c=[],d,p,m,v,b,x=new ArrayBuffer(o.length),S=new Uint8Array(x),D=0;D<o.length;++D)S[D]=o[D];for(d=new DataView(x);u<o.byteLength;)p=d.getUint32(u),m=As(o.subarray(u+4,u+8)),v=p>1?u+p:o.byteLength,b=(bi[m]||function(M){return{data:M}})(o.subarray(u+8,v)),b.size=p,b.type=m,c.push(b),u=v;return c},Ql=function(o,u){var c;return u=u||0,c=new Array(u*2+1).join(" "),o.map(function(d,p){return c+d.type+` 317`+Object.keys(d).filter(function(m){return m!=="type"&&m!=="boxes"}
317).map(function(m){var v=c+" "+m+": ",b=d[m];if(b instanceof Uint8Array||b instanceof Uint32Array){var x=Array.prototype.slice.call(new Uint8Array(b.buffer,b.byteOffset,b.byteLength)).map(function(S){return" "+("00"+S.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return x?x.length===1?v+"<"+x.join("").slice(1)+">":v+`< 318`+x.map(function(S){return c+" "+S}).join(` 319`)+` 320`+c+" >":v+"<>"}return v+JSON.stringify(b,null,2).split(` 321`).map(function(S,D){return D===0?S:c+" "+S}).join(` 322`)}).join(` 323`)+(d.boxes?` 324`+Ql(d.boxes,u+1):"")}).join(` 325`)};var vh={inspect:He,textify:Ql,parseType:As,findBox:kv,parseTraf:bi.traf,parseTfdt:bi.tfdt,parseHdlr:bi.hdlr,parseTfhd:bi.tfhd,parseTrun:bi.trun,parseSidx:bi.sidx},Ov=function(o){for(var u=0,c=String.fromCharCode(o[u]),d="";c!=="\0";)d+=c,u++,c=String.fromCharCode(o[u]);return d+=c,d},Lv={uint8ToCString:Ov},ma=Lv.uint8ToCString,Rv=n.getUint64,Mv=function(o){var u=4,c=o[0],d,p,m,v,b,x,S,D;if(c===0){d=ma(o.subarray(u)),u+=d.length,p=ma(o.subarray(u)),u+=p.length;var M=new DataView(o.buffer);m=M.getUint32(u),u+=4,b=M.getUint32(u),u+=4,x=M.getUint32(u),u+=4,S=M.getUint32(u),u+=4}else if(c===1){var M=new DataView(o.buffer);m=M.getUint32(u),u+=4,v=Rv(o.subarray(u)),u+=8,x=M.getUint32(u),u+=4,S=M.getUint32(u),u+=4,d=ma(o.subarray(u)),u+=d.length,p=ma(o.subarray(u)),u+=p.length}D=new Uint8Array(o.subarray(u,o.byteLength));var j={scheme_id_uri:d,value:p,timescale:m||1,presentation_time:v,presentation_time_delta:b,event_duration:x,id:S,message_data:D};return Bv(c,j)?j:void 0},Nv=function(o,u,c,d){return o||o===0?o/u:d+c/u},Bv=function(o,u){var c=u.scheme_id_uri!=="\0",d=o===0&&bh(u.presentation_time_delta)&&c,p=o===1&&bh(u.presentation_time)&&c;return!(o>1)&&d||p},bh=function(o){return o!==void 0||o!==null},Fv={parseEmsgBox:Mv,scaleTime:Nv},Ds;typeof window<"u"?Ds=window:typeof i<"u"?Ds=i:typeof self<"u"?Ds=self:Ds={};var Th=Ds,ga=fa.toUnsigned,Is=fa.toHexString,Pe=pa,yr=Xl,Jl=Fv,Uv=Yl,Vv=_h,qv=Kl,jv=n.getUint64,xh,Sh,Eh,Ch,wh,Zl,Ah,eu=Th,Hv=th.parseId3Frames;xh=function(o){var u={},c=Pe(o,["moov","trak"]);return c.reduce(function(d,p){var m,v,b,x,S;return m=Pe(p,["tkhd"])[0],!m||(v=m[0],b=v===0?12:20,x=ga(m[b]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3]),S=Pe(p,["mdia","mdhd"])[0],!S)?null:(v=S[0],b=v===0?12:20,d[x]=ga(S[b]<<24|S[b+1]<<16|S[b+2]<<8|S[b+3]),d)},u)},Sh=function(o,u){var c;c=Pe(u,["moof","traf"]);var d=c.reduce(function(p,m){var v=Pe(m,["tfhd"])[0],b=ga(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),x=o[b]||9e4,S=Pe(m,["tfdt"])[0],D=new DataView(S.buffer,S.byteOffset,S.byteLength),M;S[0]===1?M=jv(S.subarray(4,12)):M=D.getUint32(4);let j;return typeof M=="bigint"?j=M/eu.BigInt(x):typeof M=="number"&&!isNaN(M)&&(j=M/x),j<Number.MAX_SAFE_INTEGER&&(j=Number(j)),j<p&&(p=j),p},1/0);return typeof d=="bigint"||isFinite(d)?d:0},Eh=function(o,u){var c=Pe(u,["moof","traf"]),d=0,p=0,m;if(c&&c.length){var v=Pe(c[0],["tfhd"])[0],b=Pe(c[0],["trun"])[0],x=Pe(c[0],["tfdt"])[0];if(v){var S=Uv(v);m=S.trackId}if(x){var D=qv(x);d=D.baseMediaDecodeTime}if(b){var M=Vv(b);M.samples&&M.samples.length&&(p=M.samples[0].compositionTimeOffset||0)}}var j=o[m]||9e4;typeof d=="bigint"&&(p=eu.BigInt(p),j=eu.BigInt(j));var B=(d+p)/j;return typeof B=="bigint"&&B<Number.MAX_SAFE_INTEGER&&(B=Number(B)),B},Ch=function(o){var u=Pe(o,["moov","trak"]),c=[];return u.forEach(function(d){var p=Pe(d,["mdia","hdlr"]),m=Pe(d,["tkhd"]);p.forEach(function(v,b){var x=yr(v.subarray(8,12)),S=m[b],D,M,j;x==="vide"&&(D=new DataView(S.buffer,S.byteOffset,S.byteLength),M=D.getUint8(0),j=M===0?D.getUint32(12):D.getUint32(20),c.push(j))})}),c},Zl=function(o){var u=o[0],c=u===0?12:20;return ga(o[c]<<24|o[c+1]<<16|o[c+2]<<8|o[c+3])},wh=function(o){var u=Pe(o,["moov","trak"]),c=[];return u.forEach(function(d){var p={},m=Pe(d,["tkhd"])[0],v,b;m&&(v=new DataView(m.buffer,m.byteOffset,m.byteLength),b=v.getUint8(0),p.id=b===0?v.getUint32(12):v.getUint32(20));var x=Pe(d,["mdia","hdlr"])[0];if(x){var S=yr(x.subarray(8,12));S==="vide"?p.type="video":S==="soun"?p.type="audio":p.type=S}var D=Pe(d,["mdia","minf","stbl","stsd"])[0];if(D){var M=D.subarray(8);p.codec=yr(M.subarray(4,8));var j=Pe(M,[p.codec])[0],B,W;j&&(/^[asm]vc[1-9]$/i.test(p.codec)?(B=j.subarray(78),W=yr(B.subarray(4,8)),W==="avcC"&&B.length>
32511?(p.codec+=".",p.codec+=Is(B[9]),p.codec+=Is(B[10]),p.codec+=Is(B[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(B=j.subarray(28),W=yr(B.subarray(4,8)),W==="esds"&&B.length>20&&B[19]!==0?(p.codec+="."+Is(B[19]),p.codec+="."+Is(B[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var Y=Pe(d,["mdia","mdhd"])[0];Y&&(p.timescale=Zl(Y)),c.push(p)}),c},Ah=function(o,u=0){var c=Pe(o,["emsg"]);return c.map(d=>{var p=Jl.parseEmsgBox(new Uint8Array(d)),m=Hv(p.message_data);return{cueTime:Jl.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,u),duration:Jl.scaleTime(p.event_duration,p.timescale),frames:m}})};var ks={findBox:Pe,parseType:yr,timescale:xh,startTime:Sh,compositionStartTime:Eh,videoTrackIds:Ch,tracks:wh,getTimescaleFromMediaHeader:Zl,getEmsgID3:Ah};let{parseTrun:$v}=vh,{findBox:Dh}=ks;var Ih=Th,zv=function(o){var u=Dh(o,["moof","traf"]),c=Dh(o,["mdat"]),d=[];return c.forEach(function(p,m){var v=u[m];d.push({mdat:p,traf:v})}),d},Gv=function(o,u,c){var d=u,p=c.defaultSampleDuration||0,m=c.defaultSampleSize||0,v=c.trackId,b=[];return o.forEach(function(x){var S=$v(x),D=S.samples;D.forEach(function(M){M.duration===void 0&&(M.duration=p),M.size===void 0&&(M.size=m),M.trackId=v,M.dts=d,M.compositionTimeOffset===void 0&&(M.compositionTimeOffset=0),typeof d=="bigint"?(M.pts=d+Ih.BigInt(M.compositionTimeOffset),d+=Ih.BigInt(M.duration)):(M.pts=d+M.compositionTimeOffset,d+=M.duration)}),b=b.concat(D)}),b},kh={getMdatTrafPairs:zv,parseSamples:Gv},Wv=Yd.discardEmulationPreventionBytes,Xv=Qd.CaptionStream,tu=pa,Kv=Kl,Yv=Yl,{getMdatTrafPairs:Qv,parseSamples:Jv}=kh,Zv=function(o,u){for(var c=o,d=0;d<u.length;d++){var p=u[d];if(c<p.size)return p;c-=p.size}return null},eb=function(o,u,c){var d=new DataView(o.buffer,o.byteOffset,o.byteLength),p={logs:[],seiNals:[]},m,v,b,x;for(v=0;v+4<o.length;v+=b)if(b=d.getUint32(v),v+=4,!(b<=0))switch(o[v]&31){case 6:var S=o.subarray(v+1,v+1+b),D=Zv(v,u);if(m={nalUnitType:"sei_rbsp",size:b,data:S,escapedRBSP:Wv(S),trackId:c},D)m.pts=D.pts,m.dts=D.dts,x=D;else if(x)m.pts=x.pts,m.dts=x.dts;else{p.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+v+" for trackId "+c+". See mux.js#223."});break}p.seiNals.push(m);break}return p},tb=function(o,u){var c={},d=Qv(o);return d.forEach(function(p){var m=p.mdat,v=p.traf,b=tu(v,["tfhd"]),x=Yv(b[0]),S=x.trackId,D=tu(v,["tfdt"]),M=D.length>0?Kv(D[0]).baseMediaDecodeTime:0,j=tu(v,["trun"]),B,W;u===S&&j.length>0&&(B=Jv(j,M,x),W=eb(m,B,S),c[S]||(c[S]={seiNals:[],logs:[]}),c[S].seiNals=c[S].seiNals.concat(W.seiNals),c[S].logs=c[S].logs.concat(W.logs))}),c},ib=function(o,u,c){var d;if(u===null)return null;d=tb(o,u);var p=d[u]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:c}},rb=function(){var o=!1,u,c,d,p,m,v;this.isInitialized=function(){return o},this.init=function(b){u=new Xv,o=!0,v=b?b.isPartial:!1,u.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,m.captions.push(x),m.captionStreams[x.stream]=!0}),u.on("log",function(x){m.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,S){var D;if(this.isInitialized()){if(!x||!S)return null;if(this.isNewInit(x,S))d=x[0],p=S[d];else if(d===null||!p)return c.push(b),null}else return null;for(;c.length>0;){var M=c.shift();this.parse(M,x,S)}return D=ib(b,d,p),D&&D.logs&&(m.logs=m.logs.concat(D.logs)),D===null||!D.seiNals?m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null:(this.pushNals(D.seiNals),this.flushStream(),m)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){u.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;v?u.partialFlush():u.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;u.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){c=[],d=null,p=null,m?this.clearParsedCaptions():m={captions:[],captionStream
325s:{},logs:[]},this.resetCaptionStream()},this.reset()},sb=rb;let{parseTfdt:nb}=vh,Ti=pa,{getTimescaleFromMediaHeader:ab}=ks,{parseSamples:ob,getMdatTrafPairs:lb}=kh;var Ph=function(){let o=9e4;this.init=function(u){let c=Ti(u,["moov","trak","mdia","mdhd"])[0];c&&(o=ab(c))},this.parseSegment=function(u){let c=[],d=lb(u),p=0;return d.forEach(function(m){let v=m.mdat,b=m.traf,x=Ti(b,["tfdt"])[0],S=Ti(b,["tfhd"])[0],D=Ti(b,["trun"]);if(x&&(p=nb(x).baseMediaDecodeTime),D.length&&S){let M=ob(D,p,S),j=0;M.forEach(function(B){let W="utf-8",Y=new TextDecoder(W),Me=v.slice(j,j+B.size);if(Ti(Me,["vtte"])[0]){j+=B.size;return}Ti(Me,["vttc"]).forEach(function(Ps){let Os=Ti(Ps,["payl"])[0],Ls=Ti(Ps,["sttg"])[0],Rs=B.pts/o,va=(B.pts+B.duration)/o,xe,Ms;if(Os)try{xe=Y.decode(Os)}catch(Mt){console.error(Mt)}if(Ls)try{Ms=Y.decode(Ls)}catch(Mt){console.error(Mt)}B.duration&&xe&&c.push({cueText:xe,start:Rs,end:va,settings:Ms})}),j+=B.size})}}),c}},iu=ea,Oh=function(o){var u=o[1]&31;return u<<=8,u|=o[2],u},_a=function(o){return!!(o[1]&64)},ya=function(o){var u=0;return(o[3]&48)>>>4>1&&(u+=o[4]+1),u},ub=function(o,u){var c=Oh(o);return c===0?"pat":c===u?"pmt":u?"pes":null},cb=function(o){var u=_a(o),c=4+ya(o);return u&&(c+=o[c]+1),(o[c+10]&31)<<8|o[c+11]},db=function(o){var u={},c=_a(o),d=4+ya(o);if(c&&(d+=o[d]+1),!!(o[d+5]&1)){var p,m,v;p=(o[d+1]&15)<<8|o[d+2],m=3+p-4,v=(o[d+10]&15)<<8|o[d+11];for(var b=12+v;b<m;){var x=d+b;u[(o[x+1]&31)<<8|o[x+2]]=o[x],b+=((o[x+3]&15)<<8|o[x+4])+5}return u}},hb=function(o,u){var c=Oh(o),d=u[c];switch(d){case iu.H264_STREAM_TYPE:return"video";case iu.ADTS_STREAM_TYPE:return"audio";case iu.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},fb=function(o){var u=_a(o);if(!u)return null;var c=4+ya(o);if(c>=o.byteLength)return null;var d=null,p;return p=o[c+7],p&192&&(d={},d.pts=(o[c+9]&14)<<27|(o[c+10]&255)<<20|(o[c+11]&254)<<12|(o[c+12]&255)<<5|(o[c+13]&254)>>>3,d.pts*=4,d.pts+=(o[c+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(o[c+14]&14)<<27|(o[c+15]&255)<<20|(o[c+16]&254)<<12|(o[c+17]&255)<<5|(o[c+18]&254)>>>3,d.dts*=4,d.dts+=(o[c+18]&6)>>>1)),d},ru=function(o){switch(o){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},pb=function(o){for(var u=4+ya(o),c=o.subarray(u),d=0,p=0,m=!1,v;p<c.byteLength-3;p++)if(c[p+2]===1){d=p+5;break}for(;d<c.byteLength;)switch(c[d]){case 0:if(c[d-1]!==0){d+=2;break}else if(c[d-2]!==0){d++;break}p+3!==d-2&&(v=ru(c[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0));do d++;while(c[d]!==1&&d<c.length);p=d-2,d+=3;break;case 1:if(c[d-1]!==0||c[d-2]!==0){d+=3;break}v=ru(c[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0),p=d-2,d+=3;break;default:d+=3;break}return c=c.subarray(p),d-=p,p=0,c&&c.byteLength>3&&(v=ru(c[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(m=!0)),m},mb={parseType:ub,parsePat:cb,parsePmt:db,parsePayloadUnitStartIndicator:_a,parsePesType:hb,parsePesTime:fb,videoPacketContainsKeyFrame:pb},Lh=ea,vr=Zd.handleRollover,ue={};ue.ts=mb,ue.aac=$l;var Qi=Te.ONE_SECOND_IN_TS,Qe=188,Ht=71,gb=function(o,u){for(var c=0,d=Qe,p,m;d<o.byteLength;){if(o[c]===Ht&&o[d]===Ht){switch(p=o.subarray(c,d),m=ue.ts.parseType(p,u.pid),m){case"pat":u.pid=ue.ts.parsePat(p);break;case"pmt":var v=ue.ts.parsePmt(p);u.table=u.table||{},Object.keys(v).forEach(function(b){u.table[b]=v[b]});break}c+=Qe,d+=Qe;continue}c++,d++}},Rh=function(o,u,c){for(var d=0,p=Qe,m,v,b,x,S,D=!1;p<=o.byteLength;){if(o[d]===Ht&&(o[p]===Ht||p===o.byteLength)){switch(m=o.subarray(d,p),v=ue.ts.parseType(m,u.pid),v){case"pes":b=ue.ts.parsePesType(m,u.table),x=ue.ts.parsePayloadUnitStartIndicator(m),b==="audio"&&x&&(S=ue.ts.parsePesTime(m),S&&(S.type="audio",c.audio.push(S),D=!0));break}if(D)break;d+=Qe,p+=Qe;continue}d++,p++}for(p=o.byteLength,d=p-Qe,D=!1;d>=0;){if(o[d]===Ht&&(o[p]===Ht||p===o.byteLength)){switch(m=o.subarray(d,p),v=ue.ts.parseType(m,u.pid),v){case"pes":b=ue.ts.parsePesType(m,u.table),x=ue.ts.parsePayloadUnitStartIndicator(m),b==="audio"&&x&&(S=ue.ts.parsePesTime(m),S&&(S.type="audio",c.audio.push(S),D=!0));break}if(D)break;d-=Qe,p-=Qe;continue}d--,p--}},_b=function(o,u,c){for(var d=0,p=Qe,m,v,b,x,S,D,M,j,B=!1,W={data:[],size:0};p<o.byteLength;){if(o[d]===Ht&&o[p]===Ht){switch(m=o.subarray(d,p),v=ue.ts.parseType(m,u.pid),v){case"pes":if(b=ue.ts.parsePesType(m,u.table),x=ue.ts.parsePayloadUnitStartIndicator(m),b==="video"&&(x&&!B&&(S=ue.ts.parsePesTime(m),S&&(S.type="video",c.video.push(S),B=!0)),!c.firstKeyFrame)){if(x&&W.size!==0){for(D=new Uint8Array(W.size),M=0;W.data.length;)j=W.data.shift(),D.set(j,M),M+=j.byteLength;if(ue.ts.videoPacketContainsKeyFrame(D)){var Y=ue.ts.parsePesTime(D);Y?(c.firstKeyFrame=Y,c.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}W.size=0}W.data.push(m),W.size+=m.byteLength}break}if(B&&c.firstKeyFrame)break;d+=Qe,p+=Qe;continue}d++,p++}for(p=o.byteLength,d=p-Qe,B=!1;d>=0;){if(o[d]===Ht&&o[p]===Ht){switch(m=o.subarray(d,p),v=ue.ts.parseType(m,u.pid),v){case"pes":b=ue.ts.parsePesType(m,u.table),x=ue.ts.parsePayloadUnitStartIndicator(m),b==="video"&&x&&(S=ue.ts.parsePesTime(m),S&&(S.type="video",c.video.push(S),B=!0));break}if(B)break;d-=Qe,p-=Qe;continue}d--,p--}},yb=function(o,u){if(o.audio&&o.audio.length){var c=u;
325(typeof c>"u"||isNaN(c))&&(c=o.audio[0].dts),o.audio.forEach(function(m){m.dts=vr(m.dts,c),m.pts=vr(m.pts,c),m.dtsTime=m.dts/Qi,m.ptsTime=m.pts/Qi})}if(o.video&&o.video.length){var d=u;if((typeof d>"u"||isNaN(d))&&(d=o.video[0].dts),o.video.forEach(function(m){m.dts=vr(m.dts,d),m.pts=vr(m.pts,d),m.dtsTime=m.dts/Qi,m.ptsTime=m.pts/Qi}),o.firstKeyFrame){var p=o.firstKeyFrame;p.dts=vr(p.dts,d),p.pts=vr(p.pts,d),p.dtsTime=p.dts/Qi,p.ptsTime=p.pts/Qi}}},vb=function(o){for(var u=!1,c=0,d=null,p=null,m=0,v=0,b;o.length-v>=3;){var x=ue.aac.parseType(o,v);switch(x){case"timed-metadata":if(o.length-v<10){u=!0;break}if(m=ue.aac.parseId3TagSize(o,v),m>o.length){u=!0;break}p===null&&(b=o.subarray(v,v+m),p=ue.aac.parseAacTimestamp(b)),v+=m;break;case"audio":if(o.length-v<7){u=!0;break}if(m=ue.aac.parseAdtsSize(o,v),m>o.length){u=!0;break}d===null&&(b=o.subarray(v,v+m),d=ue.aac.parseSampleRate(b)),c++,v+=m;break;default:v++;break}if(u)return null}if(d===null||p===null)return null;var S=Qi/d,D={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+c*1024*S,pts:p+c*1024*S}]};return D},bb=function(o){var u={pid:null,table:null},c={};gb(o,u);for(var d in u.table)if(u.table.hasOwnProperty(d)){var p=u.table[d];switch(p){case Lh.H264_STREAM_TYPE:c.video=[],_b(o,u,c),c.video.length===0&&delete c.video;break;case Lh.ADTS_STREAM_TYPE:c.audio=[],Rh(o,u,c),c.audio.length===0&&delete c.audio;break}}return c},Tb=function(o,u){var c=ue.aac.isLikelyAacData(o),d;return c?d=vb(o):d=bb(o),!d||!d.audio&&!d.video?null:(yb(d,u),d)},xb={inspect:Tb,parseAudioPes_:Rh};let Sb=function(o,u){u.on("data",function(c){let d=c.initSegment;c.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};let p=c.data;c.data=p.buffer,o.postMessage({action:"data",segment:c,byteOffset:p.byteOffset,byteLength:p.byteLength},[c.data])}),u.on("done",function(c){o.postMessage({action:"done"})}),u.on("gopInfo",function(c){o.postMessage({action:"gopInfo",gopInfo:c})}),u.on("videoSegmentTimingInfo",function(c){let d={start:{decode:Te.videoTsToSeconds(c.start.dts),presentation:Te.videoTsToSeconds(c.start.pts)},end:{decode:Te.videoTsToSeconds(c.end.dts),presentation:Te.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:Te.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=Te.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),u.on("audioSegmentTimingInfo",function(c){let d={start:{decode:Te.videoTsToSeconds(c.start.dts),presentation:Te.videoTsToSeconds(c.start.pts)},end:{decode:Te.videoTsToSeconds(c.end.dts),presentation:Te.videoTsToSeconds(c.end.pts)},baseMediaDecodeTime:Te.videoTsToSeconds(c.baseMediaDecodeTime)};c.prependedContentDuration&&(d.prependedContentDuration=Te.videoTsToSeconds(c.prependedContentDuration)),o.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),u.on("id3Frame",function(c){o.postMessage({action:"id3Frame",id3Frame:c})}),u.on("caption",function(c){o.postMessage({action:"caption",caption:c})}),u.on("trackinfo",function(c){o.postMessage({action:"trackinfo",trackInfo:c})}),u.on("audioTimingInfo",function(c){o.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Te.videoTsToSeconds(c.start),end:Te.videoTsToSeconds(c.end)}})}),u.on("videoTimingInfo",function(c){o.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Te.videoTsToSeconds(c.start),end:Te.videoTsToSeconds(c.end)}})}),u.on("log",function(c){o.postMessage({action:"log",log:c})})};class Mh{constructor(u,c){this.options=c||{},this.self=u,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new pv.Transmuxer(this.options),Sb(this.self,this.transmuxer)}pushMp4Captions(u){this.captionParser||(this.captionParser=new sb,this.captionParser.init());let c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.captionParser.parse(c,u.trackIds,u.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:c.buffer},[c.buffer])}initMp4WebVttParser(u){this.webVttParser||(this.webVttParser=new Ph);let c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.webVttParser.init(c)}getMp4WebVttText(u){this.webVttParser||(this.webVttParser=new Ph);let c=new Uint8Array(u.data,u.byteOffset,u.byteLength),d=this.webVttParser.parseSegment(c);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:d||[],data:c.buffer},[c.buffer])}probeMp4StartTime({timescales:u,data:c}){let d=ks.startTime(u,c);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:c},[c.buffer])}probeMp4Tracks({data:u}){let c=ks.tracks(u);this.self.postMessage({action:"probeMp4Tracks",tracks:c,data:u},[u.buffer])}probeEmsgID3({data:u,offset:c}){let d=ks.getEmsgID3(u,c);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:u},[u.buffer])}probeTs({data:u,baseStartTime:c}){let d=typeof c=="number"&&!isNaN(c)?c*Te.ONE_SECOND_IN_TS:void 0,p=xb.inspect(u,d),m=null;p&&(m={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},m.hasVideo&&(m.videoStart=p.video[0].ptsTime),m.hasAudio&&(m.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:m,data:u},[u.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(u){let c=new Uint8Array(u.data,u.byteOffset,u.byteLength);this.transmuxer.push(c)}reset(){this.transmuxer.reset()}setTimestampOffset(u){let c=u.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Te.secondsToVideoTs(c)))}setAudioAppendStart(u){this.transmuxer.setAudioAppendStart(Math.ceil(Te.secondsToVideoTs(u.appendStart)))}setRemux(u){this.transmuxer.setRemux(u.remux)}flush(u){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(u){this.transmuxer.alignGopsWith(u.gopsToAlignWith.slice())}}
325self.onmessage=function(o){if(o.data.action==="init"&&o.data.options){this.messageHandlers=new Mh(self,o.data.options);return}this.messageHandlers||(this.messageHandlers=new Mh(self)),o.data&&o.data.action&&o.data.action!=="init"&&this.messageHandlers[o.data.action]&&this.messageHandlers[o.data.action](o.data)}})),pE=w_(fE),mE=(i,e,t)=>{let{type:r,initSegment:s,captions:n,captionStreams:a,metadata:l,videoFrameDtsTime:h,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:l});let g=i.data.segment.boxes||{data:i.data.segment.data},_={type:r,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof h<"u"&&(_.videoFrameDtsTime=h),typeof f<"u"&&(_.videoFramePtsTime=f),t(_)},gE=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},_E=(i,e)=>{e.gopInfo=i.data.gopInfo},I_=i=>{let{transmuxer:e,bytes:t,audioAppendStart:r,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:l,onAudioTimingInfo:h,onVideoTimingInfo:f,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:_,onId3:T,onCaptions:E,onDone:w,onEndedTimeline:y,onTransmuxerLog:I,isEndOfTimeline:A,segment:P,triggerSegmentEventFn:k}=i,L={buffer:[]},R=A,U=V=>{e.currentTransmux===i&&(V.data.action==="data"&&mE(V,L,a),V.data.action==="trackinfo"&&l(V.data.trackInfo),V.data.action==="gopInfo"&&_E(V,L),V.data.action==="audioTimingInfo"&&h(V.data.audioTimingInfo),V.data.action==="videoTimingInfo"&&f(V.data.videoTimingInfo),V.data.action==="videoSegmentTimingInfo"&&g(V.data.videoSegmentTimingInfo),V.data.action==="audioSegmentTimingInfo"&&_(V.data.audioSegmentTimingInfo),V.data.action==="id3Frame"&&T([V.data.id3Frame],V.data.id3Frame.dispatchType),V.data.action==="caption"&&E(V.data.caption),V.data.action==="endedtimeline"&&(R=!1,y()),V.data.action==="log"&&I(V.data.log),V.data.type==="transmuxed"&&(R||(e.onmessage=null,gE({transmuxedData:L,callback:w}),k_(e))))},N=()=>{let V={message:"Received an error message from the transmuxer worker",metadata:{errorType:O.Error.StreamingFailedToTransmuxSegment,segmentInfo:or({segment:P})}};w(null,V)};if(e.onmessage=U,e.onerror=N,r&&e.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(s)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){let V=t instanceof ArrayBuffer?t:t.buffer,X=t instanceof ArrayBuffer?0:t.byteOffset;k({type:"segmenttransmuxingstart",segment:P}),e.postMessage({action:"push",data:V,byteOffset:X,byteLength:t.byteLength},[V])}A&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},k_=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():I_(i.currentTransmux))},Kg=(i,e)=>{i.postMessage({action:e}),k_(i)},P_=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Kg(e,i);return}e.transmuxQueue.push(Kg.bind(null,e,i))},yE=i=>{P_("reset",i)},vE=i=>{P_("endTimeline",i)},O_=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,I_(i);return}i.transmuxer.transmuxQueue.push(i)},bE=i=>{let e=new pE;e.currentTransmux=null,e.transmuxQueue=[];let t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e},Ac={reset:yE,endTimeline:vE,transmux:O_,createTransmuxer:bE},is=function(i){let e=i.transmuxer,t=i.endAction||i.action,r=i.callback,s=we({},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)),r(a.data))};if(e.addEventListener("message",n),i.data){let a=i.data instanceof ArrayBuffer;s.byteOffset=a?0:i.data.byteOffset,s.byteLength=i.data.byteLength;let l=[a?i.data:i.data.buffer];e.postMessage(s,l)}else e.postMessage(s)},ei={FAILURE:2,TIMEOUT:-101,ABORTED:-102},L_="wvtt",hd=i=>{i.forEach(e=>{e.abort()})},TE=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),xE=i=>{let e=i.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return r.bytesReceived=i.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Vd=(i,e)=>{let{requestType:t}=e,r=dr({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:ei.TIMEOUT,xhr:e,metadata:r}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:ei.ABORTED,xhr:e,metadata:r}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:ei.FAILURE,xhr:e,metadata:r}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:ei.FAILURE,xhr:e,metadata:r}:null},Yg=(i,e,t,r)=>(s,n)=>{let a=n.response,l=Vd(s,n);if(l)return t(l,i);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:ei.FAILURE,xhr:n},i);let h=new DataView(a),f=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let _=0;_<e.length;_++)e[_].bytes=f;let g={uri:n.uri};return r({type:"segmentkeyloadcomplete",segment:i,keyInfo:g}),t(null,i)},SE=(i,e)=>{e===L_&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},EE=(i,e,t)=>{e===L_&&is({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:r,mp4VttCues:s})=>{i.bytes=r,t(null,i,{mp4VttCues:s})}})},R_=(i,e)=>{let t=so(i.map.bytes);if(t!=="mp4"){let r=i.map.resolvedUri||i.map.uri,s=t||"unknown";return e({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${r}`,code:ei.FAILURE,metadata:{mediaType:s}})}is({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:r,data:s})=>(i.map.bytes=s,r.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),n.type==="text"&&SE(i,n.codec))}),e(null))})},CE=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(r,s)=>{let n=Vd(r,s);if(n)return e(n,i);let a=new Uint8Array(s.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,R_(i,function(l){if(l)return l.xhr=s,l.status=s.status,e(l,i);e(null,i)})},wE=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:r})=>(s,n)=>{let a=Vd(s,n);if(a)return e(a,i);r({type:"segmentloaded",segment:i});let l=t==="arraybuffer"||!n.responseText?n.response:dE(n.responseText.substring(i.lastReachedChar||0));return i.stats=TE(n),i.key?i.encryptedBytes=new Uint8Array(l):i.bytes=new Uint8Array(l),e(null,i)},AE=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let w=i.map&&i.map.tracks||{},y=!!(w.audio&&w.video),I=r.bind(null,i,"audio","start"),A=r.bind(null,i,"audio","end"),P=r.bind(null,i,"video","start"),k=r.bind(null,i,"video","end"),L=()=>O_({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:y,onData:R=>
325{R.type=R.type==="combined"?"video":R.type,g(i,R)},onTrackInfo:R=>{t&&(y&&(R.isMuxed=!0),t(i,R))},onAudioTimingInfo:R=>{I&&typeof R.start<"u"&&(I(R.start),I=null),A&&typeof R.end<"u"&&A(R.end)},onVideoTimingInfo:R=>{P&&typeof R.start<"u"&&(P(R.start),P=null),k&&typeof R.end<"u"&&k(R.end)},onVideoSegmentTimingInfo:R=>{let U={pts:{start:R.start.presentation,end:R.end.presentation},dts:{start:R.start.decode,end:R.end.decode}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:U}),s(R)},onAudioSegmentTimingInfo:R=>{let U={pts:{start:R.start.pts,end:R.end.pts},dts:{start:R.start.dts,end:R.end.dts}};E({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:U}),n(R)},onId3:(R,U)=>{a(i,R,U)},onCaptions:R=>{l(i,[R])},isEndOfTimeline:h,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:(R,U)=>{_&&(R.type=R.type==="combined"?"video":R.type,E({type:"segmenttransmuxingcomplete",segment:i}),_(U,i,R))},segment:i,triggerSegmentEventFn:E});is({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:R=>{i.bytes=e=R.data;let U=R.result;U&&(t(i,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:y}),t=null),L()}})},M_=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let w=new Uint8Array(e);if(fg(w)){i.isFmp4=!0;let{tracks:y}=i.map;if(y.text&&(!y.audio||!y.video)){g(i,{data:w,type:"text"}),EE(i,y.text.codec,_);return}let A={isFmp4:!0,hasVideo:!!y.video,hasAudio:!!y.audio};y.audio&&y.audio.codec&&y.audio.codec!=="enca"&&(A.audioCodec=y.audio.codec),y.video&&y.video.codec&&y.video.codec!=="encv"&&(A.videoCodec=y.video.codec),y.video&&y.audio&&(A.isMuxed=!0),t(i,A);let P=(k,L)=>{g(i,{data:w,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),L&&L.length&&a(i,L),k&&k.length&&l(i,k),_(null,i,{})};is({action:"probeMp4StartTime",timescales:i.map.timescales,data:w,transmuxer:i.transmuxer,callback:({data:k,startTime:L})=>{e=k.buffer,i.bytes=w=k,A.hasAudio&&!A.isMuxed&&r(i,"audio","start",L),A.hasVideo&&r(i,"video","start",L),is({action:"probeEmsgID3",data:w,transmuxer:i.transmuxer,offset:L,callback:({emsgData:R,id3Frames:U})=>{if(e=R.buffer,i.bytes=w=R,!y.video||!R.byteLength||!i.transmuxer){P(void 0,U);return}is({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:w,timescales:i.map.timescales,trackIds:[y.video.id],callback:N=>{e=N.data.buffer,i.bytes=w=N.data,N.logs.forEach(function(V){T(oe(V,{stream:"mp4CaptionParser"}))}),P(N.captions,U)}})}})}});return}if(!i.transmuxer){_(null,i,{});return}if(typeof i.container>"u"&&(i.container=so(w)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),_(null,i,{});return}AE({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})},N_=function({id:i,key:e,encryptedBytes:t,decryptionWorker:r,segment:s,doneFn:n},a){let l=f=>{if(f.data.source===i){r.removeEventListener("message",l);let g=f.data.decrypted;a(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};r.onerror=()=>{let f="An error occurred in the decryption worker",g=or({segment:s}),_={message:f,metadata:{error:new Error(f),errorType:O.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:s.key.resolvedUri||s.map.key.resolvedUri}}};n(_,s)},r.addEventListener("message",l);let h;e.bytes.slice?h=e.bytes.slice():h=new Uint32Array(Array.prototype.slice.call(e.bytes)),r.postMessage(b_({source:i,encrypted:t,key:h,iv:e.iv}),[t.buffer,h.buffer])},DE=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{E({type:"segmentdecryptionstart"}),N_({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:_},w=>{e.bytes=w,E({type:"segmentdecryptioncomplete",segment:e}),M_({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})})},IE=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})=>{let w=0,y=!1;return(I,A)=>{if(!y){if(I)return y=!0,hd(i),_(I,A);if(w+=1,w===i.length){let P=function(){if(A.encryptedBytes)return DE({decryptionWorker:e,segment:A,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E});M_({segment:A,bytes:A.bytes,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g,doneFn:_,onTransmuxerLog:T,triggerSegmentEventFn:E})};if(A.endOfAllRequests=Date.now(),A.map&&A.map.encryptedBytes&&!A.map.bytes)return E({type:"segmentdecryptionstart",segment:A}),N_({decryptionWorker:e,id:A.requestId+"-init",encryptedBytes:A.map.encryptedBytes,key:A.map.key,segment:A,doneFn:_},k=>{A.map.bytes=k,E({type:"segmentdecryptioncomplete",segment:A}),R_(A,L=>{if(L)return hd(i),_(L,A);P()})});P()}}}},kE=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},PE=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:l,isEndOfTimeline:h,endedTimelineFn:f,dataFn:g})=>_=>{if(!_.target.aborted)return i.stats=oe(i.stats,xE(_)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(_,i)},OE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:r,abortFn:s,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:w,doneFn:y,onTransmuxerLog:I,triggerSegmentEventFn:A})=>{let P=[],k=IE({activeXhrs:P,decryptionWorker:t,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:w,doneFn:y,onTransmuxerLog:I,triggerSegmentEventFn:A});if(r.key&&!r.key.bytes){let V=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&V.push(r.map.key);let X=oe(e,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),fe=Yg(r,V,k,A),ee={uri:r.key.resolvedUri};A({type:"segmentkeyloadstart",segment:r,keyInfo:ee});let me=i(X,fe);P.push(me)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){let me=oe(e,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),G=Yg(r,[r.map.key],k,A),re={uri:r.map.key.resolvedUri};A({type:"segmentkeyloadstart",segment:r,keyInfo:re});let Ye=i(me,G);P.push(Ye)}let X=oe(e,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:dd(r.map),requestType:"segment-media-initialization"}),fe=CE({segment:r,finishProcessingFn:k,triggerSegmentEventFn:A});A({type:"segmentloadstart",segment:r});let ee=i(X,fe);P.push(ee)}let L=oe(e,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:dd(r),requestType:"segment"}),R=wE({segment:r,finishProcessingFn:k,responseType:L.responseType,triggerSegmentEventFn:A});A({type:"segmentloadstart",segment:r});let U=i(L,R);U.addEventListener("progress",PE({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:l,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:f,id3Fn:g,captionsFn:_,isEndOfTimeline:T,endedTimelineFn:E,dataFn:w})),P.push(U);let N={};return P.forEach(V=>{V.addEventListener("loadend",kE({loadendState:N,abortFn:s}))}),()=>hd(P)},uo=Ot("PlaylistSelector"),Qg=function(i){if(!i||!i.playlist)return;let e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},rs=function(i,e){if(!i)return"";let t=C.default.getComputedStyle(i);return t?t[e]:""},ss=function(i,e){let t=i.slice();i.sort(function(r,s){let n=e(r,s);return n===0?t.indexOf(r)-t.indexOf(s):n})},qd=function(i,e){let t,r;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||C.default.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(r=e.attributes.BANDWIDTH),r=r||C.default.Number.MAX_VALUE,t-r},LE=function(i,e){let t,r;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||C.default.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(r=e.attributes.RESOLUTION.width),r=r||C.default.Number.MAX_VALUE,t===r&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-r}
325,B_=function(i){let{main:e,bandwidth:t,playerWidth:r,playerHeight:s,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:l}=i;if(!e)return;let h={bandwidth:t,width:r,height:s,limitRenditionByPlayerDimensions:a},f=e.playlists;gt.isAudioOnly(e)&&(f=l.getAudioTrackPlaylists_(),h.audioOnly=!0);let g=f.map(N=>{let V,X=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,fe=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return V=N.attributes&&N.attributes.BANDWIDTH,V=V||C.default.Number.MAX_VALUE,{bandwidth:V,width:X,height:fe,playlist:N}});ss(g,(N,V)=>N.bandwidth-V.bandwidth),g=g.filter(N=>!gt.isIncompatible(N.playlist));let _=g.filter(N=>gt.isEnabled(N.playlist));_.length||(_=g.filter(N=>!gt.isDisabled(N.playlist)));let T=_.filter(N=>N.bandwidth*Fe.BANDWIDTH_VARIANCE<t),E=T[T.length-1],w=T.filter(N=>N.bandwidth===E.bandwidth)[0];if(a===!1){let N=w||_[0]||g[0];if(N&&N.playlist){let V="sortedPlaylistReps";return w&&(V="bandwidthBestRep"),_[0]&&(V="enabledPlaylistReps"),uo(`choosing ${Qg(N)} using ${V} with options`,h),N.playlist}return uo("could not choose a playlist with options",h),null}let y=T.filter(N=>N.width&&N.height);ss(y,(N,V)=>N.width-V.width);let I=y.filter(N=>N.width===r&&N.height===s);E=I[I.length-1];let A=I.filter(N=>N.bandwidth===E.bandwidth)[0],P,k,L;A||(P=y.filter(N=>n==="cover"?N.width>r&&N.height>s:N.width>r||N.height>s),k=P.filter(N=>N.width===P[0].width&&N.height===P[0].height),E=k[k.length-1],L=k.filter(N=>N.bandwidth===E.bandwidth)[0]);let R;if(l.leastPixelDiffSelector){let N=y.map(V=>(V.pixelDiff=Math.abs(V.width-r)+Math.abs(V.height-s),V));ss(N,(V,X)=>V.pixelDiff===X.pixelDiff?X.bandwidth-V.bandwidth:V.pixelDiff-X.pixelDiff),R=N[0]}let U=R||L||A||w||_[0]||g[0];if(U&&U.playlist){let N="sortedPlaylistReps";return R?N="leastPixelDiffRep":L?N="resolutionPlusOneRep":A?N="resolutionBestRep":w?N="bandwidthBestRep":_[0]&&(N="enabledPlaylistReps"),uo(`choosing ${Qg(U)} using ${N} with options`,h),U.playlist}return uo("could not choose a playlist with options",h),null},Jg=function(){let i=this.useDevicePixelRatio&&C.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),B_({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(rs(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(rs(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?rs(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},RE=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 r=this.useDevicePixelRatio&&C.default.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=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),B_({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(rs(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(rs(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?rs(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},ME=function(i){let{main:e,currentTime:t,bandwidth:r,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:l,syncController:h}=i,f=e.playlists.filter(w=>!gt.isIncompatible(w)),g=f.filter(gt.isEnabled);g.length||(g=f.filter(w=>!gt.isDisabled(w)));let T=g.filter(gt.hasAttribute.bind(null,"BANDWIDTH")).map(w=>{let I=h.getSyncPoint(w,s,l,t)?1:2,P=gt.estimateSegmentRequestTime(n,r,w)*I-a;return{playlist:w,rebufferingImpact:P}}),E=T.filter(w=>w.rebufferingImpact<=0);return ss(E,(w,y)=>qd(y.playlist,w.playlist)),E.length?E[0]:(ss(T,(w,y)=>w.rebufferingImpact-y.rebufferingImpact),T[0]||null)},NE=function(){let i=this.playlists.main.playlists.filter(gt.isEnabled);return ss(i,(t,r)=>qd(t,r)),i.filter(t=>!!bn(this.playlists.main,t).video)[0]||null},BE=i=>{let e=0,t;
325return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(r=>{t.set(r,e),e+=r.byteLength})),t};function F_(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}var FE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let r=t;/^cc708_/.test(t)&&(r="SERVICE"+t.split("_")[1]);let s=e.textTracks().getTrackById(r);if(s)i[t]=s;else{let n=e.options_.vhs&&e.options_.vhs.captionServices||{},a=t,l=t,h=!1,f=n[r];f&&(a=f.label,l=f.language,h=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:r,default:h,label:a,language:l},!1).track}}},UE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;let r=C.default.WebKitDataCue||C.default.VTTCue;e.forEach(s=>{let n=s.stream;s.content?s.content.forEach(a=>{let l=new r(s.startTime+t,s.endTime+t,a.text);l.line=a.line,l.align="left",l.position=a.position,l.positionAlign="line-left",i[n].addCue(l)}):i[n].addCue(new r(s.startTime+t,s.endTime+t,s.text))})},VE=function(i){Object.defineProperties(i.frame,{id:{get(){return O.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return O.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return O.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},qE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:r})=>{if(!e)return;let s=C.default.WebKitDataCue||C.default.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(g=>{let _=g.cueTime+t;typeof _!="number"||C.default.isNaN(_)||_<0||!(_<1/0)||!g.frames||!g.frames.length||g.frames.forEach(T=>{let E=new s(_,_,T.value||T.url||T.data||"");E.frame=T,E.value=T,VE(E),n.addCue(E)})}),!n.cues||!n.cues.length))return;let a=n.cues,l=[];for(let g=0;g<a.length;g++)a[g]&&l.push(a[g]);let h=l.reduce((g,_)=>{let T=g[_.startTime]||[];return T.push(_),g[_.startTime]=T,g},{}),f=Object.keys(h).sort((g,_)=>Number(g)-Number(_));f.forEach((g,_)=>{let T=h[g],E=isFinite(r)?r:g,w=Number(f[_+1])||E;T.forEach(y=>{y.endTime=w})})},jE={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"},HE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),$E=({inbandTextTracks:i,dateRanges:e})=>{let t=i.metadataTrack_;if(!t)return;let r=C.default.WebKitDataCue||C.default.VTTCue;e.forEach(s=>{for(let n of Object.keys(s)){if(HE.has(n))continue;let a=new r(s.startTime,s.endTime,"");a.id=s.id,a.type="com.apple.quicktime.HLS",a.value={key:jE[n],data:s[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}s.processDateRange()})},Zg=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,O.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},mn=function(i,e,t){let r,s;if(t&&t.cues)for(r=t.cues.length;r--;)s=t.cues[r],s.startTime>=i&&s.endTime<=e&&t.removeCue(s)},zE=function(i){let e=i.cues;if(!e)return;let t={};for(let r=e.length-1;r>=0;r--){let s=e[r],n=`${s.startTime}-${s.endTime}-${s.text}`;t[n]?i.removeCue(s):t[n]=s}},GE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];let r=Math.ceil((e-t+3)*Mi.ONE_SECOND_IN_TS),s;for(s=0;s<i.length&&!(i[s].pts>r);s++);return i.slice(s)},WE=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();let r=e[0].pts,s=0;for(s;s<i.length&&!(i[s].pts>=r);s++);return i.slice(0,s).concat(e)},XE=(i,e,t,r)=>{let s=Math.ceil((e-r)*Mi.ONE_SECOND_IN_TS),n=Math.ceil((t-r)*Mi.ONE_SECOND_IN_TS),a=i.slice(),l=i.length;for(;l--&&!(i[l].pts<=n););if(l===-1)return a;let h=l+1;for(;h--&&!(i[h].pts<=s););return h=Math.max(h,0),a.splice(h,l-h+1),a},KE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;let t=Object.keys(i).sort(),r=Object.keys(e).sort();if(t.length!==r.length)return!1;for(let s=0;s<t.length;s++){let n=t[s];if(n!==r[s]||i[n]!==e[n])return!1}return!0},YE=function(i,e,t){e=e||[];let r=[],s=0;for(let n=0;n<e.length;n++){let a=e[n];if(i===a.timeline&&(r.push(n),s+=a.duration,s>t))return n}return r.length===0?0:r[r.length-1]},fn=1,QE=500,e0=i=>typeof i=="number"&&isFinite(i),co=1/60,JE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video foun
325d 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,ZE=(i,e,t)=>{let r=e-Fe.BACK_BUFFER_LENGTH;i.length&&(r=Math.max(r,i.start(0)));let s=e-t;return Math.min(s,r)},Xr=i=>{let{startOfSegment:e,duration:t,segment:r,part:s,playlist:{mediaSequence:n,id:a,segments:l=[]},mediaIndex:h,partIndex:f,timeline:g}=i,_=l.length-1,T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);let E=typeof f=="number",w=i.segment.uri?"segment":"pre-segment",y=E?i_({preloadSegment:r})-1:0;return`${w} [${n+h}/${n+_}]`+(E?` part [${f}/${y}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(E?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${g}] selected by [${T}] playlist [${a}]`},t0=i=>`${i}TimingInfo`,eC=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:r,overrideCheck:s})=>!s&&i===e?null:i<e?t:r.length?r.end(r.length-1):t,fd=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:r,audioDisabled:s})=>{if(e===t)return!1;if(r==="audio"){let n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(r==="main"&&s){let n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},tC=i=>{if(!i)return!1;let e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),r=e&&t,s=r&&e.to!==t.to;return!!(r&&e.from!==-1&&t.from!==-1&&s)},iC=i=>{let e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Pi=i=>{let e=i.pendingSegment_;if(!e)return;if(fd({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&tC(i.timelineChangeController_)){if(iC(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},rC=i=>{let e=0;return["video","audio"].forEach(function(t){let r=i[`${t}TimingInfo`];if(!r)return;let{start:s,end:n}=r,a;typeof s=="bigint"||typeof n=="bigint"?a=C.default.BigInt(n)-C.default.BigInt(s):typeof s=="number"&&typeof n=="number"&&(a=n-s),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},i0=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+Jt:!1,sC=(i,e)=>{if(e!=="hls")return null;let t=rC({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;let r=i.playlist.targetDuration,s=i0({segmentDuration:t,maxDuration:r*2}),n=i0({segmentDuration:t,maxDuration:r}),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 ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||n?{severity:s?"warn":"info",message:a}:null},or=({type:i,segment:e})=>{if(!e)return;let t=!!(e.key||e.map&&e.map.ke),r=!!(e.map&&!e.map.bytes),s=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:s,duration:e.duration,isEncrypted:t,isMediaInitialization:r}},Hn=class extends O.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_={}
325,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_=Ot(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(r){r!==this.state_&&(this.logger_(`${this.state_} -> ${r}`),this.state_=r,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Pi(this)}),this.sourceUpdater_.on("codecschange",r=>{this.trigger(we({type:"codecschange"},r))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Pi(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",r=>{this.trigger(we({type:"timelinechange"},r)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Pi(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Pi(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Ac.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_&&C.default.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),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,C.default.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_&&Ac.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Ue();if(this.loaderType_==="main"){let{hasAudio:t,hasVideo:r,isMuxed:s}=e;if(r&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(r)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;let r=ll(e),s=this.initSegments_[r];return t&&!s&&e.bytes&&(this.initSegments_[r]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;let r=T_(e),s=this.keyCache_[r];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[r]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});let n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;let r=this.playlist_,s=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(r&&(r.id?n=r.id:r.uri&&(n=r.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: 326currentTime: ${this.currentTime_()} 327bufferedEnd: ${Cc(this.buffered_())} 328`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!r||r.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}let a=e.mediaSequence-r.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{let l=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!l.parts||!l.parts.length||!l.parts[this.partIndex])){let h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}s&&(s.mediaIndex-=a,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(r,e)}pause(){this.checkBufferTimeout_&&(C.default.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"}))}
328resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ac.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let 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,r=()=>{},s=!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,a=()=>{n--,n===0&&r()};(s||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(s||this.loaderType_==="main")&&(this.gopBuffer_=XE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(let l in this.inbandTextTracks_)mn(e,t,this.inbandTextTracks_[l]);mn(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&C.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.default.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&C.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=C.default.setTimeout(this.monitorBufferTick_.bind(this),QE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();if(!e)return;let t={segmentInfo:or({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_,r=this.partIndex){if(!t||!this.mediaSource_)return!1;let s=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!s||!s.parts||r+1===s.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){let e=this.buffered_(),t=Cc(e)||0,r=Nd(e,this.currentTime_()),s=!this.hasPlayed_()&&r>=1,n=r>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let l={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(l.isSyncRequest)l.mediaIndex=YE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${l.mediaIndex}`);else if(this.mediaIndex!==null){let T=a[this.mediaIndex],E=typeof this.partIndex=="number"?this.partIndex:-1;l.startOfSegment=T.end?T.end:t,T.parts&&T.parts[E+1]?(l.mediaIndex=this.mediaIndex,l.partIndex=E+1):l.mediaIndex=this.mediaIndex+1}else{let T,E,w,y=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: 329For TargetTime: ${y}. 330CurrentTime: ${this.currentTime_()} 331BufferedEnd: ${t} 332Fetch At Buffer: ${this.fetchAtBuffer_} 333`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let I=this.getSyncInfoFromMediaSequenceSync_(y);if(!I){let A="No sync info found while using media sequence sync";return this.error({message:A,metadata:{errorType:O.Error.StreamingFailedToSelectNextSegment,error:new Error(A)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${I.start} --> ${I.end})`),T=I.segmentIndex,E=I.partIndex,w=I.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");let I=gt.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:y,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=I.segmentIndex,E=I.partIndex,w=I.startTime}l.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${y}`:`currentTime ${y}`,l.mediaIndex=T,l.startOfSegment=w,l.partIndex=E,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${l.mediaIndex} `)}let h=a[l.mediaIndex],f=h&&typeof l.partIndex=="number"&&h.parts&&h.parts[l.partIndex];if(!h||typeof l.partIndex=="number"&&!f)return null;typeof l.partIndex!="number"&&h.parts&&(l.partIndex=0,f=h.parts[0]);let g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!r&&f&&!g&&!f.independent)if(l.partIndex===0){let T=a[l.mediaIndex-1],E=T.parts&&T.parts.length&&T.parts[T.parts.length-1];E&&E.independent&&(l.mediaIndex-=1,l.partIndex=T.parts.length-1,l.independent="previous segment")}else h.parts[l.partIndex-1].independent&&(l.partIndex-=1,l.independent="previous part");let _=this.mediaSource_&&this.mediaSource_.readyState==="ended";return l.mediaIndex>=a.length-1&&_&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,l.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(l))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let r=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!r)return null;if(!r.isAppended)return r;let s=this.mediaSequenceSync_.getSyncInfoForTime(r.end);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(e){let{independent:t,playlist:r,mediaIndex:s,startOfSegment:n,isSyncRequest:a,partIndex:l,forceTimestampOffset:h,getMediaInfoForTime:f}=e,g=r.segments[s],_=typeof l=="number"&&g.parts[l],T={requestId:"segment-loader-"+Math.random(),uri:_&&_.resolvedUri||g.resolvedUri,mediaIndex:s,partIndex:_?l:null,isSyncRequest:a,startOfSegment:n,playlist:r,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:_&&_.duration||g.duration,segment:g,part:_,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},E=typeof h<"u"?h:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:E});
333let w=Cc(this.sourceUpdater_.audioBuffered());return typeof w=="number"&&(T.audioAppendStart=w-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=GE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return eC(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),r=e.bandwidth,s=this.pendingSegment_.duration,n=gt.estimateSegmentRequestTime(s,r,this.playlist_,e.bytesReceived),a=xS(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;let l=ME({main:this.vhs_.playlists.main,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!l)return;let f=n-a-l.rebufferingImpact,g=.5;a<=Jt&&(g=1),!(!l.playlist||l.playlist.uri===this.playlist_.uri||f<g)&&(this.bandwidth=l.playlist.attributes.BANDWIDTH*Fe.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Xr(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){let{hasAudio:r,hasVideo:s}=t,n={segmentInfo:or({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:r,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},KE(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Pi(this))))}handleTimingInfo_(e,t,r,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let n=this.pendingSegment_,a=t0(t);n[a]=n[a]||{},n[a][r]=s,this.logger_(`timinginfo: ${t} - ${r} - ${s}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Pi(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}let s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};let l=n[a.stream];l.startTime=Math.min(l.startTime,a.startTime+s),l.endTime=Math.max(l.endTime,a.endTime+s),l.captions.push(a)}),Object.keys(n).forEach(a=>{let{startTime:l,endTime:h,captions:f}=n[a],g=this.inbandTextTracks_;this.logger_(`adding cues from ${l} -> ${h} for ${a}`),FE(g,this.vhs_.tech_,a),mn(l,h,g[a]),UE({captionArray:f,inbandTextTracks:g,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,r));return}this.addMetadataToTextTrack(r,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;let e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!fd({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;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:r,hasVideo:s,isMuxed:n}=t;return!(s&&!e.videoTimingInfo||r&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||fd({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_()){Pi(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}let r=this.pendingSegment_;if(this.setTimeMapping_(r.timeline),this.updateMediaSecondsLoaded_(r.part||r.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),r.segment.map=e.map),e.key&&this.segmentKey(e.ke
333y,!0),r.isFmp4=e.isFmp4,r.timingInfo=r.timingInfo||{},r.isFmp4)this.trigger("fmp4"),r.timingInfo.start=r[t0(t.type)].start;else{let s=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&s&&s.hasVideo,a;n&&(a=r.videoTimingInfo.start),r.timingInfo.start=this.trueSegmentStart_({currentStart:r.timingInfo.start,playlist:r.playlist,mediaIndex:r.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:r.videoTimingInfo,audioTimingInfo:r.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(r,t.type),this.updateSourceBufferTimestampOffset_(r),r.isSyncRequest){this.updateTimingInfoEnd_(r),this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});let s=this.chooseNextRequest_();if(s.mediaIndex!==r.mediaIndex||s.partIndex!==r.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}r.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(r,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:r,playlist:s}){if(r){let n=ll(r);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r},s){let n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+lr(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+lr(a).join(", "));let l=n.length?n.start(0):0,h=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,g=a.length?a.end(a.length-1):0;if(h-l<=fn&&g-f<=fn){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${r.byteLength}, audio buffer: ${lr(n).join(", ")}, video buffer: ${lr(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:r}));let T=this.currentTime_()-fn;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 ${fn}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=C.default.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},fn*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:r},s){if(s){if(s.code===f_){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:r});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error({message:`${t} append of ${r.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:O.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:r,data:s,bytes:n}){if(!n){let l=[s],h=s.byteLength;r&&(l.unshift(r),h+=r.byteLength),n=BE({bytes:h,segments:l})}let a={segmentInfo:or({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,r){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=r.prependedContentDuration||0,s[n].transmuxedPresentationStart=r.start.presentation,s[n].transmuxedDecodeStart=r.start.decode,s[n].transmuxedPresentationEnd=r.end.presentation,s[n].transmuxedDecodeEnd=r.end.decode,s[n].baseMediaDecodeTime=r.baseMediaDecodeTime}appendData_(e,t){let{type:r,data:s}=t;if(!s||!s.byteLength||r==="audio"&&this.audioDisabled_)return;let n=this.getInitSegmentAndUpdateState_({type:r,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:r,initSegment:n,data:s})}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_()){Pi(this),this.loadQueue_.push(()=>{let t=we({},e,{forceTimestampOffset:!0});we(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}));
333let t=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=r||s&&n;this.logger_(`Requesting 334${F_(e.uri)} 335${Xr(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=OE({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:l,level:h,stream:f})=>{this.logger_(`${Xr(e)} logged from transmuxer stream ${f} as a ${h}: ${l}`)},triggerSegmentEventFn:({type:l,segment:h,keyInfo:f,trackInfo:g,timingInfo:_})=>{let E={segmentInfo:or({segment:h})};f&&(E.keyInfo=f),g&&(E.trackInfo=g),_&&(E.timingInfo=_),this.trigger({type:l,metadata:E})}})}trimBackBuffer_(e){let t=ZE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){let t=e.segment,r=e.part,s=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:r?r.resolvedUri:t.resolvedUri,byterange:r?r.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:s,isMediaInitialization:n},l=e.playlist.segments[e.mediaIndex-1];if(l&&l.timeline===t.timeline&&(l.videoTimingInfo?a.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(a.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),t.key){let h=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=h}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<co){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${co}`);return}let r={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:r}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,r){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,r));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===ei.ABORTED)return;if(this.pause(),e.code===ei.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}let s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,r.gopInfo&&(this.gopBuffer_=WE(this.gopBuffer_,r.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}setTimeMapping_(e){let t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:r,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:l,audioTimingInfo:h}){if(typeof e<"u")return e;if(!a)return h.start;let f=t.segments[r-1];return r===0||!f||typeof f.start>"u"||f.end!==s+n?s:l.start}waitForAppendsToComplete_(e){let 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}let{hasAudio:r,hasVideo:s,isMuxed:n}=t,a=this.loaderType_==="main"&&s,l=!this.audioDisabled_&&r&&!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++,l&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),l&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}
335checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){let 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:r}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:r.start:r.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),s=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;s&&(e.timingInfo.end=typeof s.end=="number"?s.end:s.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let h={segmentInfo:or({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:h})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}let 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"});let t=sC(e,this.sourceType_);if(t&&(t.severity==="warn"?O.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 ${Xr(e)}`);return}this.logger_(`Appended ${Xr(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");let r=e.segment,s=e.part,n=r.end&&this.currentTime_()-r.end>e.playlist.targetDuration*3,a=s&&s.end&&this.currentTime_()-s.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Xr(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<co){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${co}`);return}let t=this.throughput.rate,r=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/r*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,r=t.start,s=t.end;if(!e0(r)||!e0(s))return;mn(r,s,this.segmentMetadataTrack_);let n=C.default.WebKitDataCue||C.default.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.ur
335i,timeline:e.timeline,playlist:e.playlist.id,start:r,end:s},l=JSON.stringify(a),h=new n(r,s,l);h.value=a,this.segmentMetadataTrack_.addCue(h)}};function pi(){}var U_=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},nC=["video","audio"],pd=(i,e)=>{let t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},aC=(i,e)=>{for(let t=0;t<e.length;t++){let r=e[t];if(r.type==="mediaSource")return null;if(r.type===i)return t}return null},ns=(i,e)=>{if(e.queue.length===0)return;let t=0,r=e.queue[t];if(r.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),r.action(e),r.doneFn&&r.doneFn(),ns("audio",e),ns("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||pd(i,e))){if(r.type!==i){if(t=aC(i,e.queue),t===null)return;r=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=r,r.action(i,e),!r.doneFn){e.queuePending[i]=null,ns(i,e);return}}},V_=(i,e)=>{let t=e[`${i}Buffer`],r=U_(i);t&&(t.removeEventListener("updateend",e[`on${r}UpdateEnd_`]),t.removeEventListener("error",e[`on${r}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},Yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Tt={appendBuffer:(i,e,t)=>(r,s)=>{let n=s[`${r}Buffer`];if(Yt(s.mediaSource,n)){s.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${r}Buffer`);try{n.appendBuffer(i)}catch(a){s.logger_(`Error with code ${a.code} `+(a.code===f_?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${r}Buffer`),s.queuePending[r]=null,t(a)}}},remove:(i,e)=>(t,r)=>{let s=r[`${t}Buffer`];if(Yt(r.mediaSource,s)){r.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{s.remove(i,e)}catch{r.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{let r=t[`${e}Buffer`];Yt(t.mediaSource,r)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),r.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){O.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){O.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;let t=e[`${i}Buffer`];if(Yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(r){O.log.warn(`Failed to abort on ${i}Buffer`,r)}}},addSourceBuffer:(i,e)=>t=>{let r=U_(i),s=ir(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);let n=t.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",t[`on${r}UpdateEnd_`]),n.addEventListener("error",t[`on${r}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{let t=e[`${i}Buffer`];if(V_(i,e),!!Yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(r){O.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,r)}}},changeType:i=>(e,t)=>{let r=t[`${e}Buffer`],s=ir(i);if(!Yt(t.mediaSource,r))return;let n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;let h={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:h}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{r.changeType(s),t.codecs[e]=i}catch(f){h.errorType=O.Error.StreamingCodecsChangeError,h.error=f,f.metadata=h,t.error_=f,t.trigger("error"),O.log.warn(`Failed to changeType on ${e}Buffer`,f)}}},xt=({type:i,sourceUpdater:e,action:t,doneFn:r,name:s})=>{e.queue.push({type:i,action:t,doneFn:r,name:s}),ns(i,e)},r0=(i,e)=>t=>{let r=e[`${i}Buffered`](),s=vS(r);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,s),e.queuePending[i]){let n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}ns(i,e)},ul=class extends O.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>ns("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ot("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=r0("video",this),this.onAudioUpdateEnd_=r0("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())}
335triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){xt({type:"mediaSource",sourceUpdater:this,action:Tt.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){xt({type:e,sourceUpdater:this,action:Tt.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){O.log.error("removeSourceBuffer is not supported!");return}xt({type:"mediaSource",sourceUpdater:this,action:Tt.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!O.browser.IS_FIREFOX&&C.default.MediaSource&&C.default.MediaSource.prototype&&typeof C.default.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return C.default.SourceBuffer&&C.default.SourceBuffer.prototype&&typeof C.default.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){O.log.error("changeType is not supported!");return}xt({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=>{let r=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,r);this.canChangeType()&&this.changeType(t,r)})}appendBuffer(e,t){let{segmentInfo:r,type:s,bytes:n}=e;if(this.processedAppend_=!0,s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}let a=t;if(xt({type:s,sourceUpdater:this,action:Tt.appendBuffer(n,r||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),s==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let l=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${l.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,l.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return Yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ue()}videoBuffered(){return Yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ue()}buffered(){let e=Yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():TS(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=pi){xt({type:"mediaSource",sourceUpdater:this,action:Tt.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=pi){typeof e!="string"&&(e=void 0),xt({type:"mediaSource",sourceUpdater:this,action:Tt.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,r=pi){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){r();return}xt({type:"audio",sourceUpdater:this,action:Tt.remove(e,t),doneFn:r,name:"remove"})}removeVideo(e,t,r=pi){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){r();return}xt({type:"video",sourceUpdater:this,action:Tt.remove(e,t),doneFn:r,name:"remove"})}updating(){return!!(pd("audio",this)||pd("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(xt({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&&(xt({type:"video",sourceUpdater:this,action:Tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&xt({type:"audio",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&xt({type:"video",sourceUpdater:this,action:Tt.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),nC.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>V_(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}},s0=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),oC=i=>{let e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},n0=new Uint8Array(` 336 337`.split("").map(i=>
337i.charCodeAt(0))),md=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},gd=class extends Hn{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ue();let e=this.subtitlesTrack_.cues,t=e[0].startTime,r=e[e.length-1].startTime;return Ue([[t,r]])}initSegmentForMap(e,t=!1){if(!e)return null;let r=ll(e),s=this.initSegments_[r];if(t&&!s&&e.bytes){let n=n0.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(n0,e.bytes.byteLength),this.initSegments_[r]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return s||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){mn(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){let 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,r){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===ei.TIMEOUT&&this.handleTimeout_(),e.code===ei.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}let s=this.pendingSegment_,n=r.mp4VttCues&&r.mp4VttCues.length;n&&(s.mp4VttCues=r.mp4VttCues),this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");let a=s.segment;if(a.map&&(a.map.bytes=t.map.bytes),s.bytes=t.bytes,typeof C.default.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,r),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(s)}catch(l){this.stopForError({message:l.message,metadata:{errorType:O.Error.StreamingVttParserError,error:l}});return}if(n||this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,s.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new C.default.VTTCue(l.startTime,l.endTime,l.text):l)}),zE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){let r=e&&e.type==="vtt",s=t&&t.type==="text";r&&s&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(r=>{let s=r.start+t,n=r.end+t,a=new C.default.VTTCue(s,n,r.cueText);r.settings&&r.settings.split(" ").forEach(l=>{let h=l.split(":"),f=h[0],g=h[1];a[f]=isNaN(g)?g:Number(g)}),e.cues.push(a)})}parseVTTCues_(e){let t,r=!1;if(typeof C.default.WebVTT!="function")throw new md;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof C.default.TextDecoder=="function"?t=new C.default.TextDecoder("utf8"):(t=C.default.WebVTT.StringDecoder(),r=!0);let s=new C.default.WebVTT.Parser(C.default,C.default.vttjs,t);if(s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=a=>{e.timestampmap=a},s.onparsingerror=a=>{O.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;r&&(a=s0(a)),s.parse(a)}let n=e.bytes;r&&(n=s0(n)),s.parse(n),s.flush()}updateTimeMapping_(e,t,r){let s=e.segment;if(!t)return;if(!e.cues.length){s.empty=!0;return}let{MPEGTS:n,LOCAL:a}=e.timestampmap,h=n/Mi.ONE_SECOND_IN_TS-a+t.mapping;
337if(e.cues.forEach(f=>{let g=f.endTime-f.startTime,_=this.handleRollover_(f.startTime+h,t.time);f.startTime=Math.max(_,0),f.endTime=Math.max(_+g,0)}),!r.syncInfo){let f=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;r.syncInfo={mediaSequence:r.mediaSequence+e.mediaIndex,time:Math.min(f,g-s.duration)}}}handleRollover_(e,t){if(t===null)return e;let r=e*Mi.ONE_SECOND_IN_TS,s=t*Mi.ONE_SECOND_IN_TS,n;for(s<r?n=-8589934592:n=8589934592;Math.abs(r-s)>4294967296;)r+=n;return r/Mi.ONE_SECOND_IN_TS}},lC=function(i,e){let t=i.cues;for(let r=0;r<t.length;r++){let s=t[r];if(e>=s.adStartTime&&e<=s.adEndTime)return s}return null},uC=function(i,e,t=0){if(!i.segments)return;let r=t,s;for(let n=0;n<i.segments.length;n++){let a=i.segments[n];if(s||(s=lC(e,r+a.duration/2)),s){if("cueIn"in a){s.endTime=r,s.adEndTime=r,r+=a.duration,s=null;continue}if(r<s.endTime){r+=a.duration;continue}s.endTime+=a.duration}else if("cueOut"in a&&(s=new C.default.VTTCue(r,r+a.duration,a.cueOut),s.adStartTime=r,s.adEndTime=r+parseFloat(a.cueOut),e.addCue(s)),"cueOutCont"in a){let[l,h]=a.cueOutCont.split("/").map(parseFloat);s=new C.default.VTTCue(r,r+a.duration,""),s.adStartTime=r-l,s.adEndTime=s.adStartTime+h,e.addCue(s)}r+=a.duration}},cl=class{constructor({start:e,end:t,segmentIndex:r,partIndex:s=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=r,this.partIndex_=s,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}},_d=class{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}},dl=class{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){let{mediaSequence:r,segments:s}=e;if(this.isReliable_=this.isReliablePlaylist_(r,s),!!this.isReliable_)return this.updateStorage_(s,r,this.calculateBaseTime_(r,s,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:r}of this.storage_.values())if(r.length){for(let s of r)if(s.isInRange(e))return s}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,r){let s=new Map,n=` 338`,a=r,l=t;this.start_=a,e.forEach((h,f)=>{let g=this.storage_.get(l),_=a,T=_+h.duration,E=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),w=new cl({start:_,end:T,appended:E,segmentIndex:f});h.syncInfo=w;let y=a,I=(h.parts||[]).map((A,P)=>{let k=y,L=y+A.duration,R=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[P]&&g.partsSyncInfo[P].isAppended),U=new cl({start:k,end:L,appended:R,segmentIndex:f,partIndex:P});return y=L,n+=`Media Sequence: ${l}.${P} | Range: ${k} --> ${L} | Appended: ${R} 339`,A.syncInfo=U,U});s.set(l,new _d(w,I)),n+=`${F_(h.resolvedUri)} | Media Sequence: ${l} | Range: ${_} --> ${T} | Appended: ${E} 340`,l++,a=T}),this.end_=a,this.storage_=s,this.diagnostics_=n}calculateBaseTime_(e,t,r){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let s=Math.min(...this.storage_.keys());if(e<s){let n=s-e,a=this.storage_.get(s).segmentSyncInfo.start;for(let l=0;l<n;l++){let h=t[l];a-=h.duration}return a}return r}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}},hl=class extends dl{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,r){if(!this.storage_.size){let s=this.parent_.getSyncInfoForMediaSequence(e);return s?s.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,r)}},cC=86400,Dc=[{name:"VOD",run:(i,e,t,r,s)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,r,s,n)=>{let a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;let l=a.getSyncInfoForTime(s);return l?{time:l.start,partIndex:l.partIndex,segmentIndex:l.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,r,s)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null,l=ad(e);s=s||0;for(let h=0;h<l.length;h++){let f=e.endList||s===0?h:l.length-(h+1),g=l[f],_=g.segment,T=i.timelineToDatetimeMappings[_.timeline];if(!T||!_.dateTimeObject)continue;let w=_.dateTimeObject.getTime()/1e3+T;if(_.parts&&typeof g.partIndex=="number")for(let I=0;I<g.partIndex;I++)w+=_.parts[I].duration;let y=Math.abs(s-w);if(a!==null&&(y===0||a<y))break;a=y,n={time:w,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}return n}},{name:"Segment",run:(i,e,t,r,s)=>{let n=null,a=null;s=s||0;let l=ad(e);for(let h=0;h<l.length;h++){let f=e.endList||s===0?h:l.length-(h+1),g=l[f],_=g.segment,T=g.part&&g.part.start||_&&_.start;if(_.timeline===r&&typeof T<"u"){let E=Math.abs(s-T);if(a!==null&&a<E)break;(!n||a===null||a>=E)&&(a=E,n={time:T,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,r,s)=>{let n=null;if(s=s||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let l=0;l<e.discontinuityStarts.length;l++){let h=e.discontinuityStarts[l],f=e.discontinuitySequence+l+1,g=i.discontinuities[f];if(g){let _=Math.abs(s-g.time);if(a!==null&&a<_)break;(!n||a===null||a>=_)&&(a=_,n={time:g.time,segmentIndex:h,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,r,s)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}],yd=class extends O.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new dl,r=new hl(t),s=new hl(t);this.mediaSequenceStorage_={main:t,audio:r,vtt:s},this.logger_=Ot("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,r,s,n){if(t!==1/0)return Dc.find(({name:h})=>h==="VOD").run(this,e,t);let a=this.runStrategies_(e,t,r,s,n);if(!a.length)return null;for(let l of a){let{syncPoint:h,strategy:f}=l,{segmentIndex:g,time:_}=h;if(g<0)continue;let T=e.segments[g],E=_,w=E+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${s}. selected segment: ${g}. Time: [${E} -> ${w}]}`),s>=E&&s<w)return this.logger_("Found sync point with exact match: ",h),h}return this.selectSyncPoint_(a,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments)return null;let r=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!r.length)return null;let s=this.selectSyncPoint_(r,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+vn({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,r,s,n){let a=[];for(let l=0;l<Dc.length;l++){let h=Dc[l],f=h.run(this,e,t,r,s,n);f&&(f.strategy=h.name,a.push({strategy:h.name,syncPoint:f}))}return a}selectSyncPoint_(e,t){let r=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){let l=Math.abs(e[a].syncPoint[t.key]-t.value);l<s&&(s=l,r=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${r.time}, segmentIndex:${r.segmentIndex}`+(typeof r.partIndex=="number"?`,partIndex:${r.partIndex}`:"")+"]"),r}saveExpiredSegmentInfo(e,t){let r=t.mediaSequence-e.mediaSequence;if(r>cC){O.log.warn(`Not saving expired segment info. Media sequence gap ${r} is too large.`);return}for(let s=r-1;s>=0;s--){let n=e.segments[s];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+s,time:n.start}
340,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){let t=e.segments[0],r=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-r}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let r=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;r&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));let n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.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,r){let s=e.segment,n=e.part,a=this.timelines[e.timeline],l,h;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},r&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),l=e.startOfSegment,h=t.end+a.mapping;else if(a)l=t.start+a.mapping,h=t.end+a.mapping;else return!1;return n&&(n.start=l,n.end=h),(!s.start||l<s.start)&&(s.start=l),s.end=h,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,r=e.segment;if(r.discontinuity)this.discontinuities[r.timeline]={time:r.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let s=0;s<t.discontinuityStarts.length;s++){let n=t.discontinuityStarts[s],a=t.discontinuitySequence+s+1,l=n-e.mediaIndex,h=Math.abs(l);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>h){let f;l<0?f=r.start-vn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=r.end+vn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}},vd=class extends O.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:r}){return typeof t=="number"&&typeof r=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:r}){if(typeof t=="number"&&typeof r=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:r},delete this.pendingTimelineChanges_[e];let s={timelineChangeInfo:{from:t,to:r}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}},dC=A_(D_(function(){var i=function(){function y(){this.listeners={}}var I=y.prototype;return I.on=function(P,k){this.listeners[P]||(this.listeners[P]=[]),this.listeners[P].push(k)},I.off=function(P,k){if(!this.listeners[P])return!1;var L=this.listeners[P].indexOf(k);return this.listeners[P]=this.listeners[P].slice(0),this.listeners[P].splice(L,1),L>-1},I.trigger=function(P){var k=this.listeners[P];if(k)if(arguments.length===2)for(var L=k.length,R=0;R<L;++R)k[R].call(this,arguments[1]);else for(var U=Array.prototype.slice.call(arguments,1),N=k.length,V=0;V<N;++V)k[V].apply(this,U)},I.dispose=function(){this.listeners={}},I.pipe=function(P){this.on("data",function(k){P.push(k)})},y}();function e(y){return y.subarray(0,y.byteLength-y[y.byteLength-1])}let t=function(){let y=[[[],[],[],[],[]],[[],[],[],[],[]]],I=y[0],A=y[1],P=I[4],k=A[4],L,R,U,N=[],V=[],X,fe,ee,me,G,re;for(L=0;L<256;L++)V[(N[L]=L<<1^(L>>7)*283)^L]=L;for(R=U=0;!P[R];R^=X||1,U=V[U]||1)for(me=U^U<<1^U<<2^U<<3^U<<4,me=me>>8^me&255^99,P[R]=me,k[me]=R,ee=N[fe=N[X=N[R]]],re=ee*16843009^fe*65537^X*25
3407^R*16843008,G=N[me]*257^me*16843008,L=0;L<4;L++)I[L][R]=G=G<<24^G>>>8,A[L][me]=re=re<<24^re>>>8;for(L=0;L<5;L++)I[L]=I[L].slice(0),A[L]=A[L].slice(0);return y},r=null;class s{constructor(I){r||(r=t()),this._tables=[[r[0][0].slice(),r[0][1].slice(),r[0][2].slice(),r[0][3].slice(),r[0][4].slice()],[r[1][0].slice(),r[1][1].slice(),r[1][2].slice(),r[1][3].slice(),r[1][4].slice()]];let A,P,k,L=this._tables[0][4],R=this._tables[1],U=I.length,N=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");let V=I.slice(0),X=[];for(this._key=[V,X],A=U;A<4*U+28;A++)k=V[A-1],(A%U===0||U===8&&A%U===4)&&(k=L[k>>>24]<<24^L[k>>16&255]<<16^L[k>>8&255]<<8^L[k&255],A%U===0&&(k=k<<8^k>>>24^N<<24,N=N<<1^(N>>7)*283)),V[A]=V[A-U]^k;for(P=0;A;P++,A--)k=V[P&3?A:A-4],A<=4||P<4?X[P]=k:X[P]=R[0][L[k>>>24]]^R[1][L[k>>16&255]]^R[2][L[k>>8&255]]^R[3][L[k&255]]}decrypt(I,A,P,k,L,R){let U=this._key[1],N=I^U[0],V=k^U[1],X=P^U[2],fe=A^U[3],ee,me,G,re=U.length/4-2,Ye,ne=4,ke=this._tables[1],si=ke[0],zi=ke[1],Gi=ke[2],Wi=ke[3],Xi=ke[4];for(Ye=0;Ye<re;Ye++)ee=si[N>>>24]^zi[V>>16&255]^Gi[X>>8&255]^Wi[fe&255]^U[ne],me=si[V>>>24]^zi[X>>16&255]^Gi[fe>>8&255]^Wi[N&255]^U[ne+1],G=si[X>>>24]^zi[fe>>16&255]^Gi[N>>8&255]^Wi[V&255]^U[ne+2],fe=si[fe>>>24]^zi[N>>16&255]^Gi[V>>8&255]^Wi[X&255]^U[ne+3],ne+=4,N=ee,V=me,X=G;for(Ye=0;Ye<4;Ye++)L[(3&-Ye)+R]=Xi[N>>>24]<<24^Xi[V>>16&255]<<16^Xi[X>>8&255]<<8^Xi[fe&255]^U[ne++],ee=N,N=V,V=X,X=fe,fe=ee}}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(I){this.jobs.push(I),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}let a=function(y){return y<<24|(y&65280)<<8|(y&16711680)>>8|y>>>24},l=function(y,I,A){let P=new Int32Array(y.buffer,y.byteOffset,y.byteLength>>2),k=new s(Array.prototype.slice.call(I)),L=new Uint8Array(y.byteLength),R=new Int32Array(L.buffer),U,N,V,X,fe,ee,me,G,re;for(U=A[0],N=A[1],V=A[2],X=A[3],re=0;re<P.length;re+=4)fe=a(P[re]),ee=a(P[re+1]),me=a(P[re+2]),G=a(P[re+3]),k.decrypt(fe,ee,me,G,R,re),R[re]=a(R[re]^U),R[re+1]=a(R[re+1]^N),R[re+2]=a(R[re+2]^V),R[re+3]=a(R[re+3]^X),U=fe,N=ee,V=me,X=G;return L};class h{constructor(I,A,P,k){let L=h.STEP,R=new Int32Array(I.buffer),U=new Uint8Array(I.byteLength),N=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(R.subarray(N,N+L),A,P,U)),N=L;N<R.length;N+=L)P=new Uint32Array([a(R[N-4]),a(R[N-3]),a(R[N-2]),a(R[N-1])]),this.asyncStream_.push(this.decryptChunk_(R.subarray(N,N+L),A,P,U));this.asyncStream_.push(function(){k(null,e(U))})}static get STEP(){return 32e3}decryptChunk_(I,A,P,k){return function(){let L=l(I,A,P);k.set(L,I.byteOffset)}}}var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g;typeof window<"u"?g=window:typeof f<"u"?g=f:typeof self<"u"?g=self:g={};var _=g,T=function(I){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(I):I&&I.buffer instanceof ArrayBuffer},E=_.BigInt||Number;E("0x1"),E("0x100"),E("0x10000"),E("0x1000000"),E("0x100000000"),E("0x10000000000"),E("0x1000000000000"),E("0x100000000000000"),E("0x10000000000000000"),function(){var y=new Uint16Array([65484]),I=new Uint8Array(y.buffer,y.byteOffset,y.byteLength);return I[0]===255?"big":I[0]===204?"little":"unknown"}();let w=function(y){let I={};return Object.keys(y).forEach(A=>{let P=y[A];T(P)?I[A]={bytes:P.buffer,byteOffset:P.byteOffset,byteLength:P.byteLength}:I[A]=P}),I};self.onmessage=function(y){let I=y.data,A=new Uint8Array(I.encrypted.bytes,I.encrypted.byteOffset,I.encrypted.byteLength),P=new Uint32Array(I.key.bytes,I.key.byteOffset,I.key.byteLength/4),k=new Uint32Array(I.iv.bytes,I.iv.byteOffset,I.iv.byteLength/4);new h(A,P,k,function(L,R){self.postMessage(w({source:I.source,decrypted:R}),[R.buffer])})}})),hC=w_(dC),fC=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},q_=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},bd=(i,e)=>{e.activePlaylistLoader=i,i.load()},pC=(i,e)=>()=>{let{segmentLoaders:{[i]:t,main:r},mediaTypes:{[i]:s}}=e,n=s.activeTrack(),a=s.getActiveGroup(),l=s.activePlaylistLoader,h=s.lastGroup_;if(!(a&&h&&a.id===h.id)&&(s.lastGroup_=a,s.lastTrack_=n,q_(t,s),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){l&&r.resetEverything();return}t.resyncLoader(),bd(a.playlistLoader,s)}},mC=(i,e)=>()=>{let{segmentLoaders:{[i]:t},mediaTypes:{[i]:r}}=e;r.lastGroup_=null,t.abort(),t.pause()},gC=(i,e)=>()=>{let{mainPlaylistLoader:t,segmentLoaders:{[i]:r,main:s},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),l=n.getActiveGroup(),h=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=l,n.lastTrack_=a,q_(r,n),!!l)){if(l.isMainPlaylist){if(!a||!f||a.id===f.id)return;let g=e.vhs.playlistController_,_=g.selectPlaylist();if(g.media()===_)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),s.resetEverything(),g.fastQualityChange_(_);return}if(i==="AUDIO"){if(!l.playlistLoader){s.setAudio(!0),s.resetEverything();return}r.setAudio(!0),s.setAudio(!1)}if(h===l.playlistLoader){bd(l.playlistLoader,n);return}r.track&&r.track(a),r.resetEverything(),bd(l.playlistLoader,n)}},fl={AUDIO:(i,e)=>()=>{let{mediaTypes:{[i]:t},excludePlaylist:r}=e,s=t.activeTrack(),n=t.activeGroup(),a=(n.filter(h=>h.default)[0]||n[0]).id,l=t.tracks[a];if(s===l){r({error:{message:"Problem encountered loading the default audio track."}});return}O.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(let h in t.tracks)t.tracks[h].enabled=t.tracks[h]===l;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{let{mediaTypes:{[i]:t}}=e;O.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let r=t.activeTrack();r&&(r.mode="disabled"),t.onTrackChanged()}},a0={AUDIO:(i,e,t)=>{if(!e)return;let{tech:r,requestOptions:s,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{let a=e.media();n.playlist(a,s),(!r.paused()||a.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),r.paused()||n.load()}),e.on("error",fl[i](i,t))},SUBTITLES:(i,e,t)=>{let{tech:r,requestOptions:s,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{let l=e.media();n.playlist(l,s),n.track(a.activeTrack()),(!r.paused()||l.endList&&r.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),s),r.paused()||n.load()}),e.on("error",fl[i](i,t))}},_C={AUDIO:(i,e)=>{let{vhs:t,sourceType:r,segmentLoaders:{[i]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:l,tracks:h,logger_:f}},mainPlaylistLoader:g}=e,_=zn(g.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},_&&(a[i].main.default.playlists=g.main.playlists));for(let T in a[i]){l[T]||(l[T]=[]);for(let E in a[i][T]){let w=a[i][T][E],y;if(_?(f(`AUDIO group '${T}' label '${E}' is a main playlist`),w.isMainPlaylist=!0,y=null):r==="vhs-json"&&w.playlists?y=new Ni(w.playlists[0],t,n):w.resolvedUri?y=new Ni(w.resolvedUri,t,n):w.playlists&&r==="dash"?y=new jn(w.playlists[0],t,n,g):y=null,w=oe({id:E,playlistLoader:y},w),a0[i](i,w.playlistLoader,e),l[T].push(w),typeof h[E]>"u"){let I=new O.AudioTrack({id:E,kind:fC(w),enabled:!1,language:w.language,default:w.default,label:E});h[E]=I}}}s.on("error",fl[i](i,e))},SUBTITLES:(i,e)=>{let{tech:t,vhs:r,sourceType:s,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:l},mediaTypes:{[i]:{groups:h,tracks:f}},mainPlaylistLoader:g}=e;for(let _ in l[i]){h[_]||(h[_]=[]);for(let T in l[i][_]){if(!r.options_.useForcedSubtitles&&l[i][_][T].forced)continue;let E=l[i][_][T],w;if(s==="hls")w=new Ni(E.resolvedUri,r,a);else if(s==="dash"){if(!E.playlists.filter(I=>I.excludeUntil!==1/0).length)return;w=new jn(E.playlists[0],r,a,g)}else s==="vhs-json"&&(w=new Ni(E.playlists?E.playlists[0]:E.resolvedUri,r,a));if(E=oe({id:T,playlistLoader:w},E),a0[i](i,E.playlistLoader,e),h[_].push(E),typeof f[T]>"u"){let y=t.addRemoteTextTrack({id:T,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:T},!1).track;f[T]=y}}}n.on("error",fl[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{let{tech:t,main:{mediaGroups:r},mediaTypes:{[i]:{groups:s,tracks:n}}}=e;for(let a in r[i]){s[a]||(s[a]=[]);for(let l in r[i][a]){let h=r[i][a][l];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;let f=t.options_.vhs&&t.options_.vhs.captionServices||{},g={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(f[g.instreamId]&&(g=oe(g,f[g.instreamId])),g.default===void 0&&delete g.default,s[a].push(oe({id:l},h)),typeof n[l]>
340"u"){let _=t.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;n[l]=_}}}}},j_=(i,e)=>{for(let t=0;t<i.length;t++)if(Ud(e,i[t])||i[t].playlists&&j_(i[t].playlists,e))return!0;return!1},yC=(i,e)=>t=>{let{mainPlaylistLoader:r,mediaTypes:{[i]:{groups:s}}}=e,n=r.media();if(!n)return null;let a=null;n.attributes[i]&&(a=s[n.attributes[i]]);let l=Object.keys(s);if(!a)if(i==="AUDIO"&&l.length>1&&zn(e.main))for(let h=0;h<l.length;h++){let f=s[l[h]];if(j_(f,n)){a=f;break}}else s.main?a=s.main:l.length===1&&(a=s[l[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(h=>h.id===t.id)[0]||null},vC={AUDIO:(i,e)=>()=>{let{mediaTypes:{[i]:{tracks:t}}}=e;for(let r in t)if(t[r].enabled)return t[r];return null},SUBTITLES:(i,e)=>()=>{let{mediaTypes:{[i]:{tracks:t}}}=e;for(let r in t)if(t[r].mode==="showing"||t[r].mode==="hidden")return t[r];return null}},bC=(i,{mediaTypes:e})=>()=>{let t=e[i].activeTrack();return t?e[i].activeGroup(t):null},TC=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{_C[f](f,i)});let{mediaTypes:e,mainPlaylistLoader:t,tech:r,vhs:s,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=yC(f,i),e[f].activeTrack=vC[f](f,i),e[f].onGroupChanged=pC(f,i),e[f].onGroupChanging=mC(f,i),e[f].onTrackChanged=gC(f,i),e[f].getActiveGroup=bC(f,i)});let l=e.AUDIO.activeGroup();if(l){let f=(l.filter(_=>_.default)[0]||l[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});let h=()=>{e.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",h),r.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",h),r.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(let f in e.AUDIO.tracks)r.audioTracks().addTrack(e.AUDIO.tracks[f])},xC=()=>{let i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:pi,activeTrack:pi,getActiveGroup:pi,onGroupChanged:pi,onTrackChanged:pi,lastTrack_:null,logger_:Ot(`MediaGroups[${e}]`)}}),i},pl=class{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_=mt(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_}},Td=class extends O.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new pl,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_=Ot("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";let r=t.serverUri||t.serverURL;if(!r){this.logger_(`steering manifest URL is ${r}, cannot request steering manifest.`),this.trigger("error");return}if(r.startsWith("data:")){this.decodeDataUriManifest_(r.substring(r.indexOf(",")+1));return}this.steeringManifest.reloadUri=mt(e,r),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let r=e?t:this.getRequestURI(t);if(!r){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}let s={contentSteeringInfo:{uri:r}};this.trigger({type:"contentsteeringloadstart",metadata:s}),this.request_=this.xhr_({uri:r,requestType:"content-steering-manifest"},(n,a)=>
340{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${r} this session.`),this.excludedSteeringManifestURLs.add(r);return}if(a.status===429){let f=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${f} seconds.`),this.startTTLTimeout_(parseInt(f,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let l;try{l=JSON.parse(this.request_.responseText)}catch(f){let g={errorType:O.Error.StreamingContentSteeringParserError,error:f};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(l);let h={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new C.default.URL(e),r=new C.default.URL(this.proxyServerUrl_);return r.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(r.toString())}decodeDataUriManifest_(e){let t=JSON.parse(C.default.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new C.default.URL(e),r=this.getPathway(),s=this.getBandwidth_();if(r){let n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,r)}if(s){let n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,s)}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());let r=(s=>{for(let n of s)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==r&&(this.currentPathway=r,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=s=>this.excludedSteeringManifestURLs.has(s);if(this.proxyServerUrl_){let s=this.setProxyServerUrl_(e);if(!t(s))return s}let r=this.setSteeringParams_(e);return t(r)?null:r}startTTLTimeout_(e=this.steeringManifest.ttl){let t=e*1e3;this.ttlTimeout_=C.default.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){C.default.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 pl}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&&(mt(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}},SC=(i,e)=>{let t=null;return(...r)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,r)},e)}},EC=10,Oi,CC=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],wC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},AC=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:r,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:l,log:h}
340){if(!r)return O.log.warn("We received no playlist to switch to. Please check your stream."),!1;let f=`allowing switch ${i&&i.id||"null"} -> ${r.id}`;if(!i)return h(`${f} as current playlist is not set`),!0;if(r.id===i.id)return!1;let g=!!Yr(e,t).length;if(!i.endList)return!g&&typeof i.partTargetDuration=="number"?(h(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(h(`${f} as current playlist is live`),!0);let _=Nd(e,t),T=l?Fe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Fe.MAX_BUFFER_LOW_WATER_LINE;if(a<T)return h(`${f} as duration < max low water line (${a} < ${T})`),!0;let E=r.attributes.BANDWIDTH,w=i.attributes.BANDWIDTH;if(E<w&&(!l||_<n)){let y=`${f} as next bandwidth < current bandwidth (${E} < ${w})`;return l&&(y+=` and forwardBuffer < bufferHighWaterLine (${_} < ${n})`),h(y),!0}if((!l||E>w)&&_>=s){let y=`${f} as forwardBuffer >= bufferLowWaterLine (${_} >= ${s})`;return l&&(y+=` and next bandwidth > current bandwidth (${E} > ${w})`),h(y),!0}return h(`not ${f} as no switching criteria met`),!1},xd=class extends O.EventTarget{constructor(e){super(),this.fastQualityChange_=SC(this.fastQualityChange_.bind(this),100);let{src:t,withCredentials:r,tech:s,bandwidth:n,externVhs:a,useCueTags:l,playlistExclusionDuration:h,enableLowInitialPlaylist:f,sourceType:g,cacheEncryptionKeys:_,bufferBasedABR:T,leastPixelDiffSelector:E,captionServices:w,experimentalUseMMS:y}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:I}=e;(I===null||typeof I>"u")&&(I=1/0),Oi=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!E,this.withCredentials=r,this.tech_=s,this.vhs_=s.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=l,this.playlistExclusionDuration=h,this.maxPlaylistRetries=I,this.enableLowInitialPlaylist=f,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:r,maxPlaylistRetries:I,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=xC(),y&&C.default.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new C.default.ManagedMediaSource,this.usingManagedMediaSource_=!0,O.log("Using ManagedMediaSource")):C.default.MediaSource&&(this.mediaSource=new C.default.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Ue(),this.hasPlayed_=!1,this.syncController_=new yd(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new hC,this.sourceUpdater_=new ul(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new vd,this.keyStatusMap_=new Map;let A={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:w,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:_,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new jn(t,this.vhs_,oe(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ni(t,this.vhs_,oe(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Hn(oe(A,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Hn(oe(A,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new gd(oe(A,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((L,R)=>{function U(){s.off("vttjserror",N),L()}function N(){s.off("vttjsloaded",U),R()}s.one("vttjsloaded",U),s.one("vttjserror",N),s.addWebVttScript_()})}),e);let P=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new Td(this.vhs_.xhr,P),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),CC.forEach(L=>{this[L+"_"]=wC.bind(this,L)}),this.logger_=Ot("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;let k=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(k,()=>{let L=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-L,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,r){let s=this.media(),n=s&&(s.id||s.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);let l={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:l}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,r)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e
340=>{let t=this.mediaTypes_[e],r=t?t.activeGroup():null,s=this.contentSteeringController_.getPathway();if(r&&s){let a=(r.length?r[0].playlists:r.playlists).filter(l=>l.attributes.serviceLocation===s);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=C.default.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(C.default.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;let r=e.mediaGroups.AUDIO,s=Object.keys(r),n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{let l=r.main||s.length&&r[s[0]];for(let h in l)if(l[h].default){n={label:h};break}}if(!n)return t;let a=[];for(let l in r)if(r[l][n.label]){let h=r[l][n.label];if(h.playlists&&h.playlists.length)a.push.apply(a,h.playlists);else if(h.uri)a.push(h);else if(e.playlists.length)for(let f=0;f<e.playlists.length;f++){let g=e.playlists[f];g.attributes&&g.attributes.AUDIO&&g.attributes.AUDIO===l&&a.push(g)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{let t=this.mainPlaylistLoader_.media(),r=t.targetDuration*1.5*1e3;od(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,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 r;if(this.enableLowInitialPlaylist&&(r=this.selectInitialPlaylist()),r||(r=this.selectPlaylist()),!r||!this.shouldSwitchToMedia_(r)||(this.initialMedia_=r,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{let 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",()=>{let t=this.mainPlaylistLoader_.media(),r=t.targetDuration*1.5*1e3;od(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=r,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let 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,r=>{this.player_.trigger(we({},r))})})}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){let r=e.mediaGroups||{},s=!0,n=Object.keys(r.AUDIO);for(let a in r.AUDIO)for(let l in r.AUDIO[a])r.AUDIO[a][l].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(r.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Oi.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(r.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){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pen
vendor: 1,326 bytes, line 340
340dingMedia_,r=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return AC({buffered:a,currentTime:r,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,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",()=>{let r=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:r.playlist,error:r})}),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",()=>
340{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{let r=this.audioSegmentLoader_.pendingSegment_;if(!r||!r.segment||!r.segment.syncInfo)return;let s=r.segment.syncInfo.end+.01;this.tech_.setCurrentTime(s)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",r=>{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:EC}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let r=this.getCodecsOrExclude_();r&&this.sourceUpdater_.addOrChangeSourceBuffers(r)};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",()=>
340{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(r=>{this.mainSegmentLoader_.on(r,s=>{this.player_.trigger(we({},s))}),this.audioSegmentLoader_.on(r,s=>{this.player_.trigger(we({},s))}),this.subtitleSegmentLoader_.on(r,s=>{this.player_.trigger(we({},s))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let r=t.end(0),s=r;if(e.start){let n=e.start.timeOffset;n<0?s=Math.max(r+n,t.start(0)):s=Math.min(r,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let 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){let 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;let r=this.syncController_.getExpiredTime(e,this.duration());if(r===null)return!1;let s=Oi.Playlist.playlistEnd(e,r),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return s-n<=Zt;let l=a.end(a.length-1);return l-n<=Zt&&s-l<=Zt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:r}){if(e=e||this.mainPlaylistLoader_.media(),r=r||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;let s=this.mainPlaylistLoader_.main.playlists,n=s.filter(kl),a=n.length===1&&n[0]===e;if(s.length===1&&r!==1/0)return O.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){let w=this.pathwayAttribute_(e),y=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(w),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(w)},y);return}let E=!1;
340s.forEach(w=>{if(w===e)return;let y=w.excludeUntil;typeof y<"u"&&y!==1/0&&(E=!0,delete w.excludeUntil)}),E&&(O.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let l;e.playlistErrors_>this.maxPlaylistRetries?l=1/0:l=Date.now()+r*1e3,e.excludeUntil=l,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let h=this.selectPlaylist();if(!h){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}let f=t.internal?this.logger_:O.log.warn,g=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);let _=h.targetDuration/2*1e3||5*1e3,T=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=_;return this.switchMedia_(h,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let r=[],s=e==="all";(s||e==="main")&&r.push(this.mainPlaylistLoader_);let n=[];(s||e==="audio")&&n.push("AUDIO"),(s||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{let l=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;l&&r.push(l)}),["main","audio","subtitle"].forEach(a=>{let l=this[`${a}SegmentLoader_`];l&&(e===a||e==="all")&&r.push(l)}),r.forEach(a=>t.forEach(l=>{typeof a[l]=="function"&&a[l]()}))}setCurrentTime(e){let t=Yr(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;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Oi.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let r=e.media();if(!r)return null;let s=this.syncController_.getMediaSequenceSync(t);if(s&&s.isReliable){let l=s.start,h=s.end;if(!isFinite(l)||!isFinite(h))return null;let f=Oi.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r),g=Math.max(l,h-f);return Ue([[l,g]])}let n=this.syncController_.getExpiredTime(r,this.duration());if(n===null)return null;let a=Oi.Playlist.seekable(r,n,Oi.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,r));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;let r=e.start(0),s=e.end(0),n=t.start(0),a=t.end(0);return n>s||r>a?e:Ue([[Math.max(r,n),Math.min(s,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;let r=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||r&&r.length&&this.seekable_.length&&r.start(0)===this.seekable_.start(0)&&r.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${e_(this.seekable_)}]`);let s={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:s}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){let s=this.seekable();if(!s.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<s.end(s.length-1))&&this.sourceUpdater_.setDuration(s.end(s.length-1));return}let t=this.tech_.buffered(),r=Oi.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(r=Math.max(r,t.end(t.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}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
340=>{let t=this.mediaTypes_[e].groups;for(let r in t)t[r].forEach(s=>{s.playlistLoader&&s.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_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),r=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!r)}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;let r=bn(this.main(),t),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=r.video||e.main.videoCodec||Fp),e.main.isMuxed&&(s.video+=`,${r.audio||e.main.audioCodec||Mu}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(s.audio=r.audio||e.main.audioCodec||e.audio.audioCodec||Mu,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}let a=(f,g)=>f?Lr(g,this.usingManagedMediaSource_):Ha(g),l={},h;if(["video","audio"].forEach(function(f){if(s.hasOwnProperty(f)&&!a(e[f].isFmp4,s[f])){let g=e[f].isFmp4?"browser":"muxer";l[g]=l[g]||[],l[g].push(s[f]),f==="audio"&&(h=g)}}),n&&h&&t.attributes.AUDIO){let f=t.attributes.AUDIO;
340this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===f&&g!==t&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${h} does not support codec(s): "${s.audio}"`)}if(Object.keys(l).length){let f=Object.keys(l).reduce((g,_)=>(g&&(g+=", "),g+=`${_} does not support codec(s): "${l[_].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let f=[];if(["video","audio"].forEach(g=>{let _=(Ut(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,T=(Ut(s[g]||"")[0]||{}).type;_&&T&&_.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[g]}" -> "${s[g]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(r=>{let s=e[r];if(t.indexOf(s.id)!==-1)return;t.push(s.id);let n=bn(this.main,s),a=[];n.audio&&!Ha(n.audio)&&!Lr(n.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${n.audio}`),n.video&&!Ha(n.video)&&!Lr(n.video,this.usingManagedMediaSource_)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){let t=[],r=this.main().playlists,s=qn(Ut(e)),n=zg(s),a=s.video&&Ut(s.video)[0]||null,l=s.audio&&Ut(s.audio)[0]||null;Object.keys(r).forEach(h=>{let f=r[h];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);let g=[],_=bn(this.mainPlaylistLoader_.main,f),T=zg(_);if(!(!_.audio&&!_.video)){if(T!==n&&g.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){let E=_.video&&Ut(_.video)[0]||null,w=_.audio&&Ut(_.audio)[0]||null;E&&a&&E.type.toLowerCase()!==a.type.toLowerCase()&&g.push(`video codec "${E.type}" !== "${a.type}"`),w&&l&&w.type.toLowerCase()!==l.type.toLowerCase()&&g.push(`audio codec "${w.type}" !== "${l.type}"`)}g.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let t=0,r=this.seekable();r.length&&(t=r.start(0)),uC(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=Fe.GOAL_BUFFER_LENGTH,r=Fe.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Fe.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*r,s)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=Fe.BUFFER_LOW_WATER_LINE,r=Fe.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Fe.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Fe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*r,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Fe.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Zg(this.inbandTextTracks_,"com.apple.streaming",this.tech_),$E({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,r){let s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Zg(this.inbandTextTracks_,e,this.tech_),qE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:r})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let 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()})}}
340resetContentSteeringController_(){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,r=>{this.trigger(we({},r))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{let t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{let n=this.contentSteeringController_.getAvailablePathways(),a=[];for(let l of t.playlists){let h=l.attributes.serviceLocation;if(h&&(a.push(h),!n.has(h)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let r=this.main().playlists,s=new Set,n=!1;Object.keys(r).forEach(a=>{let l=r[a],h=this.pathwayAttribute_(l),f=h&&e!==h;l.excludeUntil===1/0&&l.lastExcludeReason_==="content-steering"&&!f&&(delete l.excludeUntil,delete l.lastExcludeReason_,n=!0);let _=!l.excludeUntil&&l.excludeUntil!==1/0;!s.has(l.id)&&f&&_&&(s.add(l.id),l.excludeUntil=1/0,l.lastExcludeReason_="content-steering",this.logger_(`excluding ${l.id} for ${l.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{let l=this.mediaTypes_[a];if(l.activePlaylistLoader){let h=l.activePlaylistLoader.media_;h&&h.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){let t=this.main().playlists,r=this.contentSteeringController_.currentPathwayClones,s=this.contentSteeringController_.nextPathwayClones;if(r&&r.size||s&&s.size){for(let[a,l]of r.entries())s.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(l),this.contentSteeringController_.excludePathway(a));for(let[a,l]of s.entries()){let h=r.get(a);if(!h){t.filter(g=>
340g.attributes["PATHWAY-ID"]===l["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(l,g)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(h,l)||(this.mainPlaylistLoader_.updateOrDeleteClone(l,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;let r=e["URI-REPLACEMENT"].PARAMS,s=t["URI-REPLACEMENT"].PARAMS;for(let n in r)if(r[n]!==s[n])return!1;for(let n in s)if(r[n]!==s[n])return!1;return!0}changeSegmentPathway_(){let 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,t="non-usable";
340this.mainPlaylistLoader_.main.playlists.forEach(r=>{let s=this.mainPlaylistLoader_.getKeyIdSet(r);!s||!s.size||s.forEach(n=>{let a="usable",l=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,h=r.lastExcludeReason_===t&&r.excludeUntil===1/0;l?l&&h&&(delete r.excludeUntil,delete r.lastExcludeReason_,this.logger_(`enabling playlist ${r.id} because key ID ${n} is ${a}`)):(r.excludeUntil!==1/0&&r.lastExcludeReason_!==t&&(r.excludeUntil=1/0,r.lastExcludeReason_=t,this.logger_(`excluding playlist ${r.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(r=>{let s=r&&r.attributes&&r.attributes.RESOLUTION&&r.attributes.RESOLUTION.height<720,n=r.excludeUntil===1/0&&r.lastExcludeReason_===t;s&&n&&(delete r.excludeUntil,O.log.warn(`enabling non-HD playlist ${r.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let n=(typeof e=="string"?e:oC(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_()}},DC=(i,e,t)=>r=>{let s=i.main.playlists[e],n=Fd(s),a=kl(s);if(typeof r>"u")return a;r?delete s.disabled:s.disabled=!0;let l={renditionInfo:{id:e,bandwidth:s.attributes.BANDWIDTH,resolution:s.attributes.RESOLUTION,codecs:s.attributes.CODECS},cause:"fast-quality"};return r!==a&&!n&&(r?(t(s),i.trigger({type:"renditionenabled",metadata:l})):i.trigger({type:"renditiondisabled",metadata:l})),r},Sd=class{constructor(e,t,r){let{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);if(t.attributes){let 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=bn(s.main(),t),this.playlist=t,this.id=r,this.enabled=DC(e.playlists,t.id,n)}},IC=function(i){i.representations=()=>{let e=i.playlistController_.main(),t=zn(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(r=>!Fd(r)).map((r,s)=>new Sd(i,r,r.id)):[]}},o0=["seeking","seeked","pause","playing","error"],Ed=class extends O.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_=Ot("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),r=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,l=["main","subtitle","audio"],h={};l.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},a[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});let f=g=>{["main","audio"].forEach(_=>{a[`${_}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(o0,n),this.tech_.on("canplay",r),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(o0,n),this.tech_.off("canplay",r),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),l.forEach(g=>{a[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),a[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&C.default.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&C.default.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=C.default.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let 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){let t=this.playlistController_,r=t[`${e}SegmentLoader_`],s=r.buffered_(),n=SS(this[`${e}Buffered_`],s);if(this[`${e}Buffered_`]=s,n){let a={bufferedRanges:s};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:r.playlist_&&r.playlist_.id,buffered:lr(s)}),!(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;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Zt>=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(Ue([this.lastRecordedTime,e]));let r={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:r}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let t=this.seekable(),r=this.tech_.currentTime(),s=this.afterSeekableWindow_(t,r,this.media(),this.allowSeeksWithinUnsafeLiveWindow),n;if(s&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,r)){let w=t.start(0);n=w+(w===t.end(0)?0:Zt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${r} with seekable range ${e_(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;let a=this.playlistController_.sourceUpdater_,l=this.tech_.buffered(),h=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,g=this.media(),_=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Jt)*2,T=[h,f];for(let w=0;w<T.length;w++){if(!T[w])continue;if(Nd(T[w],r)<_)return!1}let E=lo(l,r);return E.length===0?!1:(n=E.start(0)+Zt,this.logger_(`Buffered region starts (${E.start(0)}) just beyond seek point (${r}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=this.tech_.buffered(),r=Yr(t,e);if(r.length&&e+3<=r.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${r.start(0)} -> ${r.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;
340if(this.beforeSeekableWindow_(e,t)){let l=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${l}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(l),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let r=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let a=lo(s,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,r,s=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Zt,a=!r.endList,l=typeof r.partTargetDuration=="number";return a&&(l||s)&&(n=e.end(e.length-1)+r.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:r}){if(!e)return;let s;if(e.length&&t.length){let n=Yr(e,r-3),a=Yr(e,r),l=Yr(t,r);l.length&&!a.length&&n.length&&(s={start:n.end(0),end:l.end(0)})}else lo(e,r).length||(s=this.gapFromVideoUnderflow_(e,r));return s?(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${r}`),!0):!1}skipTheGap_(e){let t=this.tech_.buffered(),r=this.tech_.currentTime(),s=lo(t,r);if(this.resetTimeUpdate_(),s.length===0||r!==e)return;this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Jt);let n={gapInfo:{from:r,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){let r=bS(e);for(let s=0;s<r.length;s++){let n=r.start(s),a=r.end(s);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}},kC={errorInterval:30,getSource(i){let t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},H_=function(i,e){let t=0,r=0,s=oe(kC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let n=function(){r&&i.currentTime(r)},a=function(g){g!=null&&(r=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(g),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},l=function(){if(Date.now()-t<s.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!s.getSource||typeof s.getSource!="function"){O.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),s.getSource.call(i,a)},h=function(){i.off("loadedmetadata",n),i.off("error",l),i.off("dispose",h)},f=function(g){h(),H_(i,g)};i.on("error",l),i.on("dispose",h),i.reloadSourceOnError=f},PC=function(i){H_(this,i)},$_="3.17.2",OC="7.1.0",LC="1.3.1",RC="7.2.0",MC="4.0.2",Ae={PlaylistLoader:Ni,Playlist:gt,utils:KS,STANDARD_PLAYLIST_SELECTOR:Jg,INITIAL_PLAYLIST_SELECTOR:NE,lastBandwidthSelector:Jg,movingAverageBandwidthSelector:RE,comparePlaylistBandwidth:qd,comparePlaylistResolution:LE,xhr:v_()};Object.keys(Fe).forEach(i=>{Object.defineProperty(Ae,i,{get(){return O.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Fe[i]},set(e){if(O.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){O.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Fe[i]=e}})});var z_="videojs-vhs",G_=function(i,e){let t=e.media(),r=-1;for(let s=0;s<i.length;s++)if(i[s].id===t.id){r=s;break}i.selectedIndex_=r,i.trigger({selectedIndex:r,type:"change"})},NC=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),G_(i,e.playlists)};Ae.canPlaySource=function(){return O.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};var BC=(i,e,t)=>{if(!i)return i;let r={};e&&e.attributes&&e.attributes.CODECS&&(r=qn(Ut(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(r.audio=t.attributes.CODECS);let s=ir(r.video),n=ir(r.audio),a={};for(let l in i)a[l]={},n&&(a[l].audioContentType=n),s&&(a[l].videoContentType=s),e.contentProtection&&e.contentProtection[l]&&e.contentProtection[l].pss
340h&&(a[l].pssh=e.contentProtection[l].pssh),typeof i[l]=="string"&&(a[l].url=i[l]);return oe(i,a)},FC=(i,e)=>i.reduce((t,r)=>{if(!r.contentProtection)return t;let s=e.reduce((n,a)=>{let l=r.contentProtection[a];return l&&l.pssh&&(n[a]={pssh:l.pssh}),n},{});return Object.keys(s).length&&t.push(s),t},[]),UC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:r})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();let s=t?r.concat([t]):r,n=FC(s,Object.keys(e)),a=[],l=[];return n.forEach(h=>{l.push(new Promise((f,g)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,g)=>{i.eme.initializeMediaKeys({keySystems:h},_=>{if(_){g(_);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(l)])},VC=({player:i,sourceKeySystems:e,media:t,audioMedia:r})=>{let s=BC(e,t,r);return s?(i.currentSource().keySystems=s,s&&!i.eme?(O.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},W_=()=>{if(!C.default.localStorage)return null;let i=C.default.localStorage.getItem(z_);if(!i)return null;try{return JSON.parse(i)}catch{return null}},qC=i=>{if(!C.default.localStorage)return!1;let e=W_();e=e?oe(e,i):i;try{C.default.localStorage.setItem(z_,JSON.stringify(e))}catch{return!1}return e},jC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,X_=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},K_=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Y_=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Q_=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};Ae.supportsNativeHls=function(){if(!q.default||!q.default.createElement)return!1;let i=q.default.createElement("video");return O.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();Ae.supportsNativeDash=function(){return!q.default||!q.default.createElement||!O.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(q.default.createElement("video").canPlayType("application/dash+xml"))}();Ae.supportsTypeNatively=i=>i==="hls"?Ae.supportsNativeHls:i==="dash"?Ae.supportsNativeDash:!1;Ae.isSupported=function(){return O.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Ae.xhr.onRequest=function(i){X_(Ae.xhr,i)};Ae.xhr.onResponse=function(i){K_(Ae.xhr,i)};Ae.xhr.offRequest=function(i){Y_(Ae.xhr,i)};Ae.xhr.offResponse=function(i){Q_(Ae.xhr,i)};var HC=O.getComponent("Component"),ml=class extends HC{constructor(e,t,r){if(super(t,r.vhs),typeof r.initialBandwidth=="number"&&(this.options_.bandwidth=r.initialBandwidth),this.logger_=Ot("VhsHandler"),t.options_&&t.options_.playerId){let s=O.getPlayer(t.options_.playerId);this.player_=s}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(q.default,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],s=>{let n=q.default.fullscreenElement||q.default.webkitFullscreenElement||q.default.mozFullScreenElement||q.default.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_=oe(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||
340!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){let r=W_();r&&r.bandwidth&&(this.options_.bandwidth=r.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),r&&r.throughput&&(this.options_.throughput=r.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Fe.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Fe.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(r=>{typeof this.source_[r]<"u"&&(this.options_[r]=this.source_[r])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let 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=jC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Ae,this.options_.sourceType=Nu(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new xd(this.options_);let r=oe({liveRangeSafeTimeDelta:Zt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Ed(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{let n=O.players[this.tech_.options_.playerId],a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});let s=this.options_.bufferBasedABR?Ae.movingAverageBandwidthSelector(.55):Ae.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.playlistController_.selectInitialPlaylist=Ae.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,a=C.default.navigator.connection||C.default.navigator.mozConnection||C.default.navigator.webkitConnection,l=1e7;if(this.options_.useNetworkInformationApi&&a){let h=a.downlink*1e3*1e3;h>=l&&n>=l?n=Math.max(n,h):n=h}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let n=1/(this.bandwidth||1),a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){O.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>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:()=>lr(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:()=>lr(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&&qC({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_=C.default.URL.createObjectURL(this.playlistController_.mediaSource),(O.browser.IS_ANY_SAFARI||O.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),UC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media ke
340ys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=VC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",r=>{this.playlistController_.updatePlaylistByKeyStatus(r.keyId,r.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){let e=O.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{NC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{G_(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":$_,"mux.js":OC,"mpd-parser":LC,"m3u8-parser":RC,"aes-decrypter":MC}}version(){return this.constructor.version()}canChangeType(){return ul.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_&&C.default.URL.revokeObjectURL&&(C.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return iE({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,r=!0,s=2){return E_({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:r,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{X_(this.xhr,e)},this.xhr.onResponse=e=>{K_(this.xhr,e)},this.xhr.offRequest=e=>{Y_(this.xhr,e)},this.xhr.offResponse=e=>{Q_(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){let e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(r=>{this.playlistController_.on(r,s=>{this.player_.trigger(we({},s))})}),t.forEach(r=>{this.playbackWatcher_.on(r,s=>{this.player_.trigger(we({},s))})})}},gl={name:"videojs-http-streaming",VERSION:$_,canHandleSource(i,e={}){let t=oe(O.options,e);return!t.vhs.experimentalUseMMS&&!Lr("avc1.4d400d,mp4a.40.2",!1)?!1:gl.canPlayType(i.type,t)},handleSource(i,e,t={}){let r=oe(O.options,t);return e.vhs=new ml(i,e,r),e.vhs.xhr=v_(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){let t=Nu(i);if(!t)return"";let r=gl.getOverrideNative(e);return!Ae.supportsTypeNatively(t)||r?"maybe":""},getOverrideNative(i={}){let{vhs:e={}}=i,t=!(O.browser.IS_ANY_SAFARI||O.browser.IS_IOS),{overrideNative:r=t}=e;return r}},$C=()=>Lr("avc1.4d400d,mp4a.40.2",!0);$C()&&O.getTech("Html5").registerSourceHandler(gl,0);O.VhsHandler=ml;O.VhsSourceHandler=gl;O.Vhs=Ae;O.use||O.registerComponent("Vhs",Ae);O.options.vhs=O.options.vhs||{};(!O.getPlugin||!O.getPlugin("reloadSourceOnError"))&&O.registerPlugin("reloadSourceOnError",PC);var zC=["audioRef"],GC=["targetVideoPlayer"],WC=()=>({width:"80px",height:"80px"}),XC=i=>({"fila-seleccionada":i});function KC(i,e){i&1&<(0,"i",35)}function YC(i,e){i&1&<(0,"i",36)}function QC(i,e){if(i&1){let t=$t();te(0,"div",8)(1,"div",28)(2,"button",29),Bt("click",function(){_e(t);let s=Q();return ye(s.togglePlay())}),ot(3,KC,1,0,"i",30)(4,YC,1,0,"i",31),ie(),te(5,"div",32)(6,"p-slider",33),$h("ngModelChange",function(s){_e(t);let n=Q();return Hh(n.currentTime,s)||(n.currentTime=s),ye(s)}),Bt("onChange",function(s){_e(t);let n=Q();return ye(n.seekAudio(s.value))}),ie()(),te(7,"div",34)(8,"span"),ae(9),ie(),te(10,"span"),ae(11),ie()()()()}if(i&2){let t=Q();$(3),Z("ngIf",!t.isPlaying),$(),Z("ngIf",t.isPlaying),$(2),Z("min",0)("max",t.audioDuration),jh("ngModel",t.currentTime),$(3),Ft(t.formatTime(t.currentTime)),$(2),Ft(t.formatTime(t.audioDuration))}}function JC(i,e){if(i&1&&(te(0,"tr")(1,"th"),ae(2,"N\xB0"),ie(),te(3,"th"),ae(4),ie(),te(5,"th"),ae(6,"Descripci\xF3n"),ie()()),i&2){let t=Q(3);$(4),Ft(t.fecPubReglamento?"Fecha de Publicaci\xF3n":"Fecha de Presentaci\xF3n")}}function ZC(i,e){if(i&1){let t=$t();te(0,"tr",42)(1,"td"),ae(2),ie(),te(3,"td"),ae(4),Gh(5,"date"),ie(),te(6,"td")(7,"a",43),Bt("click",function(){let s=_e(t),n=s.$implicit,a=s.rowIndex,l=Q(3);return ye(l.verPdfInforme(n,a))}),ae(8),ie()()()}if(i&2){let t=e.$implicit,r=e.rowIndex,s=Q(3);
340Z("ngClass",Fs(7,XC,s.filaSeleccionadaIndex===r)),$(2),Ft(r+1),$(2),Ft(Wh(5,4,t.fechaPresentacion,"dd/MM/yyyy")),$(4),wr(" ",t.asunto," ")}}function ew(i,e){if(i&1&&(te(0,"div",37)(1,"p-table",39),ot(2,JC,7,1,"ng-template",40)(3,ZC,9,9,"ng-template",41),ie()()),i&2){let t=Q(2);$(),Z("value",t.archivoPdfInforme)("scrollable",!0)}}function tw(i,e){if(i&1&&(xr(0,ew,4,2,"div",37),lt(1,"ngx-extended-pdf-viewer",38)),i&2){let t=Q();Sr(t.contieneInforme()||t.contieneReglamentacion()?0:-1),$(),Z("height","100vh")("zoom","page-fit")("src",t.urlPdfBlob)("textLayer",!0)("showHandToolButton",!0)("filenameForDownload","ley.pdf")("showToolbar",!0)("showSidebarButton",!0)("showFindButton",!1)("showPagingButtons",!0)("showSignatureEditor",!1)("showHighlightEditor",!1)("showDrawEditor",!1)("showStampEditor",!1)("showTextEditor",!1)("showZoomButtons",!0)("showPresentationModeButton",!1)("showOpenFileButton",!1)("showPrintButton",!0)("showDownloadButton",!0)("showSecondaryToolbarButton",!0)("showMovePageButton",!1)("showRotateButton",!1)("showRotateCwButton",!1)("showRotateCcwButton",!1)("showHandToolButton",!1)("showScrollingButtons",!1)("showSpreadButton",!1)("showPropertiesButton",!0)}}var J_=class i{constructor(e,t){this.http=e;this.zone=t;Aa(()=>{this.cargarMenu()})}itemMenu=Oa;tipoRecursoObjeto=La;audioRef;targetVideoPlayer;player;urlAudioUrlBlob="";urlVideoUrlBlob="";isPlaying=!1;currentTime=0;audioDuration=0;fecPubReglamento=!1;contienePDF=yt(!1);contieneAudio=yt(!1);contieneVideo=yt(!1);contieneInforme=yt(!1);contieneReglamentacion=yt(!1);ngAfterViewInit(){let e=this.audioRef.nativeElement;e.onloadedmetadata=()=>{this.audioDuration=e.duration},e.ontimeupdate=()=>{this.zone.run(()=>{this.currentTime=e.currentTime})},this.player=O(this.targetVideoPlayer.nativeElement,{controls:!0,autoplay:!1,preload:"auto",fluid:!0,responsive:!0,sources:[{src:"",type:"video/mp4"}]})}ngOnDestroy(){this.player&&this.player.dispose()}togglePlay(){let e=this.audioRef.nativeElement;this.isPlaying?(e.pause(),this.isPlaying=!1):e.play().then(()=>{this.isPlaying=!0}).catch(t=>{console.warn("No se pudo reproducir el audio:",t)})}seekAudio(e){this.audioRef.nativeElement.currentTime=e}formatTime(e){let t=Math.floor(e/60),r=Math.floor(e%60);return`${t}:${r<10?"0"+r:r}`}playAudio(e){e.play().catch(t=>console.log("No se puede reproducir:",t))}urlPdfBlob="";actRoute=wt(tf);router=wt(rf);expedienteService=wt(Na);recursoService=wt(wf);loading=yt(!1);expediente=yt(null);menuSeleccionado=yt(null);menuActions={[this.itemMenu.es_ley]:()=>this.getRecMenuLey(this.itemMenu.es_ley),[this.itemMenu.es_texto]:()=>this.getRecMenuTexto(this.itemMenu.es_texto),[this.itemMenu.es_reglamentacion]:()=>this.getRecMenuReglamentacion(this.itemMenu.es_reglamentacion),[this.itemMenu.es_informe]:()=>this.getRecMenuInforme(this.itemMenu.es_informe),[this.itemMenu.es_ficha_tecnica]:()=>this.getRecMenuFichaTecnica(this.itemMenu.es_ficha_tecnica),[this.itemMenu.es_exp_proy_ley]:()=>this.getRecMenuExpProyLey(this.itemMenu.es_exp_proy_ley),[this.itemMenu.es_transcripcion]:()=>this.getRecMenuTranscripciones(this.itemMenu.es_transcripcion),[this.itemMenu.es_diario_debates]:()=>this.getRecMenuDiarioDebates(this.itemMenu.es_diario_debates),[this.itemMenu.es_videoteca]:()=>this.getRecMenuVideoteca(this.itemMenu.es_videoteca),[this.itemMenu.es_ficha_tecnica_quechua]:()=>this.getRecMenuFichaTecnicaLengQuechua(this.itemMenu.es_ficha_tecnica_quechua),[this.itemMenu.es_ficha_tecnica_leng_senas]:()=>this.getRecMenuFichaTecnicaLengSenas(this.itemMenu.es_ficha_tecnica_leng_senas),[this.itemMenu.es_fe_erratas]:()=>this.getRecMenuFeErratas(this.itemMenu.es_fe_erratas),[this.itemMenu.es_ficha_tecnica_audio]:()=>this.getRecMenuFichaTecnicaAudio(this.itemMenu.es_ficha_tecnica_audio),[this.itemMenu.es_ficha_tecnica_quechua_audio]:()=>this.getFichaTecnicaQuechuaAudio(this.itemMenu.es_ficha_tecnica_quechua_audio)};cargarMenu(){let e=this.menuSeleccionado();if(e!==null){let t=this.menuActions[e];t?t():console.warn("Opci\xF3n de men\xFA no manejada:",e)}}ngOnInit(){let e=this.actRoute.snapshot.paramMap.get("numley");if(this.limpiarUrbBlobs(),e){let t=parseInt(e);this.ObtieneExpediente(t)}else this.router.navigate(["/legislacion1904"])}isSidebarHidden=!0;toggleSidebar(){this.isSidebarHidden=!this.isSidebarHidden}ObtieneExpediente(e){this.loading.set(!0),this.expedienteService.obtenerExpediente(e).subscribe({next:t=>{this.expediente.set(t),this.loading.set(!1)},error:t=>{console.error("Error cargando leyes:",t),this.loading.set(!1)}})}obtenerUrlPdf(e){if(this.contienePDF.set(!1),this.expediente()!=null){let t=this.expediente()?.recursos.find(r=>r.tipoRecursoLeyItemMenu==e&&r.tipoRecursoObjeto==this.tipoRecursoObjeto.pdf);if(!t){console.log("No se encontr\xF3 recurso PDF para el tipo de men\xFA:",e);return}t.esRepoAlfresco?t.enlace&&(this.contienePDF.set(!0),this.loading.set(!0),this.recursoService.obtenerRecursoAlfresco(t.enlace).subscribe({next:r=>{this.urlPdfBlob=URL.createObjectURL(new Blob([r],{type:"application/pdf"})),this.loading.set(!1)},error:r=>{console.error("Error cargando recurso:",r),this.loading.set(!1)}})):t.enlace&&(this.contienePDF.set(!0),this.loading.set(!0),this.recursoService.obtenerRecurso(t.enlace).subscribe({next:r=>{this.urlPdfBlob=URL.createObjectURL(new Blob([r],{type:"application/pdf"})),this.loading.set(!1)},error:r=>{console.error("Error cargando recurso:",r),this.loading.set(!1)}}))}}obtenerUrlAudio(e){if(this.contieneAudio.set(!1),this.expediente()!=null){let t=this.expediente()?.recursos.find(r=>r.tipoRecursoLeyItemMenu==e&&r.tipoRecursoObjeto==this.tipoRecursoObjeto.audio)?.enlace??"";t&&(this.contieneAudio.set(!0),this.loading.set(!0),this.recursoService.obtenerRecurso(t).subscribe({next:r=>{this.urlAudioUrlBlob=URL.createObjectURL(new Blob([r],{type:"audio/mpeg"})),this.loading.set(!1)},error:r=>{console.error("Error cargando recurso:",r),this.loading.set(!1)}}))}}obtenerUrlVideo(e){if(this.contieneVideo.set(!1),this.expediente()!=null){let t=this.expediente()?.recursos.find(r=>r.tipoRecursoLeyItemMenu==e&&r.tipoRecursoObjeto==this.tipoRecursoObjeto.video)?.enlace??"";t&&(this.contieneVideo.set(!0),this.loading.set(!0),this.recursoService.obtenerRecurso(t).subscribe({next:r=>{this.urlVideoUrlBlob=URL.createObjectURL(new Blob([r],{type:"video/mp4"})),this.loading.set(!1),this.player&&(this.player.src({src:this.urlVideoUrlBlob,type:"video/mp4",controls:!0,autoplay:!1,preload:"auto",fluid:!0,responsive:!0}),this.player.load())},error:r=>{this.loading.set(!1),console.error("Error cargando recurso:",r)}}))}}obtenerUrlPdfDemoLocal(){this.expediente()!=null&&(this.urlPdfBlob=this.expediente()?.recursos.find(e=>e.tipoRecursoLeyItemMenu==Number(1))?.enlace??"",this.getAsOctetStream().subscribe(e=>{this.urlPdfBlob=URL.createObjectURL(e)}))}getAsOctetStream(e="FRONTENDINDEX.pdf"){return this.http.get(e,{responseType:"blob"}).pipe(Ns(t=>new Blob([t],{type:"application/pdf"})))}obtenerUrlAudioDemoLocal(){this.getAsOctetStreamAudio().subscribe(e=>{this.urlAudioUrlBlob=URL.createObjectURL(e)})}getAsOctetStreamAudio(e="SoundHelix-Song-1.mp3"){return this.http.get(e,{responseType:"blob"}).pipe(Ns(t=>new Blob([t],{type:"audio/mpeg"})))}getTieneElemento(e){return this.expediente()?.recursos.some(t=>t.tipoRecursoLeyItemMenu===Number(e))??!1}getObtenerMenuClickeado(e){this.menuSeleccionado.set(e),this.contienePDF.set(!1),this.contieneAudio.set(!1),this.contieneVideo.set(!1),this.player&&this.player.pause()}getRecMenuLey(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e)}getRecMenuTexto(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e)}getRecMenuReglamentacion(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e),this.archivoPdfInforme=this.expediente()?.recursos.filter(t=>t.tipoRecursoLeyItemMenu==3&&t.tipoRecursoObjeto==this.tipoRecursoObjeto.pdf),this.contieneReglamentacion.set((this.expediente()?.recursos?.filter(t=>t.tipoRecursoLeyItemMenu==3&&t.tipoRecursoObjeto==this.tipoRecursoObjeto.pdf)?.length??0)>
3400),this.fecPubReglamento=!0}archivoPdfInforme;getRecMenuInforme(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e),this.archivoPdfInforme=this.expediente()?.recursos.filter(t=>t.tipoRecursoLeyItemMenu==4&&t.tipoRecursoObjeto==this.tipoRecursoObjeto.pdf),this.contieneInforme.set((this.expediente()?.recursos?.filter(t=>t.tipoRecursoLeyItemMenu==4&&t.tipoRecursoObjeto==this.tipoRecursoObjeto.pdf)?.length??0)>0),this.fecPubReglamento=!1}getRecMenuFichaTecnica(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(13)}getRecMenuExpProyLey(e){this.limpiarUrbBlobs();let t=this.expediente()?.recursos.find(r=>r.tipoRecursoLeyItemMenu==e&&r.tipoRecursoObjeto==this.tipoRecursoObjeto.enlace);t&&t.enlace?window.open(t.enlace,"_blank"):this.obtenerUrlPdf(e)}getRecMenuTranscripciones(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e)}getRecMenuDiarioDebates(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e)}getRecMenuVideoteca(e){this.limpiarUrbBlobs(),this.obtenerUrlVideo(e)}getRecMenuFichaTecnicaLengQuechua(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(14)}getRecMenuFichaTecnicaLengSenas(e){this.limpiarUrbBlobs(),this.obtenerUrlVideo(e)}getRecMenuFeErratas(e){this.limpiarUrbBlobs(),this.obtenerUrlPdf(e),this.obtenerUrlAudio(e)}getRecMenuFichaTecnicaAudio(e){this.limpiarUrbBlobs(),this.obtenerUrlAudio(e)}getFichaTecnicaQuechuaAudio(e){this.limpiarUrbBlobs(),this.obtenerUrlAudio(e)}limpiarUrbBlobs(){this.urlPdfBlob="",this.urlAudioUrlBlob="",this.urlVideoUrlBlob="",this.contieneInforme.set(!1),this.contieneReglamentacion.set(!1)}filaSeleccionadaIndex=null;verPdfInforme(e,t){if(this.filaSeleccionadaIndex=t,!e||!e.enlace){console.error("Este item no contiene 'enlace'");return}let r=e.enlace;!r&&r.length==0||(this.loading.set(!0),this.recursoService.obtenerRecurso(r).subscribe({next:s=>{this.urlPdfBlob=URL.createObjectURL(new Blob([s],{type:"application/pdf"}))},error:s=>{console.error("Error cargando recurso desde fila:",s),this.loading.set(!1)},complete:()=>{this.loading.set(!1)}}))}static \u0275fac=function(t){return new(t||i)(su(Ia),su(Sa))};static \u0275cmp=Si({type:i,selectors:[["app-inicio-visor"]],viewQuery:function(t,r){if(t&1&&(Ji(zC,5),Ji(GC,7)),t&2){let s;$e(s=ze())&&(r.audioRef=s.first),$e(s=ze())&&(r.targetVideoPlayer=s.first)}},decls:37,vars:16,consts:[["audioRef",""],["targetVideoPlayer",""],[1,"w-full","text-center","my-4"],[1,"bg-[#e0e0e0]","text-justify","text-2xl","md:text-3xl","font-bold","text-gray-900","titulofondodiv"],[1,"w-full","my-4","flex","flex-col","lg:flex-row","items-start","lg:items-center","justify-between","gap-4"],[1,"flex","items-center","text-2xl","md:text-1xl","font-semibold","text-gray-600","w-full","lg:w-auto",2,"margin-bottom","2px"],["routerLink","/legislacion1904",1,"flex","items-center","text-gray-600","hover:text-gray-900"],[1,"pi","pi-angle-left"],[1,"w-full","lg:w-auto"],[2,"display","none",3,"src"],[1,"flex","flex-col","lg:flex-row","gap-4"],[1,"block","lg:hidden","w-full","p-1","bg-red-600","text-white","text-center",3,"click"],[1,"w-full","flex","justify-center"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor",1,"w-6","h-6"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M4 6h16M4 12h16M4 18h16"],[1,"w-full","lg:w-64","shrink-0","lg:block","transition-all","duration-300","ease-in-out"],[3,"menuClickeado","expediente"],[1,"w-full"],[1,""],[1,"text-center","font-bold","text-slate-800","text-2xl"],[1,"text-justify"],[1,"text-slate-600","text-lg","mb-3"],[1,"my-video"],["id","video-player","controls","","preload","auto","data-setup",'{"fluid": true, "responsive": true, "aspectRatio": "16:9"}',1,"video-js","vjs-default-skin","vjs-big-play-centered"],[1,"custom-loading","items-center","justify-center",3,"blocked"],[1,"loading-content","card","flex","justify-center"],["strokeWidth","4","animationDuration",".7s","ariaLabel","this.loadingText",1,"w-4rem","h-4rem"],[1,"loading-text",2,"display","block"],[1,"max-w-sm","lg:max-w-xs","w-full","p-1","bg-gray-50","rounded-md","shadow","flex","items-center","gap-3"],[1,"text-red-600","hover:text-red-700","transition","text-xs","flex","items-center","justify-center",3,"click"],["class","pi pi-play text-xs",4,"ngIf"],["class","pi pi-pause text-xs",4,"ngIf"],[1,"flex-1","min-w-[100px]"],[1,"h-1",3,"ngModelChange","onChange","min","max","ngModel"],[1,"flex","flex-col","items-end","text-[9px]","text-gray-600","leading-none"],[1,"pi","pi-play","text-xs"],[1,"pi","pi-pause","text-xs"],[1,"max-w-[600px]","mx-auto","mt-4","p-2"],["useBrowserLocale","false",3,"height","zoom","src","textLayer","showHandToolButton","filenameForDownload","showToolbar","showSidebarButton","showFindButton","showPagingButtons","showSignatureEditor","showHighlightEditor","showDrawEditor","showStampEditor","showTextEditor","showZoomButtons","showPresentationModeButton","showOpenFileButton","showPrintButton","showDownloadButton","showSecondaryToolbarButton","showMovePageButton","showRotateButton","showRotateCwButton","showRotateCcwButton","showScrollingButtons","showSpreadButton","showPropertiesButton"],["scrollHeight","250px",3,"value","scrollable"],["pTemplate","header"],["pTemplate","body"],[3,"ngClass"],[2,"cursor","pointer","text-decoration","underline","color","#0056b3",3,"click"]],template:function(t,r){if(t&1){let s=$t();te(0,"div",2)(1,"h2",3),ae(2," Archivo Digital de la Legislaci\xF3n del Per\xFA "),ie()(),te(3,"div",4)(4,"div")(5,"h1",5)(6,"a",6),lt(7,"i",7),ie(),ae(8),ie()(),xr(9,QC,12,7,"div",8),lt(10,"audio",9,0),ie(),te(12,"div",10)(13,"button",11),Bt("click",function(){return _e(s),ye(r.toggleSidebar())}),te(14,"div",12),Bh(),te(15,"svg",13),lt(16,"path",14),ie()()(),Fh(),te(17,"aside",15)(18,"app-sidebar-visor",16),Bt("menuClickeado",function(a){return _e(s),ye(r.getObtenerMenuClickeado(a))}),ie()(),te(19,"main",17)(20,"div",18)(21,"div")(22,"div",19),ae(23),ie(),te(24,"div",20)(25,"p",21),ae(26),ie()()(),xr(27,tw,2,30),ie(),te(28,"div")(29,"div",22),lt(30,"video",23,1),ie()()()(),te(32,"p-blockUI",24)(33,"div",25),lt(34,"p-
340progress-spinner",26),te(35,"span",27),ae(36,"cargando.."),ie()()()}if(t&2){let s,n,a;$(8),wr(" Expediente Virtual Parlamentario de ",(s=r.expediente())==null||s.ley==null?null:s.ley.tipoNorma," "),$(),Sr(r.contieneAudio()?9:-1),$(),Z("src",r.urlAudioUrlBlob,Uh),$(7),Ge("hidden",r.isSidebarHidden),$(),Z("expediente",r.expediente()),$(5),qh("",(n=r.expediente())==null||n.ley==null||n.ley.tipoNorma==null?null:n.ley.tipoNorma.toUpperCase()," ",(n=r.expediente())==null||n.ley==null?null:n.ley.numLey),$(3),wr(" ",(a=r.expediente())==null||a.ley==null||a.ley.tituloLey==null?null:a.ley.tituloLey.toUpperCase()," "),$(),Sr(r.contienePDF()?27:-1),$(),Cr("display",r.contieneVideo()?"block":"none"),$(4),Z("blocked",r.loading()),$(2),Ca(zh(15,WC))}},dependencies:[Ra,Cf,Ef,sf,kf,ka,Ei,Kh,Dr,Lf,Ba,lf,af,of,Tf,bf,vf,yf,Sf,xf,Jh],styles:[`.pi{font-size:32px}.pi-play,.pi-pause{font-size:16px}.titulofondodiv{font-size:22.4px;color:#1e1e1e;background:#f2f2f2;padding:8px 16px;margin:0}.my-video{width:75%!important;height:0!important;padding-bottom:42.1875%;margin:0 auto!important;display:block!important;border-radius:10px;overflow:hidden;position:relative}.video-js{position:absolute;top:0;left:0;width:100%!important;height:100%!important;border-radius:10px;overflow:hidden}.disabled{pointer-events:none;opacity:.5}::ng-deep .custom-loading{position:fixed!important;top:0!important;left:0!important;width:100vw!important;height:100vh!important;z-index:9999!important;background:#00000080!important}::ng-deep .custom-loading .loading-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;padding:20px 30px;border-radius:8px;box-shadow:0 4px 8px #0003;display:flex;align-items:center;color:#333;font-size:16px}.custom-loading .loading-content{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:1rem}.loading-text{font-weight:600;margin-bottom:.75rem;font-size:1.1rem}.fila-seleccionada{background-color:#dbeafe!important;font-weight:600}.contenedor-pdf{height:100%;display:flex;flex-direction:column}ngx-extended-pdf-viewer #toolbarContainer{background-color:#000!important}ngx-extended-pdf-viewer .toolbar{background-color:#000!important;color:#fff!important}ngx-extended-pdf-viewer .toolbar button svg{fill:#fff!important;color:#fff!important}ngx-extended-pdf-viewer #secondaryToolbar{background-color:#000!important;color:#fff!important}ngx-extended-pdf-viewer #secondaryToolbar button{color:#fff!important}ngx-extended-pdf-viewer #sidebarContainer{background-color:#000!important;color:#fff!important}ngx-extended-pdf-viewer #thumbnailView{background-color:#000!important}ngx-extended-pdf-viewer .thumbnail{background-color:#111!important;border:none!important}ngx-extended-pdf-viewer #viewerContainer{background-color:#000!important}ngx-extended-pdf-viewer .pdfViewer{background-color:#3a3838!important}ngx-extended-pdf-viewer .toolbarHorizontalGroup,ngx-extended-pdf-viewer .horizontalToolbar{background-color:#000!important}ngx-extended-pdf-viewer #toolbarSidebar{background-color:#000!important}ngx-extended-pdf-viewer .toolbarButton>svg{color:#fff!important;background-color:#000!important}ngx-extended-pdf-viewer .toolbarButton.toggled{background-color:#000!important} 341`],encapsulation:2})};export{J_ as InicioVisorComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.