@ilo-org/react 0.28.1 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/_store/Button-chunk-OmVJkQqc.js +1 -0
- package/lib/cjs/_store/{Button-entry-D3W25SBk.js → Button-entry-bZ-SddDM.js} +1 -1
- package/lib/cjs/_store/{Callout-chunk-BdeAvp9z.js → Callout-chunk-XF2yUV-r.js} +1 -1
- package/lib/cjs/_store/{Callout-entry-DfrEmZB7.js → Callout-entry-_4WBT7Vv.js} +1 -1
- package/lib/cjs/_store/{CardGroup-chunk-HDoqytKS.js → CardGroup-chunk-Cn8ewunq.js} +1 -1
- package/lib/cjs/_store/{Cards-entry-DZ1Jw3ZI.js → Cards-entry-I79kpHUb.js} +1 -1
- package/lib/cjs/_store/{Footer-chunk-DvVEyN5x.js → Footer-chunk-Dt1p9vMD.js} +1 -1
- package/lib/cjs/_store/{Footer-entry-lrTkrnhr.js → Footer-entry-l-8RglKj.js} +1 -1
- package/lib/cjs/_store/{MainNav-chunk-C9rtuWNB.js → MainNav-chunk-DIQJwoJV.js} +1 -1
- package/lib/cjs/_store/{Nav-entry-QU2bhLkT.js → Nav-entry-X7AzXGF2.js} +1 -1
- package/lib/cjs/_store/{Notification-chunk-CEm56fOA.js → Notification-chunk-ZNuM-7Xk.js} +1 -1
- package/lib/cjs/_store/{Notification-entry-CHMbRdAy.js → Notification-entry-D2OmZYbJ.js} +1 -1
- package/lib/cjs/_store/SearchField-chunk-DtJTqVM9.js +1 -0
- package/lib/cjs/_store/{SearchField-entry-iEDyX5PR.js → SearchField-entry-Dx4K-UmO.js} +1 -1
- package/lib/cjs/_store/{Video-chunk-CEQmBL6F.js → Video-chunk-D9hf1AKM.js} +14 -14
- package/lib/cjs/_store/{Video-entry-DEabve_J.js → Video-entry-CuwN0TBI.js} +1 -1
- package/lib/cjs/_store/{components-entry-DH0DyJir.js → components-entry-BybNCccy.js} +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/_store/Button-chunk-BDRDVT-k.js +70 -0
- package/lib/esm/_store/Button-entry-BMRaXX6Z.js +4 -0
- package/lib/esm/_store/{Callout-chunk-Dgxxalpd.js → Callout-chunk-Cqttz2p6.js} +1 -1
- package/lib/esm/_store/Callout-entry-C4leVKrX.js +4 -0
- package/lib/esm/_store/{CardGroup-chunk-DOfpZMbU.js → CardGroup-chunk-BC6J6wy_.js} +1 -1
- package/lib/esm/_store/{Cards-entry-DzEZMOcE.js → Cards-entry-CKWIuymB.js} +1 -1
- package/lib/esm/_store/{Footer-chunk-TA0qQlaw.js → Footer-chunk-BbN845T6.js} +1 -1
- package/lib/esm/_store/Footer-entry-70ZADTJC.js +4 -0
- package/lib/esm/_store/{MainNav-chunk-CmtN7aWA.js → MainNav-chunk-quYHcIUb.js} +1 -1
- package/lib/esm/_store/Nav-entry-CJPTM5sS.js +5 -0
- package/lib/esm/_store/{Notification-chunk-CYe5VThf.js → Notification-chunk-Dcs9w_ap.js} +1 -1
- package/lib/esm/_store/Notification-entry-DxWQuGLy.js +4 -0
- package/lib/esm/_store/SearchField-chunk-CLWIJ2Hh.js +69 -0
- package/lib/esm/_store/SearchField-entry-Diz7Qpbv.js +4 -0
- package/lib/esm/_store/{Video-chunk-q086hHmd.js → Video-chunk-BIkVhXHb.js} +837 -827
- package/lib/esm/_store/Video-entry-CFYEUzvM.js +4 -0
- package/lib/esm/_store/{components-entry-BLXacfCY.js → components-entry-BY0r4sij.js} +8 -8
- package/lib/esm/index.js +8 -8
- package/lib/types/components/SearchField/SearchField.props.d.ts +6 -0
- package/package.json +6 -6
- package/lib/cjs/_store/Button-chunk-DaJZujL8.js +0 -1
- package/lib/cjs/_store/SearchField-chunk-CJ99dGc4.js +0 -1
- package/lib/esm/_store/Button-chunk-CQQX91Rg.js +0 -64
- package/lib/esm/_store/Button-entry-BIEEKQv3.js +0 -4
- package/lib/esm/_store/Callout-entry-Bzgq2szx.js +0 -4
- package/lib/esm/_store/Footer-entry-BoeUqJ4r.js +0 -4
- package/lib/esm/_store/Nav-entry-Dx2uLUdE.js +0 -5
- package/lib/esm/_store/Notification-entry-0QG_RMHv.js +0 -4
- package/lib/esm/_store/SearchField-chunk-Ky0ihQH5.js +0 -68
- package/lib/esm/_store/SearchField-entry-CH96-gn7.js +0 -4
- package/lib/esm/_store/Video-entry-D22SrG1x.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ir=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const Ir=require("react/jsx-runtime"),or=require("react"),Re=require("./index-chunk-Cxg31gtu.js"),Np=require("./useGlobalSettings-chunk-Cd48T6lS.js"),G=require("./inheritsLoose-chunk-VkUGvzyJ.js");var Bp={exports:{}},yi;typeof window<"u"?yi=window:typeof Re.commonjsGlobal<"u"?yi=Re.commonjsGlobal:typeof self<"u"?yi=self:yi={};var oa=yi;const A=Re.getDefaultExportFromCjs(oa),Up={},Vp=Object.freeze(Object.defineProperty({__proto__:null,default:Up},Symbol.toStringTag,{value:"Module"})),Hp=Re.getAugmentedNamespace(Vp);var Iu=typeof Re.commonjsGlobal<"u"?Re.commonjsGlobal:typeof window<"u"?window:{},qp=Hp,_i;typeof document<"u"?_i=document:(_i=Iu["__GLOBAL_DOCUMENT_CACHE@4"],_i||(_i=Iu["__GLOBAL_DOCUMENT_CACHE@4"]=qp));var ad=_i;const W=Re.getDefaultExportFromCjs(ad);function ht(){return ht=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(a[n]=r[n])}return a},ht.apply(null,arguments)}var ls={exports:{}};(function(a,t){function r(u){if(u&&typeof u=="object"){var l=u.which||u.keyCode||u.charCode;l&&(u=l)}if(typeof u=="number")return s[u];var c=String(u),p=n[c.toLowerCase()];if(p)return p;var p=e[c.toLowerCase()];if(p)return p;if(c.length===1)return c.charCodeAt(0)}r.isEventKey=function(l,c){if(l&&typeof l=="object"){var p=l.which||l.keyCode||l.charCode;if(p==null)return!1;if(typeof c=="string"){var m=n[c.toLowerCase()];if(m)return m===p;var m=e[c.toLowerCase()];if(m)return m===p}else if(typeof c=="number")return c===p;return!1}},t=a.exports=r;var n=t.code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},e=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
|
|
2
2
|
* Programatically add the following
|
|
3
3
|
*/for(i=97;i<123;i++)n[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)n[i-48]=i;for(i=1;i<13;i++)n["f"+i]=i+111;for(i=0;i<10;i++)n["numpad "+i]=i+96;var s=t.names=t.title={};for(i in n)s[n[i]]=i;for(var o in e)n[o]=e[o]})(ls,ls.exports);var jp=ls.exports;const te=Re.getDefaultExportFromCjs(jp);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}var Wp=Gp;function Gp(a,t){var r,n=null;try{r=JSON.parse(a,t)}catch(e){n=e}return[n,r]}const zp=Re.getDefaultExportFromCjs(Wp);var Us={exports:{}},sd={exports:{}};(function(a){function t(){return a.exports=t=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var i in e)({}).hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},a.exports.__esModule=!0,a.exports.default=a.exports,t.apply(null,arguments)}a.exports=t,a.exports.__esModule=!0,a.exports.default=a.exports})(sd);var $p=sd.exports,Kp=Yp,Xp=Object.prototype.toString;function Yp(a){if(!a)return!1;var t=Xp.call(a);return t==="[object Function]"||typeof a=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}var Qp=oa,Jp=function(t,r){return r===void 0&&(r=!1),function(n,e,i){if(n){t(n);return}if(e.statusCode>=400&&e.statusCode<=599){var s=i;if(r)if(Qp.TextDecoder){var o=Zp(e.headers&&e.headers["content-type"]);try{s=new TextDecoder(o).decode(i)}catch{}}else s=String.fromCharCode.apply(null,new Uint8Array(i));t({cause:s});return}t(null,i)}};function Zp(a){return a===void 0&&(a=""),a.toLowerCase().split(";").reduce(function(t,r){var n=r.split("="),e=n[0],i=n[1];return e.trim()==="charset"?i.trim():t},"utf-8")}var em=Jp,od=oa,tm=$p,rm=Kp;St.httpHandler=em;/**
|
|
4
4
|
* @license
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
`).replace(/u2029/g,`
|
|
15
15
|
`);continue;case"BADCUE":s||(t.state="ID");continue}}}catch(c){t.reportOrThrowError(c),t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||a.state==="HEADER")&&(a.buffer+=`
|
|
16
16
|
|
|
17
|
-
`,a.parse()),a.state==="INITIAL")throw new it(it.Errors.BadSignature)}catch(t){a.reportOrThrowError(t)}return a.onflush&&a.onflush(),this}};var _m=Yr,Tm="auto",bm={"":1,lr:1,rl:1},xm={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Sm(a){if(typeof a!="string")return!1;var t=bm[a.toLowerCase()];return t?a.toLowerCase():!1}function Ha(a){if(typeof a!="string")return!1;var t=xm[a.toLowerCase()];return t?a.toLowerCase():!1}function hd(a,t,r){this.hasBeenReset=!1;var n="",e=!1,i=a,s=t,o=r,u=null,l="",c=!0,p="auto",m="start",_="auto",b="auto",S=100,x="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(k){n=""+k}},pauseOnExit:{enumerable:!0,get:function(){return e},set:function(k){e=!!k}},startTime:{enumerable:!0,get:function(){return i},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");i=k,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");s=k,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(k){o=""+k,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(k){u=k,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(k){var L=Sm(k);if(L===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=L,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(k){c=!!k,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(k){if(typeof k!="number"&&k!==Tm)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=k,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(k){var L=Ha(k);L?(m=L,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return _},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");_=k,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(k){var L=Ha(k);L?(b=L,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return S},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");S=k,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return x},set:function(k){var L=Ha(k);if(!L)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");x=L,this.hasBeenReset=!0}}}),this.displayState=void 0}hd.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Em=hd,Cm={"":!0,up:!0};function Am(a){if(typeof a!="string")return!1;var t=Cm[a.toLowerCase()];return t?a.toLowerCase():!1}function ci(a){return typeof a=="number"&&a>=0&&a<=100}function Dm(){var a=100,t=3,r=0,n=100,e=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(o){if(!ci(o))throw new Error("Width must be between 0 and 100.");a=o}},lines:{enumerable:!0,get:function(){return t},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");t=o}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!ci(o))throw new Error("RegionAnchorX must be between 0 and 100.");n=o}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!ci(o))throw new Error("RegionAnchorY must be between 0 and 100.");r=o}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(o){if(!ci(o))throw new Error("ViewportAnchorY must be between 0 and 100.");i=o}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(o){if(!ci(o))throw new Error("ViewportAnchorX must be between 0 and 100.");e=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=Am(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})}var wm=Dm,Nt=oa,
|
|
17
|
+
`,a.parse()),a.state==="INITIAL")throw new it(it.Errors.BadSignature)}catch(t){a.reportOrThrowError(t)}return a.onflush&&a.onflush(),this}};var _m=Yr,Tm="auto",bm={"":1,lr:1,rl:1},xm={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Sm(a){if(typeof a!="string")return!1;var t=bm[a.toLowerCase()];return t?a.toLowerCase():!1}function Ha(a){if(typeof a!="string")return!1;var t=xm[a.toLowerCase()];return t?a.toLowerCase():!1}function hd(a,t,r){this.hasBeenReset=!1;var n="",e=!1,i=a,s=t,o=r,u=null,l="",c=!0,p="auto",m="start",_="auto",b="auto",S=100,x="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(k){n=""+k}},pauseOnExit:{enumerable:!0,get:function(){return e},set:function(k){e=!!k}},startTime:{enumerable:!0,get:function(){return i},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");i=k,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");s=k,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(k){o=""+k,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(k){u=k,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(k){var L=Sm(k);if(L===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");l=L,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(k){c=!!k,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(k){if(typeof k!="number"&&k!==Tm)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=k,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(k){var L=Ha(k);L?(m=L,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return _},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");_=k,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(k){var L=Ha(k);L?(b=L,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return S},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");S=k,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return x},set:function(k){var L=Ha(k);if(!L)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");x=L,this.hasBeenReset=!0}}}),this.displayState=void 0}hd.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Em=hd,Cm={"":!0,up:!0};function Am(a){if(typeof a!="string")return!1;var t=Cm[a.toLowerCase()];return t?a.toLowerCase():!1}function ci(a){return typeof a=="number"&&a>=0&&a<=100}function Dm(){var a=100,t=3,r=0,n=100,e=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(o){if(!ci(o))throw new Error("Width must be between 0 and 100.");a=o}},lines:{enumerable:!0,get:function(){return t},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");t=o}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!ci(o))throw new Error("RegionAnchorX must be between 0 and 100.");n=o}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!ci(o))throw new Error("RegionAnchorY must be between 0 and 100.");r=o}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(o){if(!ci(o))throw new Error("ViewportAnchorY must be between 0 and 100.");i=o}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(o){if(!ci(o))throw new Error("ViewportAnchorX must be between 0 and 100.");e=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=Am(o);u===!1?console.warn("Scroll: an invalid or illegal string was specified."):s=u}}})}var wm=Dm,Nt=oa,gr=cd.exports={WebVTT:_m,VTTCue:Em,VTTRegion:wm};Nt.vttjs=gr;Nt.WebVTT=gr.WebVTT;var km=gr.VTTCue,Pm=gr.VTTRegion,Im=Nt.VTTCue,Lm=Nt.VTTRegion;gr.shim=function(){Nt.VTTCue=km,Nt.VTTRegion=Pm};gr.restore=function(){Nt.VTTCue=Im,Nt.VTTRegion=Lm};Nt.VTTCue||gr.shim();var Om=cd.exports;const Mu=Re.getDefaultExportFromCjs(Om);function pd(){try{var a=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pd=function(){return!!a})()}function md(a,t,r){if(pd())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var e=new(a.bind.apply(a,n));return r&&G._setPrototypeOf(e,r.prototype),e}function Fm(a,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),t&&G._setPrototypeOf(a,t)}var gd={exports:{}};(function(a,t){(function(r){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,e=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(u,l,c){if(c=c||{},u=u.trim(),l=l.trim(),!l){if(!c.alwaysNormalize)return u;var p=o.parseURL(u);if(!p)throw new Error("Error trying to parse base URL.");return p.path=o.normalizePath(p.path),o.buildURLFromParts(p)}var m=o.parseURL(l);if(!m)throw new Error("Error trying to parse relative URL.");if(m.scheme)return c.alwaysNormalize?(m.path=o.normalizePath(m.path),o.buildURLFromParts(m)):l;var _=o.parseURL(u);if(!_)throw new Error("Error trying to parse base URL.");if(!_.netLoc&&_.path&&_.path[0]!=="/"){var b=e.exec(_.path);_.netLoc=b[1],_.path=b[2]}_.netLoc&&!_.path&&(_.path="/");var S={scheme:_.scheme,netLoc:m.netLoc,path:null,params:m.params,query:m.query,fragment:m.fragment};if(!m.netLoc&&(S.netLoc=_.netLoc,m.path[0]!=="/"))if(!m.path)S.path=_.path,m.params||(S.params=_.params,m.query||(S.query=_.query));else{var x=_.path,k=x.substring(0,x.lastIndexOf("/")+1)+m.path;S.path=o.normalizePath(k)}return S.path===null&&(S.path=c.alwaysNormalize?o.normalizePath(m.path):m.path),o.buildURLFromParts(S)},parseURL:function(u){var l=n.exec(u);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(i,"");u.length!==(u=u.replace(s,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};a.exports=o})()})(gd);var Rm=gd.exports;const Nu=Re.getDefaultExportFromCjs(Rm);var Bu="http://example.com",la=function(t,r){if(/^[a-z]+:/i.test(r))return r;/^data:/.test(t)&&(t=A.location&&A.location.href||"");var n=typeof A.URL=="function",e=/^\/\//.test(t),i=!A.location&&!/\/\//i.test(t);if(n?t=new A.URL(t,A.location||Bu):/\/\//i.test(t)||(t=Nu.buildAbsoluteURL(A.location&&A.location.href||"",t)),n){var s=new URL(r,t);return i?s.href.slice(Bu.length):e?s.href.slice(s.protocol.length):s.href}return Nu.buildAbsoluteURL(t,r)},qs=function(){function a(){this.listeners={}}var t=a.prototype;return t.on=function(n,e){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(e)},t.off=function(n,e){if(!this.listeners[n])return!1;var i=this.listeners[n].indexOf(e);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(i,1),i>-1},t.trigger=function(n){var e=this.listeners[n];if(e)if(arguments.length===2)for(var i=e.length,s=0;s<i;++s)e[s].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),u=e.length,l=0;l<u;++l)e[l].apply(this,o)},t.dispose=function(){this.listeners={}},t.pipe=function(n){this.on("data",function(e){n.push(e)})},a}(),Mm=function(t){return A.atob?A.atob(t):Buffer.from(t,"base64").toString("binary")};function vd(a){for(var t=Mm(a),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var Nm=function(a){G._inheritsLoose(t,a);function t(){var n;return n=a.call(this)||this,n.buffer="",n}var r=t.prototype;return r.push=function(e){var i;for(this.buffer+=e,i=this.buffer.indexOf(`
|
|
18
18
|
`);i>-1;i=this.buffer.indexOf(`
|
|
19
|
-
`))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)},t}(qs),Bm=" ",qa=function(t){var r=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),n={};return r[1]&&(n.length=parseInt(r[1],10)),r[2]&&(n.offset=parseInt(r[2],10)),n},Um=function(){var t="[^=]*",r='"[^"]*"|[^,]*',n="(?:"+t+")=(?:"+r+")";return new RegExp("(?:^|,)("+n+")")},lt=function(t){for(var r=t.split(Um()),n={},e=r.length,i;e--;)r[e]!==""&&(i=/([^=]*)=(.*)/.exec(r[e]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),n[i[0]]=i[1]);return n},Vm=function(a){G._inheritsLoose(t,a);function t(){var n;return n=a.call(this)||this,n.customParsers=[],n.tagMappers=[],n}var r=t.prototype;return r.push=function(e){var i=this,s,o;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}var u=this.tagMappers.reduce(function(l,c){var p=c(e);return p===e?l:l.concat([p])},[e]);u.forEach(function(l){for(var c=0;c<i.customParsers.length;c++)if(i.customParsers[c].call(i,l))return;if(l.indexOf("#EXT")!==0){i.trigger("data",{type:"comment",text:l.slice(1)});return}if(l=l.replace("\r",""),s=/^#EXTM3U/.exec(l),s){i.trigger("data",{type:"tag",tagType:"m3u"});return}if(s=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(l),s){o={type:"tag",tagType:"inf"},s[1]&&(o.duration=parseFloat(s[1])),s[2]&&(o.title=s[2]),i.trigger("data",o);return}if(s=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"targetduration"},s[1]&&(o.duration=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"version"},s[1]&&(o.version=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"media-sequence"},s[1]&&(o.number=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"discontinuity-sequence"},s[1]&&(o.number=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"playlist-type"},s[1]&&(o.playlistType=s[1]),i.trigger("data",o);return}if(s=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(l),s){o=ht(qa(s[1]),{type:"tag",tagType:"byterange"}),i.trigger("data",o);return}if(s=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(l),s){o={type:"tag",tagType:"allow-cache"},s[1]&&(o.allowed=!/NO/.test(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-MAP:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"map"},s[1]){var p=lt(s[1]);p.URI&&(o.uri=p.URI),p.BYTERANGE&&(o.byterange=qa(p.BYTERANGE))}i.trigger("data",o);return}if(s=/^#EXT-X-STREAM-INF:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"stream-inf"},s[1]){if(o.attributes=lt(s[1]),o.attributes.RESOLUTION){var m=o.attributes.RESOLUTION.split("x"),_={};m[0]&&(_.width=parseInt(m[0],10)),m[1]&&(_.height=parseInt(m[1],10)),o.attributes.RESOLUTION=_}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}i.trigger("data",o);return}if(s=/^#EXT-X-MEDIA:?(.*)$/.exec(l),s){o={type:"tag",tagType:"media"},s[1]&&(o.attributes=lt(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-ENDLIST/.exec(l),s){i.trigger("data",{type:"tag",tagType:"endlist"});return}if(s=/^#EXT-X-DISCONTINUITY/.exec(l),s){i.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(s=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(l),s){o={type:"tag",tagType:"program-date-time"},s[1]&&(o.dateTimeString=s[1],o.dateTimeObject=new Date(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-KEY:?(.*)$/.exec(l),s){o={type:"tag",tagType:"key"},s[1]&&(o.attributes=lt(s[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),i.trigger("data",o);return}if(s=/^#EXT-X-START:?(.*)$/.exec(l),s){o={type:"tag",tagType:"start"},s[1]&&(o.attributes=lt(s[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),i.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out-cont"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-CUE-IN:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-in"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-SKIP:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"skip"},o.attributes=lt(s[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(Bm)),i.trigger("data",o);return}if(s=/^#EXT-X-PART:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part"},o.attributes=lt(s[1]),["DURATION"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["INDEPENDENT","GAP"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=qa(o.attributes.BYTERANGE)),i.trigger("data",o);return}if(s=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"server-control"},o.attributes=lt(s[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),i.trigger("data",o);return}if(s=/^#EXT-X-PART-INF:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part-inf"},o.attributes=lt(s[1]),["PART-TARGET"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),i.trigger("data",o);return}if(s=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=lt(s[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(b){if(o.attributes.hasOwnProperty(b)){o.attributes[b]=parseInt(o.attributes[b],10);var S=b==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[S]=o.attributes[b],delete o.attributes[b]}}),i.trigger("data",o);return}if(s=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=lt(s[1]),["LAST-MSN","LAST-PART"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseInt(o.attributes[b],10))}),i.trigger("data",o);return}i.trigger("data",{type:"tag",data:l.slice(4)})})}},r.addParser=function(e){var i=this,s=e.expression,o=e.customType,u=e.dataParser,l=e.segment;typeof u!="function"&&(u=function(p){return p}),this.customParsers.push(function(c){var p=s.exec(c);if(p)return i.trigger("data",{type:"custom",data:u(c),customType:o,segment:l}),!0})},r.addTagMapper=function(e){var i=e.expression,s=e.map,o=function(l){return i.test(l)?s(l):l};this.tagMappers.push(o)},t}(qs),Hm=function(t){return t.toLowerCase().replace(/-(\w)/g,function(r){return r[1].toUpperCase()})},xr=function(t){var r={};return Object.keys(t).forEach(function(n){r[Hm(n)]=t[n]}),r},ja=function(t){var r=t.serverControl,n=t.targetDuration,e=t.partTargetDuration;if(r){var i="#EXT-X-SERVER-CONTROL",s="holdBack",o="partHoldBack",u=n&&n*3,l=e&&e*2;n&&!r.hasOwnProperty(s)&&(r[s]=u,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+u+")."})),u&&r[s]<u&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+r[s]+") to targetDuration * 3 ("+u+")"}),r[s]=u),e&&!r.hasOwnProperty(o)&&(r[o]=e*3,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+r[o]+")."})),e&&r[o]<l&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+r[o]+") to partTargetDuration * 2 ("+l+")."}),r[o]=l)}},qm=function(a){G._inheritsLoose(t,a);function t(){var n;n=a.call(this)||this,n.lineStream=new Nm,n.parseStream=new Vm,n.lineStream.pipe(n.parseStream);var e=ee(n),i=[],s={},o,u,l=!1,c=function(){},p={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",_=0;n.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var b=0,S=0;return n.on("end",function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&o&&(s.map=o),!s.key&&u&&(s.key=u),!s.timeline&&typeof _=="number"&&(s.timeline=_),n.manifest.preloadSegment=s)}),n.parseStream.on("data",function(x){var k,L;({tag:function(){({version:function(){x.version&&(this.manifest.version=x.version)},"allow-cache":function(){this.manifest.allowCache=x.allowed,"allowed"in x||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var F={};"length"in x&&(s.byterange=F,F.length=x.length,"offset"in x||(x.offset=b)),"offset"in x&&(s.byterange=F,F.offset=x.offset),b=F.offset+F.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),x.duration>0&&(s.duration=x.duration),x.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key:function(){if(!x.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(x.attributes.METHOD==="NONE"){u=null;return}if(!x.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(x.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:x.attributes};return}if(x.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:x.attributes.URI};return}if(x.attributes.KEYFORMAT===m){var F=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(F.indexOf(x.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(x.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),x.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(x.attributes.KEYID&&x.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:x.attributes.KEYFORMAT,keyId:x.attributes.KEYID.substring(2)},pssh:vd(x.attributes.URI.split(",")[1])};return}x.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:x.attributes.METHOD||"AES-128",uri:x.attributes.URI},typeof x.attributes.IV<"u"&&(u.iv=x.attributes.IV)},"media-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+x.number});return}this.manifest.mediaSequence=x.number},"discontinuity-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+x.number});return}this.manifest.discontinuitySequence=x.number,_=x.number},"playlist-type":function(){if(!/VOD|EVENT/.test(x.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+x.playlist});return}this.manifest.playlistType=x.playlistType},map:function(){o={},x.uri&&(o.uri=x.uri),x.byterange&&(o.byterange=x.byterange),u&&(o.key=u)},"stream-inf":function(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,!x.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),ht(s.attributes,x.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(x.attributes&&x.attributes.TYPE&&x.attributes["GROUP-ID"]&&x.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var F=this.manifest.mediaGroups[x.attributes.TYPE];F[x.attributes["GROUP-ID"]]=F[x.attributes["GROUP-ID"]]||{},k=F[x.attributes["GROUP-ID"]],L={default:/yes/i.test(x.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(x.attributes.AUTOSELECT),x.attributes.LANGUAGE&&(L.language=x.attributes.LANGUAGE),x.attributes.URI&&(L.uri=x.attributes.URI),x.attributes["INSTREAM-ID"]&&(L.instreamId=x.attributes["INSTREAM-ID"]),x.attributes.CHARACTERISTICS&&(L.characteristics=x.attributes.CHARACTERISTICS),x.attributes.FORCED&&(L.forced=/yes/i.test(x.attributes.FORCED)),k[x.attributes.NAME]=L},discontinuity:function(){_+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=x.dateTimeString,this.manifest.dateTimeObject=x.dateTimeObject),s.dateTimeString=x.dateTimeString,s.dateTimeObject=x.dateTimeObject},targetduration:function(){if(!isFinite(x.duration)||x.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+x.duration});return}this.manifest.targetDuration=x.duration,ja.call(this,this.manifest)},start:function(){if(!x.attributes||isNaN(x.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:x.attributes["TIME-OFFSET"],precise:x.attributes.PRECISE}},"cue-out":function(){s.cueOut=x.data},"cue-out-cont":function(){s.cueOutCont=x.data},"cue-in":function(){s.cueIn=x.data},skip:function(){this.manifest.skip=xr(x.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",x.attributes,["SKIPPED-SEGMENTS"])},part:function(){var F=this;l=!0;var q=this.manifest.segments.length,B=xr(x.attributes);s.parts=s.parts||[],s.parts.push(B),B.byterange&&(B.byterange.hasOwnProperty("offset")||(B.byterange.offset=S),S=B.byterange.offset+B.byterange.length);var R=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+R+" for segment #"+q,x.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(U,N){U.hasOwnProperty("lastPart")||F.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+N+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var F=this.manifest.serverControl=xr(x.attributes);F.hasOwnProperty("canBlockReload")||(F.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ja.call(this,this.manifest),F.canSkipDateranges&&!F.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var F=this.manifest.segments.length,q=xr(x.attributes),B=q.type&&q.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(q),q.byterange&&(q.byterange.hasOwnProperty("offset")||(q.byterange.offset=B?S:0,B&&(S=q.byterange.offset+q.byterange.length)));var R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+R+" for segment #"+F,x.attributes,["TYPE","URI"]),!!q.type)for(var U=0;U<s.preloadHints.length-1;U++){var N=s.preloadHints[U];N.type&&N.type===q.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+R+" for segment #"+F+" has the same TYPE "+q.type+" as preload hint #"+U})}},"rendition-report":function(){var F=xr(x.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(F);var q=this.manifest.renditionReports.length-1,B=["LAST-MSN","URI"];l&&B.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+q,x.attributes,B)},"part-inf":function(){this.manifest.partInf=xr(x.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",x.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ja.call(this,this.manifest)}}[x.tagType]||c).call(e)},uri:function(){s.uri=x.uri,i.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),u&&(s.key=u),s.timeline=_,o&&(s.map=o),S=0,s={}},comment:function(){},custom:function(){x.segment?(s.custom=s.custom||{},s.custom[x.customType]=x.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[x.customType]=x.data)}})[x.type].call(e)}),n}var r=t.prototype;return r.warnOnMissingAttributes_=function(e,i,s){var o=[];s.forEach(function(u){i.hasOwnProperty(u)||o.push(u)}),o.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+o.join(", ")})},r.push=function(e){this.lineStream.push(e)},r.end=function(){this.lineStream.push(`
|
|
20
|
-
`),this.trigger("end")},r.addParser=function(e){this.parseStream.addParser(e)},r.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(qs),dr={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^/},jm=["video","audio","text"],Uu=["Video","Audio","Text"],yd=function(t){return t&&t.replace(/avc1\.(\d+)\.(\d+)/i,function(r,n,e){var i=("00"+Number(n).toString(16)).slice(-2),s=("00"+Number(e).toString(16)).slice(-2);return"avc1."+i+"00"+s})},yt=function(t){t===void 0&&(t="");var r=t.split(","),n=[];return r.forEach(function(e){e=e.trim();var i;jm.forEach(function(s){var o=dr[s].exec(e.toLowerCase());if(!(!o||o.length<=1)){i=s;var u=e.substring(0,o[1].length),l=e.replace(u,"");n.push({type:u,details:l,mediaType:s})}}),i||n.push({type:e,details:"",mediaType:"unknown"})}),n},Wm=function(t,r){if(!t.mediaGroups.AUDIO||!r)return null;var n=t.mediaGroups.AUDIO[r];if(!n)return null;for(var e in n){var i=n[e];if(i.default&&i.playlists)return yt(i.playlists[0].attributes.CODECS)}return null},_d=function(t){return t===void 0&&(t=""),dr.audio.test(t.trim().toLowerCase())},Gm=function(t){return t===void 0&&(t=""),dr.text.test(t.trim().toLowerCase())},wi=function(t){if(!(!t||typeof t!="string")){var r=t.toLowerCase().split(",").map(function(i){return yd(i.trim())}),n="video";r.length===1&&_d(r[0])?n="audio":r.length===1&&Gm(r[0])&&(n="application");var e="mp4";return r.every(function(i){return dr.mp4.test(i)})?e="mp4":r.every(function(i){return dr.webm.test(i)})?e="webm":r.every(function(i){return dr.ogg.test(i)})&&(e="ogg"),n+"/"+e+';codecs="'+t+'"'}},Ln=function(t){return t===void 0&&(t=""),A.MediaSource&&A.MediaSource.isTypeSupported&&A.MediaSource.isTypeSupported(wi(t))||!1},Wa=function(t){return t===void 0&&(t=""),t.toLowerCase().split(",").every(function(r){r=r.trim();for(var n=0;n<Uu.length;n++){var e=Uu[n];if(dr["muxer"+e].test(r))return!0}return!1})},Vu="mp4a.40.2",zm="avc1.4d400d",$m=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Km=/^application\/dash\+xml/i,Td=function(t){return $m.test(t)?"hls":Km.test(t)?"dash":t==="application/vnd.videojs.vhs+json"?"vhs-json":null},Xm=function(t){return t.toString(2).length},Ym=function(t){return Math.ceil(Xm(t)/8)},bd=function(t){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},Qm=function(t){return bd(t)},Q=function(t){return t instanceof Uint8Array?t:(!Array.isArray(t)&&!Qm(t)&&!(t instanceof ArrayBuffer)&&(typeof t!="number"||typeof t=="number"&&t!==t?t=0:t=[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},Oe=A.BigInt||Number,ds=[Oe("0x1"),Oe("0x100"),Oe("0x10000"),Oe("0x1000000"),Oe("0x100000000"),Oe("0x10000000000"),Oe("0x1000000000000"),Oe("0x100000000000000"),Oe("0x10000000000000000")];(function(){var a=new Uint16Array([65484]),t=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);return t[0]===255?"big":t[0]===204?"little":"unknown"})();var Jm=function(t,r){var n=r===void 0?{}:r,e=n.signed,i=e===void 0?!1:e,s=n.le,o=s===void 0?!1:s;t=Q(t);var u=o?"reduce":"reduceRight",l=t[u]?t[u]:Array.prototype[u],c=l.call(t,function(m,_,b){var S=o?b:Math.abs(b+1-t.length);return m+Oe(_)*ds[S]},Oe(0));if(i){var p=ds[t.length]/Oe(2)-Oe(1);c=Oe(c),c>p&&(c-=p,c-=p,c-=Oe(2))}return Number(c)},Zm=function(t,r){var n={},e=n.le,i=e===void 0?!1:e;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!==t)&&(t=0),t=Oe(t);for(var s=Ym(t),o=new Uint8Array(new ArrayBuffer(s)),u=0;u<s;u++){var l=i?u:Math.abs(u+1-o.length);o[l]=Number(t/ds[u]&Oe(255)),t<0&&(o[l]=Math.abs(~o[l]),o[l]-=u===0?1:2)}return o},xd=function(t,r){if(typeof t!="string"&&t&&typeof t.toString=="function"&&(t=t.toString()),typeof t!="string")return new Uint8Array;r||(t=unescape(encodeURIComponent(t)));for(var n=new Uint8Array(t.length),e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},eg=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r=r.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),r.length<=1)return Q(r[0]);var e=r.reduce(function(o,u,l){return o+(u.byteLength||u.length)},0),i=new Uint8Array(e),s=0;return r.forEach(function(o){o=Q(o),i.set(o,s),s+=o.byteLength}),i},_e=function(t,r,n){var e=n===void 0?{}:n,i=e.offset,s=i===void 0?0:i,o=e.mask,u=o===void 0?[]:o;t=Q(t),r=Q(r);var l=r.every?r.every:Array.prototype.every;return r.length&&t.length-s>=r.length&&l.call(r,function(c,p){var m=u[p]?u[p]&t[s+p]:t[s+p];return c===m})},tg=function(t,r,n){r.forEach(function(e){for(var i in t.mediaGroups[e])for(var s in t.mediaGroups[e][i]){var o=t.mediaGroups[e][i][s];n(o,e,i,s)}})},Jt={},qt={};function rg(a,t,r){if(r===void 0&&(r=Array.prototype),a&&typeof r.find=="function")return r.find.call(a,t);for(var n=0;n<a.length;n++)if(Object.prototype.hasOwnProperty.call(a,n)){var e=a[n];if(t.call(void 0,e,n,a))return e}}function js(a,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(a):a}function ig(a,t){if(a===null||typeof a!="object")throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r]);return a}var Sd=js({HTML:"text/html",isHTML:function(a){return a===Sd.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Ed=js({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(a){return a===Ed.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});qt.assign=ig;qt.find=rg;qt.freeze=js;qt.MIME_TYPE=Sd;qt.NAMESPACE=Ed;var Cd=qt,Et=Cd.find,ki=Cd.NAMESPACE;function ng(a){return a!==""}function ag(a){return a?a.split(/[\t\n\f\r ]+/).filter(ng):[]}function sg(a,t){return a.hasOwnProperty(t)||(a[t]=!0),a}function Hu(a){if(!a)return[];var t=ag(a);return Object.keys(t.reduce(sg,{}))}function og(a){return function(t){return a&&a.indexOf(t)!==-1}}function Bi(a,t){for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}function Je(a,t){var r=a.prototype;if(!(r instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,Bi(r,n),a.prototype=r=n}r.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),r.constructor=a)}var Ze={},ct=Ze.ELEMENT_NODE=1,Ur=Ze.ATTRIBUTE_NODE=2,Bn=Ze.TEXT_NODE=3,Ad=Ze.CDATA_SECTION_NODE=4,Dd=Ze.ENTITY_REFERENCE_NODE=5,ug=Ze.ENTITY_NODE=6,wd=Ze.PROCESSING_INSTRUCTION_NODE=7,kd=Ze.COMMENT_NODE=8,Pd=Ze.DOCUMENT_NODE=9,Id=Ze.DOCUMENT_TYPE_NODE=10,Bt=Ze.DOCUMENT_FRAGMENT_NODE=11,lg=Ze.NOTATION_NODE=12,Ue={},Pe={};Ue.INDEX_SIZE_ERR=(Pe[1]="Index size error",1);Ue.DOMSTRING_SIZE_ERR=(Pe[2]="DOMString size error",2);var Ye=Ue.HIERARCHY_REQUEST_ERR=(Pe[3]="Hierarchy request error",3);Ue.WRONG_DOCUMENT_ERR=(Pe[4]="Wrong document",4);Ue.INVALID_CHARACTER_ERR=(Pe[5]="Invalid character",5);Ue.NO_DATA_ALLOWED_ERR=(Pe[6]="No data allowed",6);Ue.NO_MODIFICATION_ALLOWED_ERR=(Pe[7]="No modification allowed",7);var Ld=Ue.NOT_FOUND_ERR=(Pe[8]="Not found",8);Ue.NOT_SUPPORTED_ERR=(Pe[9]="Not supported",9);var qu=Ue.INUSE_ATTRIBUTE_ERR=(Pe[10]="Attribute in use",10);Ue.INVALID_STATE_ERR=(Pe[11]="Invalid state",11);Ue.SYNTAX_ERR=(Pe[12]="Syntax error",12);Ue.INVALID_MODIFICATION_ERR=(Pe[13]="Invalid modification",13);Ue.NAMESPACE_ERR=(Pe[14]="Invalid namespace",14);Ue.INVALID_ACCESS_ERR=(Pe[15]="Invalid access",15);function Ce(a,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,Pe[a]),this.message=Pe[a],Error.captureStackTrace&&Error.captureStackTrace(this,Ce);return r.code=a,t&&(this.message=this.message+": "+t),r}Ce.prototype=Error.prototype;Bi(Ue,Ce);function Ft(){}Ft.prototype={length:0,item:function(a){return a>=0&&a<this.length?this[a]:null},toString:function(a,t){for(var r=[],n=0;n<this.length;n++)Lr(this[n],r,a,t);return r.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}};function Vr(a,t){this._node=a,this._refresh=t,Ws(this)}function Ws(a){var t=a._node._inc||a._node.ownerDocument._inc;if(a._inc!==t){var r=a._refresh(a._node);if(Wd(a,"length",r.length),!a.$$length||r.length<a.$$length)for(var n=r.length;n in a;n++)Object.prototype.hasOwnProperty.call(a,n)&&delete a[n];Bi(r,a),a._inc=t}}Vr.prototype.item=function(a){return Ws(this),this[a]||null};Je(Vr,Ft);function Un(){}function Od(a,t){for(var r=a.length;r--;)if(a[r]===t)return r}function ju(a,t,r,n){if(n?t[Od(t,n)]=r:t[t.length++]=r,a){r.ownerElement=a;var e=a.ownerDocument;e&&(n&&Md(e,a,n),dg(e,a,r))}}function Wu(a,t,r){var n=Od(t,r);if(n>=0){for(var e=t.length-1;n<e;)t[n]=t[++n];if(t.length=e,a){var i=a.ownerDocument;i&&(Md(i,a,r),r.ownerElement=null)}}else throw new Ce(Ld,new Error(a.tagName+"@"+r))}Un.prototype={length:0,item:Ft.prototype.item,getNamedItem:function(a){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==a)return r}},setNamedItem:function(a){var t=a.ownerElement;if(t&&t!=this._ownerElement)throw new Ce(qu);var r=this.getNamedItem(a.nodeName);return ju(this._ownerElement,this,a,r),r},setNamedItemNS:function(a){var t=a.ownerElement,r;if(t&&t!=this._ownerElement)throw new Ce(qu);return r=this.getNamedItemNS(a.namespaceURI,a.localName),ju(this._ownerElement,this,a,r),r},removeNamedItem:function(a){var t=this.getNamedItem(a);return Wu(this._ownerElement,this,t),t},removeNamedItemNS:function(a,t){var r=this.getNamedItemNS(a,t);return Wu(this._ownerElement,this,r),r},getNamedItemNS:function(a,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==a)return n}return null}};function Fd(){}Fd.prototype={hasFeature:function(a,t){return!0},createDocument:function(a,t,r){var n=new Ui;if(n.implementation=this,n.childNodes=new Ft,n.doctype=r||null,r&&n.appendChild(r),t){var e=n.createElementNS(a,t);n.appendChild(e)}return n},createDocumentType:function(a,t,r){var n=new da;return n.name=a,n.nodeName=a,n.publicId=t||"",n.systemId=r||"",n}};function ce(){}ce.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(a,t){return Vn(this,a,t)},replaceChild:function(a,t){Vn(this,a,t,Bd),t&&this.removeChild(t)},removeChild:function(a){return Nd(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return cs(this.ownerDocument||this,this,a)},normalize:function(){for(var a=this.firstChild;a;){var t=a.nextSibling;t&&t.nodeType==Bn&&a.nodeType==Bn?(this.removeChild(t),a.appendData(t.data)):(a.normalize(),a=t)}},isSupported:function(a,t){return this.ownerDocument.implementation.hasFeature(a,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(a){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===a)return n}t=t.nodeType==Ur?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(a){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a];t=t.nodeType==Ur?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(a){var t=this.lookupPrefix(a);return t==null}};function Rd(a){return a=="<"&&"<"||a==">"&&">"||a=="&"&&"&"||a=='"'&&"""||"&#"+a.charCodeAt()+";"}Bi(Ze,ce);Bi(Ze,ce.prototype);function Pi(a,t){if(t(a))return!0;if(a=a.firstChild)do if(Pi(a,t))return!0;while(a=a.nextSibling)}function Ui(){this.ownerDocument=this}function dg(a,t,r){a&&a._inc++;var n=r.namespaceURI;n===ki.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function Md(a,t,r,n){a&&a._inc++;var e=r.namespaceURI;e===ki.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Gs(a,t,r){if(a&&a._inc){a._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var e=t.firstChild,i=0;e;)n[i++]=e,e=e.nextSibling;n.length=i,delete n[n.length]}}}function Nd(a,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:a.firstChild=n,n?n.previousSibling=r:a.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Gs(a.ownerDocument,a),t}function cg(a){return a&&(a.nodeType===ce.DOCUMENT_NODE||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.ELEMENT_NODE)}function fg(a){return a&&(Ct(a)||zs(a)||Ut(a)||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.COMMENT_NODE||a.nodeType===ce.PROCESSING_INSTRUCTION_NODE)}function Ut(a){return a&&a.nodeType===ce.DOCUMENT_TYPE_NODE}function Ct(a){return a&&a.nodeType===ce.ELEMENT_NODE}function zs(a){return a&&a.nodeType===ce.TEXT_NODE}function Gu(a,t){var r=a.childNodes||[];if(Et(r,Ct)||Ut(t))return!1;var n=Et(r,Ut);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function zu(a,t){var r=a.childNodes||[];function n(i){return Ct(i)&&i!==t}if(Et(r,n))return!1;var e=Et(r,Ut);return!(t&&e&&r.indexOf(e)>r.indexOf(t))}function hg(a,t,r){if(!cg(a))throw new Ce(Ye,"Unexpected parent node type "+a.nodeType);if(r&&r.parentNode!==a)throw new Ce(Ld,"child not in parent");if(!fg(t)||Ut(t)&&a.nodeType!==ce.DOCUMENT_NODE)throw new Ce(Ye,"Unexpected node type "+t.nodeType+" for parent node type "+a.nodeType)}function pg(a,t,r){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===ce.DOCUMENT_FRAGMENT_NODE){var i=e.filter(Ct);if(i.length>1||Et(e,zs))throw new Ce(Ye,"More than one element or text in fragment");if(i.length===1&&!Gu(a,r))throw new Ce(Ye,"Element in fragment can not be inserted before doctype")}if(Ct(t)&&!Gu(a,r))throw new Ce(Ye,"Only one element can be added and only after doctype");if(Ut(t)){if(Et(n,Ut))throw new Ce(Ye,"Only one doctype is allowed");var s=Et(n,Ct);if(r&&n.indexOf(s)<n.indexOf(r))throw new Ce(Ye,"Doctype can only be inserted before an element");if(!r&&s)throw new Ce(Ye,"Doctype can not be appended since element is present")}}function Bd(a,t,r){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===ce.DOCUMENT_FRAGMENT_NODE){var i=e.filter(Ct);if(i.length>1||Et(e,zs))throw new Ce(Ye,"More than one element or text in fragment");if(i.length===1&&!zu(a,r))throw new Ce(Ye,"Element in fragment can not be inserted before doctype")}if(Ct(t)&&!zu(a,r))throw new Ce(Ye,"Only one element can be added and only after doctype");if(Ut(t)){if(Et(n,function(u){return Ut(u)&&u!==r}))throw new Ce(Ye,"Only one doctype is allowed");var s=Et(n,Ct);if(r&&n.indexOf(s)<n.indexOf(r))throw new Ce(Ye,"Doctype can only be inserted before an element")}}function Vn(a,t,r,n){hg(a,t,r),a.nodeType===ce.DOCUMENT_NODE&&(n||pg)(a,t,r);var e=t.parentNode;if(e&&e.removeChild(t),t.nodeType===Bt){var i=t.firstChild;if(i==null)return t;var s=t.lastChild}else i=s=t;var o=r?r.previousSibling:a.lastChild;i.previousSibling=o,s.nextSibling=r,o?o.nextSibling=i:a.firstChild=i,r==null?a.lastChild=s:r.previousSibling=s;do i.parentNode=a;while(i!==s&&(i=i.nextSibling));return Gs(a.ownerDocument||a,a),t.nodeType==Bt&&(t.firstChild=t.lastChild=null),t}function mg(a,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=a,t.previousSibling=a.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:a.firstChild=t,a.lastChild=t,Gs(a.ownerDocument,a,t),t}Ui.prototype={nodeName:"#document",nodeType:Pd,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,t){if(a.nodeType==Bt){for(var r=a.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return a}return Vn(this,a,t),a.ownerDocument=this,this.documentElement===null&&a.nodeType===ct&&(this.documentElement=a),a},removeChild:function(a){return this.documentElement==a&&(this.documentElement=null),Nd(this,a)},replaceChild:function(a,t){Vn(this,a,t,Bd),a.ownerDocument=this,t&&this.removeChild(t),Ct(a)&&(this.documentElement=a)},importNode:function(a,t){return jd(this,a,t)},getElementById:function(a){var t=null;return Pi(this.documentElement,function(r){if(r.nodeType==ct&&r.getAttribute("id")==a)return t=r,!0}),t},getElementsByClassName:function(a){var t=Hu(a);return new Vr(this,function(r){var n=[];return t.length>0&&Pi(r.documentElement,function(e){if(e!==r&&e.nodeType===ct){var i=e.getAttribute("class");if(i){var s=a===i;if(!s){var o=Hu(i);s=t.every(og(o))}s&&n.push(e)}}}),n})},createElement:function(a){var t=new pr;t.ownerDocument=this,t.nodeName=a,t.tagName=a,t.localName=a,t.childNodes=new Ft;var r=t.attributes=new Un;return r._ownerElement=t,t},createDocumentFragment:function(){var a=new ca;return a.ownerDocument=this,a.childNodes=new Ft,a},createTextNode:function(a){var t=new $s;return t.ownerDocument=this,t.appendData(a),t},createComment:function(a){var t=new Ks;return t.ownerDocument=this,t.appendData(a),t},createCDATASection:function(a){var t=new Xs;return t.ownerDocument=this,t.appendData(a),t},createProcessingInstruction:function(a,t){var r=new Qs;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=a,r.nodeValue=r.data=t,r},createAttribute:function(a){var t=new Hn;return t.ownerDocument=this,t.name=a,t.nodeName=a,t.localName=a,t.specified=!0,t},createEntityReference:function(a){var t=new Ys;return t.ownerDocument=this,t.nodeName=a,t},createElementNS:function(a,t){var r=new pr,n=t.split(":"),e=r.attributes=new Un;return r.childNodes=new Ft,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=a,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,e._ownerElement=r,r},createAttributeNS:function(a,t){var r=new Hn,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=a,r.specified=!0,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}};Je(Ui,ce);function pr(){this._nsMap={}}pr.prototype={nodeType:ct,hasAttribute:function(a){return this.getAttributeNode(a)!=null},getAttribute:function(a){var t=this.getAttributeNode(a);return t&&t.value||""},getAttributeNode:function(a){return this.attributes.getNamedItem(a)},setAttribute:function(a,t){var r=this.ownerDocument.createAttribute(a);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(a){var t=this.getAttributeNode(a);t&&this.removeAttributeNode(t)},appendChild:function(a){return a.nodeType===Bt?this.insertBefore(a,null):mg(this,a)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(a,t){return this.getAttributeNodeNS(a,t)!=null},getAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);return r&&r.value||""},setAttributeNS:function(a,t,r){var n=this.ownerDocument.createAttributeNS(a,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(a,t){return this.attributes.getNamedItemNS(a,t)},getElementsByTagName:function(a){return new Vr(this,function(t){var r=[];return Pi(t,function(n){n!==t&&n.nodeType==ct&&(a==="*"||n.tagName==a)&&r.push(n)}),r})},getElementsByTagNameNS:function(a,t){return new Vr(this,function(r){var n=[];return Pi(r,function(e){e!==r&&e.nodeType===ct&&(a==="*"||e.namespaceURI===a)&&(t==="*"||e.localName==t)&&n.push(e)}),n})}};Ui.prototype.getElementsByTagName=pr.prototype.getElementsByTagName;Ui.prototype.getElementsByTagNameNS=pr.prototype.getElementsByTagNameNS;Je(pr,ce);function Hn(){}Hn.prototype.nodeType=Ur;Je(Hn,ce);function Vi(){}Vi.prototype={data:"",substringData:function(a,t){return this.data.substring(a,a+t)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,t){this.replaceData(a,0,t)},appendChild:function(a){throw new Error(Pe[Ye])},deleteData:function(a,t){this.replaceData(a,t,"")},replaceData:function(a,t,r){var n=this.data.substring(0,a),e=this.data.substring(a+t);r=n+r+e,this.nodeValue=this.data=r,this.length=r.length}};Je(Vi,ce);function $s(){}$s.prototype={nodeName:"#text",nodeType:Bn,splitText:function(a){var t=this.data,r=t.substring(a);t=t.substring(0,a),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};Je($s,Vi);function Ks(){}Ks.prototype={nodeName:"#comment",nodeType:kd};Je(Ks,Vi);function Xs(){}Xs.prototype={nodeName:"#cdata-section",nodeType:Ad};Je(Xs,Vi);function da(){}da.prototype.nodeType=Id;Je(da,ce);function Ud(){}Ud.prototype.nodeType=lg;Je(Ud,ce);function Vd(){}Vd.prototype.nodeType=ug;Je(Vd,ce);function Ys(){}Ys.prototype.nodeType=Dd;Je(Ys,ce);function ca(){}ca.prototype.nodeName="#document-fragment";ca.prototype.nodeType=Bt;Je(ca,ce);function Qs(){}Qs.prototype.nodeType=wd;Je(Qs,ce);function Hd(){}Hd.prototype.serializeToString=function(a,t,r){return qd.call(a,t,r)};ce.prototype.toString=qd;function qd(a,t){var r=[],n=this.nodeType==9&&this.documentElement||this,e=n.prefix,i=n.namespaceURI;if(i&&e==null){var e=n.lookupPrefix(i);if(e==null)var s=[{namespace:i,prefix:null}]}return Lr(this,r,a,t,s),r.join("")}function $u(a,t,r){var n=a.prefix||"",e=a.namespaceURI;if(!e||n==="xml"&&e===ki.XML||e===ki.XMLNS)return!1;for(var i=r.length;i--;){var s=r[i];if(s.prefix===n)return s.namespace!==e}return!0}function Ga(a,t,r){a.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Rd),'"')}function Lr(a,t,r,n,e){if(e||(e=[]),n)if(a=n(a),a){if(typeof a=="string"){t.push(a);return}}else return;switch(a.nodeType){case ct:var i=a.attributes,s=i.length,k=a.firstChild,o=a.tagName;r=ki.isHTML(a.namespaceURI)||r;var u=o;if(!r&&!a.prefix&&a.namespaceURI){for(var l,c=0;c<i.length;c++)if(i.item(c).name==="xmlns"){l=i.item(c).value;break}if(!l)for(var p=e.length-1;p>=0;p--){var m=e[p];if(m.prefix===""&&m.namespace===a.namespaceURI){l=m.namespace;break}}if(l!==a.namespaceURI)for(var p=e.length-1;p>=0;p--){var m=e[p];if(m.namespace===a.namespaceURI){m.prefix&&(u=m.prefix+":"+o);break}}}t.push("<",u);for(var _=0;_<s;_++){var b=i.item(_);b.prefix=="xmlns"?e.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&e.push({prefix:"",namespace:b.value})}for(var _=0;_<s;_++){var b=i.item(_);if($u(b,r,e)){var S=b.prefix||"",x=b.namespaceURI;Ga(t,S?"xmlns:"+S:"xmlns",x),e.push({prefix:S,namespace:x})}Lr(b,t,r,n,e)}if(o===u&&$u(a,r,e)){var S=a.prefix||"",x=a.namespaceURI;Ga(t,S?"xmlns:"+S:"xmlns",x),e.push({prefix:S,namespace:x})}if(k||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(t.push(">"),r&&/^script$/i.test(o))for(;k;)k.data?t.push(k.data):Lr(k,t,r,n,e.slice()),k=k.nextSibling;else for(;k;)Lr(k,t,r,n,e.slice()),k=k.nextSibling;t.push("</",u,">")}else t.push("/>");return;case Pd:case Bt:for(var k=a.firstChild;k;)Lr(k,t,r,n,e.slice()),k=k.nextSibling;return;case Ur:return Ga(t,a.name,a.value);case Bn:return t.push(a.data.replace(/[<&>]/g,Rd));case Ad:return t.push("<![CDATA[",a.data,"]]>");case kd:return t.push("<!--",a.data,"-->");case Id:var L=a.publicId,H=a.systemId;if(t.push("<!DOCTYPE ",a.name),L)t.push(" PUBLIC ",L),H&&H!="."&&t.push(" ",H),t.push(">");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var O=a.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case wd:return t.push("<?",a.target," ",a.data,"?>");case Dd:return t.push("&",a.nodeName,";");default:t.push("??",a.nodeName)}}function jd(a,t,r){var n;switch(t.nodeType){case ct:n=t.cloneNode(!1),n.ownerDocument=a;case Bt:break;case Ur:r=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=a,n.parentNode=null,r)for(var e=t.firstChild;e;)n.appendChild(jd(a,e,r)),e=e.nextSibling;return n}function cs(a,t,r){var n=new t.constructor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var i=t[e];typeof i!="object"&&i!=n[e]&&(n[e]=i)}switch(t.childNodes&&(n.childNodes=new Ft),n.ownerDocument=a,n.nodeType){case ct:var s=t.attributes,o=n.attributes=new Un,u=s.length;o._ownerElement=n;for(var l=0;l<u;l++)n.setAttributeNode(cs(a,s.item(l),!0));break;case Ur:r=!0}if(r)for(var c=t.firstChild;c;)n.appendChild(cs(a,c,r)),c=c.nextSibling;return n}function Wd(a,t,r){a[t]=r}try{if(Object.defineProperty){let a=function(t){switch(t.nodeType){case ct:case Bt:var r=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&r.push(a(t)),t=t.nextSibling;return r.join("");default:return t.nodeValue}};Object.defineProperty(Vr.prototype,"length",{get:function(){return Ws(this),this.$$length}}),Object.defineProperty(ce.prototype,"textContent",{get:function(){return a(this)},set:function(t){switch(this.nodeType){case ct:case Bt:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Wd=function(t,r,n){t["$$"+r]=n}}}catch{}Jt.DocumentType=da;Jt.DOMException=Ce;Jt.DOMImplementation=Fd;Jt.Element=pr;Jt.Node=ce;Jt.NodeList=Ft;Jt.XMLSerializer=Hd;var fa={},Gd={};(function(a){var t=qt.freeze;a.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),a.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
21
|
-
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),a.entityMap=a.HTML_ENTITIES})(Gd);var Js={},Ii=qt.NAMESPACE,fs=/[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]/,Ku=new RegExp("[\\-\\.0-9"+fs.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Xu=new RegExp("^"+fs.source+Ku.source+"*(?::"+fs.source+Ku.source+"*)?$"),fi=0,Kt=1,Sr=2,hi=3,Er=4,Cr=5,pi=6,bn=7;function Hr(a,t){this.message=a,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Hr)}Hr.prototype=new Error;Hr.prototype.name=Hr.name;function zd(){}zd.prototype={parse:function(a,t,r){var n=this.domBuilder;n.startDocument(),$d(t,t={}),gg(a,t,r,n,this.errorHandler),n.endDocument()}};function gg(a,t,r,n,e){function i(re){if(re>65535){re-=65536;var ae=55296+(re>>10),pe=56320+(re&1023);return String.fromCharCode(ae,pe)}else return String.fromCharCode(re)}function s(re){var ae=re.slice(1,-1);return Object.hasOwnProperty.call(r,ae)?r[ae]:ae.charAt(0)==="#"?i(parseInt(ae.substr(1).replace("x","0x"))):(e.error("entity not found:"+re),re)}function o(re){if(re>S){var ae=a.substring(S,re).replace(/&#?\w+;/g,s);m&&u(S),n.characters(ae,0,re-S),S=re}}function u(re,ae){for(;re>=c&&(ae=p.exec(a));)l=ae.index,c=l+ae[0].length,m.lineNumber++;m.columnNumber=re-l+1}for(var l=0,c=0,p=/.*(?:\r\n?|\n)|.*$/g,m=n.locator,_=[{currentNSMap:t}],b={},S=0;;){try{var x=a.indexOf("<",S);if(x<0){if(!a.substr(S).match(/^\s*$/)){var k=n.doc,L=k.createTextNode(a.substr(S));k.appendChild(L),n.currentElement=L}return}switch(x>S&&o(x),a.charAt(x+1)){case"/":var X=a.indexOf(">",x+3),H=a.substring(x+2,X).replace(/[ \t\n\r]+$/g,""),O=_.pop();X<0?(H=a.substring(x+2).replace(/[\s<].*/,""),e.error("end tag name: "+H+" is not complete:"+O.tagName),X=x+1+H.length):H.match(/\s</)&&(H=H.replace(/[\s<].*/,""),e.error("end tag name: "+H+" maybe not complete"),X=x+1+H.length);var F=O.localNSMap,q=O.tagName==H,B=q||O.tagName&&O.tagName.toLowerCase()==H.toLowerCase();if(B){if(n.endElement(O.uri,O.localName,H),F)for(var R in F)Object.prototype.hasOwnProperty.call(F,R)&&n.endPrefixMapping(R);q||e.fatalError("end tag name: "+H+" is not match the current start tagName:"+O.tagName)}else _.push(O);X++;break;case"?":m&&u(x),X=bg(a,x,n);break;case"!":m&&u(x),X=Tg(a,x,n,e);break;default:m&&u(x);var U=new Kd,N=_[_.length-1].currentNSMap,X=vg(a,x,U,N,s,e),$=U.length;if(!U.closed&&_g(a,X,U.tagName,b)&&(U.closed=!0,r.nbsp||e.warning("unclosed xml attribute")),m&&$){for(var J=Yu(m,{}),oe=0;oe<$;oe++){var fe=U[oe];u(fe.offset),fe.locator=Yu(m,{})}n.locator=J,Qu(U,n,N)&&_.push(U),n.locator=m}else Qu(U,n,N)&&_.push(U);Ii.isHTML(U.uri)&&!U.closed?X=yg(a,X,U.tagName,s,n):X++}}catch(re){if(re instanceof Hr)throw re;e.error("element parse error: "+re),X=-1}X>S?S=X:o(Math.max(x,S)+1)}}function Yu(a,t){return t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber,t}function vg(a,t,r,n,e,i){function s(m,_,b){r.attributeNames.hasOwnProperty(m)&&i.fatalError("Attribute "+m+" redefined"),r.addValue(m,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,e),b)}for(var o,u,l=++t,c=fi;;){var p=a.charAt(l);switch(p){case"=":if(c===Kt)o=a.slice(t,l),c=hi;else if(c===Sr)c=hi;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===hi||c===Kt)if(c===Kt&&(i.warning('attribute value must after "="'),o=a.slice(t,l)),t=l+1,l=a.indexOf(p,t),l>0)u=a.slice(t,l),s(o,u,t-1),c=Cr;else throw new Error("attribute value no end '"+p+"' match");else if(c==Er)u=a.slice(t,l),s(o,u,t),i.warning('attribute "'+o+'" missed start quot('+p+")!!"),t=l+1,c=Cr;else throw new Error('attribute value must after "="');break;case"/":switch(c){case fi:r.setTagName(a.slice(t,l));case Cr:case pi:case bn:c=bn,r.closed=!0;case Er:case Kt:break;case Sr:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),c==fi&&r.setTagName(a.slice(t,l)),l;case">":switch(c){case fi:r.setTagName(a.slice(t,l));case Cr:case pi:case bn:break;case Er:case Kt:u=a.slice(t,l),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Sr:c===Sr&&(u=o),c==Er?(i.warning('attribute "'+u+'" missed quot(")!'),s(o,u,t)):((!Ii.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case hi:throw new Error("attribute value missed!!")}return l;case"":p=" ";default:if(p<=" ")switch(c){case fi:r.setTagName(a.slice(t,l)),c=pi;break;case Kt:o=a.slice(t,l),c=Sr;break;case Er:var u=a.slice(t,l);i.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case Cr:c=pi;break}else switch(c){case Sr:r.tagName,(!Ii.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=Kt;break;case Cr:i.warning('attribute space is required"'+o+'"!!');case pi:c=Kt,t=l;break;case hi:c=Er,t=l;break;case bn:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function Qu(a,t,r){for(var n=a.tagName,e=null,p=a.length;p--;){var i=a[p],s=i.qName,o=i.value,m=s.indexOf(":");if(m>0)var u=i.prefix=s.slice(0,m),l=s.slice(m+1),c=u==="xmlns"&&l;else l=s,u=null,c=s==="xmlns"&&"";i.localName=l,c!==!1&&(e==null&&(e={},$d(r,r={})),r[c]=e[c]=o,i.uri=Ii.XMLNS,t.startPrefixMapping(c,o))}for(var p=a.length;p--;){i=a[p];var u=i.prefix;u&&(u==="xml"&&(i.uri=Ii.XML),u!=="xmlns"&&(i.uri=r[u||""]))}var m=n.indexOf(":");m>0?(u=a.prefix=n.slice(0,m),l=a.localName=n.slice(m+1)):(u=null,l=a.localName=n);var _=a.uri=r[u||""];if(t.startElement(_,l,n,a),a.closed){if(t.endElement(_,l,n),e)for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&t.endPrefixMapping(u)}else return a.currentNSMap=r,a.localNSMap=e,!0}function yg(a,t,r,n,e){if(/^(?:script|textarea)$/i.test(r)){var i=a.indexOf("</"+r+">",t),s=a.substring(t+1,i);if(/[&<]/.test(s))return/^script$/i.test(r)?(e.characters(s,0,s.length),i):(s=s.replace(/&#?\w+;/g,n),e.characters(s,0,s.length),i)}return t+1}function _g(a,t,r,n){var e=n[r];return e==null&&(e=a.lastIndexOf("</"+r+">"),e<t&&(e=a.lastIndexOf("</"+r)),n[r]=e),e<t}function $d(a,t){for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}function Tg(a,t,r,n){var e=a.charAt(t+2);switch(e){case"-":if(a.charAt(t+3)==="-"){var i=a.indexOf("-->",t+4);return i>t?(r.comment(a,t+4,i-t-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(a.substr(t+3,6)=="CDATA["){var i=a.indexOf("]]>",t+9);return r.startCDATA(),r.characters(a,t+9,i-t-9),r.endCDATA(),i+3}var s=xg(a,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var p=s[o-1];return r.startDTD(u,l,c),r.endDTD(),p.index+p[0].length}}return-1}function bg(a,t,r){var n=a.indexOf("?>",t);if(n){var e=a.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return e?(e[0].length,r.processingInstruction(e[1],e[2]),n+2):-1}return-1}function Kd(){this.attributeNames={}}Kd.prototype={setTagName:function(a){if(!Xu.test(a))throw new Error("invalid tagName:"+a);this.tagName=a},addValue:function(a,t,r){if(!Xu.test(a))throw new Error("invalid attribute:"+a);this.attributeNames[a]=this.length,this[this.length++]={qName:a,value:t,offset:r}},length:0,getLocalName:function(a){return this[a].localName},getLocator:function(a){return this[a].locator},getQName:function(a){return this[a].qName},getURI:function(a){return this[a].uri},getValue:function(a){return this[a].value}};function xg(a,t){var r,n=[],e=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(e.lastIndex=t,e.exec(a);r=e.exec(a);)if(n.push(r),r[1])return n}Js.XMLReader=zd;Js.ParseError=Hr;var Sg=qt,Eg=Jt,Ju=Gd,Xd=Js,Cg=Eg.DOMImplementation,Zu=Sg.NAMESPACE,Ag=Xd.ParseError,Dg=Xd.XMLReader;function Yd(a){return a.replace(/\r[\n\u0085]/g,`
|
|
19
|
+
`))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)},t}(qs),Bm=" ",qa=function(t){var r=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),n={};return r[1]&&(n.length=parseInt(r[1],10)),r[2]&&(n.offset=parseInt(r[2],10)),n},Um=function(){var t="[^=]*",r='"[^"]*"|[^,]*',n="(?:"+t+")=(?:"+r+")";return new RegExp("(?:^|,)("+n+")")},lt=function(t){for(var r=t.split(Um()),n={},e=r.length,i;e--;)r[e]!==""&&(i=/([^=]*)=(.*)/.exec(r[e]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),n[i[0]]=i[1]);return n},Vm=function(a){G._inheritsLoose(t,a);function t(){var n;return n=a.call(this)||this,n.customParsers=[],n.tagMappers=[],n}var r=t.prototype;return r.push=function(e){var i=this,s,o;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}var u=this.tagMappers.reduce(function(l,c){var p=c(e);return p===e?l:l.concat([p])},[e]);u.forEach(function(l){for(var c=0;c<i.customParsers.length;c++)if(i.customParsers[c].call(i,l))return;if(l.indexOf("#EXT")!==0){i.trigger("data",{type:"comment",text:l.slice(1)});return}if(l=l.replace("\r",""),s=/^#EXTM3U/.exec(l),s){i.trigger("data",{type:"tag",tagType:"m3u"});return}if(s=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(l),s){o={type:"tag",tagType:"inf"},s[1]&&(o.duration=parseFloat(s[1])),s[2]&&(o.title=s[2]),i.trigger("data",o);return}if(s=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"targetduration"},s[1]&&(o.duration=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"version"},s[1]&&(o.version=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"media-sequence"},s[1]&&(o.number=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),s){o={type:"tag",tagType:"discontinuity-sequence"},s[1]&&(o.number=parseInt(s[1],10)),i.trigger("data",o);return}if(s=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"playlist-type"},s[1]&&(o.playlistType=s[1]),i.trigger("data",o);return}if(s=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(l),s){o=ht(qa(s[1]),{type:"tag",tagType:"byterange"}),i.trigger("data",o);return}if(s=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(l),s){o={type:"tag",tagType:"allow-cache"},s[1]&&(o.allowed=!/NO/.test(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-MAP:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"map"},s[1]){var p=lt(s[1]);p.URI&&(o.uri=p.URI),p.BYTERANGE&&(o.byterange=qa(p.BYTERANGE))}i.trigger("data",o);return}if(s=/^#EXT-X-STREAM-INF:?(.*)$/.exec(l),s){if(o={type:"tag",tagType:"stream-inf"},s[1]){if(o.attributes=lt(s[1]),o.attributes.RESOLUTION){var m=o.attributes.RESOLUTION.split("x"),_={};m[0]&&(_.width=parseInt(m[0],10)),m[1]&&(_.height=parseInt(m[1],10)),o.attributes.RESOLUTION=_}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}i.trigger("data",o);return}if(s=/^#EXT-X-MEDIA:?(.*)$/.exec(l),s){o={type:"tag",tagType:"media"},s[1]&&(o.attributes=lt(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-ENDLIST/.exec(l),s){i.trigger("data",{type:"tag",tagType:"endlist"});return}if(s=/^#EXT-X-DISCONTINUITY/.exec(l),s){i.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(s=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(l),s){o={type:"tag",tagType:"program-date-time"},s[1]&&(o.dateTimeString=s[1],o.dateTimeObject=new Date(s[1])),i.trigger("data",o);return}if(s=/^#EXT-X-KEY:?(.*)$/.exec(l),s){o={type:"tag",tagType:"key"},s[1]&&(o.attributes=lt(s[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),i.trigger("data",o);return}if(s=/^#EXT-X-START:?(.*)$/.exec(l),s){o={type:"tag",tagType:"start"},s[1]&&(o.attributes=lt(s[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),i.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out-cont"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-out"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-CUE-IN:?(.*)?$/.exec(l),s){o={type:"tag",tagType:"cue-in"},s[1]?o.data=s[1]:o.data="",i.trigger("data",o);return}if(s=/^#EXT-X-SKIP:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"skip"},o.attributes=lt(s[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(Bm)),i.trigger("data",o);return}if(s=/^#EXT-X-PART:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part"},o.attributes=lt(s[1]),["DURATION"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["INDEPENDENT","GAP"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=qa(o.attributes.BYTERANGE)),i.trigger("data",o);return}if(s=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"server-control"},o.attributes=lt(s[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=/YES/.test(o.attributes[b]))}),i.trigger("data",o);return}if(s=/^#EXT-X-PART-INF:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"part-inf"},o.attributes=lt(s[1]),["PART-TARGET"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),i.trigger("data",o);return}if(s=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=lt(s[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(b){if(o.attributes.hasOwnProperty(b)){o.attributes[b]=parseInt(o.attributes[b],10);var S=b==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[S]=o.attributes[b],delete o.attributes[b]}}),i.trigger("data",o);return}if(s=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(l),s&&s[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=lt(s[1]),["LAST-MSN","LAST-PART"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseInt(o.attributes[b],10))}),i.trigger("data",o);return}i.trigger("data",{type:"tag",data:l.slice(4)})})}},r.addParser=function(e){var i=this,s=e.expression,o=e.customType,u=e.dataParser,l=e.segment;typeof u!="function"&&(u=function(p){return p}),this.customParsers.push(function(c){var p=s.exec(c);if(p)return i.trigger("data",{type:"custom",data:u(c),customType:o,segment:l}),!0})},r.addTagMapper=function(e){var i=e.expression,s=e.map,o=function(l){return i.test(l)?s(l):l};this.tagMappers.push(o)},t}(qs),Hm=function(t){return t.toLowerCase().replace(/-(\w)/g,function(r){return r[1].toUpperCase()})},Sr=function(t){var r={};return Object.keys(t).forEach(function(n){r[Hm(n)]=t[n]}),r},ja=function(t){var r=t.serverControl,n=t.targetDuration,e=t.partTargetDuration;if(r){var i="#EXT-X-SERVER-CONTROL",s="holdBack",o="partHoldBack",u=n&&n*3,l=e&&e*2;n&&!r.hasOwnProperty(s)&&(r[s]=u,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+u+")."})),u&&r[s]<u&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+r[s]+") to targetDuration * 3 ("+u+")"}),r[s]=u),e&&!r.hasOwnProperty(o)&&(r[o]=e*3,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+r[o]+")."})),e&&r[o]<l&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+r[o]+") to partTargetDuration * 2 ("+l+")."}),r[o]=l)}},qm=function(a){G._inheritsLoose(t,a);function t(){var n;n=a.call(this)||this,n.lineStream=new Nm,n.parseStream=new Vm,n.lineStream.pipe(n.parseStream);var e=ee(n),i=[],s={},o,u,l=!1,c=function(){},p={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",_=0;n.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var b=0,S=0;return n.on("end",function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&o&&(s.map=o),!s.key&&u&&(s.key=u),!s.timeline&&typeof _=="number"&&(s.timeline=_),n.manifest.preloadSegment=s)}),n.parseStream.on("data",function(x){var k,L;({tag:function(){({version:function(){x.version&&(this.manifest.version=x.version)},"allow-cache":function(){this.manifest.allowCache=x.allowed,"allowed"in x||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var F={};"length"in x&&(s.byterange=F,F.length=x.length,"offset"in x||(x.offset=b)),"offset"in x&&(s.byterange=F,F.offset=x.offset),b=F.offset+F.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),x.duration>0&&(s.duration=x.duration),x.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key:function(){if(!x.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(x.attributes.METHOD==="NONE"){u=null;return}if(!x.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(x.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:x.attributes};return}if(x.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:x.attributes.URI};return}if(x.attributes.KEYFORMAT===m){var F=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(F.indexOf(x.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(x.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),x.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(x.attributes.KEYID&&x.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:x.attributes.KEYFORMAT,keyId:x.attributes.KEYID.substring(2)},pssh:vd(x.attributes.URI.split(",")[1])};return}x.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:x.attributes.METHOD||"AES-128",uri:x.attributes.URI},typeof x.attributes.IV<"u"&&(u.iv=x.attributes.IV)},"media-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+x.number});return}this.manifest.mediaSequence=x.number},"discontinuity-sequence":function(){if(!isFinite(x.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+x.number});return}this.manifest.discontinuitySequence=x.number,_=x.number},"playlist-type":function(){if(!/VOD|EVENT/.test(x.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+x.playlist});return}this.manifest.playlistType=x.playlistType},map:function(){o={},x.uri&&(o.uri=x.uri),x.byterange&&(o.byterange=x.byterange),u&&(o.key=u)},"stream-inf":function(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||p,!x.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),ht(s.attributes,x.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(x.attributes&&x.attributes.TYPE&&x.attributes["GROUP-ID"]&&x.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var F=this.manifest.mediaGroups[x.attributes.TYPE];F[x.attributes["GROUP-ID"]]=F[x.attributes["GROUP-ID"]]||{},k=F[x.attributes["GROUP-ID"]],L={default:/yes/i.test(x.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(x.attributes.AUTOSELECT),x.attributes.LANGUAGE&&(L.language=x.attributes.LANGUAGE),x.attributes.URI&&(L.uri=x.attributes.URI),x.attributes["INSTREAM-ID"]&&(L.instreamId=x.attributes["INSTREAM-ID"]),x.attributes.CHARACTERISTICS&&(L.characteristics=x.attributes.CHARACTERISTICS),x.attributes.FORCED&&(L.forced=/yes/i.test(x.attributes.FORCED)),k[x.attributes.NAME]=L},discontinuity:function(){_+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=x.dateTimeString,this.manifest.dateTimeObject=x.dateTimeObject),s.dateTimeString=x.dateTimeString,s.dateTimeObject=x.dateTimeObject},targetduration:function(){if(!isFinite(x.duration)||x.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+x.duration});return}this.manifest.targetDuration=x.duration,ja.call(this,this.manifest)},start:function(){if(!x.attributes||isNaN(x.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:x.attributes["TIME-OFFSET"],precise:x.attributes.PRECISE}},"cue-out":function(){s.cueOut=x.data},"cue-out-cont":function(){s.cueOutCont=x.data},"cue-in":function(){s.cueIn=x.data},skip:function(){this.manifest.skip=Sr(x.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",x.attributes,["SKIPPED-SEGMENTS"])},part:function(){var F=this;l=!0;var q=this.manifest.segments.length,B=Sr(x.attributes);s.parts=s.parts||[],s.parts.push(B),B.byterange&&(B.byterange.hasOwnProperty("offset")||(B.byterange.offset=S),S=B.byterange.offset+B.byterange.length);var R=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+R+" for segment #"+q,x.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(U,N){U.hasOwnProperty("lastPart")||F.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+N+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var F=this.manifest.serverControl=Sr(x.attributes);F.hasOwnProperty("canBlockReload")||(F.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ja.call(this,this.manifest),F.canSkipDateranges&&!F.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var F=this.manifest.segments.length,q=Sr(x.attributes),B=q.type&&q.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(q),q.byterange&&(q.byterange.hasOwnProperty("offset")||(q.byterange.offset=B?S:0,B&&(S=q.byterange.offset+q.byterange.length)));var R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+R+" for segment #"+F,x.attributes,["TYPE","URI"]),!!q.type)for(var U=0;U<s.preloadHints.length-1;U++){var N=s.preloadHints[U];N.type&&N.type===q.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+R+" for segment #"+F+" has the same TYPE "+q.type+" as preload hint #"+U})}},"rendition-report":function(){var F=Sr(x.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(F);var q=this.manifest.renditionReports.length-1,B=["LAST-MSN","URI"];l&&B.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+q,x.attributes,B)},"part-inf":function(){this.manifest.partInf=Sr(x.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",x.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ja.call(this,this.manifest)}}[x.tagType]||c).call(e)},uri:function(){s.uri=x.uri,i.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),u&&(s.key=u),s.timeline=_,o&&(s.map=o),S=0,s={}},comment:function(){},custom:function(){x.segment?(s.custom=s.custom||{},s.custom[x.customType]=x.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[x.customType]=x.data)}})[x.type].call(e)}),n}var r=t.prototype;return r.warnOnMissingAttributes_=function(e,i,s){var o=[];s.forEach(function(u){i.hasOwnProperty(u)||o.push(u)}),o.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+o.join(", ")})},r.push=function(e){this.lineStream.push(e)},r.end=function(){this.lineStream.push(`
|
|
20
|
+
`),this.trigger("end")},r.addParser=function(e){this.parseStream.addParser(e)},r.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(qs),cr={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^/},jm=["video","audio","text"],Uu=["Video","Audio","Text"],yd=function(t){return t&&t.replace(/avc1\.(\d+)\.(\d+)/i,function(r,n,e){var i=("00"+Number(n).toString(16)).slice(-2),s=("00"+Number(e).toString(16)).slice(-2);return"avc1."+i+"00"+s})},yt=function(t){t===void 0&&(t="");var r=t.split(","),n=[];return r.forEach(function(e){e=e.trim();var i;jm.forEach(function(s){var o=cr[s].exec(e.toLowerCase());if(!(!o||o.length<=1)){i=s;var u=e.substring(0,o[1].length),l=e.replace(u,"");n.push({type:u,details:l,mediaType:s})}}),i||n.push({type:e,details:"",mediaType:"unknown"})}),n},Wm=function(t,r){if(!t.mediaGroups.AUDIO||!r)return null;var n=t.mediaGroups.AUDIO[r];if(!n)return null;for(var e in n){var i=n[e];if(i.default&&i.playlists)return yt(i.playlists[0].attributes.CODECS)}return null},_d=function(t){return t===void 0&&(t=""),cr.audio.test(t.trim().toLowerCase())},Gm=function(t){return t===void 0&&(t=""),cr.text.test(t.trim().toLowerCase())},wi=function(t){if(!(!t||typeof t!="string")){var r=t.toLowerCase().split(",").map(function(i){return yd(i.trim())}),n="video";r.length===1&&_d(r[0])?n="audio":r.length===1&&Gm(r[0])&&(n="application");var e="mp4";return r.every(function(i){return cr.mp4.test(i)})?e="mp4":r.every(function(i){return cr.webm.test(i)})?e="webm":r.every(function(i){return cr.ogg.test(i)})&&(e="ogg"),n+"/"+e+';codecs="'+t+'"'}},Ln=function(t){return t===void 0&&(t=""),A.MediaSource&&A.MediaSource.isTypeSupported&&A.MediaSource.isTypeSupported(wi(t))||!1},Wa=function(t){return t===void 0&&(t=""),t.toLowerCase().split(",").every(function(r){r=r.trim();for(var n=0;n<Uu.length;n++){var e=Uu[n];if(cr["muxer"+e].test(r))return!0}return!1})},Vu="mp4a.40.2",zm="avc1.4d400d",$m=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Km=/^application\/dash\+xml/i,Td=function(t){return $m.test(t)?"hls":Km.test(t)?"dash":t==="application/vnd.videojs.vhs+json"?"vhs-json":null},Xm=function(t){return t.toString(2).length},Ym=function(t){return Math.ceil(Xm(t)/8)},bd=function(t){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},Qm=function(t){return bd(t)},Q=function(t){return t instanceof Uint8Array?t:(!Array.isArray(t)&&!Qm(t)&&!(t instanceof ArrayBuffer)&&(typeof t!="number"||typeof t=="number"&&t!==t?t=0:t=[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},Oe=A.BigInt||Number,ds=[Oe("0x1"),Oe("0x100"),Oe("0x10000"),Oe("0x1000000"),Oe("0x100000000"),Oe("0x10000000000"),Oe("0x1000000000000"),Oe("0x100000000000000"),Oe("0x10000000000000000")];(function(){var a=new Uint16Array([65484]),t=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);return t[0]===255?"big":t[0]===204?"little":"unknown"})();var Jm=function(t,r){var n=r===void 0?{}:r,e=n.signed,i=e===void 0?!1:e,s=n.le,o=s===void 0?!1:s;t=Q(t);var u=o?"reduce":"reduceRight",l=t[u]?t[u]:Array.prototype[u],c=l.call(t,function(m,_,b){var S=o?b:Math.abs(b+1-t.length);return m+Oe(_)*ds[S]},Oe(0));if(i){var p=ds[t.length]/Oe(2)-Oe(1);c=Oe(c),c>p&&(c-=p,c-=p,c-=Oe(2))}return Number(c)},Zm=function(t,r){var n={},e=n.le,i=e===void 0?!1:e;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!==t)&&(t=0),t=Oe(t);for(var s=Ym(t),o=new Uint8Array(new ArrayBuffer(s)),u=0;u<s;u++){var l=i?u:Math.abs(u+1-o.length);o[l]=Number(t/ds[u]&Oe(255)),t<0&&(o[l]=Math.abs(~o[l]),o[l]-=u===0?1:2)}return o},xd=function(t,r){if(typeof t!="string"&&t&&typeof t.toString=="function"&&(t=t.toString()),typeof t!="string")return new Uint8Array;r||(t=unescape(encodeURIComponent(t)));for(var n=new Uint8Array(t.length),e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},eg=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r=r.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),r.length<=1)return Q(r[0]);var e=r.reduce(function(o,u,l){return o+(u.byteLength||u.length)},0),i=new Uint8Array(e),s=0;return r.forEach(function(o){o=Q(o),i.set(o,s),s+=o.byteLength}),i},_e=function(t,r,n){var e=n===void 0?{}:n,i=e.offset,s=i===void 0?0:i,o=e.mask,u=o===void 0?[]:o;t=Q(t),r=Q(r);var l=r.every?r.every:Array.prototype.every;return r.length&&t.length-s>=r.length&&l.call(r,function(c,p){var m=u[p]?u[p]&t[s+p]:t[s+p];return c===m})},tg=function(t,r,n){r.forEach(function(e){for(var i in t.mediaGroups[e])for(var s in t.mediaGroups[e][i]){var o=t.mediaGroups[e][i][s];n(o,e,i,s)}})},Jt={},qt={};function rg(a,t,r){if(r===void 0&&(r=Array.prototype),a&&typeof r.find=="function")return r.find.call(a,t);for(var n=0;n<a.length;n++)if(Object.prototype.hasOwnProperty.call(a,n)){var e=a[n];if(t.call(void 0,e,n,a))return e}}function js(a,t){return t===void 0&&(t=Object),t&&typeof t.freeze=="function"?t.freeze(a):a}function ig(a,t){if(a===null||typeof a!="object")throw new TypeError("target is not an object");for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(a[r]=t[r]);return a}var Sd=js({HTML:"text/html",isHTML:function(a){return a===Sd.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Ed=js({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(a){return a===Ed.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});qt.assign=ig;qt.find=rg;qt.freeze=js;qt.MIME_TYPE=Sd;qt.NAMESPACE=Ed;var Cd=qt,Et=Cd.find,ki=Cd.NAMESPACE;function ng(a){return a!==""}function ag(a){return a?a.split(/[\t\n\f\r ]+/).filter(ng):[]}function sg(a,t){return a.hasOwnProperty(t)||(a[t]=!0),a}function Hu(a){if(!a)return[];var t=ag(a);return Object.keys(t.reduce(sg,{}))}function og(a){return function(t){return a&&a.indexOf(t)!==-1}}function Bi(a,t){for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}function Je(a,t){var r=a.prototype;if(!(r instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,Bi(r,n),a.prototype=r=n}r.constructor!=a&&(typeof a!="function"&&console.error("unknown Class:"+a),r.constructor=a)}var Ze={},ct=Ze.ELEMENT_NODE=1,Ur=Ze.ATTRIBUTE_NODE=2,Bn=Ze.TEXT_NODE=3,Ad=Ze.CDATA_SECTION_NODE=4,Dd=Ze.ENTITY_REFERENCE_NODE=5,ug=Ze.ENTITY_NODE=6,wd=Ze.PROCESSING_INSTRUCTION_NODE=7,kd=Ze.COMMENT_NODE=8,Pd=Ze.DOCUMENT_NODE=9,Id=Ze.DOCUMENT_TYPE_NODE=10,Bt=Ze.DOCUMENT_FRAGMENT_NODE=11,lg=Ze.NOTATION_NODE=12,Ue={},Pe={};Ue.INDEX_SIZE_ERR=(Pe[1]="Index size error",1);Ue.DOMSTRING_SIZE_ERR=(Pe[2]="DOMString size error",2);var Ye=Ue.HIERARCHY_REQUEST_ERR=(Pe[3]="Hierarchy request error",3);Ue.WRONG_DOCUMENT_ERR=(Pe[4]="Wrong document",4);Ue.INVALID_CHARACTER_ERR=(Pe[5]="Invalid character",5);Ue.NO_DATA_ALLOWED_ERR=(Pe[6]="No data allowed",6);Ue.NO_MODIFICATION_ALLOWED_ERR=(Pe[7]="No modification allowed",7);var Ld=Ue.NOT_FOUND_ERR=(Pe[8]="Not found",8);Ue.NOT_SUPPORTED_ERR=(Pe[9]="Not supported",9);var qu=Ue.INUSE_ATTRIBUTE_ERR=(Pe[10]="Attribute in use",10);Ue.INVALID_STATE_ERR=(Pe[11]="Invalid state",11);Ue.SYNTAX_ERR=(Pe[12]="Syntax error",12);Ue.INVALID_MODIFICATION_ERR=(Pe[13]="Invalid modification",13);Ue.NAMESPACE_ERR=(Pe[14]="Invalid namespace",14);Ue.INVALID_ACCESS_ERR=(Pe[15]="Invalid access",15);function Ce(a,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,Pe[a]),this.message=Pe[a],Error.captureStackTrace&&Error.captureStackTrace(this,Ce);return r.code=a,t&&(this.message=this.message+": "+t),r}Ce.prototype=Error.prototype;Bi(Ue,Ce);function Ft(){}Ft.prototype={length:0,item:function(a){return a>=0&&a<this.length?this[a]:null},toString:function(a,t){for(var r=[],n=0;n<this.length;n++)Lr(this[n],r,a,t);return r.join("")},filter:function(a){return Array.prototype.filter.call(this,a)},indexOf:function(a){return Array.prototype.indexOf.call(this,a)}};function Vr(a,t){this._node=a,this._refresh=t,Ws(this)}function Ws(a){var t=a._node._inc||a._node.ownerDocument._inc;if(a._inc!==t){var r=a._refresh(a._node);if(Wd(a,"length",r.length),!a.$$length||r.length<a.$$length)for(var n=r.length;n in a;n++)Object.prototype.hasOwnProperty.call(a,n)&&delete a[n];Bi(r,a),a._inc=t}}Vr.prototype.item=function(a){return Ws(this),this[a]||null};Je(Vr,Ft);function Un(){}function Od(a,t){for(var r=a.length;r--;)if(a[r]===t)return r}function ju(a,t,r,n){if(n?t[Od(t,n)]=r:t[t.length++]=r,a){r.ownerElement=a;var e=a.ownerDocument;e&&(n&&Md(e,a,n),dg(e,a,r))}}function Wu(a,t,r){var n=Od(t,r);if(n>=0){for(var e=t.length-1;n<e;)t[n]=t[++n];if(t.length=e,a){var i=a.ownerDocument;i&&(Md(i,a,r),r.ownerElement=null)}}else throw new Ce(Ld,new Error(a.tagName+"@"+r))}Un.prototype={length:0,item:Ft.prototype.item,getNamedItem:function(a){for(var t=this.length;t--;){var r=this[t];if(r.nodeName==a)return r}},setNamedItem:function(a){var t=a.ownerElement;if(t&&t!=this._ownerElement)throw new Ce(qu);var r=this.getNamedItem(a.nodeName);return ju(this._ownerElement,this,a,r),r},setNamedItemNS:function(a){var t=a.ownerElement,r;if(t&&t!=this._ownerElement)throw new Ce(qu);return r=this.getNamedItemNS(a.namespaceURI,a.localName),ju(this._ownerElement,this,a,r),r},removeNamedItem:function(a){var t=this.getNamedItem(a);return Wu(this._ownerElement,this,t),t},removeNamedItemNS:function(a,t){var r=this.getNamedItemNS(a,t);return Wu(this._ownerElement,this,r),r},getNamedItemNS:function(a,t){for(var r=this.length;r--;){var n=this[r];if(n.localName==t&&n.namespaceURI==a)return n}return null}};function Fd(){}Fd.prototype={hasFeature:function(a,t){return!0},createDocument:function(a,t,r){var n=new Ui;if(n.implementation=this,n.childNodes=new Ft,n.doctype=r||null,r&&n.appendChild(r),t){var e=n.createElementNS(a,t);n.appendChild(e)}return n},createDocumentType:function(a,t,r){var n=new da;return n.name=a,n.nodeName=a,n.publicId=t||"",n.systemId=r||"",n}};function ce(){}ce.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(a,t){return Vn(this,a,t)},replaceChild:function(a,t){Vn(this,a,t,Bd),t&&this.removeChild(t)},removeChild:function(a){return Nd(this,a)},appendChild:function(a){return this.insertBefore(a,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(a){return cs(this.ownerDocument||this,this,a)},normalize:function(){for(var a=this.firstChild;a;){var t=a.nextSibling;t&&t.nodeType==Bn&&a.nodeType==Bn?(this.removeChild(t),a.appendData(t.data)):(a.normalize(),a=t)}},isSupported:function(a,t){return this.ownerDocument.implementation.hasFeature(a,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(a){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&r[n]===a)return n}t=t.nodeType==Ur?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(a){for(var t=this;t;){var r=t._nsMap;if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a];t=t.nodeType==Ur?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(a){var t=this.lookupPrefix(a);return t==null}};function Rd(a){return a=="<"&&"<"||a==">"&&">"||a=="&"&&"&"||a=='"'&&"""||"&#"+a.charCodeAt()+";"}Bi(Ze,ce);Bi(Ze,ce.prototype);function Pi(a,t){if(t(a))return!0;if(a=a.firstChild)do if(Pi(a,t))return!0;while(a=a.nextSibling)}function Ui(){this.ownerDocument=this}function dg(a,t,r){a&&a._inc++;var n=r.namespaceURI;n===ki.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function Md(a,t,r,n){a&&a._inc++;var e=r.namespaceURI;e===ki.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Gs(a,t,r){if(a&&a._inc){a._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var e=t.firstChild,i=0;e;)n[i++]=e,e=e.nextSibling;n.length=i,delete n[n.length]}}}function Nd(a,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:a.firstChild=n,n?n.previousSibling=r:a.lastChild=r,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Gs(a.ownerDocument,a),t}function cg(a){return a&&(a.nodeType===ce.DOCUMENT_NODE||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.ELEMENT_NODE)}function fg(a){return a&&(Ct(a)||zs(a)||Ut(a)||a.nodeType===ce.DOCUMENT_FRAGMENT_NODE||a.nodeType===ce.COMMENT_NODE||a.nodeType===ce.PROCESSING_INSTRUCTION_NODE)}function Ut(a){return a&&a.nodeType===ce.DOCUMENT_TYPE_NODE}function Ct(a){return a&&a.nodeType===ce.ELEMENT_NODE}function zs(a){return a&&a.nodeType===ce.TEXT_NODE}function Gu(a,t){var r=a.childNodes||[];if(Et(r,Ct)||Ut(t))return!1;var n=Et(r,Ut);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function zu(a,t){var r=a.childNodes||[];function n(i){return Ct(i)&&i!==t}if(Et(r,n))return!1;var e=Et(r,Ut);return!(t&&e&&r.indexOf(e)>r.indexOf(t))}function hg(a,t,r){if(!cg(a))throw new Ce(Ye,"Unexpected parent node type "+a.nodeType);if(r&&r.parentNode!==a)throw new Ce(Ld,"child not in parent");if(!fg(t)||Ut(t)&&a.nodeType!==ce.DOCUMENT_NODE)throw new Ce(Ye,"Unexpected node type "+t.nodeType+" for parent node type "+a.nodeType)}function pg(a,t,r){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===ce.DOCUMENT_FRAGMENT_NODE){var i=e.filter(Ct);if(i.length>1||Et(e,zs))throw new Ce(Ye,"More than one element or text in fragment");if(i.length===1&&!Gu(a,r))throw new Ce(Ye,"Element in fragment can not be inserted before doctype")}if(Ct(t)&&!Gu(a,r))throw new Ce(Ye,"Only one element can be added and only after doctype");if(Ut(t)){if(Et(n,Ut))throw new Ce(Ye,"Only one doctype is allowed");var s=Et(n,Ct);if(r&&n.indexOf(s)<n.indexOf(r))throw new Ce(Ye,"Doctype can only be inserted before an element");if(!r&&s)throw new Ce(Ye,"Doctype can not be appended since element is present")}}function Bd(a,t,r){var n=a.childNodes||[],e=t.childNodes||[];if(t.nodeType===ce.DOCUMENT_FRAGMENT_NODE){var i=e.filter(Ct);if(i.length>1||Et(e,zs))throw new Ce(Ye,"More than one element or text in fragment");if(i.length===1&&!zu(a,r))throw new Ce(Ye,"Element in fragment can not be inserted before doctype")}if(Ct(t)&&!zu(a,r))throw new Ce(Ye,"Only one element can be added and only after doctype");if(Ut(t)){if(Et(n,function(u){return Ut(u)&&u!==r}))throw new Ce(Ye,"Only one doctype is allowed");var s=Et(n,Ct);if(r&&n.indexOf(s)<n.indexOf(r))throw new Ce(Ye,"Doctype can only be inserted before an element")}}function Vn(a,t,r,n){hg(a,t,r),a.nodeType===ce.DOCUMENT_NODE&&(n||pg)(a,t,r);var e=t.parentNode;if(e&&e.removeChild(t),t.nodeType===Bt){var i=t.firstChild;if(i==null)return t;var s=t.lastChild}else i=s=t;var o=r?r.previousSibling:a.lastChild;i.previousSibling=o,s.nextSibling=r,o?o.nextSibling=i:a.firstChild=i,r==null?a.lastChild=s:r.previousSibling=s;do i.parentNode=a;while(i!==s&&(i=i.nextSibling));return Gs(a.ownerDocument||a,a),t.nodeType==Bt&&(t.firstChild=t.lastChild=null),t}function mg(a,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=a,t.previousSibling=a.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:a.firstChild=t,a.lastChild=t,Gs(a.ownerDocument,a,t),t}Ui.prototype={nodeName:"#document",nodeType:Pd,doctype:null,documentElement:null,_inc:1,insertBefore:function(a,t){if(a.nodeType==Bt){for(var r=a.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return a}return Vn(this,a,t),a.ownerDocument=this,this.documentElement===null&&a.nodeType===ct&&(this.documentElement=a),a},removeChild:function(a){return this.documentElement==a&&(this.documentElement=null),Nd(this,a)},replaceChild:function(a,t){Vn(this,a,t,Bd),a.ownerDocument=this,t&&this.removeChild(t),Ct(a)&&(this.documentElement=a)},importNode:function(a,t){return jd(this,a,t)},getElementById:function(a){var t=null;return Pi(this.documentElement,function(r){if(r.nodeType==ct&&r.getAttribute("id")==a)return t=r,!0}),t},getElementsByClassName:function(a){var t=Hu(a);return new Vr(this,function(r){var n=[];return t.length>0&&Pi(r.documentElement,function(e){if(e!==r&&e.nodeType===ct){var i=e.getAttribute("class");if(i){var s=a===i;if(!s){var o=Hu(i);s=t.every(og(o))}s&&n.push(e)}}}),n})},createElement:function(a){var t=new mr;t.ownerDocument=this,t.nodeName=a,t.tagName=a,t.localName=a,t.childNodes=new Ft;var r=t.attributes=new Un;return r._ownerElement=t,t},createDocumentFragment:function(){var a=new ca;return a.ownerDocument=this,a.childNodes=new Ft,a},createTextNode:function(a){var t=new $s;return t.ownerDocument=this,t.appendData(a),t},createComment:function(a){var t=new Ks;return t.ownerDocument=this,t.appendData(a),t},createCDATASection:function(a){var t=new Xs;return t.ownerDocument=this,t.appendData(a),t},createProcessingInstruction:function(a,t){var r=new Qs;return r.ownerDocument=this,r.tagName=r.nodeName=r.target=a,r.nodeValue=r.data=t,r},createAttribute:function(a){var t=new Hn;return t.ownerDocument=this,t.name=a,t.nodeName=a,t.localName=a,t.specified=!0,t},createEntityReference:function(a){var t=new Ys;return t.ownerDocument=this,t.nodeName=a,t},createElementNS:function(a,t){var r=new mr,n=t.split(":"),e=r.attributes=new Un;return r.childNodes=new Ft,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=a,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,e._ownerElement=r,r},createAttributeNS:function(a,t){var r=new Hn,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=a,r.specified=!0,n.length==2?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}};Je(Ui,ce);function mr(){this._nsMap={}}mr.prototype={nodeType:ct,hasAttribute:function(a){return this.getAttributeNode(a)!=null},getAttribute:function(a){var t=this.getAttributeNode(a);return t&&t.value||""},getAttributeNode:function(a){return this.attributes.getNamedItem(a)},setAttribute:function(a,t){var r=this.ownerDocument.createAttribute(a);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(a){var t=this.getAttributeNode(a);t&&this.removeAttributeNode(t)},appendChild:function(a){return a.nodeType===Bt?this.insertBefore(a,null):mg(this,a)},setAttributeNode:function(a){return this.attributes.setNamedItem(a)},setAttributeNodeNS:function(a){return this.attributes.setNamedItemNS(a)},removeAttributeNode:function(a){return this.attributes.removeNamedItem(a.nodeName)},removeAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(a,t){return this.getAttributeNodeNS(a,t)!=null},getAttributeNS:function(a,t){var r=this.getAttributeNodeNS(a,t);return r&&r.value||""},setAttributeNS:function(a,t,r){var n=this.ownerDocument.createAttributeNS(a,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(a,t){return this.attributes.getNamedItemNS(a,t)},getElementsByTagName:function(a){return new Vr(this,function(t){var r=[];return Pi(t,function(n){n!==t&&n.nodeType==ct&&(a==="*"||n.tagName==a)&&r.push(n)}),r})},getElementsByTagNameNS:function(a,t){return new Vr(this,function(r){var n=[];return Pi(r,function(e){e!==r&&e.nodeType===ct&&(a==="*"||e.namespaceURI===a)&&(t==="*"||e.localName==t)&&n.push(e)}),n})}};Ui.prototype.getElementsByTagName=mr.prototype.getElementsByTagName;Ui.prototype.getElementsByTagNameNS=mr.prototype.getElementsByTagNameNS;Je(mr,ce);function Hn(){}Hn.prototype.nodeType=Ur;Je(Hn,ce);function Vi(){}Vi.prototype={data:"",substringData:function(a,t){return this.data.substring(a,a+t)},appendData:function(a){a=this.data+a,this.nodeValue=this.data=a,this.length=a.length},insertData:function(a,t){this.replaceData(a,0,t)},appendChild:function(a){throw new Error(Pe[Ye])},deleteData:function(a,t){this.replaceData(a,t,"")},replaceData:function(a,t,r){var n=this.data.substring(0,a),e=this.data.substring(a+t);r=n+r+e,this.nodeValue=this.data=r,this.length=r.length}};Je(Vi,ce);function $s(){}$s.prototype={nodeName:"#text",nodeType:Bn,splitText:function(a){var t=this.data,r=t.substring(a);t=t.substring(0,a),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};Je($s,Vi);function Ks(){}Ks.prototype={nodeName:"#comment",nodeType:kd};Je(Ks,Vi);function Xs(){}Xs.prototype={nodeName:"#cdata-section",nodeType:Ad};Je(Xs,Vi);function da(){}da.prototype.nodeType=Id;Je(da,ce);function Ud(){}Ud.prototype.nodeType=lg;Je(Ud,ce);function Vd(){}Vd.prototype.nodeType=ug;Je(Vd,ce);function Ys(){}Ys.prototype.nodeType=Dd;Je(Ys,ce);function ca(){}ca.prototype.nodeName="#document-fragment";ca.prototype.nodeType=Bt;Je(ca,ce);function Qs(){}Qs.prototype.nodeType=wd;Je(Qs,ce);function Hd(){}Hd.prototype.serializeToString=function(a,t,r){return qd.call(a,t,r)};ce.prototype.toString=qd;function qd(a,t){var r=[],n=this.nodeType==9&&this.documentElement||this,e=n.prefix,i=n.namespaceURI;if(i&&e==null){var e=n.lookupPrefix(i);if(e==null)var s=[{namespace:i,prefix:null}]}return Lr(this,r,a,t,s),r.join("")}function $u(a,t,r){var n=a.prefix||"",e=a.namespaceURI;if(!e||n==="xml"&&e===ki.XML||e===ki.XMLNS)return!1;for(var i=r.length;i--;){var s=r[i];if(s.prefix===n)return s.namespace!==e}return!0}function Ga(a,t,r){a.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Rd),'"')}function Lr(a,t,r,n,e){if(e||(e=[]),n)if(a=n(a),a){if(typeof a=="string"){t.push(a);return}}else return;switch(a.nodeType){case ct:var i=a.attributes,s=i.length,k=a.firstChild,o=a.tagName;r=ki.isHTML(a.namespaceURI)||r;var u=o;if(!r&&!a.prefix&&a.namespaceURI){for(var l,c=0;c<i.length;c++)if(i.item(c).name==="xmlns"){l=i.item(c).value;break}if(!l)for(var p=e.length-1;p>=0;p--){var m=e[p];if(m.prefix===""&&m.namespace===a.namespaceURI){l=m.namespace;break}}if(l!==a.namespaceURI)for(var p=e.length-1;p>=0;p--){var m=e[p];if(m.namespace===a.namespaceURI){m.prefix&&(u=m.prefix+":"+o);break}}}t.push("<",u);for(var _=0;_<s;_++){var b=i.item(_);b.prefix=="xmlns"?e.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&e.push({prefix:"",namespace:b.value})}for(var _=0;_<s;_++){var b=i.item(_);if($u(b,r,e)){var S=b.prefix||"",x=b.namespaceURI;Ga(t,S?"xmlns:"+S:"xmlns",x),e.push({prefix:S,namespace:x})}Lr(b,t,r,n,e)}if(o===u&&$u(a,r,e)){var S=a.prefix||"",x=a.namespaceURI;Ga(t,S?"xmlns:"+S:"xmlns",x),e.push({prefix:S,namespace:x})}if(k||r&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(t.push(">"),r&&/^script$/i.test(o))for(;k;)k.data?t.push(k.data):Lr(k,t,r,n,e.slice()),k=k.nextSibling;else for(;k;)Lr(k,t,r,n,e.slice()),k=k.nextSibling;t.push("</",u,">")}else t.push("/>");return;case Pd:case Bt:for(var k=a.firstChild;k;)Lr(k,t,r,n,e.slice()),k=k.nextSibling;return;case Ur:return Ga(t,a.name,a.value);case Bn:return t.push(a.data.replace(/[<&>]/g,Rd));case Ad:return t.push("<![CDATA[",a.data,"]]>");case kd:return t.push("<!--",a.data,"-->");case Id:var L=a.publicId,H=a.systemId;if(t.push("<!DOCTYPE ",a.name),L)t.push(" PUBLIC ",L),H&&H!="."&&t.push(" ",H),t.push(">");else if(H&&H!=".")t.push(" SYSTEM ",H,">");else{var O=a.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case wd:return t.push("<?",a.target," ",a.data,"?>");case Dd:return t.push("&",a.nodeName,";");default:t.push("??",a.nodeName)}}function jd(a,t,r){var n;switch(t.nodeType){case ct:n=t.cloneNode(!1),n.ownerDocument=a;case Bt:break;case Ur:r=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=a,n.parentNode=null,r)for(var e=t.firstChild;e;)n.appendChild(jd(a,e,r)),e=e.nextSibling;return n}function cs(a,t,r){var n=new t.constructor;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var i=t[e];typeof i!="object"&&i!=n[e]&&(n[e]=i)}switch(t.childNodes&&(n.childNodes=new Ft),n.ownerDocument=a,n.nodeType){case ct:var s=t.attributes,o=n.attributes=new Un,u=s.length;o._ownerElement=n;for(var l=0;l<u;l++)n.setAttributeNode(cs(a,s.item(l),!0));break;case Ur:r=!0}if(r)for(var c=t.firstChild;c;)n.appendChild(cs(a,c,r)),c=c.nextSibling;return n}function Wd(a,t,r){a[t]=r}try{if(Object.defineProperty){let a=function(t){switch(t.nodeType){case ct:case Bt:var r=[];for(t=t.firstChild;t;)t.nodeType!==7&&t.nodeType!==8&&r.push(a(t)),t=t.nextSibling;return r.join("");default:return t.nodeValue}};Object.defineProperty(Vr.prototype,"length",{get:function(){return Ws(this),this.$$length}}),Object.defineProperty(ce.prototype,"textContent",{get:function(){return a(this)},set:function(t){switch(this.nodeType){case ct:case Bt:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Wd=function(t,r,n){t["$$"+r]=n}}}catch{}Jt.DocumentType=da;Jt.DOMException=Ce;Jt.DOMImplementation=Fd;Jt.Element=mr;Jt.Node=ce;Jt.NodeList=Ft;Jt.XMLSerializer=Hd;var fa={},Gd={};(function(a){var t=qt.freeze;a.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),a.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
21
|
+
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),a.entityMap=a.HTML_ENTITIES})(Gd);var Js={},Ii=qt.NAMESPACE,fs=/[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]/,Ku=new RegExp("[\\-\\.0-9"+fs.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Xu=new RegExp("^"+fs.source+Ku.source+"*(?::"+fs.source+Ku.source+"*)?$"),fi=0,Kt=1,Er=2,hi=3,Cr=4,Ar=5,pi=6,bn=7;function Hr(a,t){this.message=a,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Hr)}Hr.prototype=new Error;Hr.prototype.name=Hr.name;function zd(){}zd.prototype={parse:function(a,t,r){var n=this.domBuilder;n.startDocument(),$d(t,t={}),gg(a,t,r,n,this.errorHandler),n.endDocument()}};function gg(a,t,r,n,e){function i(re){if(re>65535){re-=65536;var ae=55296+(re>>10),pe=56320+(re&1023);return String.fromCharCode(ae,pe)}else return String.fromCharCode(re)}function s(re){var ae=re.slice(1,-1);return Object.hasOwnProperty.call(r,ae)?r[ae]:ae.charAt(0)==="#"?i(parseInt(ae.substr(1).replace("x","0x"))):(e.error("entity not found:"+re),re)}function o(re){if(re>S){var ae=a.substring(S,re).replace(/&#?\w+;/g,s);m&&u(S),n.characters(ae,0,re-S),S=re}}function u(re,ae){for(;re>=c&&(ae=p.exec(a));)l=ae.index,c=l+ae[0].length,m.lineNumber++;m.columnNumber=re-l+1}for(var l=0,c=0,p=/.*(?:\r\n?|\n)|.*$/g,m=n.locator,_=[{currentNSMap:t}],b={},S=0;;){try{var x=a.indexOf("<",S);if(x<0){if(!a.substr(S).match(/^\s*$/)){var k=n.doc,L=k.createTextNode(a.substr(S));k.appendChild(L),n.currentElement=L}return}switch(x>S&&o(x),a.charAt(x+1)){case"/":var X=a.indexOf(">",x+3),H=a.substring(x+2,X).replace(/[ \t\n\r]+$/g,""),O=_.pop();X<0?(H=a.substring(x+2).replace(/[\s<].*/,""),e.error("end tag name: "+H+" is not complete:"+O.tagName),X=x+1+H.length):H.match(/\s</)&&(H=H.replace(/[\s<].*/,""),e.error("end tag name: "+H+" maybe not complete"),X=x+1+H.length);var F=O.localNSMap,q=O.tagName==H,B=q||O.tagName&&O.tagName.toLowerCase()==H.toLowerCase();if(B){if(n.endElement(O.uri,O.localName,H),F)for(var R in F)Object.prototype.hasOwnProperty.call(F,R)&&n.endPrefixMapping(R);q||e.fatalError("end tag name: "+H+" is not match the current start tagName:"+O.tagName)}else _.push(O);X++;break;case"?":m&&u(x),X=bg(a,x,n);break;case"!":m&&u(x),X=Tg(a,x,n,e);break;default:m&&u(x);var U=new Kd,N=_[_.length-1].currentNSMap,X=vg(a,x,U,N,s,e),$=U.length;if(!U.closed&&_g(a,X,U.tagName,b)&&(U.closed=!0,r.nbsp||e.warning("unclosed xml attribute")),m&&$){for(var J=Yu(m,{}),oe=0;oe<$;oe++){var fe=U[oe];u(fe.offset),fe.locator=Yu(m,{})}n.locator=J,Qu(U,n,N)&&_.push(U),n.locator=m}else Qu(U,n,N)&&_.push(U);Ii.isHTML(U.uri)&&!U.closed?X=yg(a,X,U.tagName,s,n):X++}}catch(re){if(re instanceof Hr)throw re;e.error("element parse error: "+re),X=-1}X>S?S=X:o(Math.max(x,S)+1)}}function Yu(a,t){return t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber,t}function vg(a,t,r,n,e,i){function s(m,_,b){r.attributeNames.hasOwnProperty(m)&&i.fatalError("Attribute "+m+" redefined"),r.addValue(m,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,e),b)}for(var o,u,l=++t,c=fi;;){var p=a.charAt(l);switch(p){case"=":if(c===Kt)o=a.slice(t,l),c=hi;else if(c===Er)c=hi;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(c===hi||c===Kt)if(c===Kt&&(i.warning('attribute value must after "="'),o=a.slice(t,l)),t=l+1,l=a.indexOf(p,t),l>0)u=a.slice(t,l),s(o,u,t-1),c=Ar;else throw new Error("attribute value no end '"+p+"' match");else if(c==Cr)u=a.slice(t,l),s(o,u,t),i.warning('attribute "'+o+'" missed start quot('+p+")!!"),t=l+1,c=Ar;else throw new Error('attribute value must after "="');break;case"/":switch(c){case fi:r.setTagName(a.slice(t,l));case Ar:case pi:case bn:c=bn,r.closed=!0;case Cr:case Kt:break;case Er:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),c==fi&&r.setTagName(a.slice(t,l)),l;case">":switch(c){case fi:r.setTagName(a.slice(t,l));case Ar:case pi:case bn:break;case Cr:case Kt:u=a.slice(t,l),u.slice(-1)==="/"&&(r.closed=!0,u=u.slice(0,-1));case Er:c===Er&&(u=o),c==Cr?(i.warning('attribute "'+u+'" missed quot(")!'),s(o,u,t)):((!Ii.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case hi:throw new Error("attribute value missed!!")}return l;case"":p=" ";default:if(p<=" ")switch(c){case fi:r.setTagName(a.slice(t,l)),c=pi;break;case Kt:o=a.slice(t,l),c=Er;break;case Cr:var u=a.slice(t,l);i.warning('attribute "'+u+'" missed quot(")!!'),s(o,u,t);case Ar:c=pi;break}else switch(c){case Er:r.tagName,(!Ii.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=l,c=Kt;break;case Ar:i.warning('attribute space is required"'+o+'"!!');case pi:c=Kt,t=l;break;case hi:c=Cr,t=l;break;case bn:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function Qu(a,t,r){for(var n=a.tagName,e=null,p=a.length;p--;){var i=a[p],s=i.qName,o=i.value,m=s.indexOf(":");if(m>0)var u=i.prefix=s.slice(0,m),l=s.slice(m+1),c=u==="xmlns"&&l;else l=s,u=null,c=s==="xmlns"&&"";i.localName=l,c!==!1&&(e==null&&(e={},$d(r,r={})),r[c]=e[c]=o,i.uri=Ii.XMLNS,t.startPrefixMapping(c,o))}for(var p=a.length;p--;){i=a[p];var u=i.prefix;u&&(u==="xml"&&(i.uri=Ii.XML),u!=="xmlns"&&(i.uri=r[u||""]))}var m=n.indexOf(":");m>0?(u=a.prefix=n.slice(0,m),l=a.localName=n.slice(m+1)):(u=null,l=a.localName=n);var _=a.uri=r[u||""];if(t.startElement(_,l,n,a),a.closed){if(t.endElement(_,l,n),e)for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&t.endPrefixMapping(u)}else return a.currentNSMap=r,a.localNSMap=e,!0}function yg(a,t,r,n,e){if(/^(?:script|textarea)$/i.test(r)){var i=a.indexOf("</"+r+">",t),s=a.substring(t+1,i);if(/[&<]/.test(s))return/^script$/i.test(r)?(e.characters(s,0,s.length),i):(s=s.replace(/&#?\w+;/g,n),e.characters(s,0,s.length),i)}return t+1}function _g(a,t,r,n){var e=n[r];return e==null&&(e=a.lastIndexOf("</"+r+">"),e<t&&(e=a.lastIndexOf("</"+r)),n[r]=e),e<t}function $d(a,t){for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}function Tg(a,t,r,n){var e=a.charAt(t+2);switch(e){case"-":if(a.charAt(t+3)==="-"){var i=a.indexOf("-->",t+4);return i>t?(r.comment(a,t+4,i-t-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(a.substr(t+3,6)=="CDATA["){var i=a.indexOf("]]>",t+9);return r.startCDATA(),r.characters(a,t+9,i-t-9),r.endCDATA(),i+3}var s=xg(a,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var p=s[o-1];return r.startDTD(u,l,c),r.endDTD(),p.index+p[0].length}}return-1}function bg(a,t,r){var n=a.indexOf("?>",t);if(n){var e=a.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return e?(e[0].length,r.processingInstruction(e[1],e[2]),n+2):-1}return-1}function Kd(){this.attributeNames={}}Kd.prototype={setTagName:function(a){if(!Xu.test(a))throw new Error("invalid tagName:"+a);this.tagName=a},addValue:function(a,t,r){if(!Xu.test(a))throw new Error("invalid attribute:"+a);this.attributeNames[a]=this.length,this[this.length++]={qName:a,value:t,offset:r}},length:0,getLocalName:function(a){return this[a].localName},getLocator:function(a){return this[a].locator},getQName:function(a){return this[a].qName},getURI:function(a){return this[a].uri},getValue:function(a){return this[a].value}};function xg(a,t){var r,n=[],e=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(e.lastIndex=t,e.exec(a);r=e.exec(a);)if(n.push(r),r[1])return n}Js.XMLReader=zd;Js.ParseError=Hr;var Sg=qt,Eg=Jt,Ju=Gd,Xd=Js,Cg=Eg.DOMImplementation,Zu=Sg.NAMESPACE,Ag=Xd.ParseError,Dg=Xd.XMLReader;function Yd(a){return a.replace(/\r[\n\u0085]/g,`
|
|
22
22
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
23
|
-
`)}function Qd(a){this.options=a||{locator:{}}}Qd.prototype.parseFromString=function(a,t){var r=this.options,n=new Dg,e=r.domBuilder||new Hi,i=r.errorHandler,s=r.locator,o=r.xmlns||{},u=/\/x?html?$/.test(t),l=u?Ju.HTML_ENTITIES:Ju.XML_ENTITIES;s&&e.setDocumentLocator(s),n.errorHandler=wg(i,e,s),n.domBuilder=r.domBuilder||e,u&&(o[""]=Zu.HTML),o.xml=o.xml||Zu.XML;var c=r.normalizeLineEndings||Yd;return a&&typeof a=="string"?n.parse(c(a),o,l):n.errorHandler.error("invalid doc source"),e.doc};function wg(a,t,r){if(!a){if(t instanceof Hi)return t;a=t}var n={},e=a instanceof Function;r=r||{};function i(s){var o=a[s];!o&&e&&(o=a.length==2?function(u){a(s,u)}:a),n[s]=o&&function(u){o("[xmldom "+s+"] "+u+hs(r))}||function(){}}return i("warning"),i("error"),i("fatalError"),n}function Hi(){this.cdata=!1}function
|
|
24
|
-
@`+(a.systemId||"")+"#[line:"+a.lineNumber+",col:"+a.columnNumber+"]"}function el(a,t,r){return typeof a=="string"?a.substr(t,r):a.length>=t+r||t?new java.lang.String(a,t,r)+"":a}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(a){Hi.prototype[a]=function(){return null}});function xn(a,t){a.currentElement?a.currentElement.appendChild(t):a.doc.appendChild(t)}fa.__DOMHandler=Hi;fa.normalizeLineEndings=Yd;fa.DOMParser=Qd;var kg=fa.DOMParser;/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var tl=function(t){return!!t&&typeof t=="object"},Ge=function a(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(function(e,i){return typeof i!="object"||Object.keys(i).forEach(function(s){Array.isArray(e[s])&&Array.isArray(i[s])?e[s]=e[s].concat(i[s]):tl(e[s])&&tl(i[s])?e[s]=a(e[s],i[s]):e[s]=i[s]}),e},{})},Jd=function(t){return Object.keys(t).map(function(r){return t[r]})},Pg=function(t,r){for(var n=[],e=t;e<r;e++)n.push(e);return n},ha=function(t){return t.reduce(function(r,n){return r.concat(n)},[])},Zd=function(t){if(!t.length)return[];for(var r=[],n=0;n<t.length;n++)r.push(t[n]);return r},Ig=function(t,r){return t.reduce(function(n,e,i){return e[r]&&n.push(i),n},[])},ps=function(t,r){for(var n=0;n<t.length;n++)if(r(t[n]))return n;return-1},Lg=function(t,r){return Jd(t.reduce(function(n,e){return e.forEach(function(i){n[r(i)]=i}),n},{}))},qr={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Li=function(t){var r=t.baseUrl,n=r===void 0?"":r,e=t.source,i=e===void 0?"":e,s=t.range,o=s===void 0?"":s,u=t.indexRange,l=u===void 0?"":u,c={uri:i,resolvedUri:la(n||"",i)};if(o||l){var p=o||l,m=p.split("-"),_=A.BigInt?A.BigInt(m[0]):parseInt(m[0],10),b=A.BigInt?A.BigInt(m[1]):parseInt(m[1],10);_<Number.MAX_SAFE_INTEGER&&typeof _=="bigint"&&(_=Number(_)),b<Number.MAX_SAFE_INTEGER&&typeof b=="bigint"&&(b=Number(b));var S;typeof b=="bigint"||typeof _=="bigint"?S=A.BigInt(b)-A.BigInt(_)+A.BigInt(1):S=b-_+1,typeof S=="bigint"&&S<Number.MAX_SAFE_INTEGER&&(S=Number(S)),c.byterange={length:S,offset:_}}return c},Og=function(t){var r;return typeof t.offset=="bigint"||typeof t.length=="bigint"?r=A.BigInt(t.offset)+A.BigInt(t.length)-A.BigInt(1):r=t.offset+t.length-1,t.offset+"-"+r},rl=function(t){return t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t},Fg={static:function(t){var r=t.duration,n=t.timescale,e=n===void 0?1:n,i=t.sourceDuration,s=t.periodDuration,o=rl(t.endNumber),u=r/e;return typeof o=="number"?{start:0,end:o}:typeof s=="number"?{start:0,end:s/u}:{start:0,end:i/u}},dynamic:function(t){var r=t.NOW,n=t.clientOffset,e=t.availabilityStartTime,i=t.timescale,s=i===void 0?1:i,o=t.duration,u=t.periodStart,l=u===void 0?0:u,c=t.minimumUpdatePeriod,p=c===void 0?0:c,m=t.timeShiftBufferDepth,_=m===void 0?1/0:m,b=rl(t.endNumber),S=(r+n)/1e3,x=e+l,k=S+p,L=k-x,H=Math.ceil(L*s/o),O=Math.floor((S-x-_)*s/o),F=Math.floor((S-x)*s/o);return{start:Math.max(0,O),end:typeof b=="number"?b:Math.min(H,F)}}},Rg=function(t){return function(r){var n=t.duration,e=t.timescale,i=e===void 0?1:e,s=t.periodStart,o=t.startNumber,u=o===void 0?1:o;return{number:u+r,duration:n/i,timeline:s,time:r*n}}},Zs=function(t){var r=t.type,n=t.duration,e=t.timescale,i=e===void 0?1:e,s=t.periodDuration,o=t.sourceDuration,u=Fg[r](t),l=u.start,c=u.end,p=Pg(l,c).map(Rg(t));if(r==="static"){var m=p.length-1,_=typeof s=="number"?s:o;p[m].duration=_-n/i*m}return p},ec=function(t){var r=t.baseUrl,n=t.initialization,e=n===void 0?{}:n,i=t.sourceDuration,s=t.indexRange,o=s===void 0?"":s,u=t.periodStart,l=t.presentationTime,c=t.number,p=c===void 0?0:c,m=t.duration;if(!r)throw new Error(qr.NO_BASE_URL);var _=Li({baseUrl:r,source:e.sourceURL,range:e.range}),b=Li({baseUrl:r,source:r,indexRange:o});if(b.map=_,m){var S=Zs(t);S.length&&(b.duration=S[0].duration,b.timeline=S[0].timeline)}else i&&(b.duration=i,b.timeline=u);return b.presentationTime=l||u,b.number=p,[b]},eo=function(t,r,n){var e=t.sidx.map?t.sidx.map:null,i=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,u=o.offset+o.length,l=r.timescale,c=r.references.filter(function(U){return U.referenceType!==1}),p=[],m=t.endList?"static":"dynamic",_=t.sidx.timeline,b=_,S=t.mediaSequence||0,x;typeof r.firstOffset=="bigint"?x=A.BigInt(u)+r.firstOffset:x=u+r.firstOffset;for(var k=0;k<c.length;k++){var L=r.references[k],H=L.referencedSize,O=L.subsegmentDuration,F=void 0;typeof x=="bigint"?F=x+A.BigInt(H)-A.BigInt(1):F=x+H-1;var q=x+"-"+F,B={baseUrl:n,timescale:l,timeline:s,periodStart:_,presentationTime:b,number:S,duration:O,sourceDuration:i,indexRange:q,type:m},R=ec(B)[0];e&&(R.map=e),p.push(R),typeof x=="bigint"?x+=A.BigInt(H):x+=H,b+=O/l,S++}return t.segments=p,t},Mg=["AUDIO","SUBTITLES"],Ng=1/60,tc=function(t){return Lg(t,function(r){var n=r.timeline;return n}).sort(function(r,n){return r.timeline>n.timeline?1:-1})},Bg=function(t,r){for(var n=0;n<t.length;n++)if(t[n].attributes.NAME===r)return t[n];return null},il=function(t){var r=[];return tg(t,Mg,function(n,e,i,s){r=r.concat(n.playlists||[])}),r},nl=function(t){var r=t.playlist,n=t.mediaSequence;r.mediaSequence=n,r.segments.forEach(function(e,i){e.number=r.mediaSequence+i})},Ug=function(t){var r=t.oldPlaylists,n=t.newPlaylists,e=t.timelineStarts;n.forEach(function(i){i.discontinuitySequence=ps(e,function(c){var p=c.timeline;return p===i.timeline});var s=Bg(r,i.attributes.NAME);if(s&&!i.sidx){var o=i.segments[0],u=ps(s.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<Ng});if(u===-1){nl({playlist:i,mediaSequence:s.mediaSequence+s.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!s.segments.length&&i.timeline>s.timeline||s.segments.length&&i.timeline>s.segments[s.segments.length-1].timeline)&&i.discontinuitySequence--;return}var l=s.segments[u];l.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),nl({playlist:i,mediaSequence:s.segments[u].number})}})},Vg=function(t){var r=t.oldManifest,n=t.newManifest,e=r.playlists.concat(il(r)),i=n.playlists.concat(il(n));return n.timelineStarts=tc([r.timelineStarts,n.timelineStarts]),Ug({oldPlaylists:e,newPlaylists:i,timelineStarts:n.timelineStarts}),n},pa=function(t){return t&&t.uri+"-"+Og(t.byterange)},za=function(t){var r=Jd(t.reduce(function(n,e){var i=e.attributes.id+(e.attributes.lang||"");if(!n[i])n[i]=e,n[i].attributes.timelineStarts=[];else{if(e.segments){var s;e.segments[0]&&(e.segments[0].discontinuity=!0),(s=n[i].segments).push.apply(s,e.segments)}e.attributes.contentProtection&&(n[i].attributes.contentProtection=e.attributes.contentProtection)}return n[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),n},{}));return r.map(function(n){return n.discontinuityStarts=Ig(n.segments||[],"discontinuity"),n})},to=function(t,r){var n=pa(t.sidx),e=n&&r[n]&&r[n].sidx;return e&&eo(t,e,t.sidx.resolvedUri),t},Hg=function(t,r){if(r===void 0&&(r={}),!Object.keys(r).length)return t;for(var n in t)t[n]=to(t[n],r);return t},qg=function(t,r){var n,e=t.attributes,i=t.segments,s=t.sidx,o=t.mediaSequence,u=t.discontinuitySequence,l=t.discontinuityStarts,c={attributes:(n={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:u,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:o,segments:i};return e.contentProtection&&(c.contentProtection=e.contentProtection),s&&(c.sidx=s),r&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},jg=function(t){var r,n=t.attributes,e=t.segments,i=t.mediaSequence,s=t.discontinuityStarts,o=t.discontinuitySequence;typeof e>"u"&&(e=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var u=(r={NAME:n.id,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r);return n.codecs&&(u.CODECS=n.codecs),{attributes:u,uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:s,discontinuitySequence:o,mediaSequence:i,segments:e}},Wg=function(t,r,n){r===void 0&&(r={}),n===void 0&&(n=!1);var e,i=t.reduce(function(o,u){var l=u.attributes.role&&u.attributes.role.value||"",c=u.attributes.lang||"",p=u.attributes.label||"main";if(c&&!u.attributes.label){var m=l?" ("+l+")":"";p=""+u.attributes.lang+m}o[p]||(o[p]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});var _=to(qg(u,n),r);return o[p].playlists.push(_),typeof e>"u"&&l==="main"&&(e=u,e.default=!0),o},{});if(!e){var s=Object.keys(i)[0];i[s].default=!0}return i},Gg=function(t,r){return r===void 0&&(r={}),t.reduce(function(n,e){var i=e.attributes.lang||"text";return n[i]||(n[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),n[i].playlists.push(to(jg(e),r)),n},{})},zg=function(t){return t.reduce(function(r,n){return n&&n.forEach(function(e){var i=e.channel,s=e.language;r[s]={autoselect:!1,default:!1,instreamId:i,language:s},e.hasOwnProperty("aspectRatio")&&(r[s].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(r[s].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(r[s]["3D"]=e["3D"])}),r},{})},$g=function(t){var r,n=t.attributes,e=t.segments,i=t.sidx,s=t.discontinuityStarts,o={attributes:(r={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r),uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:s,timelineStarts:n.timelineStarts,segments:e};return n.frameRate&&(o.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(o.contentProtection=n.contentProtection),i&&(o.sidx=i),o},Kg=function(t){var r=t.attributes;return r.mimeType==="video/mp4"||r.mimeType==="video/webm"||r.contentType==="video"},Xg=function(t){var r=t.attributes;return r.mimeType==="audio/mp4"||r.mimeType==="audio/webm"||r.contentType==="audio"},Yg=function(t){var r=t.attributes;return r.mimeType==="text/vtt"||r.contentType==="text"},Qg=function(t,r){t.forEach(function(n){n.mediaSequence=0,n.discontinuitySequence=ps(r,function(e){var i=e.timeline;return i===n.timeline}),n.segments&&n.segments.forEach(function(e,i){e.number=i})})},al=function(t){return t?Object.keys(t).reduce(function(r,n){var e=t[n];return r.concat(e.playlists)},[]):[]},Jg=function(t){var r,n=t.dashPlaylists,e=t.locations,i=t.sidxMapping,s=i===void 0?{}:i,o=t.previousManifest;if(!n.length)return{};var u=n[0].attributes,l=u.sourceDuration,c=u.type,p=u.suggestedPresentationDelay,m=u.minimumUpdatePeriod,_=za(n.filter(Kg)).map($g),b=za(n.filter(Xg)),S=za(n.filter(Yg)),x=n.map(function(B){return B.attributes.captionServices}).filter(Boolean),k={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(r={AUDIO:{},VIDEO:{}},r["CLOSED-CAPTIONS"]={},r.SUBTITLES={},r),uri:"",duration:l,playlists:Hg(_,s)};m>=0&&(k.minimumUpdatePeriod=m*1e3),e&&(k.locations=e),c==="dynamic"&&(k.suggestedPresentationDelay=p);var L=k.playlists.length===0,H=b.length?Wg(b,s,L):null,O=S.length?Gg(S,s):null,F=_.concat(al(H),al(O)),q=F.map(function(B){var R=B.timelineStarts;return R});return k.timelineStarts=tc(q),Qg(F,k.timelineStarts),H&&(k.mediaGroups.AUDIO.audio=H),O&&(k.mediaGroups.SUBTITLES.subs=O),x.length&&(k.mediaGroups["CLOSED-CAPTIONS"].cc=zg(x)),o?Vg({oldManifest:o,newManifest:k}):k},Zg=function(t,r,n){var e=t.NOW,i=t.clientOffset,s=t.availabilityStartTime,o=t.timescale,u=o===void 0?1:o,l=t.periodStart,c=l===void 0?0:l,p=t.minimumUpdatePeriod,m=p===void 0?0:p,_=(e+i)/1e3,b=s+c,S=_+m,x=S-b;return Math.ceil((x*u-r)/n)},rc=function(t,r){for(var n=t.type,e=t.minimumUpdatePeriod,i=e===void 0?0:e,s=t.media,o=s===void 0?"":s,u=t.sourceDuration,l=t.timescale,c=l===void 0?1:l,p=t.startNumber,m=p===void 0?1:p,_=t.periodStart,b=[],S=-1,x=0;x<r.length;x++){var k=r[x],L=k.d,H=k.r||0,O=k.t||0;S<0&&(S=O),O&&O>S&&(S=O);var F=void 0;if(H<0){var q=x+1;q===r.length?n==="dynamic"&&i>0&&o.indexOf("$Number$")>0?F=Zg(t,S,L):F=(u*c-S)/L:F=(r[q].t-S)/L}else F=H+1;for(var B=m+b.length+F,R=m+b.length;R<B;)b.push({number:R,duration:L/c,time:S,timeline:_}),S+=L,R++}return b},ev=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,tv=function(t){return function(r,n,e,i){if(r==="$$")return"$";if(typeof t[n]>"u")return r;var s=""+t[n];return n==="RepresentationID"||(e?i=parseInt(i,10):i=1,s.length>=i)?s:""+new Array(i-s.length+1).join("0")+s}},sl=function(t,r){return t.replace(ev,tv(r))},rv=function(t,r){return!t.duration&&!r?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?Zs(t):rc(t,r)},iv=function(t,r){var n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,i=e===void 0?{sourceURL:"",range:""}:e,s=Li({baseUrl:t.baseUrl,source:sl(i.sourceURL,n),range:i.range}),o=rv(t,r);return o.map(function(u){n.Number=u.number,n.Time=u.time;var l=sl(t.media||"",n),c=t.timescale||1,p=t.presentationTimeOffset||0,m=t.periodStart+(u.time-p)/c,_={uri:l,timeline:u.timeline,duration:u.duration,resolvedUri:la(t.baseUrl||"",l),map:s,number:u.number,presentationTime:m};return _})},nv=function(t,r){var n=t.baseUrl,e=t.initialization,i=e===void 0?{}:e,s=Li({baseUrl:n,source:i.sourceURL,range:i.range}),o=Li({baseUrl:n,source:r.media,range:r.mediaRange});return o.map=s,o},av=function(t,r){var n=t.duration,e=t.segmentUrls,i=e===void 0?[]:e,s=t.periodStart;if(!n&&!r||n&&r)throw new Error(qr.SEGMENT_TIME_UNSPECIFIED);var o=i.map(function(c){return nv(t,c)}),u;n&&(u=Zs(t)),r&&(u=rc(t,r));var l=u.map(function(c,p){if(o[p]){var m=o[p],_=t.timescale||1,b=t.presentationTimeOffset||0;return m.timeline=c.timeline,m.duration=c.duration,m.number=c.number,m.presentationTime=s+(c.time-b)/_,m}}).filter(function(c){return c});return l},sv=function(t){var r=t.attributes,n=t.segmentInfo,e,i;n.template?(i=iv,e=Ge(r,n.template)):n.base?(i=ec,e=Ge(r,n.base)):n.list&&(i=av,e=Ge(r,n.list));var s={attributes:r};if(!i)return s;var o=i(e,n.segmentTimeline);if(e.duration){var u=e,l=u.duration,c=u.timescale,p=c===void 0?1:c;e.duration=l/p}else o.length?e.duration=o.reduce(function(m,_){return Math.max(m,Math.ceil(_.duration))},0):e.duration=0;return s.attributes=e,s.segments=o,n.base&&e.indexRange&&(s.sidx=o[0],s.segments=[]),s},ov=function(t){return t.map(sv)},Se=function(t,r){return Zd(t.childNodes).filter(function(n){var e=n.tagName;return e===r})},ro=function(t){return t.textContent.trim()},uv=function(t){return parseFloat(t.split("/").reduce(function(r,n){return r/n}))},Dr=function(t){var r=31536e3,n=30*24*60*60,e=24*60*60,i=60*60,s=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,u=o.exec(t);if(!u)return 0;var l=u.slice(1),c=l[0],p=l[1],m=l[2],_=l[3],b=l[4],S=l[5];return parseFloat(c||0)*r+parseFloat(p||0)*n+parseFloat(m||0)*e+parseFloat(_||0)*i+parseFloat(b||0)*s+parseFloat(S||0)},lv=function(t){var r=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return r.test(t)&&(t+="Z"),Date.parse(t)},ol={mediaPresentationDuration:function(t){return Dr(t)},availabilityStartTime:function(t){return lv(t)/1e3},minimumUpdatePeriod:function(t){return Dr(t)},suggestedPresentationDelay:function(t){return Dr(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return Dr(t)},start:function(t){return Dr(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},frameRate:function(t){return uv(t)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var r=parseInt(t,10);return isNaN(r)?Dr(t):r},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},Ne=function(t){return t&&t.attributes?Zd(t.attributes).reduce(function(r,n){var e=ol[n.name]||ol.DEFAULT;return r[n.name]=e(n.value),r},{}):{}},dv={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},ma=function(t,r){return r.length?ha(t.map(function(n){return r.map(function(e){return la(n,ro(e))})})):t},io=function(t){var r=Se(t,"SegmentTemplate")[0],n=Se(t,"SegmentList")[0],e=n&&Se(n,"SegmentURL").map(function(m){return Ge({tag:"SegmentURL"},Ne(m))}),i=Se(t,"SegmentBase")[0],s=n||r,o=s&&Se(s,"SegmentTimeline")[0],u=n||i||r,l=u&&Se(u,"Initialization")[0],c=r&&Ne(r);c&&l?c.initialization=l&&Ne(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var p={template:c,segmentTimeline:o&&Se(o,"S").map(function(m){return Ne(m)}),list:n&&Ge(Ne(n),{segmentUrls:e,initialization:Ne(l)}),base:i&&Ge(Ne(i),{initialization:Ne(l)})};return Object.keys(p).forEach(function(m){p[m]||delete p[m]}),p},cv=function(t,r,n){return function(e){var i=Se(e,"BaseURL"),s=ma(r,i),o=Ge(t,Ne(e)),u=io(e);return s.map(function(l){return{segmentInfo:Ge(n,u),attributes:Ge(o,{baseUrl:l})}})}},fv=function(t){return t.reduce(function(r,n){var e=Ne(n);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var i=dv[e.schemeIdUri];if(i){r[i]={attributes:e};var s=Se(n,"cenc:pssh")[0];if(s){var o=ro(s);r[i].pssh=o&&vd(o)}}return r},{})},hv=function(t){if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var r=typeof t.value!="string"?[]:t.value.split(";");return r.map(function(e){var i,s;if(s=e,/^CC\d=/.test(e)){var o=e.split("=");i=o[0],s=o[1]}else/^CC\d$/.test(e)&&(i=e);return{channel:i,language:s}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var n=typeof t.value!="string"?[]:t.value.split(";");return n.map(function(e){var i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var s=e.split("="),o=s[0],u=s[1],l=u===void 0?"":u;i.channel=o,i.language=e,l.split(",").forEach(function(c){var p=c.split(":"),m=p[0],_=p[1];m==="lang"?i.language=_:m==="er"?i.easyReader=Number(_):m==="war"?i.aspectRatio=Number(_):m==="3D"&&(i["3D"]=Number(_))})}else i.language=e;return i.channel&&(i.channel="SERVICE"+i.channel),i})}},pv=function(t,r,n){return function(e){var i=Ne(e),s=ma(r,Se(e,"BaseURL")),o=Se(e,"Role")[0],u={role:Ne(o)},l=Ge(t,i,u),c=Se(e,"Accessibility")[0],p=hv(Ne(c));p&&(l=Ge(l,{captionServices:p}));var m=Se(e,"Label")[0];if(m&&m.childNodes.length){var _=m.childNodes[0].nodeValue.trim();l=Ge(l,{label:_})}var b=fv(Se(e,"ContentProtection"));Object.keys(b).length&&(l=Ge(l,{contentProtection:b}));var S=io(e),x=Se(e,"Representation"),k=Ge(n,S);return ha(x.map(cv(l,s,k)))}},mv=function(t,r){return function(n,e){var i=ma(r,Se(n.node,"BaseURL")),s=Ge(t,{periodStart:n.attributes.start});typeof n.attributes.duration=="number"&&(s.periodDuration=n.attributes.duration);var o=Se(n.node,"AdaptationSet"),u=io(n.node);return ha(o.map(pv(s,i,u)))}},gv=function(t){var r=t.attributes,n=t.priorPeriodAttributes,e=t.mpdType;return typeof r.start=="number"?r.start:n&&typeof n.start=="number"&&typeof n.duration=="number"?n.start+n.duration:!n&&e==="static"?0:null},vv=function(t,r){r===void 0&&(r={});var n=r,e=n.manifestUri,i=e===void 0?"":e,s=n.NOW,o=s===void 0?Date.now():s,u=n.clientOffset,l=u===void 0?0:u,c=Se(t,"Period");if(!c.length)throw new Error(qr.INVALID_NUMBER_OF_PERIOD);var p=Se(t,"Location"),m=Ne(t),_=ma([i],Se(t,"BaseURL"));m.type=m.type||"static",m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=l,p.length&&(m.locations=p.map(ro));var b=[];return c.forEach(function(S,x){var k=Ne(S),L=b[x-1];k.start=gv({attributes:k,priorPeriodAttributes:L?L.attributes:null,mpdType:m.type}),b.push({node:S,attributes:k})}),{locations:m.locations,representationInfo:ha(b.map(mv(m,_)))}},ic=function(t){if(t==="")throw new Error(qr.DASH_EMPTY_MANIFEST);var r=new kg,n,e;try{n=r.parseFromString(t,"application/xml"),e=n&&n.documentElement.tagName==="MPD"?n.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error(qr.DASH_INVALID_XML);return e},yv=function(t){var r=Se(t,"UTCTiming")[0];if(!r)return null;var n=Ne(r);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(qr.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},_v=function(t,r){r===void 0&&(r={});var n=vv(ic(t),r),e=ov(n.representationInfo);return Jg({dashPlaylists:e,locations:n.locations,sidxMapping:r.sidxMapping,previousManifest:r.previousManifest})},Tv=function(t){return yv(ic(t))},bv=Math.pow(2,32),xv=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),r;return t.getBigUint64?(r=t.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):t.getUint32(0)*bv+t.getUint32(4)},Sv={getUint64:xv},ul=Sv.getUint64,Ev=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),r={version:a[0],flags:new Uint8Array(a.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=t.getUint32(n),r.firstOffset=t.getUint32(n+4),n+=8):(r.earliestPresentationTime=ul(a.subarray(n)),r.firstOffset=ul(a.subarray(n+8)),n+=16),n+=2;var e=t.getUint16(n);for(n+=2;e>0;n+=12,e--)r.references.push({referenceType:(a[n]&128)>>>7,referencedSize:t.getUint32(n)&2147483647,subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(a[n+8]&128),sapType:(a[n+8]&112)>>>4,sapDeltaTime:t.getUint32(n+8)&268435455});return r},Cv=Ev;const Av=Re.getDefaultExportFromCjs(Cv);var Dv=Q([73,68,51]),wv=function(t,r){r===void 0&&(r=0),t=Q(t);var n=t[r+5],e=t[r+6]<<21|t[r+7]<<14|t[r+8]<<7|t[r+9],i=(n&16)>>4;return i?e+20:e+10},bi=function a(t,r){return r===void 0&&(r=0),t=Q(t),t.length-r<10||!_e(t,Dv,{offset:r})?r:(r+=wv(t,r),a(t,r))},ll=function(t){return typeof t=="string"?xd(t):t},kv=function(t){return Array.isArray(t)?t.map(function(r){return ll(r)}):[ll(t)]},Pv=function a(t,r,n){n===void 0&&(n=!1),r=kv(r),t=Q(t);var e=[];if(!r.length)return e;for(var i=0;i<t.length;){var s=(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0,o=t.subarray(i+4,i+8);if(s===0)break;var u=i+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(i+8,u);_e(o,r[0])&&(r.length===1?e.push(l):e.push.apply(e,a(l,r.slice(1),n))),i=u}return e},Sn={EBML:Q([26,69,223,163]),DocType:Q([66,130]),Segment:Q([24,83,128,103]),SegmentInfo:Q([21,73,169,102]),Tracks:Q([22,84,174,107]),Track:Q([174]),TrackNumber:Q([215]),DefaultDuration:Q([35,227,131]),TrackEntry:Q([174]),TrackType:Q([131]),FlagDefault:Q([136]),CodecID:Q([134]),CodecPrivate:Q([99,162]),VideoTrack:Q([224]),AudioTrack:Q([225]),Cluster:Q([31,67,182,117]),Timestamp:Q([231]),TimestampScale:Q([42,215,177]),BlockGroup:Q([160]),BlockDuration:Q([155]),Block:Q([161]),SimpleBlock:Q([163])},ms=[128,64,32,16,8,4,2,1],Iv=function(t){for(var r=1,n=0;n<ms.length&&!(t&ms[n]);n++)r++;return r},qn=function(t,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var i=Iv(t[r]),s=t.subarray(r,r+i);return n&&(s=Array.prototype.slice.call(t,r,r+i),s[0]^=ms[i-1]),{length:i,value:Jm(s,{signed:e}),bytes:s}},dl=function a(t){return typeof t=="string"?t.match(/.{1,2}/g).map(function(r){return a(r)}):typeof t=="number"?Zm(t):t},Lv=function(t){return Array.isArray(t)?t.map(function(r){return dl(r)}):[dl(t)]},Ov=function a(t,r,n){if(n>=r.length)return r.length;var e=qn(r,n,!1);if(_e(t.bytes,e.bytes))return n;var i=qn(r,n+e.length);return a(t,r,n+i.length+i.value+e.length)},cl=function a(t,r){r=Lv(r),t=Q(t);var n=[];if(!r.length)return n;for(var e=0;e<t.length;){var i=qn(t,e,!1),s=qn(t,e+i.length),o=e+i.length+s.length;s.value===127&&(s.value=Ov(i,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);_e(r[0],i.bytes)&&(r.length===1?n.push(l):n=n.concat(a(l,r.slice(1))));var c=i.length+s.length+l.length;e+=c}return n},Fv=Q([0,0,0,1]),Rv=Q([0,0,1]),Mv=Q([0,0,3]),Nv=function(t){for(var r=[],n=1;n<t.length-2;)_e(t.subarray(n,n+3),Mv)&&(r.push(n+2),n++),n++;if(r.length===0)return t;var e=t.length-r.length,i=new Uint8Array(e),s=0;for(n=0;n<e;s++,n++)s===r[0]&&(s++,r.shift()),i[n]=t[s];return i},nc=function(t,r,n,e){t=Q(t),n=[].concat(n);for(var i=0,s,o=0;i<t.length&&(o<e||s);){var u=void 0;if(_e(t.subarray(i),Fv)?u=4:_e(t.subarray(i),Rv)&&(u=3),!u){i++;continue}if(o++,s)return Nv(t.subarray(s,i));var l=void 0;r==="h264"?l=t[i+u]&31:r==="h265"&&(l=t[i+u]>>1&63),n.indexOf(l)!==-1&&(s=i+u),i+=u+(r==="h264"?1:2)}return t.subarray(0,0)},Bv=function(t,r,n){return nc(t,"h264",r,n)},Uv=function(t,r,n){return nc(t,"h265",r,n)},qe={webm:Q([119,101,98,109]),matroska:Q([109,97,116,114,111,115,107,97]),flac:Q([102,76,97,67]),ogg:Q([79,103,103,83]),ac3:Q([11,119]),riff:Q([82,73,70,70]),avi:Q([65,86,73]),wav:Q([87,65,86,69]),"3gp":Q([102,116,121,112,51,103]),mp4:Q([102,116,121,112]),fmp4:Q([115,116,121,112]),mov:Q([102,116,121,112,113,116]),moov:Q([109,111,111,118]),moof:Q([109,111,111,102])},jr={aac:function(t){var r=bi(t);return _e(t,[255,16],{offset:r,mask:[255,22]})},mp3:function(t){var r=bi(t);return _e(t,[255,2],{offset:r,mask:[255,6]})},webm:function(t){var r=cl(t,[Sn.EBML,Sn.DocType])[0];return _e(r,qe.webm)},mkv:function(t){var r=cl(t,[Sn.EBML,Sn.DocType])[0];return _e(r,qe.matroska)},mp4:function(t){if(jr["3gp"](t)||jr.mov(t))return!1;if(_e(t,qe.mp4,{offset:4})||_e(t,qe.fmp4,{offset:4})||_e(t,qe.moof,{offset:4})||_e(t,qe.moov,{offset:4}))return!0},mov:function(t){return _e(t,qe.mov,{offset:4})},"3gp":function(t){return _e(t,qe["3gp"],{offset:4})},ac3:function(t){var r=bi(t);return _e(t,qe.ac3,{offset:r})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var r=0;r+188<t.length&&r<188;){if(t[r]===71&&t[r+188]===71)return!0;r+=1}return!1},flac:function(t){var r=bi(t);return _e(t,qe.flac,{offset:r})},ogg:function(t){return _e(t,qe.ogg)},avi:function(t){return _e(t,qe.riff)&&_e(t,qe.avi,{offset:8})},wav:function(t){return _e(t,qe.riff)&&_e(t,qe.wav,{offset:8})},h264:function(t){return Bv(t,7,3).length},h265:function(t){return Uv(t,[32,33],3).length}},gs=Object.keys(jr).filter(function(a){return a!=="ts"&&a!=="h264"&&a!=="h265"}).concat(["ts","h264","h265"]);gs.forEach(function(a){var t=jr[a];jr[a]=function(r){return t(Q(r))}});var Vv=jr,no=function(t){t=Q(t);for(var r=0;r<gs.length;r++){var n=gs[r];if(Vv[n](t))return n}return""},Hv=function(t){return Pv(t,["moof"]).length>0},jn={};function vs(a){return vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vs(a)}function qv(a){try{return Function.toString.call(a).indexOf("[native code]")!==-1}catch{return typeof a=="function"}}function ys(a){var t=typeof Map=="function"?new Map:void 0;return ys=function(n){if(n===null||!qv(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,e)}function e(){return md(n,arguments,vs(this).constructor)}return e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),G._setPrototypeOf(e,n)},ys(a)}/**
|
|
23
|
+
`)}function Qd(a){this.options=a||{locator:{}}}Qd.prototype.parseFromString=function(a,t){var r=this.options,n=new Dg,e=r.domBuilder||new Hi,i=r.errorHandler,s=r.locator,o=r.xmlns||{},u=/\/x?html?$/.test(t),l=u?Ju.HTML_ENTITIES:Ju.XML_ENTITIES;s&&e.setDocumentLocator(s),n.errorHandler=wg(i,e,s),n.domBuilder=r.domBuilder||e,u&&(o[""]=Zu.HTML),o.xml=o.xml||Zu.XML;var c=r.normalizeLineEndings||Yd;return a&&typeof a=="string"?n.parse(c(a),o,l):n.errorHandler.error("invalid doc source"),e.doc};function wg(a,t,r){if(!a){if(t instanceof Hi)return t;a=t}var n={},e=a instanceof Function;r=r||{};function i(s){var o=a[s];!o&&e&&(o=a.length==2?function(u){a(s,u)}:a),n[s]=o&&function(u){o("[xmldom "+s+"] "+u+hs(r))}||function(){}}return i("warning"),i("error"),i("fatalError"),n}function Hi(){this.cdata=!1}function Dr(a,t){t.lineNumber=a.lineNumber,t.columnNumber=a.columnNumber}Hi.prototype={startDocument:function(){this.doc=new Cg().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(a,t,r,n){var e=this.doc,i=e.createElementNS(a,r||t),s=n.length;xn(this,i),this.currentElement=i,this.locator&&Dr(this.locator,i);for(var o=0;o<s;o++){var a=n.getURI(o),u=n.getValue(o),r=n.getQName(o),l=e.createAttributeNS(a,r);this.locator&&Dr(n.getLocator(o),l),l.value=l.nodeValue=u,i.setAttributeNode(l)}},endElement:function(a,t,r){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(a,t){},endPrefixMapping:function(a){},processingInstruction:function(a,t){var r=this.doc.createProcessingInstruction(a,t);this.locator&&Dr(this.locator,r),xn(this,r)},ignorableWhitespace:function(a,t,r){},characters:function(a,t,r){if(a=el.apply(this,arguments),a){if(this.cdata)var n=this.doc.createCDATASection(a);else var n=this.doc.createTextNode(a);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(a)&&this.doc.appendChild(n),this.locator&&Dr(this.locator,n)}},skippedEntity:function(a){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(a){(this.locator=a)&&(a.lineNumber=0)},comment:function(a,t,r){a=el.apply(this,arguments);var n=this.doc.createComment(a);this.locator&&Dr(this.locator,n),xn(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(a,t,r){var n=this.doc.implementation;if(n&&n.createDocumentType){var e=n.createDocumentType(a,t,r);this.locator&&Dr(this.locator,e),xn(this,e),this.doc.doctype=e}},warning:function(a){console.warn("[xmldom warning] "+a,hs(this.locator))},error:function(a){console.error("[xmldom error] "+a,hs(this.locator))},fatalError:function(a){throw new Ag(a,this.locator)}};function hs(a){if(a)return`
|
|
24
|
+
@`+(a.systemId||"")+"#[line:"+a.lineNumber+",col:"+a.columnNumber+"]"}function el(a,t,r){return typeof a=="string"?a.substr(t,r):a.length>=t+r||t?new java.lang.String(a,t,r)+"":a}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(a){Hi.prototype[a]=function(){return null}});function xn(a,t){a.currentElement?a.currentElement.appendChild(t):a.doc.appendChild(t)}fa.__DOMHandler=Hi;fa.normalizeLineEndings=Yd;fa.DOMParser=Qd;var kg=fa.DOMParser;/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var tl=function(t){return!!t&&typeof t=="object"},Ge=function a(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(function(e,i){return typeof i!="object"||Object.keys(i).forEach(function(s){Array.isArray(e[s])&&Array.isArray(i[s])?e[s]=e[s].concat(i[s]):tl(e[s])&&tl(i[s])?e[s]=a(e[s],i[s]):e[s]=i[s]}),e},{})},Jd=function(t){return Object.keys(t).map(function(r){return t[r]})},Pg=function(t,r){for(var n=[],e=t;e<r;e++)n.push(e);return n},ha=function(t){return t.reduce(function(r,n){return r.concat(n)},[])},Zd=function(t){if(!t.length)return[];for(var r=[],n=0;n<t.length;n++)r.push(t[n]);return r},Ig=function(t,r){return t.reduce(function(n,e,i){return e[r]&&n.push(i),n},[])},ps=function(t,r){for(var n=0;n<t.length;n++)if(r(t[n]))return n;return-1},Lg=function(t,r){return Jd(t.reduce(function(n,e){return e.forEach(function(i){n[r(i)]=i}),n},{}))},qr={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Li=function(t){var r=t.baseUrl,n=r===void 0?"":r,e=t.source,i=e===void 0?"":e,s=t.range,o=s===void 0?"":s,u=t.indexRange,l=u===void 0?"":u,c={uri:i,resolvedUri:la(n||"",i)};if(o||l){var p=o||l,m=p.split("-"),_=A.BigInt?A.BigInt(m[0]):parseInt(m[0],10),b=A.BigInt?A.BigInt(m[1]):parseInt(m[1],10);_<Number.MAX_SAFE_INTEGER&&typeof _=="bigint"&&(_=Number(_)),b<Number.MAX_SAFE_INTEGER&&typeof b=="bigint"&&(b=Number(b));var S;typeof b=="bigint"||typeof _=="bigint"?S=A.BigInt(b)-A.BigInt(_)+A.BigInt(1):S=b-_+1,typeof S=="bigint"&&S<Number.MAX_SAFE_INTEGER&&(S=Number(S)),c.byterange={length:S,offset:_}}return c},Og=function(t){var r;return typeof t.offset=="bigint"||typeof t.length=="bigint"?r=A.BigInt(t.offset)+A.BigInt(t.length)-A.BigInt(1):r=t.offset+t.length-1,t.offset+"-"+r},rl=function(t){return t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t},Fg={static:function(t){var r=t.duration,n=t.timescale,e=n===void 0?1:n,i=t.sourceDuration,s=t.periodDuration,o=rl(t.endNumber),u=r/e;return typeof o=="number"?{start:0,end:o}:typeof s=="number"?{start:0,end:s/u}:{start:0,end:i/u}},dynamic:function(t){var r=t.NOW,n=t.clientOffset,e=t.availabilityStartTime,i=t.timescale,s=i===void 0?1:i,o=t.duration,u=t.periodStart,l=u===void 0?0:u,c=t.minimumUpdatePeriod,p=c===void 0?0:c,m=t.timeShiftBufferDepth,_=m===void 0?1/0:m,b=rl(t.endNumber),S=(r+n)/1e3,x=e+l,k=S+p,L=k-x,H=Math.ceil(L*s/o),O=Math.floor((S-x-_)*s/o),F=Math.floor((S-x)*s/o);return{start:Math.max(0,O),end:typeof b=="number"?b:Math.min(H,F)}}},Rg=function(t){return function(r){var n=t.duration,e=t.timescale,i=e===void 0?1:e,s=t.periodStart,o=t.startNumber,u=o===void 0?1:o;return{number:u+r,duration:n/i,timeline:s,time:r*n}}},Zs=function(t){var r=t.type,n=t.duration,e=t.timescale,i=e===void 0?1:e,s=t.periodDuration,o=t.sourceDuration,u=Fg[r](t),l=u.start,c=u.end,p=Pg(l,c).map(Rg(t));if(r==="static"){var m=p.length-1,_=typeof s=="number"?s:o;p[m].duration=_-n/i*m}return p},ec=function(t){var r=t.baseUrl,n=t.initialization,e=n===void 0?{}:n,i=t.sourceDuration,s=t.indexRange,o=s===void 0?"":s,u=t.periodStart,l=t.presentationTime,c=t.number,p=c===void 0?0:c,m=t.duration;if(!r)throw new Error(qr.NO_BASE_URL);var _=Li({baseUrl:r,source:e.sourceURL,range:e.range}),b=Li({baseUrl:r,source:r,indexRange:o});if(b.map=_,m){var S=Zs(t);S.length&&(b.duration=S[0].duration,b.timeline=S[0].timeline)}else i&&(b.duration=i,b.timeline=u);return b.presentationTime=l||u,b.number=p,[b]},eo=function(t,r,n){var e=t.sidx.map?t.sidx.map:null,i=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,u=o.offset+o.length,l=r.timescale,c=r.references.filter(function(U){return U.referenceType!==1}),p=[],m=t.endList?"static":"dynamic",_=t.sidx.timeline,b=_,S=t.mediaSequence||0,x;typeof r.firstOffset=="bigint"?x=A.BigInt(u)+r.firstOffset:x=u+r.firstOffset;for(var k=0;k<c.length;k++){var L=r.references[k],H=L.referencedSize,O=L.subsegmentDuration,F=void 0;typeof x=="bigint"?F=x+A.BigInt(H)-A.BigInt(1):F=x+H-1;var q=x+"-"+F,B={baseUrl:n,timescale:l,timeline:s,periodStart:_,presentationTime:b,number:S,duration:O,sourceDuration:i,indexRange:q,type:m},R=ec(B)[0];e&&(R.map=e),p.push(R),typeof x=="bigint"?x+=A.BigInt(H):x+=H,b+=O/l,S++}return t.segments=p,t},Mg=["AUDIO","SUBTITLES"],Ng=1/60,tc=function(t){return Lg(t,function(r){var n=r.timeline;return n}).sort(function(r,n){return r.timeline>n.timeline?1:-1})},Bg=function(t,r){for(var n=0;n<t.length;n++)if(t[n].attributes.NAME===r)return t[n];return null},il=function(t){var r=[];return tg(t,Mg,function(n,e,i,s){r=r.concat(n.playlists||[])}),r},nl=function(t){var r=t.playlist,n=t.mediaSequence;r.mediaSequence=n,r.segments.forEach(function(e,i){e.number=r.mediaSequence+i})},Ug=function(t){var r=t.oldPlaylists,n=t.newPlaylists,e=t.timelineStarts;n.forEach(function(i){i.discontinuitySequence=ps(e,function(c){var p=c.timeline;return p===i.timeline});var s=Bg(r,i.attributes.NAME);if(s&&!i.sidx){var o=i.segments[0],u=ps(s.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<Ng});if(u===-1){nl({playlist:i,mediaSequence:s.mediaSequence+s.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!s.segments.length&&i.timeline>s.timeline||s.segments.length&&i.timeline>s.segments[s.segments.length-1].timeline)&&i.discontinuitySequence--;return}var l=s.segments[u];l.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),nl({playlist:i,mediaSequence:s.segments[u].number})}})},Vg=function(t){var r=t.oldManifest,n=t.newManifest,e=r.playlists.concat(il(r)),i=n.playlists.concat(il(n));return n.timelineStarts=tc([r.timelineStarts,n.timelineStarts]),Ug({oldPlaylists:e,newPlaylists:i,timelineStarts:n.timelineStarts}),n},pa=function(t){return t&&t.uri+"-"+Og(t.byterange)},za=function(t){var r=Jd(t.reduce(function(n,e){var i=e.attributes.id+(e.attributes.lang||"");if(!n[i])n[i]=e,n[i].attributes.timelineStarts=[];else{if(e.segments){var s;e.segments[0]&&(e.segments[0].discontinuity=!0),(s=n[i].segments).push.apply(s,e.segments)}e.attributes.contentProtection&&(n[i].attributes.contentProtection=e.attributes.contentProtection)}return n[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),n},{}));return r.map(function(n){return n.discontinuityStarts=Ig(n.segments||[],"discontinuity"),n})},to=function(t,r){var n=pa(t.sidx),e=n&&r[n]&&r[n].sidx;return e&&eo(t,e,t.sidx.resolvedUri),t},Hg=function(t,r){if(r===void 0&&(r={}),!Object.keys(r).length)return t;for(var n in t)t[n]=to(t[n],r);return t},qg=function(t,r){var n,e=t.attributes,i=t.segments,s=t.sidx,o=t.mediaSequence,u=t.discontinuitySequence,l=t.discontinuityStarts,c={attributes:(n={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:u,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:o,segments:i};return e.contentProtection&&(c.contentProtection=e.contentProtection),s&&(c.sidx=s),r&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},jg=function(t){var r,n=t.attributes,e=t.segments,i=t.mediaSequence,s=t.discontinuityStarts,o=t.discontinuitySequence;typeof e>"u"&&(e=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var u=(r={NAME:n.id,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r);return n.codecs&&(u.CODECS=n.codecs),{attributes:u,uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:s,discontinuitySequence:o,mediaSequence:i,segments:e}},Wg=function(t,r,n){r===void 0&&(r={}),n===void 0&&(n=!1);var e,i=t.reduce(function(o,u){var l=u.attributes.role&&u.attributes.role.value||"",c=u.attributes.lang||"",p=u.attributes.label||"main";if(c&&!u.attributes.label){var m=l?" ("+l+")":"";p=""+u.attributes.lang+m}o[p]||(o[p]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});var _=to(qg(u,n),r);return o[p].playlists.push(_),typeof e>"u"&&l==="main"&&(e=u,e.default=!0),o},{});if(!e){var s=Object.keys(i)[0];i[s].default=!0}return i},Gg=function(t,r){return r===void 0&&(r={}),t.reduce(function(n,e){var i=e.attributes.lang||"text";return n[i]||(n[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),n[i].playlists.push(to(jg(e),r)),n},{})},zg=function(t){return t.reduce(function(r,n){return n&&n.forEach(function(e){var i=e.channel,s=e.language;r[s]={autoselect:!1,default:!1,instreamId:i,language:s},e.hasOwnProperty("aspectRatio")&&(r[s].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(r[s].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(r[s]["3D"]=e["3D"])}),r},{})},$g=function(t){var r,n=t.attributes,e=t.segments,i=t.sidx,s=t.discontinuityStarts,o={attributes:(r={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},r["PROGRAM-ID"]=1,r),uri:"",endList:n.type==="static",timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:s,timelineStarts:n.timelineStarts,segments:e};return n.frameRate&&(o.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(o.contentProtection=n.contentProtection),i&&(o.sidx=i),o},Kg=function(t){var r=t.attributes;return r.mimeType==="video/mp4"||r.mimeType==="video/webm"||r.contentType==="video"},Xg=function(t){var r=t.attributes;return r.mimeType==="audio/mp4"||r.mimeType==="audio/webm"||r.contentType==="audio"},Yg=function(t){var r=t.attributes;return r.mimeType==="text/vtt"||r.contentType==="text"},Qg=function(t,r){t.forEach(function(n){n.mediaSequence=0,n.discontinuitySequence=ps(r,function(e){var i=e.timeline;return i===n.timeline}),n.segments&&n.segments.forEach(function(e,i){e.number=i})})},al=function(t){return t?Object.keys(t).reduce(function(r,n){var e=t[n];return r.concat(e.playlists)},[]):[]},Jg=function(t){var r,n=t.dashPlaylists,e=t.locations,i=t.sidxMapping,s=i===void 0?{}:i,o=t.previousManifest;if(!n.length)return{};var u=n[0].attributes,l=u.sourceDuration,c=u.type,p=u.suggestedPresentationDelay,m=u.minimumUpdatePeriod,_=za(n.filter(Kg)).map($g),b=za(n.filter(Xg)),S=za(n.filter(Yg)),x=n.map(function(B){return B.attributes.captionServices}).filter(Boolean),k={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(r={AUDIO:{},VIDEO:{}},r["CLOSED-CAPTIONS"]={},r.SUBTITLES={},r),uri:"",duration:l,playlists:Hg(_,s)};m>=0&&(k.minimumUpdatePeriod=m*1e3),e&&(k.locations=e),c==="dynamic"&&(k.suggestedPresentationDelay=p);var L=k.playlists.length===0,H=b.length?Wg(b,s,L):null,O=S.length?Gg(S,s):null,F=_.concat(al(H),al(O)),q=F.map(function(B){var R=B.timelineStarts;return R});return k.timelineStarts=tc(q),Qg(F,k.timelineStarts),H&&(k.mediaGroups.AUDIO.audio=H),O&&(k.mediaGroups.SUBTITLES.subs=O),x.length&&(k.mediaGroups["CLOSED-CAPTIONS"].cc=zg(x)),o?Vg({oldManifest:o,newManifest:k}):k},Zg=function(t,r,n){var e=t.NOW,i=t.clientOffset,s=t.availabilityStartTime,o=t.timescale,u=o===void 0?1:o,l=t.periodStart,c=l===void 0?0:l,p=t.minimumUpdatePeriod,m=p===void 0?0:p,_=(e+i)/1e3,b=s+c,S=_+m,x=S-b;return Math.ceil((x*u-r)/n)},rc=function(t,r){for(var n=t.type,e=t.minimumUpdatePeriod,i=e===void 0?0:e,s=t.media,o=s===void 0?"":s,u=t.sourceDuration,l=t.timescale,c=l===void 0?1:l,p=t.startNumber,m=p===void 0?1:p,_=t.periodStart,b=[],S=-1,x=0;x<r.length;x++){var k=r[x],L=k.d,H=k.r||0,O=k.t||0;S<0&&(S=O),O&&O>S&&(S=O);var F=void 0;if(H<0){var q=x+1;q===r.length?n==="dynamic"&&i>0&&o.indexOf("$Number$")>0?F=Zg(t,S,L):F=(u*c-S)/L:F=(r[q].t-S)/L}else F=H+1;for(var B=m+b.length+F,R=m+b.length;R<B;)b.push({number:R,duration:L/c,time:S,timeline:_}),S+=L,R++}return b},ev=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,tv=function(t){return function(r,n,e,i){if(r==="$$")return"$";if(typeof t[n]>"u")return r;var s=""+t[n];return n==="RepresentationID"||(e?i=parseInt(i,10):i=1,s.length>=i)?s:""+new Array(i-s.length+1).join("0")+s}},sl=function(t,r){return t.replace(ev,tv(r))},rv=function(t,r){return!t.duration&&!r?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?Zs(t):rc(t,r)},iv=function(t,r){var n={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,i=e===void 0?{sourceURL:"",range:""}:e,s=Li({baseUrl:t.baseUrl,source:sl(i.sourceURL,n),range:i.range}),o=rv(t,r);return o.map(function(u){n.Number=u.number,n.Time=u.time;var l=sl(t.media||"",n),c=t.timescale||1,p=t.presentationTimeOffset||0,m=t.periodStart+(u.time-p)/c,_={uri:l,timeline:u.timeline,duration:u.duration,resolvedUri:la(t.baseUrl||"",l),map:s,number:u.number,presentationTime:m};return _})},nv=function(t,r){var n=t.baseUrl,e=t.initialization,i=e===void 0?{}:e,s=Li({baseUrl:n,source:i.sourceURL,range:i.range}),o=Li({baseUrl:n,source:r.media,range:r.mediaRange});return o.map=s,o},av=function(t,r){var n=t.duration,e=t.segmentUrls,i=e===void 0?[]:e,s=t.periodStart;if(!n&&!r||n&&r)throw new Error(qr.SEGMENT_TIME_UNSPECIFIED);var o=i.map(function(c){return nv(t,c)}),u;n&&(u=Zs(t)),r&&(u=rc(t,r));var l=u.map(function(c,p){if(o[p]){var m=o[p],_=t.timescale||1,b=t.presentationTimeOffset||0;return m.timeline=c.timeline,m.duration=c.duration,m.number=c.number,m.presentationTime=s+(c.time-b)/_,m}}).filter(function(c){return c});return l},sv=function(t){var r=t.attributes,n=t.segmentInfo,e,i;n.template?(i=iv,e=Ge(r,n.template)):n.base?(i=ec,e=Ge(r,n.base)):n.list&&(i=av,e=Ge(r,n.list));var s={attributes:r};if(!i)return s;var o=i(e,n.segmentTimeline);if(e.duration){var u=e,l=u.duration,c=u.timescale,p=c===void 0?1:c;e.duration=l/p}else o.length?e.duration=o.reduce(function(m,_){return Math.max(m,Math.ceil(_.duration))},0):e.duration=0;return s.attributes=e,s.segments=o,n.base&&e.indexRange&&(s.sidx=o[0],s.segments=[]),s},ov=function(t){return t.map(sv)},Se=function(t,r){return Zd(t.childNodes).filter(function(n){var e=n.tagName;return e===r})},ro=function(t){return t.textContent.trim()},uv=function(t){return parseFloat(t.split("/").reduce(function(r,n){return r/n}))},wr=function(t){var r=31536e3,n=30*24*60*60,e=24*60*60,i=60*60,s=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,u=o.exec(t);if(!u)return 0;var l=u.slice(1),c=l[0],p=l[1],m=l[2],_=l[3],b=l[4],S=l[5];return parseFloat(c||0)*r+parseFloat(p||0)*n+parseFloat(m||0)*e+parseFloat(_||0)*i+parseFloat(b||0)*s+parseFloat(S||0)},lv=function(t){var r=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return r.test(t)&&(t+="Z"),Date.parse(t)},ol={mediaPresentationDuration:function(t){return wr(t)},availabilityStartTime:function(t){return lv(t)/1e3},minimumUpdatePeriod:function(t){return wr(t)},suggestedPresentationDelay:function(t){return wr(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return wr(t)},start:function(t){return wr(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},frameRate:function(t){return uv(t)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var r=parseInt(t,10);return isNaN(r)?wr(t):r},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},Ne=function(t){return t&&t.attributes?Zd(t.attributes).reduce(function(r,n){var e=ol[n.name]||ol.DEFAULT;return r[n.name]=e(n.value),r},{}):{}},dv={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},ma=function(t,r){return r.length?ha(t.map(function(n){return r.map(function(e){return la(n,ro(e))})})):t},io=function(t){var r=Se(t,"SegmentTemplate")[0],n=Se(t,"SegmentList")[0],e=n&&Se(n,"SegmentURL").map(function(m){return Ge({tag:"SegmentURL"},Ne(m))}),i=Se(t,"SegmentBase")[0],s=n||r,o=s&&Se(s,"SegmentTimeline")[0],u=n||i||r,l=u&&Se(u,"Initialization")[0],c=r&&Ne(r);c&&l?c.initialization=l&&Ne(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var p={template:c,segmentTimeline:o&&Se(o,"S").map(function(m){return Ne(m)}),list:n&&Ge(Ne(n),{segmentUrls:e,initialization:Ne(l)}),base:i&&Ge(Ne(i),{initialization:Ne(l)})};return Object.keys(p).forEach(function(m){p[m]||delete p[m]}),p},cv=function(t,r,n){return function(e){var i=Se(e,"BaseURL"),s=ma(r,i),o=Ge(t,Ne(e)),u=io(e);return s.map(function(l){return{segmentInfo:Ge(n,u),attributes:Ge(o,{baseUrl:l})}})}},fv=function(t){return t.reduce(function(r,n){var e=Ne(n);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var i=dv[e.schemeIdUri];if(i){r[i]={attributes:e};var s=Se(n,"cenc:pssh")[0];if(s){var o=ro(s);r[i].pssh=o&&vd(o)}}return r},{})},hv=function(t){if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var r=typeof t.value!="string"?[]:t.value.split(";");return r.map(function(e){var i,s;if(s=e,/^CC\d=/.test(e)){var o=e.split("=");i=o[0],s=o[1]}else/^CC\d$/.test(e)&&(i=e);return{channel:i,language:s}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var n=typeof t.value!="string"?[]:t.value.split(";");return n.map(function(e){var i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var s=e.split("="),o=s[0],u=s[1],l=u===void 0?"":u;i.channel=o,i.language=e,l.split(",").forEach(function(c){var p=c.split(":"),m=p[0],_=p[1];m==="lang"?i.language=_:m==="er"?i.easyReader=Number(_):m==="war"?i.aspectRatio=Number(_):m==="3D"&&(i["3D"]=Number(_))})}else i.language=e;return i.channel&&(i.channel="SERVICE"+i.channel),i})}},pv=function(t,r,n){return function(e){var i=Ne(e),s=ma(r,Se(e,"BaseURL")),o=Se(e,"Role")[0],u={role:Ne(o)},l=Ge(t,i,u),c=Se(e,"Accessibility")[0],p=hv(Ne(c));p&&(l=Ge(l,{captionServices:p}));var m=Se(e,"Label")[0];if(m&&m.childNodes.length){var _=m.childNodes[0].nodeValue.trim();l=Ge(l,{label:_})}var b=fv(Se(e,"ContentProtection"));Object.keys(b).length&&(l=Ge(l,{contentProtection:b}));var S=io(e),x=Se(e,"Representation"),k=Ge(n,S);return ha(x.map(cv(l,s,k)))}},mv=function(t,r){return function(n,e){var i=ma(r,Se(n.node,"BaseURL")),s=Ge(t,{periodStart:n.attributes.start});typeof n.attributes.duration=="number"&&(s.periodDuration=n.attributes.duration);var o=Se(n.node,"AdaptationSet"),u=io(n.node);return ha(o.map(pv(s,i,u)))}},gv=function(t){var r=t.attributes,n=t.priorPeriodAttributes,e=t.mpdType;return typeof r.start=="number"?r.start:n&&typeof n.start=="number"&&typeof n.duration=="number"?n.start+n.duration:!n&&e==="static"?0:null},vv=function(t,r){r===void 0&&(r={});var n=r,e=n.manifestUri,i=e===void 0?"":e,s=n.NOW,o=s===void 0?Date.now():s,u=n.clientOffset,l=u===void 0?0:u,c=Se(t,"Period");if(!c.length)throw new Error(qr.INVALID_NUMBER_OF_PERIOD);var p=Se(t,"Location"),m=Ne(t),_=ma([i],Se(t,"BaseURL"));m.type=m.type||"static",m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=l,p.length&&(m.locations=p.map(ro));var b=[];return c.forEach(function(S,x){var k=Ne(S),L=b[x-1];k.start=gv({attributes:k,priorPeriodAttributes:L?L.attributes:null,mpdType:m.type}),b.push({node:S,attributes:k})}),{locations:m.locations,representationInfo:ha(b.map(mv(m,_)))}},ic=function(t){if(t==="")throw new Error(qr.DASH_EMPTY_MANIFEST);var r=new kg,n,e;try{n=r.parseFromString(t,"application/xml"),e=n&&n.documentElement.tagName==="MPD"?n.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error(qr.DASH_INVALID_XML);return e},yv=function(t){var r=Se(t,"UTCTiming")[0];if(!r)return null;var n=Ne(r);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(qr.UNSUPPORTED_UTC_TIMING_SCHEME)}return n},_v=function(t,r){r===void 0&&(r={});var n=vv(ic(t),r),e=ov(n.representationInfo);return Jg({dashPlaylists:e,locations:n.locations,sidxMapping:r.sidxMapping,previousManifest:r.previousManifest})},Tv=function(t){return yv(ic(t))},bv=Math.pow(2,32),xv=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),r;return t.getBigUint64?(r=t.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):t.getUint32(0)*bv+t.getUint32(4)},Sv={getUint64:xv},ul=Sv.getUint64,Ev=function(a){var t=new DataView(a.buffer,a.byteOffset,a.byteLength),r={version:a[0],flags:new Uint8Array(a.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=t.getUint32(n),r.firstOffset=t.getUint32(n+4),n+=8):(r.earliestPresentationTime=ul(a.subarray(n)),r.firstOffset=ul(a.subarray(n+8)),n+=16),n+=2;var e=t.getUint16(n);for(n+=2;e>0;n+=12,e--)r.references.push({referenceType:(a[n]&128)>>>7,referencedSize:t.getUint32(n)&2147483647,subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(a[n+8]&128),sapType:(a[n+8]&112)>>>4,sapDeltaTime:t.getUint32(n+8)&268435455});return r},Cv=Ev;const Av=Re.getDefaultExportFromCjs(Cv);var Dv=Q([73,68,51]),wv=function(t,r){r===void 0&&(r=0),t=Q(t);var n=t[r+5],e=t[r+6]<<21|t[r+7]<<14|t[r+8]<<7|t[r+9],i=(n&16)>>4;return i?e+20:e+10},bi=function a(t,r){return r===void 0&&(r=0),t=Q(t),t.length-r<10||!_e(t,Dv,{offset:r})?r:(r+=wv(t,r),a(t,r))},ll=function(t){return typeof t=="string"?xd(t):t},kv=function(t){return Array.isArray(t)?t.map(function(r){return ll(r)}):[ll(t)]},Pv=function a(t,r,n){n===void 0&&(n=!1),r=kv(r),t=Q(t);var e=[];if(!r.length)return e;for(var i=0;i<t.length;){var s=(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0,o=t.subarray(i+4,i+8);if(s===0)break;var u=i+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(i+8,u);_e(o,r[0])&&(r.length===1?e.push(l):e.push.apply(e,a(l,r.slice(1),n))),i=u}return e},Sn={EBML:Q([26,69,223,163]),DocType:Q([66,130]),Segment:Q([24,83,128,103]),SegmentInfo:Q([21,73,169,102]),Tracks:Q([22,84,174,107]),Track:Q([174]),TrackNumber:Q([215]),DefaultDuration:Q([35,227,131]),TrackEntry:Q([174]),TrackType:Q([131]),FlagDefault:Q([136]),CodecID:Q([134]),CodecPrivate:Q([99,162]),VideoTrack:Q([224]),AudioTrack:Q([225]),Cluster:Q([31,67,182,117]),Timestamp:Q([231]),TimestampScale:Q([42,215,177]),BlockGroup:Q([160]),BlockDuration:Q([155]),Block:Q([161]),SimpleBlock:Q([163])},ms=[128,64,32,16,8,4,2,1],Iv=function(t){for(var r=1,n=0;n<ms.length&&!(t&ms[n]);n++)r++;return r},qn=function(t,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var i=Iv(t[r]),s=t.subarray(r,r+i);return n&&(s=Array.prototype.slice.call(t,r,r+i),s[0]^=ms[i-1]),{length:i,value:Jm(s,{signed:e}),bytes:s}},dl=function a(t){return typeof t=="string"?t.match(/.{1,2}/g).map(function(r){return a(r)}):typeof t=="number"?Zm(t):t},Lv=function(t){return Array.isArray(t)?t.map(function(r){return dl(r)}):[dl(t)]},Ov=function a(t,r,n){if(n>=r.length)return r.length;var e=qn(r,n,!1);if(_e(t.bytes,e.bytes))return n;var i=qn(r,n+e.length);return a(t,r,n+i.length+i.value+e.length)},cl=function a(t,r){r=Lv(r),t=Q(t);var n=[];if(!r.length)return n;for(var e=0;e<t.length;){var i=qn(t,e,!1),s=qn(t,e+i.length),o=e+i.length+s.length;s.value===127&&(s.value=Ov(i,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);_e(r[0],i.bytes)&&(r.length===1?n.push(l):n=n.concat(a(l,r.slice(1))));var c=i.length+s.length+l.length;e+=c}return n},Fv=Q([0,0,0,1]),Rv=Q([0,0,1]),Mv=Q([0,0,3]),Nv=function(t){for(var r=[],n=1;n<t.length-2;)_e(t.subarray(n,n+3),Mv)&&(r.push(n+2),n++),n++;if(r.length===0)return t;var e=t.length-r.length,i=new Uint8Array(e),s=0;for(n=0;n<e;s++,n++)s===r[0]&&(s++,r.shift()),i[n]=t[s];return i},nc=function(t,r,n,e){t=Q(t),n=[].concat(n);for(var i=0,s,o=0;i<t.length&&(o<e||s);){var u=void 0;if(_e(t.subarray(i),Fv)?u=4:_e(t.subarray(i),Rv)&&(u=3),!u){i++;continue}if(o++,s)return Nv(t.subarray(s,i));var l=void 0;r==="h264"?l=t[i+u]&31:r==="h265"&&(l=t[i+u]>>1&63),n.indexOf(l)!==-1&&(s=i+u),i+=u+(r==="h264"?1:2)}return t.subarray(0,0)},Bv=function(t,r,n){return nc(t,"h264",r,n)},Uv=function(t,r,n){return nc(t,"h265",r,n)},qe={webm:Q([119,101,98,109]),matroska:Q([109,97,116,114,111,115,107,97]),flac:Q([102,76,97,67]),ogg:Q([79,103,103,83]),ac3:Q([11,119]),riff:Q([82,73,70,70]),avi:Q([65,86,73]),wav:Q([87,65,86,69]),"3gp":Q([102,116,121,112,51,103]),mp4:Q([102,116,121,112]),fmp4:Q([115,116,121,112]),mov:Q([102,116,121,112,113,116]),moov:Q([109,111,111,118]),moof:Q([109,111,111,102])},jr={aac:function(t){var r=bi(t);return _e(t,[255,16],{offset:r,mask:[255,22]})},mp3:function(t){var r=bi(t);return _e(t,[255,2],{offset:r,mask:[255,6]})},webm:function(t){var r=cl(t,[Sn.EBML,Sn.DocType])[0];return _e(r,qe.webm)},mkv:function(t){var r=cl(t,[Sn.EBML,Sn.DocType])[0];return _e(r,qe.matroska)},mp4:function(t){if(jr["3gp"](t)||jr.mov(t))return!1;if(_e(t,qe.mp4,{offset:4})||_e(t,qe.fmp4,{offset:4})||_e(t,qe.moof,{offset:4})||_e(t,qe.moov,{offset:4}))return!0},mov:function(t){return _e(t,qe.mov,{offset:4})},"3gp":function(t){return _e(t,qe["3gp"],{offset:4})},ac3:function(t){var r=bi(t);return _e(t,qe.ac3,{offset:r})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var r=0;r+188<t.length&&r<188;){if(t[r]===71&&t[r+188]===71)return!0;r+=1}return!1},flac:function(t){var r=bi(t);return _e(t,qe.flac,{offset:r})},ogg:function(t){return _e(t,qe.ogg)},avi:function(t){return _e(t,qe.riff)&&_e(t,qe.avi,{offset:8})},wav:function(t){return _e(t,qe.riff)&&_e(t,qe.wav,{offset:8})},h264:function(t){return Bv(t,7,3).length},h265:function(t){return Uv(t,[32,33],3).length}},gs=Object.keys(jr).filter(function(a){return a!=="ts"&&a!=="h264"&&a!=="h265"}).concat(["ts","h264","h265"]);gs.forEach(function(a){var t=jr[a];jr[a]=function(r){return t(Q(r))}});var Vv=jr,no=function(t){t=Q(t);for(var r=0;r<gs.length;r++){var n=gs[r];if(Vv[n](t))return n}return""},Hv=function(t){return Pv(t,["moof"]).length>0},jn={};function vs(a){return vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vs(a)}function qv(a){try{return Function.toString.call(a).indexOf("[native code]")!==-1}catch{return typeof a=="function"}}function ys(a){var t=typeof Map=="function"?new Map:void 0;return ys=function(n){if(n===null||!qv(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,e)}function e(){return md(n,arguments,vs(this).constructor)}return e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),G._setPrototypeOf(e,n)},ys(a)}/**
|
|
25
25
|
* @license
|
|
26
26
|
* Video.js 7.21.2 <http://videojs.com/>
|
|
27
27
|
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
34
34
|
*/var ac="7.21.2",Lt={},Xt=function(t,r){return Lt[t]=Lt[t]||[],r&&(Lt[t]=Lt[t].concat(r)),Lt[t]},jv=function(t,r){Xt(t,r)},sc=function(t,r){var n=Xt(t).indexOf(r);return n<=-1?!1:(Lt[t]=Lt[t].slice(),Lt[t].splice(n,1),!0)},Wv=function(t,r){Xt(t,[].concat(r).map(function(n){var e=function i(){return sc(t,i),n.apply(void 0,arguments)};return e}))},Wn={prefixed:!0},On=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],fl=On[0],xi;for(var En=0;En<On.length;En++)if(On[En][1]in W){xi=On[En];break}if(xi){for(var Cn=0;Cn<xi.length;Cn++)Wn[fl[Cn]]=xi[Cn];Wn.prefixed=xi[0]!==fl[0]}var Xe=[],Gv=function(t,r){return function(n,e,i){var s=r.levels[e],o=new RegExp("^("+s+")$");if(n!=="log"&&i.unshift(n.toUpperCase()+":"),i.unshift(t+":"),Xe){Xe.push([].concat(i));var u=Xe.length-1e3;Xe.splice(0,u>0?u:0)}if(A.console){var l=A.console[n];!l&&n==="debug"&&(l=A.console.info||A.console.log),!(!l||!s||!o.test(n))&&l[Array.isArray(i)?"apply":"call"](A.console,i)}}};function oc(a){var t="info",r,n=function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];r("log",t,s)};return r=Gv(a,n),n.createLogger=function(e){return oc(a+": "+e)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(e){if(typeof e=="string"){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},n.history=function(){return Xe?[].concat(Xe):[]},n.history.filter=function(e){return(Xe||[]).filter(function(i){return new RegExp(".*"+e+".*").test(i[0])})},n.history.clear=function(){Xe&&(Xe.length=0)},n.history.disable=function(){Xe!==null&&(Xe.length=0,Xe=null)},n.history.enable=function(){Xe===null&&(Xe=[])},n.error=function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r("error",t,i)},n.warn=function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r("warn",t,i)},n.debug=function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];return r("debug",t,i)},n}var ie=oc("VIDEOJS"),uc=ie.createLogger,zv=Object.prototype.toString,lc=function(t){return Vt(t)?Object.keys(t):[]};function Mr(a,t){lc(a).forEach(function(r){return t(a[r],r)})}function $v(a,t,r){return r===void 0&&(r=0),lc(a).reduce(function(n,e){return t(n,a[e],e)},r)}function be(a){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Object.assign?ht.apply(void 0,[a].concat(r)):(r.forEach(function(e){e&&Mr(e,function(i,s){a[s]=i})}),a)}function Vt(a){return!!a&&typeof a=="object"}function Oi(a){return Vt(a)&&zv.call(a)==="[object Object]"&&a.constructor===Object}function Fi(a,t){if(!a||!t)return"";if(typeof A.getComputedStyle=="function"){var r;try{r=A.getComputedStyle(a)}catch{return""}return r?r.getPropertyValue(t)||r[t]:""}return""}var ke=A.navigator&&A.navigator.userAgent||"",hl=/AppleWebKit\/([\d.]+)/i.exec(ke),Kv=hl?parseFloat(hl.pop()):null,dc=/iPod/i.test(ke),Xv=function(){var a=ke.match(/OS (\d+)_/i);return a&&a[1]?a[1]:null}(),jt=/Android/i.test(ke),ao=function(){var a=ke.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!a)return null;var t=a[1]&&parseFloat(a[1]),r=a[2]&&parseFloat(a[2]);return t&&r?parseFloat(a[1]+"."+a[2]):t||null}(),cc=jt&&ao<5&&Kv<537,fc=/Firefox/i.test(ke),qi=/Edg/i.test(ke),Wt=!qi&&(/Chrome/i.test(ke)||/CriOS/i.test(ke)),hc=function(){var a=ke.match(/(Chrome|CriOS)\/(\d+)/);return a&&a[2]?parseFloat(a[2]):null}(),ji=function(){var a=/MSIE\s(\d+)\.\d/.exec(ke),t=a&&parseFloat(a[1]);return!t&&/Trident\/7.0/i.test(ke)&&/rv:11.0/.test(ke)&&(t=11),t}(),so=/Safari/i.test(ke)&&!Wt&&!jt&&!qi,pc=/Windows/i.test(ke),Wr=!!(Qr()&&("ontouchstart"in A||A.navigator.maxTouchPoints||A.DocumentTouch&&A.document instanceof A.DocumentTouch)),oo=/iPad/i.test(ke)||so&&Wr&&!/iPhone/i.test(ke),uo=/iPhone/i.test(ke)&&!oo,Ke=uo||oo||dc,ga=(so||Ke)&&!Wt,Yv=Object.freeze({__proto__:null,IS_IPOD:dc,IOS_VERSION:Xv,IS_ANDROID:jt,ANDROID_VERSION:ao,IS_NATIVE_ANDROID:cc,IS_FIREFOX:fc,IS_EDGE:qi,IS_CHROME:Wt,CHROME_VERSION:hc,IE_VERSION:ji,IS_SAFARI:so,IS_WINDOWS:pc,TOUCH_ENABLED:Wr,IS_IPAD:oo,IS_IPHONE:uo,IS_IOS:Ke,IS_ANY_SAFARI:ga});function pl(a){return typeof a=="string"&&!!a.trim()}function mc(a){if(a.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Qv(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function Qr(){return W===A.document}function Jr(a){return Vt(a)&&a.nodeType===1}function gc(){try{return A.parent!==A.self}catch{return!0}}function vc(a){return function(t,r){if(!pl(t))return W[a](null);pl(r)&&(r=W.querySelector(r));var n=Jr(r)?r:W;return n[a]&&n[a](t)}}function ne(a,t,r,n){a===void 0&&(a="div"),t===void 0&&(t={}),r===void 0&&(r={});var e=W.createElement(a);return Object.getOwnPropertyNames(t).forEach(function(i){var s=t[i];i.indexOf("aria-")!==-1||i==="role"||i==="type"?(ie.warn(`Setting attributes in the second argument of createEl()
|
|
35
35
|
has been deprecated. Use the third argument instead.
|
|
36
|
-
`+("createEl(type, properties, attributes). Attempting to set "+i+" to "+s+".")),e.setAttribute(i,s)):i==="textContent"?gr(e,s):(e[i]!==s||i==="tabIndex")&&(e[i]=s)}),Object.getOwnPropertyNames(r).forEach(function(i){e.setAttribute(i,r[i])}),n&&co(e,n),e}function gr(a,t){return typeof a.textContent>"u"?a.innerText=t:a.textContent=t,a}function _s(a,t){t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)}function cr(a,t){return mc(t),a.classList?a.classList.contains(t):Qv(t).test(a.className)}function Rt(a,t){return a.classList?a.classList.add(t):cr(a,t)||(a.className=(a.className+" "+t).trim()),a}function Wi(a,t){return a?(a.classList?a.classList.remove(t):(mc(t),a.className=a.className.split(/\s+/).filter(function(r){return r!==t}).join(" ")),a):(ie.warn("removeClass was called with an element that doesn't exist"),null)}function yc(a,t,r){var n=cr(a,t);if(typeof r=="function"&&(r=r(a,t)),typeof r!="boolean"&&(r=!n),r!==n)return r?Rt(a,t):Wi(a,t),a}function _c(a,t){Object.getOwnPropertyNames(t).forEach(function(r){var n=t[r];n===null||typeof n>"u"||n===!1?a.removeAttribute(r):a.setAttribute(r,n===!0?"":n)})}function It(a){var t={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(a&&a.attributes&&a.attributes.length>0)for(var n=a.attributes,e=n.length-1;e>=0;e--){var i=n[e].name,s=n[e].value;(typeof a[i]=="boolean"||r.indexOf(","+i+",")!==-1)&&(s=s!==null),t[i]=s}return t}function Tc(a,t){return a.getAttribute(t)}function Gr(a,t,r){a.setAttribute(t,r)}function va(a,t){a.removeAttribute(t)}function bc(){W.body.focus(),W.onselectstart=function(){return!1}}function xc(){W.onselectstart=function(){return!0}}function zr(a){if(a&&a.getBoundingClientRect&&a.parentNode){var t=a.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(n){t[n]!==void 0&&(r[n]=t[n])}),r.height||(r.height=parseFloat(Fi(a,"height"))),r.width||(r.width=parseFloat(Fi(a,"width"))),r}}function Ri(a){if(!a||a&&!a.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=a.offsetWidth,r=a.offsetHeight,n=0,e=0;a.offsetParent&&a!==W[Wn.fullscreenElement];)n+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;return{left:n,top:e,width:t,height:r}}function ya(a,t){var r={x:0,y:0};if(Ke)for(var n=a;n&&n.nodeName.toLowerCase()!=="html";){var e=Fi(n,"transform");if(/^matrix/.test(e)){var i=e.slice(7,-1).split(/,\s/).map(Number);r.x+=i[4],r.y+=i[5]}else if(/^matrix3d/.test(e)){var s=e.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}n=n.parentNode}var o={},u=Ri(t.target),l=Ri(a),c=l.width,p=l.height,m=t.offsetY-(l.top-u.top),_=t.offsetX-(l.left-u.left);return t.changedTouches&&(_=t.changedTouches[0].pageX-l.left,m=t.changedTouches[0].pageY+l.top,Ke&&(_-=r.x,m-=r.y)),o.y=1-Math.max(0,Math.min(1,m/p)),o.x=Math.max(0,Math.min(1,_/c)),o}function Sc(a){return Vt(a)&&a.nodeType===3}function lo(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function Ec(a){return typeof a=="function"&&(a=a()),(Array.isArray(a)?a:[a]).map(function(t){if(typeof t=="function"&&(t=t()),Jr(t)||Sc(t))return t;if(typeof t=="string"&&/\S/.test(t))return W.createTextNode(t)}).filter(function(t){return t})}function co(a,t){return Ec(t).forEach(function(r){return a.appendChild(r)}),a}function Cc(a,t){return co(lo(a),t)}function Mi(a){return a.button===void 0&&a.buttons===void 0||a.button===0&&a.buttons===void 0||a.type==="mouseup"&&a.button===0&&a.buttons===0?!0:!(a.button!==0||a.buttons!==1)}var Yt=vc("querySelector"),Ac=vc("querySelectorAll"),Dc=Object.freeze({__proto__:null,isReal:Qr,isEl:Jr,isInFrame:gc,createEl:ne,textContent:gr,prependTo:_s,hasClass:cr,addClass:Rt,removeClass:Wi,toggleClass:yc,setAttributes:_c,getAttributes:It,getAttribute:Tc,setAttribute:Gr,removeAttribute:va,blockTextSelection:bc,unblockTextSelection:xc,getBoundingClientRect:zr,findPosition:Ri,getPointerPosition:ya,isTextNode:Sc,emptyEl:lo,normalizeContent:Ec,appendContent:co,insertContent:Cc,isSingleLeftClick:Mi,$:Yt,$$:Ac}),wc=!1,Ts,Jv=function(){if(Ts.options.autoSetup!==!1){var t=Array.prototype.slice.call(W.getElementsByTagName("video")),r=Array.prototype.slice.call(W.getElementsByTagName("audio")),n=Array.prototype.slice.call(W.getElementsByTagName("video-js")),e=t.concat(r,n);if(e&&e.length>0)for(var i=0,s=e.length;i<s;i++){var o=e[i];if(o&&o.getAttribute){if(o.player===void 0){var u=o.getAttribute("data-setup");u!==null&&Ts(o)}}else{bs(1);break}}else wc||bs(1)}};function bs(a,t){Qr()&&(t&&(Ts=t),A.setTimeout(Jv,a))}function xs(){wc=!0,A.removeEventListener("load",xs)}Qr()&&(W.readyState==="complete"?xs():A.addEventListener("load",xs));var kc=function(t){var r=W.createElement("style");return r.className=t,r},Pc=function(t,r){t.styleSheet?t.styleSheet.cssText=r:t.textContent=r},Zv=3,e0=Zv;function Gt(){return e0++}var Ic;A.WeakMap||(Ic=function(){function a(){this.vdata="vdata"+Math.floor(A.performance&&A.performance.now()||Date.now()),this.data={}}var t=a.prototype;return t.set=function(n,e){var i=n[this.vdata]||Gt();return n[this.vdata]||(n[this.vdata]=i),this.data[i]=e,this},t.get=function(n){var e=n[this.vdata];if(e)return this.data[e];ie("We have no data for this element",n)},t.has=function(n){var e=n[this.vdata];return e in this.data},t.delete=function(n){var e=n[this.vdata];e&&(delete this.data[e],delete n[this.vdata])},a}());var ze=A.WeakMap?new WeakMap:new Ic;function ml(a,t){if(ze.has(a)){var r=ze.get(a);r.handlers[t].length===0&&(delete r.handlers[t],a.removeEventListener?a.removeEventListener(t,r.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+t,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),Object.getOwnPropertyNames(r).length===0&&ze.delete(a)}}function fo(a,t,r,n){r.forEach(function(e){a(t,e,n)})}function _a(a){if(a.fixed_)return a;function t(){return!0}function r(){return!1}if(!a||!a.isPropagationStopped||!a.isImmediatePropagationStopped){var n=a||A.event;a={};for(var e in n)e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"&&(e==="returnValue"&&n.preventDefault||(a[e]=n[e]));if(a.target||(a.target=a.srcElement||W),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){n.preventDefault&&n.preventDefault(),a.returnValue=!1,n.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),a.cancelBubble=!0,n.cancelBubble=!0,a.isPropagationStopped=t},a.isPropagationStopped=r,a.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),a.isImmediatePropagationStopped=t,a.stopPropagation()},a.isImmediatePropagationStopped=r,a.clientX!==null&&a.clientX!==void 0){var i=W.documentElement,s=W.body;a.pageX=a.clientX+(i&&i.scrollLeft||s&&s.scrollLeft||0)-(i&&i.clientLeft||s&&s.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||s&&s.scrollTop||0)-(i&&i.clientTop||s&&s.clientTop||0)}a.which=a.charCode||a.keyCode,a.button!==null&&a.button!==void 0&&(a.button=a.button&1?0:a.button&4?1:a.button&2?2:0)}return a.fixed_=!0,a}var An,t0=function(){if(typeof An!="boolean"){An=!1;try{var t=Object.defineProperty({},"passive",{get:function(){An=!0}});A.addEventListener("test",null,t),A.removeEventListener("test",null,t)}catch{}}return An},r0=["touchstart","touchmove"];function nt(a,t,r){if(Array.isArray(t))return fo(nt,a,t,r);ze.has(a)||ze.set(a,{});var n=ze.get(a);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),r.guid||(r.guid=Gt()),n.handlers[t].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(i,s){if(!n.disabled){i=_a(i);var o=n.handlers[i.type];if(o)for(var u=o.slice(0),l=0,c=u.length;l<c&&!i.isImmediatePropagationStopped();l++)try{u[l].call(a,i,s)}catch(p){ie.error(p)}}}),n.handlers[t].length===1)if(a.addEventListener){var e=!1;t0()&&r0.indexOf(t)>-1&&(e={passive:!0}),a.addEventListener(t,n.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+t,n.dispatcher)}function Be(a,t,r){if(ze.has(a)){var n=ze.get(a);if(n.handlers){if(Array.isArray(t))return fo(Be,a,t,r);var e=function(l,c){n.handlers[c]=[],ml(l,c)};if(t===void 0){for(var i in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},i)&&e(a,i);return}var s=n.handlers[t];if(s){if(!r){e(a,t);return}if(r.guid)for(var o=0;o<s.length;o++)s[o].guid===r.guid&&s.splice(o--,1);ml(a,t)}}}}function Zr(a,t,r){var n=ze.has(a)?ze.get(a):{},e=a.parentNode||a.ownerDocument;if(typeof t=="string"?t={type:t,target:a}:t.target||(t.target=a),t=_a(t),n.dispatcher&&n.dispatcher.call(a,t,r),e&&!t.isPropagationStopped()&&t.bubbles===!0)Zr.call(null,e,t,r);else if(!e&&!t.defaultPrevented&&t.target&&t.target[t.type]){ze.has(t.target)||ze.set(t.target,{});var i=ze.get(t.target);t.target[t.type]&&(i.disabled=!0,typeof t.target[t.type]=="function"&&t.target[t.type](),i.disabled=!1)}return!t.defaultPrevented}function Ta(a,t,r){if(Array.isArray(t))return fo(Ta,a,t,r);var n=function e(){Be(a,t,e),r.apply(this,arguments)};n.guid=r.guid=r.guid||Gt(),nt(a,t,n)}function Lc(a,t,r){var n=function e(){Be(a,t,e),r.apply(this,arguments)};n.guid=r.guid=r.guid||Gt(),nt(a,t,n)}var i0=Object.freeze({__proto__:null,fixEvent:_a,on:nt,off:Be,trigger:Zr,one:Ta,any:Lc}),pt=30,ye=function(t,r,n){r.guid||(r.guid=Gt());var e=r.bind(t);return e.guid=n?n+"_"+r.guid:r.guid,e},Ht=function(t,r){var n=A.performance.now(),e=function(){var s=A.performance.now();s-n>=r&&(t.apply(void 0,arguments),n=s)};return e},n0=function(t,r,n,e){e===void 0&&(e=A);var i,s=function(){e.clearTimeout(i),i=null},o=function(){var l=this,c=arguments,p=function(){i=null,p=null,t.apply(l,c)};e.clearTimeout(i),i=e.setTimeout(p,r)};return o.cancel=s,o},Ie=function(){};Ie.prototype.allowedEvents_={};Ie.prototype.on=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},nt(this,a,t),this.addEventListener=r};Ie.prototype.addEventListener=Ie.prototype.on;Ie.prototype.off=function(a,t){Be(this,a,t)};Ie.prototype.removeEventListener=Ie.prototype.off;Ie.prototype.one=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},Ta(this,a,t),this.addEventListener=r};Ie.prototype.any=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},Lc(this,a,t),this.addEventListener=r};Ie.prototype.trigger=function(a){var t=a.type||a;typeof a=="string"&&(a={type:t}),a=_a(a),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](a),Zr(this,a)};Ie.prototype.dispatchEvent=Ie.prototype.trigger;var mi;Ie.prototype.queueTrigger=function(a){var t=this;mi||(mi=new Map);var r=a.type||a,n=mi.get(this);n||(n=new Map,mi.set(this,n));var e=n.get(r);n.delete(r),A.clearTimeout(e);var i=A.setTimeout(function(){n.delete(r),n.size===0&&(n=null,mi.delete(t)),t.trigger(a)},0);n.set(r,i)};var ba=function(t){return typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},Mt=function(t){return t instanceof Ie||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(r){return typeof t[r]=="function"})},a0=function(t,r){Mt(t)?r():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(r))},Ss=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},Gn=function(t,r,n){if(!t||!t.nodeName&&!Mt(t))throw new Error("Invalid target for "+ba(r)+"#"+n+"; must be a DOM node or evented object.")},Oc=function(t,r,n){if(!Ss(t))throw new Error("Invalid event type for "+ba(r)+"#"+n+"; must be a non-empty string or array.")},Fc=function(t,r,n){if(typeof t!="function")throw new Error("Invalid listener for "+ba(r)+"#"+n+"; must be a function.")},$a=function(t,r,n){var e=r.length<3||r[0]===t||r[0]===t.eventBusEl_,i,s,o;return e?(i=t.eventBusEl_,r.length>=3&&r.shift(),s=r[0],o=r[1]):(i=r[0],s=r[1],o=r[2]),Gn(i,t,n),Oc(s,t,n),Fc(o,t,n),o=ye(t,o),{isTargetingSelf:e,target:i,type:s,listener:o}},sr=function(t,r,n,e){Gn(t,t,r),t.nodeName?i0[r](t,n,e):t[r](n,e)},s0={on:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"on"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(sr(o,"on",u,l),!s){var c=function(){return t.off(o,u,l)};c.guid=l.guid;var p=function(){return t.off("dispose",c)};p.guid=l.guid,sr(this,"on","dispose",c),sr(o,"on","dispose",p)}},one:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"one"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(s)sr(o,"one",u,l);else{var c=function p(){t.off(o,u,p);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,sr(o,"one",u,c)}},any:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"any"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(s)sr(o,"any",u,l);else{var c=function p(){t.off(o,u,p);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,sr(o,"any",u,c)}},off:function(t,r,n){if(!t||Ss(t))Be(this.eventBusEl_,t,r);else{var e=t,i=r;Gn(e,this,"off"),Oc(i,this,"off"),Fc(n,this,"off"),n=ye(this,n),this.off("dispose",n),e.nodeName?(Be(e,i,n),Be(e,"dispose",n)):Mt(e)&&(e.off(i,n),e.off("dispose",n))}},trigger:function(t,r){Gn(this.eventBusEl_,this,"trigger");var n=t&&typeof t!="string"?t.type:t;if(!Ss(n)){var e="Invalid event type for "+ba(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(t)(this.log||ie).error(e);else throw new Error(e)}return Zr(this.eventBusEl_,t,r)}};function ho(a,t){t===void 0&&(t={});var r=t,n=r.eventBusKey;if(n){if(!a[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');a.eventBusEl_=a[n]}else a.eventBusEl_=ne("span",{className:"vjs-event-bus"});return be(a,s0),a.eventedCallbacks&&a.eventedCallbacks.forEach(function(e){e()}),a.on("dispose",function(){a.off(),[a,a.el_,a.eventBusEl_].forEach(function(e){e&&ze.has(e)&&ze.delete(e)}),A.setTimeout(function(){a.eventBusEl_=null},0)}),a}var o0={state:{},setState:function(t){var r=this;typeof t=="function"&&(t=t());var n;return Mr(t,function(e,i){r.state[i]!==e&&(n=n||{},n[i]={from:r.state[i],to:e}),r.state[i]=e}),n&&Mt(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function Rc(a,t){return be(a,o0),a.state=be({},a.state,t),typeof a.handleStateChanged=="function"&&Mt(a)&&a.on("statechanged",a.handleStateChanged),a}var Fn=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toLowerCase()})},Ee=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toUpperCase()})},u0=function(t,r){return Ee(t)===Ee(r)};function ve(){for(var a={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach(function(e){e&&Mr(e,function(i,s){if(!Oi(i)){a[s]=i;return}Oi(a[s])||(a[s]={}),a[s]=ve(a[s],i)})}),a}var l0=function(){function a(){this.map_={}}var t=a.prototype;return t.has=function(n){return n in this.map_},t.delete=function(n){var e=this.has(n);return delete this.map_[n],e},t.set=function(n,e){return this.map_[n]=e,this},t.forEach=function(n,e){for(var i in this.map_)n.call(e,this.map_[i],i,this)},a}(),d0=A.Map?A.Map:l0,c0=function(){function a(){this.set_={}}var t=a.prototype;return t.has=function(n){return n in this.set_},t.delete=function(n){var e=this.has(n);return delete this.set_[n],e},t.add=function(n){return this.set_[n]=1,this},t.forEach=function(n,e){for(var i in this.set_)n.call(e,i,i,this)},a}(),Ka=A.Set?A.Set:c0,V=function(){function a(r,n,e){var i=this;if(!r&&this.play?this.player_=r=this:this.player_=r,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ve({},this.options_),n=this.options_=ve(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var s=r&&r.id&&r.id()||"no_player";this.id_=s+"_component_"+Gt()}this.name_=n.name||null,n.el?this.el_=n.el:n.createEl!==!1&&(this.el_=this.createEl()),n.className&&this.el_&&n.className.split(" ").forEach(function(o){return i.addClass(o)}),n.evented!==!1&&(ho(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Rc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Ka,this.setIntervalIds_=new Ka,this.rafIds_=new Ka,this.namedRafs_=new d0,this.clearingTimersOnDispose_=!1,n.initChildren!==!1&&this.initChildren(),this.ready(e),n.reportTouchActivity!==!1&&this.enableTouchActivity()}var t=a.prototype;return t.dispose=function(n){if(n===void 0&&(n={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(n.restoreEl?this.el_.parentNode.replaceChild(n.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return!!this.isDisposed_},t.player=function(){return this.player_},t.options=function(n){return n?(this.options_=ve(this.options_,n),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(n,e,i){return ne(n,e,i)},t.localize=function(n,e,i){i===void 0&&(i=n);var s=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),u=o&&o[s],l=s&&s.split("-")[0],c=o&&o[l],p=i;return u&&u[n]?p=u[n]:c&&c[n]&&(p=c[n]),e&&(p=p.replace(/\{(\d+)\}/g,function(m,_){var b=e[_-1],S=b;return typeof b>"u"&&(S=m),S})),p},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(n){return this.childIndex_[n]},t.getChild=function(n){if(n)return this.childNameIndex_[n]},t.getDescendant=function(){for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];e=e.reduce(function(u,l){return u.concat(l)},[]);for(var s=this,o=0;o<e.length;o++)if(s=s.getChild(e[o]),!s||!s.getChild)return;return s},t.addChild=function(n,e,i){e===void 0&&(e={}),i===void 0&&(i=this.children_.length);var s,o;if(typeof n=="string"){o=Ee(n);var u=e.componentClass||o;e.name=o;var l=a.getComponent(u);if(!l)throw new Error("Component "+u+" does not exist");if(typeof l!="function")return null;s=new l(this.player_||this,e)}else s=n;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),o=o||s.name&&Ee(s.name()),o&&(this.childNameIndex_[o]=s,this.childNameIndex_[Fn(o)]=s),typeof s.el=="function"&&s.el()){var c=null;this.children_[i+1]&&(this.children_[i+1].el_?c=this.children_[i+1].el_:Jr(this.children_[i+1])&&(c=this.children_[i+1])),this.contentEl().insertBefore(s.el(),c)}return s},t.removeChild=function(n){if(typeof n=="string"&&(n=this.getChild(n)),!(!n||!this.children_)){for(var e=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===n){e=!0,this.children_.splice(i,1);break}if(e){n.parentComponent_=null,this.childIndex_[n.id()]=null,this.childNameIndex_[Ee(n.name())]=null,this.childNameIndex_[Fn(n.name())]=null;var s=n.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(n.el())}}},t.initChildren=function(){var n=this,e=this.options_.children;if(e){var i=this.options_,s=function(c){var p=c.name,m=c.opts;if(i[p]!==void 0&&(m=i[p]),m!==!1){m===!0&&(m={}),m.playerOptions=n.options_.playerOptions;var _=n.addChild(p,m);_&&(n[p]=_)}},o,u=a.getComponent("Tech");Array.isArray(e)?o=e:o=Object.keys(e),o.concat(Object.keys(this.options_).filter(function(l){return!o.some(function(c){return typeof c=="string"?l===c:l===c.name})})).map(function(l){var c,p;return typeof l=="string"?(c=l,p=e[c]||n.options_[c]||{}):(c=l.name,p=l),{name:c,opts:p}}).filter(function(l){var c=a.getComponent(l.opts.componentClass||Ee(l.name));return c&&!u.isTech(c)}).forEach(s)}},t.buildCSSClass=function(){return""},t.ready=function(n,e){if(e===void 0&&(e=!1),!!n){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(n);return}e?n.call(this):this.setTimeout(n,1)}},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var n=this.readyQueue_;this.readyQueue_=[],n&&n.length>0&&n.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(n,e){return Yt(n,e||this.contentEl())},t.$$=function(n,e){return Ac(n,e||this.contentEl())},t.hasClass=function(n){return cr(this.el_,n)},t.addClass=function(n){Rt(this.el_,n)},t.removeClass=function(n){Wi(this.el_,n)},t.toggleClass=function(n,e){yc(this.el_,n,e)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(n){return Tc(this.el_,n)},t.setAttribute=function(n,e){Gr(this.el_,n,e)},t.removeAttribute=function(n){va(this.el_,n)},t.width=function(n,e){return this.dimension("width",n,e)},t.height=function(n,e){return this.dimension("height",n,e)},t.dimensions=function(n,e){this.width(n,!0),this.height(e)},t.dimension=function(n,e,i){if(e!==void 0){(e===null||e!==e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[n]=e:e==="auto"?this.el_.style[n]="":this.el_.style[n]=e+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;var s=this.el_.style[n],o=s.indexOf("px");return parseInt(o!==-1?s.slice(0,o):this.el_["offset"+Ee(n)],10)},t.currentDimension=function(n){var e=0;if(n!=="width"&&n!=="height")throw new Error("currentDimension only accepts width or height value");if(e=Fi(this.el_,n),e=parseFloat(e),e===0||isNaN(e)){var i="offset"+Ee(n);e=this.el_[i]}return e},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(n){this.player_&&(te.isEventKey(n,"Tab")||n.stopPropagation(),this.player_.handleKeyDown(n))},t.handleKeyPress=function(n){this.handleKeyDown(n)},t.emitTapEvents=function(){var n=0,e=null,i=10,s=200,o;this.on("touchstart",function(l){l.touches.length===1&&(e={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},n=A.performance.now(),o=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)o=!1;else if(e){var c=l.touches[0].pageX-e.pageX,p=l.touches[0].pageY-e.pageY,m=Math.sqrt(c*c+p*p);m>i&&(o=!1)}});var u=function(){o=!1};this.on("touchleave",u),this.on("touchcancel",u),this.on("touchend",function(l){if(e=null,o===!0){var c=A.performance.now()-n;c<s&&(l.preventDefault(),this.trigger("tap"))}})},t.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var n=ye(this.player(),this.player().reportUserActivity),e;this.on("touchstart",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)});var i=function(o){n(),this.clearInterval(e)};this.on("touchmove",n),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(n,e){var i=this,s;return n=ye(this,n),this.clearTimersOnDispose_(),s=A.setTimeout(function(){i.setTimeoutIds_.has(s)&&i.setTimeoutIds_.delete(s),n()},e),this.setTimeoutIds_.add(s),s},t.clearTimeout=function(n){return this.setTimeoutIds_.has(n)&&(this.setTimeoutIds_.delete(n),A.clearTimeout(n)),n},t.setInterval=function(n,e){n=ye(this,n),this.clearTimersOnDispose_();var i=A.setInterval(n,e);return this.setIntervalIds_.add(i),i},t.clearInterval=function(n){return this.setIntervalIds_.has(n)&&(this.setIntervalIds_.delete(n),A.clearInterval(n)),n},t.requestAnimationFrame=function(n){var e=this;if(!this.supportsRaf_)return this.setTimeout(n,1e3/60);this.clearTimersOnDispose_();var i;return n=ye(this,n),i=A.requestAnimationFrame(function(){e.rafIds_.has(i)&&e.rafIds_.delete(i),n()}),this.rafIds_.add(i),i},t.requestNamedAnimationFrame=function(n,e){var i=this;if(!this.namedRafs_.has(n)){this.clearTimersOnDispose_(),e=ye(this,e);var s=this.requestAnimationFrame(function(){e(),i.namedRafs_.has(n)&&i.namedRafs_.delete(n)});return this.namedRafs_.set(n,s),n}},t.cancelNamedAnimationFrame=function(n){this.namedRafs_.has(n)&&(this.cancelAnimationFrame(this.namedRafs_.get(n)),this.namedRafs_.delete(n))},t.cancelAnimationFrame=function(n){return this.supportsRaf_?(this.rafIds_.has(n)&&(this.rafIds_.delete(n),A.cancelAnimationFrame(n)),n):this.clearTimeout(n)},t.clearTimersOnDispose_=function(){var n=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var i=e[0],s=e[1];n[i].forEach(function(o,u){return n[s](u)})}),n.clearingTimersOnDispose_=!1}))},a.registerComponent=function(n,e){if(typeof n!="string"||!n)throw new Error('Illegal component name, "'+n+'"; must be a non-empty string.');var i=a.getComponent("Tech"),s=i&&i.isTech(e),o=a===e||a.prototype.isPrototypeOf(e.prototype);if(s||!o){var u;throw s?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error('Illegal component, "'+n+'"; '+u+".")}n=Ee(n),a.components_||(a.components_={});var l=a.getComponent("Player");if(n==="Player"&&l&&l.players){var c=l.players,p=Object.keys(c);if(c&&p.length>0&&p.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[n]=e,a.components_[Fn(n)]=e,e},a.getComponent=function(n){if(!(!n||!a.components_))return a.components_[n]},a}();V.prototype.supportsRaf_=typeof A.requestAnimationFrame=="function"&&typeof A.cancelAnimationFrame=="function";V.registerComponent("Component",V);function f0(a,t,r){if(typeof t!="number"||t<0||t>r)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+r+").")}function gl(a,t,r,n){return f0(a,n,r.length-1),r[n][t]}function Xa(a){var t;return a===void 0||a.length===0?t={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:t={length:a.length,start:gl.bind(null,"start",0,a),end:gl.bind(null,"end",1,a)},A.Symbol&&A.Symbol.iterator&&(t[A.Symbol.iterator]=function(){return(a||[]).values()}),t}function fr(a,t){return Array.isArray(a)?Xa(a):a===void 0||t===void 0?Xa():Xa([[a,t]])}function Mc(a,t){var r=0,n,e;if(!t)return 0;(!a||!a.length)&&(a=fr(0,0));for(var i=0;i<a.length;i++)n=a.start(i),e=a.end(i),e>t&&(e=t),r+=e-n;return r/t}function $e(a){if(a instanceof $e)return a;typeof a=="number"?this.code=a:typeof a=="string"?this.message=a:Vt(a)&&(typeof a.code=="number"&&(this.code=a.code),be(this,a)),this.message||(this.message=$e.defaultMessages[this.code]||"")}$e.prototype.code=0;$e.prototype.message="";$e.prototype.status=null;$e.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];$e.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var wr=0;wr<$e.errorTypes.length;wr++)$e[$e.errorTypes[wr]]=wr,$e.prototype[$e.errorTypes[wr]]=wr;function Ci(a){return a!=null&&typeof a.then=="function"}function Tt(a){Ci(a)&&a.then(null,function(t){})}var Es=function(t){var r=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(n,e,i){return t[e]&&(n[e]=t[e]),n},{cues:t.cues&&Array.prototype.map.call(t.cues,function(n){return{startTime:n.startTime,endTime:n.endTime,text:n.text,id:n.id}})});return r},h0=function(t){var r=t.$$("track"),n=Array.prototype.map.call(r,function(i){return i.track}),e=Array.prototype.map.call(r,function(i){var s=Es(i.track);return i.src&&(s.src=i.src),s});return e.concat(Array.prototype.filter.call(t.textTracks(),function(i){return n.indexOf(i)===-1}).map(Es))},p0=function(t,r){return t.forEach(function(n){var e=r.addRemoteTextTrack(n).track;!n.src&&n.cues&&n.cues.forEach(function(i){return e.addCue(i)})}),r.textTracks()},vl={textTracksToJson:h0,jsonToTextTracks:p0,trackToJson_:Es},Ya="vjs-modal-dialog",ei=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.close_=function(s){return i.close(s)},i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=ne("div",{className:Ya+"-content"},{role:"document"}),i.descEl_=ne("p",{className:Ya+"-description vjs-control-text",id:i.el().getAttribute("aria-describedby")}),gr(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},r.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,a.prototype.dispose.call(this)},r.buildCSSClass=function(){return Ya+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},r.label=function(){return this.localize(this.options_.label||"Modal Window")},r.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},r.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},r.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},r.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},r.closeable=function(e){if(typeof e=="boolean"){var i=this.closeable_=!!e,s=this.getChild("closeButton");if(i&&!s){var o=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(s,"close",this.close_)}!i&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_},r.fill=function(){this.fillWith(this.content())},r.fillWith=function(e){var i=this.contentEl(),s=i.parentNode,o=i.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(i),this.empty(),Cc(i,e),this.trigger("modalfill"),o?s.insertBefore(i,o):s.appendChild(i);var u=this.getChild("closeButton");u&&s.appendChild(u.el_)},r.empty=function(){this.trigger("beforemodalempty"),lo(this.contentEl()),this.trigger("modalempty")},r.content=function(e){return typeof e<"u"&&(this.content_=e),this.content_},r.conditionalFocus_=function(){var e=W.activeElement,i=this.player_.el_;this.previouslyActiveEl_=null,(i.contains(e)||i===e)&&(this.previouslyActiveEl_=e,this.focus())},r.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},r.handleKeyDown=function(e){if(e.stopPropagation(),te.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(te.isEventKey(e,"Tab")){for(var i=this.focusableEls_(),s=this.el_.querySelector(":focus"),o,u=0;u<i.length;u++)if(s===i[u]){o=u;break}W.activeElement===this.el_&&(o=0),e.shiftKey&&o===0?(i[i.length-1].focus(),e.preventDefault()):!e.shiftKey&&o===i.length-1&&(i[0].focus(),e.preventDefault())}},r.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(i){return(i instanceof A.HTMLAnchorElement||i instanceof A.HTMLAreaElement)&&i.hasAttribute("href")||(i instanceof A.HTMLInputElement||i instanceof A.HTMLSelectElement||i instanceof A.HTMLTextAreaElement||i instanceof A.HTMLButtonElement)&&!i.hasAttribute("disabled")||i instanceof A.HTMLIFrameElement||i instanceof A.HTMLObjectElement||i instanceof A.HTMLEmbedElement||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")!==-1||i.hasAttribute("contenteditable")})},t}(V);ei.prototype.options_={pauseOnOpen:!0,temporary:!0};V.registerComponent("ModalDialog",ei);var $r=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]),e=a.call(this)||this,e.tracks_=[],Object.defineProperty(ee(e),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<n.length;i++)e.addTrack(n[i]);return e}var r=t.prototype;return r.addTrack=function(e){var i=this,s=this.tracks_.length;""+s in this||Object.defineProperty(this,s,{get:function(){return this.tracks_[s]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){i.trigger({track:e,type:"labelchange",target:i})},Mt(e)&&e.addEventListener("labelchange",e.labelchange_)},r.removeTrack=function(e){for(var i,s=0,o=this.length;s<o;s++)if(this[s]===e){i=this[s],i.off&&i.off(),this.tracks_.splice(s,1);break}i&&this.trigger({track:i,type:"removetrack",target:this})},r.getTrackById=function(e){for(var i=null,s=0,o=this.length;s<o;s++){var u=this[s];if(u.id===e){i=u;break}}return i},t}(Ie);$r.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var m0 in $r.prototype.allowedEvents_)$r.prototype["on"+m0]=null;var Qa=function(t,r){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||r.id===t[n].id||(t[n].enabled=!1)},g0=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]);for(var i=n.length-1;i>=0;i--)if(n[i].enabled){Qa(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,e}var r=t.prototype;return r.addTrack=function(e){var i=this;e.enabled&&Qa(this,e),a.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){i.changing_||(i.changing_=!0,Qa(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},t}($r),Ja=function(t,r){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||r.id===t[n].id||(t[n].selected=!1)},v0=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]);for(var i=n.length-1;i>=0;i--)if(n[i].selected){Ja(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,Object.defineProperty(ee(e),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),e}var r=t.prototype;return r.addTrack=function(e){var i=this;e.selected&&Ja(this,e),a.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){i.changing_||(i.changing_=!0,Ja(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},t}($r),Nc=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.addTrack=function(e){var i=this;a.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return i.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return i.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);var s=["metadata","chapters"];s.indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}($r),y0=function(){function a(r){r===void 0&&(r=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var n=0,e=r.length;n<e;n++)this.addTrackElement_(r[n])}var t=a.prototype;return t.addTrackElement_=function(n){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),this.trackElements_.indexOf(n)===-1&&this.trackElements_.push(n)},t.getTrackElementByTrack_=function(n){for(var e,i=0,s=this.trackElements_.length;i<s;i++)if(n===this.trackElements_[i].track){e=this.trackElements_[i];break}return e},t.removeTrackElement_=function(n){for(var e=0,i=this.trackElements_.length;e<i;e++)if(n===this.trackElements_[e]){this.trackElements_[e].track&&typeof this.trackElements_[e].track.off=="function"&&this.trackElements_[e].track.off(),typeof this.trackElements_[e].off=="function"&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},a}(),yl=function(){function a(r){a.prototype.setCues_.call(this,r),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=a.prototype;return t.setCues_=function(n){var e=this.length||0,i=0,s=n.length;this.cues_=n,this.length_=n.length;var o=function(l){""+l in this||Object.defineProperty(this,""+l,{get:function(){return this.cues_[l]}})};if(e<s)for(i=e;i<s;i++)o.call(this,i)},t.getCueById=function(n){for(var e=null,i=0,s=this.length;i<s;i++){var o=this[i];if(o.id===n){e=o;break}}return e},a}(),_0={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},T0={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},b0={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},_l={disabled:"disabled",hidden:"hidden",showing:"showing"},po=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={}),n=a.call(this)||this;var e={id:r.id||"vjs_track_"+Gt(),kind:r.kind||"",language:r.language||""},i=r.label||"",s=function(l){Object.defineProperty(ee(n),l,{get:function(){return e[l]},set:function(){}})};for(var o in e)s(o);return Object.defineProperty(ee(n),"label",{get:function(){return i},set:function(l){l!==i&&(i=l,this.trigger("labelchange"))}}),n}return t}(Ie),mo=function(t){var r=["protocol","hostname","port","pathname","search","hash","host"],n=W.createElement("a");n.href=t;for(var e={},i=0;i<r.length;i++)e[r[i]]=n[r[i]];return e.protocol==="http:"&&(e.host=e.host.replace(/:80$/,"")),e.protocol==="https:"&&(e.host=e.host.replace(/:443$/,"")),e.protocol||(e.protocol=A.location.protocol),e.host||(e.host=A.location.host),e},Bc=function(t){if(!t.match(/^https?:\/\//)){var r=W.createElement("a");r.href=t,t=r.href}return t},go=function(t){if(typeof t=="string"){var r=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,n=r.exec(t);if(n)return n.pop().toLowerCase()}return""},xa=function(t,r){r===void 0&&(r=A.location);var n=mo(t),e=n.protocol===":"?r.protocol:n.protocol,i=e+n.host!==r.protocol+r.host;return i},x0=Object.freeze({__proto__:null,parseUrl:mo,getAbsoluteURL:Bc,getFileExtension:go,isCrossOrigin:xa}),Tl=function(t,r){var n=new A.WebVTT.Parser(A,A.vttjs,A.WebVTT.StringDecoder()),e=[];n.oncue=function(i){r.addCue(i)},n.onparsingerror=function(i){e.push(i)},n.onflush=function(){r.trigger({type:"loadeddata",target:r})},n.parse(t),e.length>0&&(A.console&&A.console.groupCollapsed&&A.console.groupCollapsed("Text Track parsing errors for "+r.src),e.forEach(function(i){return ie.error(i)}),A.console&&A.console.groupEnd&&A.console.groupEnd()),n.flush()},bl=function(t,r){var n={uri:t},e=xa(t);e&&(n.cors=e);var i=r.tech_.crossOrigin()==="use-credentials";i&&(n.withCredentials=i),dd(n,ye(this,function(s,o,u){if(s)return ie.error(s,o);r.loaded_=!0,typeof A.WebVTT!="function"?r.tech_&&r.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type==="vttjserror"){ie.error("vttjs failed to load, stopping trying to process "+r.src);return}return Tl(u,r)}):Tl(u,r)}))},Gi=function(a){G._inheritsLoose(t,a);function t(n){var e;if(n===void 0&&(n={}),!n.tech)throw new Error("A tech was not provided.");var i=ve(n,{kind:b0[n.kind]||"subtitles",language:n.language||n.srclang||""}),s=_l[i.mode]||"disabled",o=i.default;(i.kind==="metadata"||i.kind==="chapters")&&(s="hidden"),e=a.call(this,i)||this,e.tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=e.tech_.preloadTextTracks!==!1;var u=new yl(e.cues_),l=new yl(e.activeCues_),c=!1;e.timeupdateHandler=ye(ee(e),function(m){if(m===void 0&&(m={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var p=function(){e.stopTracking()};return e.tech_.one("dispose",p),s!=="disabled"&&e.startTracking(),Object.defineProperties(ee(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(_){_l[_]&&s!==_&&(s=_,!this.preload_&&s!=="disabled"&&this.cues.length===0&&bl(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return l;for(var _=this.tech_.currentTime(),b=[],S=0,x=this.cues.length;S<x;S++){var k=this.cues[S];(k.startTime<=_&&k.endTime>=_||k.startTime===k.endTime&&k.startTime<=_&&k.startTime+.5>=_)&&b.push(k)}if(c=!1,b.length!==this.activeCues_.length)c=!0;else for(var L=0;L<b.length;L++)this.activeCues_.indexOf(b[L])===-1&&(c=!0);return this.activeCues_=b,l.setCues_(this.activeCues_),l},set:function(){}}}),i.src?(e.src=i.src,e.preload_||(e.loaded_=!0),(e.preload_||i.kind!=="subtitles"&&i.kind!=="captions")&&bl(e.src,ee(e))):e.loaded_=!0,e}var r=t.prototype;return r.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},r.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},r.addCue=function(e){var i=e;if(A.vttjs&&!(e instanceof A.vttjs.VTTCue)){i=new A.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var s in e)s in i||(i[s]=e[s]);i.id=e.id,i.originalCue_=e}for(var o=this.tech_.textTracks(),u=0;u<o.length;u++)o[u]!==this&&o[u].removeCue(i);this.cues_.push(i),this.cues.setCues_(this.cues_)},r.removeCue=function(e){for(var i=this.cues_.length;i--;){var s=this.cues_[i];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(i,1),this.cues.setCues_(this.cues_);break}}},t}(po);Gi.prototype.allowedEvents_={cuechange:"cuechange"};var Uc=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={});var e=ve(r,{kind:T0[r.kind]||""});n=a.call(this,e)||this;var i=!1;return Object.defineProperty(ee(n),"enabled",{get:function(){return i},set:function(o){typeof o!="boolean"||o===i||(i=o,this.trigger("enabledchange"))}}),e.enabled&&(n.enabled=e.enabled),n.loaded_=!0,n}return t}(po),Vc=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={});var e=ve(r,{kind:_0[r.kind]||""});n=a.call(this,e)||this;var i=!1;return Object.defineProperty(ee(n),"selected",{get:function(){return i},set:function(o){typeof o!="boolean"||o===i||(i=o,this.trigger("selectedchange"))}}),e.selected&&(n.selected=e.selected),n}return t}(po),Hc=0,S0=1,qc=2,E0=3,ti=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={}),n=a.call(this)||this;var e,i=new Gi(r);return n.kind=i.kind,n.src=i.src,n.srclang=i.language,n.label=i.label,n.default=i.default,Object.defineProperties(ee(n),{readyState:{get:function(){return e}},track:{get:function(){return i}}}),e=Hc,i.addEventListener("loadeddata",function(){e=qc,n.trigger({type:"load",target:ee(n)})}),n}return t}(Ie);ti.prototype.allowedEvents_={load:"load"};ti.NONE=Hc;ti.LOADING=S0;ti.LOADED=qc;ti.ERROR=E0;var ot={audio:{ListClass:g0,TrackClass:Uc,capitalName:"Audio"},video:{ListClass:v0,TrackClass:Vc,capitalName:"Video"},text:{ListClass:Nc,TrackClass:Gi,capitalName:"Text"}};Object.keys(ot).forEach(function(a){ot[a].getterName=a+"Tracks",ot[a].privateName=a+"Tracks_"});var Kr={remoteText:{ListClass:Nc,TrackClass:Gi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:y0,TrackClass:ti,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},je=ht({},ot,Kr);Kr.names=Object.keys(Kr);ot.names=Object.keys(ot);je.names=[].concat(Kr.names).concat(ot.names);function C0(a,t,r,n,e){e===void 0&&(e={});var i=a.textTracks();e.kind=t,r&&(e.label=r),n&&(e.language=n),e.tech=a;var s=new je.text.TrackClass(e);return i.addTrack(s),s}var he=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return n===void 0&&(n={}),e===void 0&&(e=function(){}),n.reportTouchActivity=!1,i=a.call(this,null,n,e)||this,i.onDurationChange_=function(s){return i.onDurationChange(s)},i.trackProgress_=function(s){return i.trackProgress(s)},i.trackCurrentTime_=function(s){return i.trackCurrentTime(s)},i.stopTrackingCurrentTime_=function(s){return i.stopTrackingCurrentTime(s)},i.disposeSourceHandler_=function(s){return i.disposeSourceHandler(s)},i.queuedHanders_=new Set,i.hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),je.names.forEach(function(s){var o=je[s];n&&n[o.getterName]&&(i[o.privateName]=n[o.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){n["native"+s+"Tracks"]===!1&&(i["featuresNative"+s+"Tracks"]=!1)}),n.nativeCaptions===!1||n.nativeTextTracks===!1?i.featuresNativeTextTracks=!1:(n.nativeCaptions===!0||n.nativeTextTracks===!0)&&(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.preloadTextTracks=n.preloadTextTracks!==!1,i.autoRemoteTextTracks_=new je.text.ListClass,i.initTrackListeners(),n.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}var r=t.prototype;return r.triggerSourceset=function(e){var i=this;this.isReady_||this.one("ready",function(){return i.setTimeout(function(){return i.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},r.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},r.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ye(this,function(){var i=this.bufferedPercent();this.bufferedPercent_!==i&&this.trigger("progress"),this.bufferedPercent_=i,i===1&&this.stopTrackingProgress()}),500)},r.onDurationChange=function(e){this.duration_=this.duration()},r.buffered=function(){return fr(0,0)},r.bufferedPercent=function(){return Mc(this.buffered(),this.duration_)},r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},r.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.dispose=function(){this.clearTracks(ot.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},r.clearTracks=function(e){var i=this;e=[].concat(e),e.forEach(function(s){for(var o=i[s+"Tracks"]()||[],u=o.length;u--;){var l=o[u];s==="text"&&i.removeRemoteTextTrack(l),o.removeTrack(l)}})},r.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],i=e.length;i--;){var s=e[i];this.removeRemoteTextTrack(s)}},r.reset=function(){},r.crossOrigin=function(){},r.setCrossOrigin=function(){},r.error=function(e){return e!==void 0&&(this.error_=new $e(e),this.trigger("error")),this.error_},r.played=function(){return this.hasStarted_?fr(0,0):fr()},r.play=function(){},r.setScrubbing=function(){},r.scrubbing=function(){},r.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.initTrackListeners=function(){var e=this;ot.names.forEach(function(i){var s=ot[i],o=function(){e.trigger(i+"trackchange")},u=e[s.getterName]();u.addEventListener("removetrack",o),u.addEventListener("addtrack",o),e.on("dispose",function(){u.removeEventListener("removetrack",o),u.removeEventListener("addtrack",o)})})},r.addWebVttScript_=function(){var e=this;if(!A.WebVTT)if(W.body.contains(this.el())){if(!this.options_["vtt.js"]&&Oi(Mu)&&Object.keys(Mu).length>0){this.trigger("vttjsloaded");return}var i=W.createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){e.trigger("vttjsloaded")},i.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){i.onload=null,i.onerror=null}),A.WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,i=this.textTracks(),s=this.remoteTextTracks(),o=function(m){return i.addTrack(m.track)},u=function(m){return i.removeTrack(m.track)};s.on("addtrack",o),s.on("removetrack",u),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var m=0;m<i.length;m++){var _=i[m];_.removeEventListener("cuechange",l),_.mode==="showing"&&_.addEventListener("cuechange",l)}};c(),i.addEventListener("change",c),i.addEventListener("addtrack",c),i.addEventListener("removetrack",c),this.on("dispose",function(){s.off("addtrack",o),s.off("removetrack",u),i.removeEventListener("change",c),i.removeEventListener("addtrack",c),i.removeEventListener("removetrack",c);for(var p=0;p<i.length;p++){var m=i[p];m.removeEventListener("cuechange",l)}})},r.addTextTrack=function(e,i,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return C0(this,e,i,s)},r.createRemoteTextTrack=function(e){var i=ve(e,{tech:this});return new Kr.remoteTextEl.TrackClass(i)},r.addRemoteTextTrack=function(e,i){var s=this;e===void 0&&(e={});var o=this.createRemoteTextTrack(e);return i!==!0&&i!==!1&&(ie.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),i!==!0&&this.ready(function(){return s.autoRemoteTextTracks_.addTrack(o.track)}),o},r.removeRemoteTextTrack=function(e){var i=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(i),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},r.getVideoPlaybackQuality=function(){return{}},r.requestPictureInPicture=function(){var e=this.options_.Promise||A.Promise;if(e)return e.reject()},r.disablePictureInPicture=function(){return!0},r.setDisablePictureInPicture=function(){},r.requestVideoFrameCallback=function(e){var i=this,s=Gt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(s),this.one("playing",function(){i.queuedHanders_.has(s)&&(i.queuedHanders_.delete(s),e())})):this.requestNamedAnimationFrame(s,e),s},r.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},r.setPoster=function(){},r.playsinline=function(){},r.setPlaysinline=function(){},r.overrideNativeAudioTracks=function(){},r.overrideNativeVideoTracks=function(){},r.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ee(e),t.techs_[e]=i,t.techs_[Fn(e)]=i,e!=="Tech"&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e){if(t.techs_&&t.techs_[e])return t.techs_[e];if(e=Ee(e),A&&A.videojs&&A.videojs[e])return ie.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),A.videojs[e]}},t}(V);je.names.forEach(function(a){var t=je[a];he.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.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(a){a.registerSourceHandler=function(r,n){var e=a.sourceHandlers;e||(e=a.sourceHandlers=[]),n===void 0&&(n=e.length),e.splice(n,0,r)},a.canPlayType=function(r){for(var n=a.sourceHandlers||[],e,i=0;i<n.length;i++)if(e=n[i].canPlayType(r),e)return e;return""},a.selectSourceHandler=function(r,n){for(var e=a.sourceHandlers||[],i,s=0;s<e.length;s++)if(i=e[s].canHandleSource(r,n),i)return e[s];return null},a.canPlaySource=function(r,n){var e=a.selectSourceHandler(r,n);return e?e.canHandleSource(r,n):""};var t=["seekable","seeking","duration"];t.forEach(function(r){var n=this[r];typeof n=="function"&&(this[r]=function(){return this.sourceHandler_&&this.sourceHandler_[r]?this.sourceHandler_[r].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},a.prototype),a.prototype.setSource=function(r){var n=a.selectSourceHandler(r,this.options_);n||(a.nativeSourceHandler?n=a.nativeSourceHandler:ie.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==a.nativeSourceHandler&&(this.currentSource_=r),this.sourceHandler_=n.handleSource(r,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},a.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};V.registerComponent("Tech",he);he.registerTech("Tech",he);he.defaultTechOrder_=[];var hr={},Cs={},zn={};function A0(a,t){hr[a]=hr[a]||[],hr[a].push(t)}function D0(a,t,r){a.setTimeout(function(){return or(t,hr[t.type],r,a)},1)}function w0(a,t){a.forEach(function(r){return r.setTech&&r.setTech(t)})}function k0(a,t,r){return a.reduceRight(vo(r),t[r]())}function P0(a,t,r,n){return t[r](a.reduce(vo(r),n))}function xl(a,t,r,n){n===void 0&&(n=null);var e="call"+Ee(r),i=a.reduce(vo(e),n),s=i===zn,o=s?null:t[r](i);return O0(a,r,o,s),o}var I0={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},L0={setCurrentTime:1,setMuted:1,setVolume:1},Sl={play:1,pause:1};function vo(a){return function(t,r){return t===zn?zn:r[a]?r[a](t):t}}function O0(a,t,r,n){for(var e=a.length-1;e>=0;e--){var i=a[e];i[t]&&i[t](n,r)}}function F0(a){Cs[a.id()]=null}function R0(a,t){var r=Cs[a.id()],n=null;if(r==null)return n=t(a),Cs[a.id()]=[[t,n]],n;for(var e=0;e<r.length;e++){var i=r[e],s=i[0],o=i[1];s===t&&(n=o)}return n===null&&(n=t(a),r.push([t,n])),n}function or(a,t,r,n,e,i){a===void 0&&(a={}),t===void 0&&(t=[]),e===void 0&&(e=[]),i===void 0&&(i=!1);var s=t,o=s[0],u=s.slice(1);if(typeof o=="string")or(a,hr[o],r,n,e,i);else if(o){var l=R0(n,o);if(!l.setSource)return e.push(l),or(a,u,r,n,e,i);l.setSource(be({},a),function(c,p){if(c)return or(a,u,r,n,e,i);e.push(l),or(p,a.type===p.type?u:hr[p.type],r,n,e,i)})}else u.length?or(a,u,r,n,e,i):i?r(a,e):or(a,hr["*"],r,n,e,!0)}var M0={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"},$n=function(t){t===void 0&&(t="");var r=go(t),n=M0[r.toLowerCase()];return n||""},N0=function(t,r){if(!r)return"";if(t.cache_.source.src===r&&t.cache_.source.type)return t.cache_.source.type;var n=t.cache_.sources.filter(function(o){return o.src===r});if(n.length)return n[0].type;for(var e=t.$$("source"),i=0;i<e.length;i++){var s=e[i];if(s.type&&s.src&&s.src===r)return s.type}return $n(r)},B0=function a(t){if(Array.isArray(t)){var r=[];t.forEach(function(n){n=a(n),Array.isArray(n)?r=r.concat(n):Vt(n)&&r.push(n)}),t=r}else typeof t=="string"&&t.trim()?t=[El({src:t})]:Vt(t)&&typeof t.src=="string"&&t.src&&t.src.trim()?t=[El(t)]:t=[];return t};function El(a){if(!a.type){var t=$n(a.src);t&&(a.type=t)}return a}var U0=function(a){G._inheritsLoose(t,a);function t(r,n,e){var i,s=ve({createEl:!1},n);if(i=a.call(this,r,s,e)||this,!n.playerOptions.sources||n.playerOptions.sources.length===0)for(var o=0,u=n.playerOptions.techOrder;o<u.length;o++){var l=Ee(u[o]),c=he.getTech(l);if(l||(c=V.getComponent(l)),c&&c.isSupported()){r.loadTech_(l);break}}else r.src(n.playerOptions.sources);return i}return t}(V);V.registerComponent("MediaLoader",U0);var Sa=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.options_.controlText&&i.controlText(i.options_.controlText),i.handleMouseOver_=function(s){return i.handleMouseOver(s)},i.handleMouseOut_=function(s){return i.handleMouseOut(s)},i.handleClick_=function(s){return i.handleClick(s)},i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.emitTapEvents(),i.enable(),i}var r=t.prototype;return r.createEl=function(e,i,s){e===void 0&&(e="div"),i===void 0&&(i={}),s===void 0&&(s={}),i=be({className:this.buildCSSClass(),tabIndex:0},i),e==="button"&&ie.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),s=be({role:"button"},s),this.tabIndex_=i.tabIndex;var o=ne(e,i,s);return o.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},r.dispose=function(){this.controlTextEl_=null,a.prototype.dispose.call(this)},r.createControlTextEl=function(e){return this.controlTextEl_=ne("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},r.controlText=function(e,i){if(i===void 0&&(i=this.el()),e===void 0)return this.controlText_||"Need Text";var s=this.localize(e);this.controlText_=e,gr(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&i.setAttribute("title",s)},r.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},r.enable=function(){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_))},r.disable=function(){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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(e){te.isEventKey(e,"Space")||te.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(V);V.registerComponent("ClickableComponent",Sa);var V0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update(),i.update_=function(s){return i.update(s)},n.on("posterchange",i.update_),i}var r=t.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),a.prototype.dispose.call(this)},r.createEl=function(){var e=ne("div",{className:"vjs-poster",tabIndex:-1});return e},r.update=function(e){var i=this.player().poster();this.setSrc(i),i?this.show():this.hide()},r.setSrc=function(e){var i="";e&&(i='url("'+e+'")'),this.el_.style.backgroundImage=i},r.handleClick=function(e){if(this.player_.controls()){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((ji||qi)&&i)&&this.player_.tech(!0).focus(),this.player_.paused()?Tt(this.player_.play()):this.player_.pause()}},t}(Sa);V.registerComponent("PosterImage",V0);var st="#222",Cl="#ccc",H0={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Za(a,t){var r;if(a.length===4)r=a[1]+a[1]+a[2]+a[2]+a[3]+a[3];else if(a.length===7)r=a.slice(1);else throw new Error("Invalid color code provided, "+a+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}function es(a,t,r){try{a.style[t]=r}catch{return}}var q0=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;s=a.call(this,n,e,i)||this;var o=function(l){return s.updateDisplay(l)};return n.on("loadstart",function(u){return s.toggleDisplay(u)}),n.on("texttrackchange",o),n.on("loadedmetadata",function(u){return s.preselectTrack(u)}),n.ready(ye(ee(s),function(){if(n.tech_&&n.tech_.featuresNativeTextTracks){this.hide();return}n.on("fullscreenchange",o),n.on("playerresize",o),A.addEventListener("orientationchange",o),n.on("dispose",function(){return A.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],l=0;l<u.length;l++)this.player_.addRemoteTextTrack(u[l],!0);this.preselectTrack()})),s}var r=t.prototype;return r.preselectTrack=function(){for(var e={captions:1,subtitles:1},i=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,o,u,l,c=0;c<i.length;c++){var p=i[c];s&&s.enabled&&s.language&&s.language===p.language&&p.kind in e?p.kind===s.kind?l=p:l||(l=p):s&&!s.enabled?(l=null,o=null,u=null):p.default&&(p.kind==="descriptions"&&!o?o=p:p.kind in e&&!u&&(u=p))}l?l.mode="showing":u?u.mode="showing":o&&(o.mode="showing")},r.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},r.clearDisplay=function(){typeof A.WebVTT=="function"&&A.WebVTT.processCues(A,[],this.el_)},r.updateDisplay=function(){var e=this.player_.textTracks(),i=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),i){for(var s=[],o=0;o<e.length;++o){var u=e[o];u.mode==="showing"&&s.push(u)}this.updateForTrack(s);return}for(var l=null,c=null,p=e.length;p--;){var m=e[p];m.mode==="showing"&&(m.kind==="descriptions"?l=m:c=m)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):l&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(l))},r.updateDisplayState=function(e){for(var i=this.player_.textTrackSettings.getValues(),s=e.activeCues,o=s.length;o--;){var u=s[o];if(u){var l=u.displayState;if(i.color&&(l.firstChild.style.color=i.color),i.textOpacity&&es(l.firstChild,"color",Za(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(l.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&es(l.firstChild,"backgroundColor",Za(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?es(l,"backgroundColor",Za(i.windowColor,i.windowOpacity)):l.style.backgroundColor=i.windowColor),i.edgeStyle&&(i.edgeStyle==="dropshadow"?l.firstChild.style.textShadow="2px 2px 3px "+st+", 2px 2px 4px "+st+", 2px 2px 5px "+st:i.edgeStyle==="raised"?l.firstChild.style.textShadow="1px 1px "+st+", 2px 2px "+st+", 3px 3px "+st:i.edgeStyle==="depressed"?l.firstChild.style.textShadow="1px 1px "+Cl+", 0 1px "+Cl+", -1px -1px "+st+", 0 -1px "+st:i.edgeStyle==="uniform"&&(l.firstChild.style.textShadow="0 0 4px "+st+", 0 0 4px "+st+", 0 0 4px "+st+", 0 0 4px "+st)),i.fontPercent&&i.fontPercent!==1){var c=A.parseFloat(l.style.fontSize);l.style.fontSize=c*i.fontPercent+"px",l.style.height="auto",l.style.top="auto"}i.fontFamily&&i.fontFamily!=="default"&&(i.fontFamily==="small-caps"?l.firstChild.style.fontVariant="small-caps":l.firstChild.style.fontFamily=H0[i.fontFamily])}}},r.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),!(typeof A.WebVTT!="function"||e.every(function(_){return!_.activeCues}))){for(var i=[],s=0;s<e.length;++s)for(var o=e[s],u=0;u<o.activeCues.length;++u)i.push(o.activeCues[u]);A.WebVTT.processCues(A,i,this.el_);for(var l=0;l<e.length;++l){for(var c=e[l],p=0;p<c.activeCues.length;++p){var m=c.activeCues[p].displayState;Rt(m,"vjs-text-track-cue"),Rt(m,"vjs-text-track-cue-"+(c.language?c.language:l)),c.language&&Gr(m,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},t}(V);V.registerComponent("TextTrackDisplay",q0);var j0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=this.player_.isAudio(),i=this.localize(e?"Audio Player":"Video Player"),s=ne("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[i])}),o=a.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(s),o},t}(V);V.registerComponent("LoadingSpinner",j0);var ft=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(e,i,s){i===void 0&&(i={}),s===void 0&&(s={}),e="button",i=be({className:this.buildCSSClass()},i),s=be({type:"button"},s);var o=ne(e,i,s);return o.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},r.addChild=function(e,i){i===void 0&&(i={});var s=this.constructor.name;return ie.warn("Adding an actionable (user controllable) child to a Button ("+s+") is not supported; use a ClickableComponent instead."),V.prototype.addChild.call(this,e,i)},r.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(e){if(te.isEventKey(e,"Space")||te.isEventKey(e,"Enter")){e.stopPropagation();return}a.prototype.handleKeyDown.call(this,e)},t}(Sa);V.registerComponent("Button",ft);var jc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.mouseused_=!1,i.on("mousedown",function(s){return i.handleMouseDown(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(e){var i=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var s=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Tt(i),this.player_.tech(!0)&&!((ji||qi)&&s)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),u=o&&o.getChild("playToggle");if(!u){this.player_.tech(!0).focus();return}var l=function(){return u.focus()};Ci(i)?i.then(l,function(){}):this.setTimeout(l,1)},r.handleKeyDown=function(e){this.mouseused_=!1,a.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(e){this.mouseused_=!0},t}(ft);jc.prototype.controlText_="Play Video";V.registerComponent("BigPlayButton",jc);var W0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.controlText(e&&e.controlText||i.localize("Close")),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){te.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(ft);V.registerComponent("CloseButton",W0);var Wc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,e.replay=e.replay===void 0||e.replay,i.on(n,"play",function(s){return i.handlePlay(s)}),i.on(n,"pause",function(s){return i.handlePause(s)}),e.replay&&i.on(n,"ended",function(s){return i.handleEnded(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?Tt(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(e){var i=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(s){return i.handleSeeked(s)})},t}(ft);Wc.prototype.controlText_="Play";V.registerComponent("PlayToggle",Wc);var Gc=function(t,r){t=t<0?0:t;var n=Math.floor(t%60),e=Math.floor(t/60%60),i=Math.floor(t/3600),s=Math.floor(r/60%60),o=Math.floor(r/3600);return(isNaN(t)||t===1/0)&&(i=e=n="-"),i=i>0||o>0?i+":":"",e=((i||s>=10)&&e<10?"0"+e:e)+":",n=n<10?"0"+n:n,i+e+n},yo=Gc;function G0(a){yo=a}function z0(){yo=Gc}function Xr(a,t){return t===void 0&&(t=a),yo(a,t)}var ri=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["timeupdate","ended"],function(s){return i.updateContent(s)}),i.updateTextNode_(),i}var r=t.prototype;return r.createEl=function(){var e=this.buildCSSClass(),i=a.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),s=ne("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(s),this.contentEl_=ne("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},r.dispose=function(){this.contentEl_=null,this.textNode_=null,a.prototype.dispose.call(this)},r.updateTextNode_=function(e){var i=this;e===void 0&&(e=0),e=Xr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(i.contentEl_){var s=i.textNode_;s&&i.contentEl_.firstChild!==s&&(s=null,ie.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),i.textNode_=W.createTextNode(i.formattedTime_),i.textNode_&&(s?i.contentEl_.replaceChild(i.textNode_,s):i.contentEl_.appendChild(i.textNode_))}}))},r.updateContent=function(e){},t}(V);ri.prototype.labelText_="Time";ri.prototype.controlText_="Time";V.registerComponent("TimeDisplay",ri);var _o=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(e){var i;this.player_.ended()?i=this.player_.duration():i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)},t}(ri);_o.prototype.labelText_="Current Time";_o.prototype.controlText_="Current Time";V.registerComponent("CurrentTimeDisplay",_o);var To=function(a){G._inheritsLoose(t,a);function t(n,e){var i;i=a.call(this,n,e)||this;var s=function(u){return i.updateContent(u)};return i.on(n,"durationchange",s),i.on(n,"loadstart",s),i.on(n,"loadedmetadata",s),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var i=this.player_.duration();this.updateTextNode_(i)},t}(ri);To.prototype.labelText_="Duration";To.prototype.controlText_="Duration";V.registerComponent("DurationDisplay",To);var $0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=a.prototype.createEl.call(this,"div"),s=a.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(s),e.appendChild(i),e},t}(V);V.registerComponent("TimeDivider",$0);var bo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"durationchange",function(s){return i.updateContent(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=a.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(ne("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(e){if(typeof this.player_.duration()=="number"){var i;this.player_.ended()?i=0:this.player_.remainingTimeDisplay?i=this.player_.remainingTimeDisplay():i=this.player_.remainingTime(),this.updateTextNode_(i)}},t}(ri);bo.prototype.labelText_="Remaining Time";bo.prototype.controlText_="Remaining Time";V.registerComponent("RemainingTimeDisplay",bo);var K0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateShowing(),i.on(i.player(),"durationchange",function(s){return i.updateShowing(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ne("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ne("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(W.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(V);V.registerComponent("LiveDisplay",K0);var zc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(s){return i.updateLiveEdgeStatus(s)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ne("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,a.prototype.dispose.call(this)},t}(ft);zc.prototype.controlText_="Seek to live, currently playing live";V.registerComponent("SeekToLive",zc);var Ea=function(t,r,n){return t=Number(t),Math.min(n,Math.max(r,isNaN(t)?r:t))},xo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseDown_=function(s){return i.handleMouseDown(s)},i.handleMouseUp_=function(s){return i.handleMouseUp(s)},i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.handleClick_=function(s){return i.handleClick(s)},i.handleMouseMove_=function(s){return i.handleMouseMove(s)},i.update_=function(s){return i.update(s)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}var r=t.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i.className=i.className+" vjs-slider",i=be({tabIndex:0},i),s=be({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},s),a.prototype.createEl.call(this,e,i,s)},r.handleMouseDown=function(e){var i=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Wt&&e.preventDefault(),bc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;xc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var e=this;if(!(!this.el_||!this.bar)){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var s=e.vertical()?"height":"width";e.bar.el().style[s]=(i*100).toFixed(2)+"%"})),i}},r.getProgress=function(){return Number(Ea(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var i=ya(this.el_,e);return this.vertical()?i.y:i.x},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):te.isEventKey(e,"Right")||te.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):a.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(V);V.registerComponent("Slider",xo);var ts=function(t,r){return Ea(t/r*100,0,100).toFixed(2)+"%"},X0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.partEls_=[],i.on(n,"progress",function(s){return i.update(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=ne("span",{className:"vjs-control-text"}),s=ne("span",{textContent:this.localize("Loaded")}),o=W.createTextNode(": ");return this.percentageEl_=ne("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(s),i.appendChild(o),i.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,a.prototype.dispose.call(this)},r.update=function(e){var i=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var s=i.player_.liveTracker,o=i.player_.buffered(),u=s&&s.isLive()?s.seekableEnd():i.player_.duration(),l=i.player_.bufferedEnd(),c=i.partEls_,p=ts(l,u);i.percent_!==p&&(i.el_.style.width=p,gr(i.percentageEl_,p),i.percent_=p);for(var m=0;m<o.length;m++){var _=o.start(m),b=o.end(m),S=c[m];S||(S=i.el_.appendChild(ne()),c[m]=S),!(S.dataset.start===_&&S.dataset.end===b)&&(S.dataset.start=_,S.dataset.end=b,S.style.left=ts(_,l),S.style.width=ts(b-_,l))}for(var x=c.length;x>o.length;x--)i.el_.removeChild(c[x-1]);c.length=o.length})},t}(V);V.registerComponent("LoadProgressBar",X0);var Y0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s){var o=Ri(this.el_),u=zr(this.player_.el()),l=e.width*i;if(!(!u||!o)){var c=e.left-u.left+l,p=e.width-l+(u.right-e.right),m=o.width/2;c<m?m+=m-c:p<m&&(m=p),m<0?m=0:m>o.width&&(m=o.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(s)}},r.write=function(e){gr(this.el_,e)},r.updateTime=function(e,i,s,o){var u=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,c=u.player_.duration();if(u.player_.liveTracker&&u.player_.liveTracker.isLive()){var p=u.player_.liveTracker.liveWindow(),m=p-i*p;l=(m<1?"":"-")+Xr(m,p)}else l=Xr(s,c);u.update(e,i,l),o&&o()})},t}(V);V.registerComponent("TimeTooltip",Y0);var So=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,i){var s=this.getChild("timeTooltip");if(s){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,i,o)}},t}(V);So.prototype.options_={children:[]};!Ke&&!jt&&So.prototype.options_.children.push("timeTooltip");V.registerComponent("PlayProgressBar",So);var $c=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i){var s=this,o=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,o,function(){s.el_.style.left=e.width*i+"px"})},t}(V);$c.prototype.options_={children:["timeTooltip"]};V.registerComponent("MouseTimeDisplay",$c);var Dn=5,Al=12,Eo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.setEventHandlers_(),i}var r=t.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=ye(this,this.update),this.update=Ht(this.update_,pt),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(i){return e.enableInterval_(i)},this.disableIntervalHandler_=function(i){return e.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in W&&"visibilityState"in W&&this.on(W,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){W.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,pt))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var i=this;if(W.visibilityState!=="hidden"){var s=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),u=i.player_.liveTracker,l=i.player_.duration();u&&u.isLive()&&(l=i.player_.liveTracker.liveCurrentTime()),i.percent_!==s&&(i.el_.setAttribute("aria-valuenow",(s*100).toFixed(2)),i.percent_=s),(i.currentTime_!==o||i.duration_!==l)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Xr(o,l),Xr(l,l)],"{1} of {2}")),i.currentTime_=o,i.duration_=l),i.bar&&i.bar.update(zr(i.el()),i.getProgress())}),s}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e=this.getCurrentTime_(),i,s=this.player_.liveTracker;return s&&s.isLive()?(i=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i},r.handleMouseDown=function(e){Mi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(e,i){if(i===void 0&&(i=!1),!!Mi(e)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var s,o=this.calculateDistance(e),u=this.player_.liveTracker;if(!u||!u.isLive())s=o*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(o>=.99){u.seekToLiveEdge();return}var l=u.seekableStart(),c=u.liveCurrentTime();if(s=l+o*u.liveWindow(),s>=c&&(s=c),s<=l&&(s=l+.1),s===1/0)return}this.userSeek_(s)}},r.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},r.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},r.handleMouseUp=function(e){a.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Tt(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+Dn)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-Dn)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var i=this.player_.liveTracker;if(te.isEventKey(e,"Space")||te.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(te.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(te.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(te(e))){e.preventDefault(),e.stopPropagation();var s=(te.codes[te(e)]-te.codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else te.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Dn*Al)):te.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Dn*Al)):a.prototype.handleKeyDown.call(this,e)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in W&&"visibilityState"in W&&this.off(W,"visibilitychange",this.toggleVisibility_),a.prototype.dispose.call(this)},t}(xo);Eo.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Ke&&!jt&&Eo.prototype.options_.children.splice(1,0,"mouseTimeDisplay");V.registerComponent("SeekBar",Eo);var Kc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseMove=Ht(ye(ee(i),i.handleMouseMove),pt),i.throttledHandleMouseSeek=Ht(ye(ee(i),i.handleMouseSeek),pt),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.handleMouseDownHandler_=function(s){return i.handleMouseDown(s)},i.enable(),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var i=this.getChild("seekBar");if(i){var s=i.getChild("playProgressBar"),o=i.getChild("mouseTimeDisplay");if(!(!s&&!o)){var u=i.el(),l=Ri(u),c=ya(u,e).x;c=Ea(c,0,1),o&&o.update(l,c),s&&s.update(l,i.getProgress())}}},r.handleMouseSeek=function(e){var i=this.getChild("seekBar");i&&i.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Tt(this.player_.play())}},r.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(e){var i=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(V);Kc.prototype.options_={children:["seekBar"]};V.registerComponent("ProgressControl",Kc);var Xc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["enterpictureinpicture","leavepictureinpicture"],function(s){return i.handlePictureInPictureChange(s)}),i.on(n,["disablepictureinpicturechanged","loadedmetadata"],function(s){return i.handlePictureInPictureEnabledChange(s)}),i.on(n,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var s=n.currentType().substring(0,5)==="audio";s||n.audioPosterMode()||n.audioOnlyMode()?(n.isInPictureInPicture()&&n.exitPictureInPicture(),i.hide()):i.show()}),i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+a.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){W.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(ft);Xc.prototype.controlText_="Picture-in-Picture";V.registerComponent("PictureInPictureToggle",Xc);var Yc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"fullscreenchange",function(s){return i.handleFullscreenChange(s)}),W[n.fsApi_.fullscreenEnabled]===!1&&i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ft);Yc.prototype.controlText_="Fullscreen";V.registerComponent("FullscreenToggle",Yc);var Q0=function(t,r){r.tech_&&!r.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},J0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(a.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},t}(V);V.registerComponent("VolumeLevel",J0);var Z0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s,o){if(!s){var u=zr(this.el_),l=zr(this.player_.el()),c=e.width*i;if(!l||!u)return;var p=e.left-l.left+c,m=e.width-c+(l.right-e.right),_=u.width/2;p<_?_+=_-p:m<_&&(_=m),_<0?_=0:_>u.width&&(_=u.width),this.el_.style.right="-"+_+"px"}this.write(o+"%")},r.write=function(e){gr(this.el_,e)},r.updateVolume=function(e,i,s,o,u){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,i,s,o.toFixed(0)),u&&u()})},t}(V);V.registerComponent("VolumeLevelTooltip",Z0);var Qc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i,s){var o=this,u=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,s,u,function(){s?o.el_.style.bottom=e.height*i+"px":o.el_.style.left=e.width*i+"px"})},t}(V);Qc.prototype.options_={children:["volumeLevelTooltip"]};V.registerComponent("MouseVolumeLevelDisplay",Qc);var Ca=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on("slideractive",function(s){return i.updateLastVolume_(s)}),i.on(n,"volumechange",function(s){return i.updateARIAAttributes(s)}),n.ready(function(){return i.updateARIAAttributes()}),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){Mi(e)&&a.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(e){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var s=this.el(),o=zr(s),u=this.vertical(),l=ya(s,e);l=u?l.y:l.x,l=Ea(l,0,1),i.update(o,l,u)}Mi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},r.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},r.updateLastVolume_=function(){var e=this,i=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(i)})},t}(xo);Ca.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Ke&&!jt&&Ca.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Ca.prototype.playerEvent="volumechange";V.registerComponent("VolumeBar",Ca);var Jc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||Oi(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),i=a.call(this,n,e)||this,Q0(ee(i),n),i.throttledHandleMouseMove=Ht(ye(ee(i),i.handleMouseMove),pt),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.on("mousedown",function(s){return i.handleMouseDown(s)}),i.on("touchstart",function(s){return i.handleMouseDown(s)}),i.on("mousemove",function(s){return i.handleMouseMove(s)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}var r=t.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(e){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(V);Jc.prototype.options_={children:["volumeBar"]};V.registerComponent("VolumeControl",Jc);var ey=function(t,r){r.tech_&&!r.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Zc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,ey(ee(i),n),i.on(n,["loadstart","volumechange"],function(s){return i.update(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var i=this.player_.volume(),s=this.player_.lastVolume_();if(i===0){var o=s<.1?.1:s;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),i=3;Ke&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?i=0:e<.33?i=1:e<.67&&(i=2);for(var s=0;s<4;s++)Wi(this.el_,"vjs-vol-"+s);Rt(this.el_,"vjs-vol-"+i)},r.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0,i=e?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},t}(ft);Zc.prototype.controlText_="Mute";V.registerComponent("MuteToggle",Zc);var ef=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),typeof e.inline<"u"?e.inline=e.inline:e.inline=!0,(typeof e.volumeControl>"u"||Oi(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),i=a.call(this,n,e)||this,i.handleKeyPressHandler_=function(s){return i.handleKeyPress(s)},i.on(n,["loadstart"],function(s){return i.volumePanelState_(s)}),i.on(i.muteToggle,"keyup",function(s){return i.handleKeyPress(s)}),i.on(i.volumeControl,"keyup",function(s){return i.handleVolumeControlKeyUp(s)}),i.on("keydown",function(s){return i.handleKeyPress(s)}),i.on("mouseover",function(s){return i.handleMouseOver(s)}),i.on("mouseout",function(s){return i.handleMouseOut(s)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}var r=t.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),a.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){te.isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),nt(W,"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Be(W,"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){te.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(V);ef.prototype.options_={children:["muteToggle","volumeControl"]};V.registerComponent("VolumePanel",ef);var tf=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,e&&(i.menuButton_=e.menuButton),i.focusedChild_=-1,i.on("keydown",function(s){return i.handleKeyDown(s)}),i.boundHandleBlur_=function(s){return i.handleBlur(s)},i.boundHandleTapClick_=function(s){return i.handleTapClick(s)},i}var r=t.prototype;return r.addEventListenerForItem=function(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),a.prototype.removeChild.call(this,e)},r.addItem=function(e){var i=this.addChild(e);i&&this.addEventListenerForItem(i)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=ne(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),nt(i,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),i},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,a.prototype.dispose.call(this)},r.handleBlur=function(e){var i=e.relatedTarget||W.activeElement;if(!this.children().some(function(o){return o.el()===i})){var s=this.menuButton_;s&&s.buttonPressed_&&i!==s.el().firstChild&&s.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var s=i.filter(function(o){return o.el()===e.target})[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(te.isEventKey(e,"Right")||te.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){e===void 0&&(e=0);var i=this.children().slice(),s=i.length&&i[0].hasClass("vjs-menu-title");s&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())},t}(V);V.registerComponent("Menu",tf);var Co=function(a){G._inheritsLoose(t,a);function t(n,e){var i;e===void 0&&(e={}),i=a.call(this,n,e)||this,i.menuButton_=new ft(n,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ft.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+s,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var o=function(l){return i.handleClick(l)};return i.handleMenuKeyUp_=function(u){return i.handleMenuKeyUp(u)},i.on(i.menuButton_,"tap",o),i.on(i.menuButton_,"click",o),i.on(i.menuButton_,"keydown",function(u){return i.handleKeyDown(u)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),nt(W,"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(u){return i.handleMouseLeave(u)}),i.on("keydown",function(u){return i.handleSubmenuKeyDown(u)}),i}var r=t.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var e=new tf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=ne("li",{className:"vjs-menu-title",textContent:Ee(this.options_.title),tabIndex:-1}),s=new V(this.player_,{el:i});e.addItem(s)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)e.addItem(this.items[o]);return e},r.createItems=function(){},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";var i=ft.prototype.buildCSSClass();return"vjs-menu-button "+e+" "+i+" "+a.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+a.prototype.buildCSSClass.call(this)},r.controlText=function(e,i){return i===void 0&&(i=this.menuButton_.el()),this.menuButton_.controlText(e,i)},r.dispose=function(){this.handleMouseLeave(),a.prototype.dispose.call(this)},r.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Be(W,"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(e){te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),te.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(te.isEventKey(e,"Up")||te.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(e){(te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},r.handleSubmenuKeyDown=function(e){(te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),te.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ke&&gc())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(V);V.registerComponent("MenuButton",Co);var Ao=function(a){G._inheritsLoose(t,a);function t(r,n){var e,i=n.tracks;if(e=a.call(this,r,n)||this,e.items.length<=1&&e.hide(),!i)return ee(e);var s=ye(ee(e),e.update);return i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),e.player_.on("ready",s),e.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s)}),e}return t}(Co);V.registerComponent("TrackButton",Ao);var ty=["Tab","Esc","Up","Down","Right","Left"],zi=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.selectable=e.selectable,i.isSelected_=e.selected||!1,i.multiSelectable=e.multiSelectable,i.selected(i.isSelected_),i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}var r=t.prototype;return r.createEl=function(e,i,s){this.nonIconControl=!0;var o=a.prototype.createEl.call(this,"li",be({className:"vjs-menu-item",tabIndex:-1},i),s);return o.replaceChild(ne("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},r.handleKeyDown=function(e){ty.some(function(i){return te.isEventKey(e,i)})||a.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){this.selected(!0)},r.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Sa);V.registerComponent("MenuItem",zi);var $i=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=n.textTracks();e.label=s.label||s.language||"Unknown",e.selected=s.mode==="showing",i=a.call(this,n,e)||this,i.track=s,i.kinds=(e.kinds||[e.kind||i.track.kind]).filter(Boolean);var u=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];i.handleTracksChange.apply(ee(i),_)},l=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];i.handleSelectedLanguageChange.apply(ee(i),_)};if(n.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",l),i.on("dispose",function(){n.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",l)}),o.onchange===void 0){var c;i.on(["tap","click"],function(){if(typeof A.Event!="object")try{c=new A.Event("change")}catch{}c||(c=W.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return i.handleTracksChange(),i}var r=t.prototype;return r.handleClick=function(e){var i=this.track,s=this.player_.textTracks();if(a.prototype.handleClick.call(this,e),!!s)for(var o=0;o<s.length;o++){var u=s[o];this.kinds.indexOf(u.kind)!==-1&&(u===i?u.mode!=="showing"&&(u.mode="showing"):u.mode!=="disabled"&&(u.mode="disabled"))}},r.handleTracksChange=function(e){var i=this.track.mode==="showing";i!==this.isSelected_&&this.selected(i)},r.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var i=this.player_.cache_.selectedLanguage;if(i&&i.enabled&&i.language===this.track.language&&i.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},r.dispose=function(){this.track=null,a.prototype.dispose.call(this)},t}(zi);V.registerComponent("TextTrackMenuItem",$i);var rf=function(a){G._inheritsLoose(t,a);function t(n,e){return e.track={player:n,kind:e.kind,kinds:e.kinds,default:!1,mode:"disabled"},e.kinds||(e.kinds=[e.kind]),e.label?e.track.label=e.label:e.track.label=e.kinds.join(" and ")+" off",e.selectable=!0,e.multiSelectable=!1,a.call(this,n,e)||this}var r=t.prototype;return r.handleTracksChange=function(e){for(var i=this.player().textTracks(),s=!0,o=0,u=i.length;o<u;o++){var l=i[o];if(this.options_.kinds.indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)},r.handleSelectedLanguageChange=function(e){for(var i=this.player().textTracks(),s=!0,o=0,u=i.length;o<u;o++){var l=i[o];if(["captions","descriptions","subtitles"].indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}($i);V.registerComponent("OffTextTrackMenuItem",rf);var ii=function(a){G._inheritsLoose(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.textTracks(),a.call(this,n,e)||this}var r=t.prototype;return r.createItems=function(e,i){e===void 0&&(e=[]),i===void 0&&(i=$i);var s;this.label_&&(s=this.label_+" off"),e.push(new rf(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var u=0;u<o.length;u++){var l=o[u];if(this.kinds_.indexOf(l.kind)>-1){var c=new i(this.player_,{track:l,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+l.kind+"-menu-item"),e.push(c)}}return e},t}(Ao);V.registerComponent("TextTrackButton",ii);var nf=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=e.cue,u=n.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=u&&u<o.endTime,i=a.call(this,n,e)||this,i.track=s,i.cue=o,i}var r=t.prototype;return r.handleClick=function(e){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},t}(zi);V.registerComponent("ChaptersTrackMenuItem",nf);var Do=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;return s=a.call(this,n,e,i)||this,s.selectCurrentItem_=function(){s.items.forEach(function(o){o.selected(s.track_.activeCues[0]===o.cue)})},s}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildWrapperCSSClass.call(this)},r.update=function(e){if(!(e&&e.track&&e.track.kind!=="chapters")){var i=this.findChaptersTrack();i!==this.track_?(this.setTrack(i),a.prototype.update.call(this)):(!this.items||i&&i.cues&&i.cues.length!==this.items.length)&&a.prototype.update.call(this)}},r.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var s=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);s&&s.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},r.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],i=e.length-1;i>=0;i--){var s=e[i];if(s.kind===this.kind_)return s}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ee(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var i=this.track_.cues;if(!i)return e;for(var s=0,o=i.length;s<o;s++){var u=i[s],l=new nf(this.player_,{track:this.track_,cue:u});e.push(l)}return e},t}(ii);Do.prototype.kind_="chapters";Do.prototype.controlText_="Chapters";V.registerComponent("ChaptersButton",Do);var wo=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;s=a.call(this,n,e,i)||this;var o=n.textTracks(),u=ye(ee(s),s.handleTracksChange);return o.addEventListener("change",u),s.on("dispose",function(){o.removeEventListener("change",u)}),s}var r=t.prototype;return r.handleTracksChange=function(e){for(var i=this.player().textTracks(),s=!1,o=0,u=i.length;o<u;o++){var l=i[o];if(l.kind!==this.kind_&&l.mode==="showing"){s=!0;break}}s?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ii);wo.prototype.kind_="descriptions";wo.prototype.controlText_="Descriptions";V.registerComponent("DescriptionsButton",wo);var ko=function(a){G._inheritsLoose(t,a);function t(n,e,i){return a.call(this,n,e,i)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ii);ko.prototype.kind_="subtitles";ko.prototype.controlText_="Subtitles";V.registerComponent("SubtitlesButton",ko);var Po=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e.track={player:n,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",i=a.call(this,n,e)||this,i.addClass("vjs-texttrack-settings"),i.controlText(", opens "+e.kind+" settings dialog"),i}var r=t.prototype;return r.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}($i);V.registerComponent("CaptionSettingsMenuItem",Po);var Io=function(a){G._inheritsLoose(t,a);function t(n,e,i){return a.call(this,n,e,i)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Po(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),a.prototype.createItems.call(this,e)},t}(ii);Io.prototype.kind_="captions";Io.prototype.controlText_="Captions";V.registerComponent("CaptionsButton",Io);var af=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(e,i,s){var o=a.prototype.createEl.call(this,e,i,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(u.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(ne("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},t}($i);V.registerComponent("SubsCapsMenuItem",af);var Lo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,i.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(i.player_.language_)>-1&&(i.label_="captions"),i.menuButton_.controlText(Ee(i.label_)),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Po(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=a.prototype.createItems.call(this,e,af),e},t}(ii);Lo.prototype.kinds_=["captions","subtitles"];Lo.prototype.controlText_="Subtitles";V.registerComponent("SubsCapsButton",Lo);var sf=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=n.audioTracks();e.label=s.label||s.language||"Unknown",e.selected=s.enabled,i=a.call(this,n,e)||this,i.track=s,i.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,p=new Array(c),m=0;m<c;m++)p[m]=arguments[m];i.handleTracksChange.apply(ee(i),p)};return o.addEventListener("change",u),i.on("dispose",function(){o.removeEventListener("change",u)}),i}var r=t.prototype;return r.createEl=function(e,i,s){var o=a.prototype.createEl.call(this,e,i,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(u.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(ne("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},r.handleClick=function(e){if(a.prototype.handleClick.call(this,e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var i=this.player_.audioTracks(),s=0;s<i.length;s++){var o=i[s];o!==this.track&&(o.enabled=o===this.track)}},r.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(zi);V.registerComponent("AudioTrackMenuItem",sf);var of=function(a){G._inheritsLoose(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.audioTracks(),a.call(this,n,e)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var i=this.player_.audioTracks(),s=0;s<i.length;s++){var o=i[s];e.push(new sf(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return e},t}(Ao);of.prototype.controlText_="Audio Track";V.registerComponent("AudioTrackButton",of);var Oo=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.rate,o=parseFloat(s,10);return e.label=s,e.selected=o===n.playbackRate(),e.selectable=!0,e.multiSelectable=!1,i=a.call(this,n,e)||this,i.label=s,i.rate=o,i.on(n,"ratechange",function(u){return i.update(u)}),i}var r=t.prototype;return r.handleClick=function(e){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(zi);Oo.prototype.contentElType="button";V.registerComponent("PlaybackRateMenuItem",Oo);var uf=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.menuButton_.el_.setAttribute("aria-describedby",i.labelElId_),i.updateVisibility(),i.updateLabel(),i.on(n,"loadstart",function(s){return i.updateVisibility(s)}),i.on(n,"ratechange",function(s){return i.updateLabel(s)}),i.on(n,"playbackrateschange",function(s){return i.handlePlaybackRateschange(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ne("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e},r.dispose=function(){this.labelEl_=null,a.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){for(var e=this.playbackRates(),i=[],s=e.length-1;s>=0;s--)i.push(new Oo(this.player(),{rate:e[s]+"x"}));return i},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){var i=this.player().playbackRate(),s=this.playbackRates(),o=s.indexOf(i),u=(o+1)%s.length;this.player().playbackRate(s[u])},r.handlePlaybackRateschange=function(e){this.update()},r.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Co);uf.prototype.controlText_="Playback Rate";V.registerComponent("PlaybackRateMenuButton",uf);var lf=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(e,i,s){return e===void 0&&(e="div"),i===void 0&&(i={}),s===void 0&&(s={}),i.className||(i.className=this.buildCSSClass()),a.prototype.createEl.call(this,e,i,s)},t}(V);V.registerComponent("Spacer",lf);var ry=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(lf);V.registerComponent("CustomControlSpacer",ry);var Kn=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(V);Kn.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in W&&Kn.prototype.options_.children.splice(Kn.prototype.options_.children.length-1,0,"pictureInPictureToggle");V.registerComponent("ControlBar",Kn);var df=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"error",function(s){return i.open(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(ei);df.prototype.options_=ht({},ei.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});V.registerComponent("ErrorDisplay",df);var rs="vjs-text-track-settings",Dl=["#000","Black"],wl=["#00F","Blue"],kl=["#0FF","Cyan"],Pl=["#0F0","Green"],Il=["#F0F","Magenta"],Ll=["#F00","Red"],Ol=["#FFF","White"],Fl=["#FF0","Yellow"],is=["1","Opaque"],ns=["0.5","Semi-Transparent"],Rl=["0","Transparent"],ur={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Dl,Ol,Ll,Pl,wl,Fl,Il,kl]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[is,ns,Rl]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ol,Dl,Ll,Pl,wl,Fl,Il,kl]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[is,ns]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Rl,ns,is]}};ur.windowColor.options=ur.backgroundColor.options;function cf(a,t){if(t&&(a=t(a)),a&&a!=="none")return a}function iy(a,t){var r=a.options[a.options.selectedIndex].value;return cf(r,t)}function ny(a,t,r){if(t){for(var n=0;n<a.options.length;n++)if(cf(a.options[n].value,r)===t){a.selectedIndex=n;break}}}var ay=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e.temporary=!1,i=a.call(this,n,e)||this,i.updateDisplay=i.updateDisplay.bind(ee(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=ne("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),e.persistTextTrackSettings===void 0&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),Mr(ur,function(s){i.on(i.$(s.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}var r=t.prototype;return r.dispose=function(){this.endDialog=null,a.prototype.dispose.call(this)},r.createElSelect_=function(e,i,s){var o=this;i===void 0&&(i=""),s===void 0&&(s="label");var u=ur[e],l=u.id.replace("%s",this.id_),c=[i,l].join(" ").trim();return["<"+s+' id="'+l+'" class="'+(s==="label"?"vjs-label":"")+'">',this.localize(u.label),"</"+s+">",'<select aria-labelledby="'+c+'">'].concat(u.options.map(function(p){var m=l+"-"+p[1].replace(/\W+/g,"");return['<option id="'+m+'" value="'+p[0]+'" ','aria-labelledby="'+c+" "+m+'">',o.localize(p[1]),"</option>"].join("")})).concat("</select>").join("")},r.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},r.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},r.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},r.createElColors_=function(){return ne("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return ne("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},r.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ne("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var e=this;return $v(ur,function(i,s,o){var u=iy(e.$(s.selector),s.parser);return u!==void 0&&(i[o]=u),i},{})},r.setValues=function(e){var i=this;Mr(ur,function(s,o){ny(i.$(s.selector),e[o],s.parser)})},r.setDefaults=function(){var e=this;Mr(ur,function(i){var s=i.hasOwnProperty("default")?i.default:0;e.$(i.selector).selectedIndex=s})},r.restoreSettings=function(){var e;try{e=JSON.parse(A.localStorage.getItem(rs))}catch(i){ie.warn(i)}e&&this.setValues(e)},r.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?A.localStorage.setItem(rs,JSON.stringify(e)):A.localStorage.removeItem(rs)}catch(i){ie.warn(i)}}},r.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,i=e&&e.subsCapsButton,s=e&&e.captionsButton;i?i.focus():s&&s.focus()},t}(ei);V.registerComponent("TextTrackSettings",ay);var sy=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.ResizeObserver||A.ResizeObserver;e.ResizeObserver===null&&(s=!1);var o=ve({createEl:!s,reportTouchActivity:!1},e);return i=a.call(this,n,o)||this,i.ResizeObserver=e.ResizeObserver||A.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=n0(function(){i.resizeHandler()},100,!1,ee(i)),s?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(n.el())):(i.loadListener_=function(){if(!(!i.el_||!i.el_.contentWindow)){var u=i.debouncedHandler_,l=i.unloadListener_=function(){Be(this,"resize",u),Be(this,"unload",l),l=null};nt(i.el_.contentWindow,"unload",l),nt(i.el_.contentWindow,"resize",u)}},i.one("load",i.loadListener_)),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},r.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,a.prototype.dispose.call(this)},t}(V);V.registerComponent("ResizeManager",sy);var oy={trackingThreshold:20,liveTolerance:15},uy=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=ve(oy,e,{createEl:!1});return i=a.call(this,n,s)||this,i.handleVisibilityChange_=function(o){return i.handleVisibilityChange(o)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(o){return i.handlePlay(o)},i.handleFirstTimeupdate_=function(o){return i.handleFirstTimeupdate(o)},i.handleSeeked_=function(o){return i.handleSeeked(o)},i.seekToLiveEdge_=function(o){return i.seekToLiveEdge(o)},i.reset_(),i.on(i.player_,"durationchange",function(o){return i.handleDurationchange(o)}),i.on(i.player_,"canplay",function(){return i.toggleTracking()}),ji&&"hidden"in W&&"visibilityState"in W&&i.on(W,"visibilitychange",i.handleVisibilityChange_),i}var r=t.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(W.hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var e=this.player_.seekable();if(!(!e||!e.length)){var i=Number(A.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+s;var o=this.liveCurrentTime(),u=this.player_.currentTime(),l=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-u)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(l=!1),l!==this.behindLiveEdge_&&(this.behindLiveEdge_=l,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,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_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.end(s));return i.length?i.sort()[i.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.start(s));return i.length?i.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(W,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),a.prototype.dispose.call(this)},t}(V);V.registerComponent("LiveTracker",uy);var As=function(t){var r=t.el();if(r.hasAttribute("src"))return t.triggerSourceset(r.src),!0;var n=t.$$("source"),e=[],i="";if(!n.length)return!1;for(var s=0;s<n.length;s++){var o=n[s].src;o&&e.indexOf(o)===-1&&e.push(o)}return e.length?(e.length===1&&(i=e[0]),t.triggerSourceset(i),!0):!1},ly=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var r=W.createElement(this.nodeName.toLowerCase());r.innerHTML=t;for(var n=W.createDocumentFragment();r.childNodes.length;)n.appendChild(r.childNodes[0]);return this.innerText="",A.Element.prototype.appendChild.call(this,n),this.innerHTML}}),ff=function(t,r){for(var n={},e=0;e<t.length&&(n=Object.getOwnPropertyDescriptor(t[e],r),!(n&&n.set&&n.get));e++);return n.enumerable=!0,n.configurable=!0,n},dy=function(t){return ff([t.el(),A.HTMLMediaElement.prototype,A.Element.prototype,ly],"innerHTML")},Ml=function(t){var r=t.el();if(!r.resetSourceWatch_){var n={},e=dy(t),i=function(o){return function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];var p=o.apply(r,l);return As(t),p}};["append","appendChild","insertAdjacentHTML"].forEach(function(s){r[s]&&(n[s]=r[s],r[s]=i(n[s]))}),Object.defineProperty(r,"innerHTML",ve(e,{set:i(e.set)})),r.resetSourceWatch_=function(){r.resetSourceWatch_=null,Object.keys(n).forEach(function(s){r[s]=n[s]}),Object.defineProperty(r,"innerHTML",e)},t.one("sourceset",r.resetSourceWatch_)}},cy=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Bc(A.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return A.Element.prototype.setAttribute.call(this,"src",t),t}}),fy=function(t){return ff([t.el(),A.HTMLMediaElement.prototype,cy],"src")},hy=function(t){if(t.featuresSourceset){var r=t.el();if(!r.resetSourceset_){var n=fy(t),e=r.setAttribute,i=r.load;Object.defineProperty(r,"src",ve(n,{set:function(o){var u=n.set.call(r,o);return t.triggerSourceset(r.src),u}})),r.setAttribute=function(s,o){var u=e.call(r,s,o);return/src/i.test(s)&&t.triggerSourceset(r.src),u},r.load=function(){var s=i.call(r);return As(t)||(t.triggerSourceset(""),Ml(t)),s},r.currentSrc?t.triggerSourceset(r.currentSrc):As(t)||Ml(t),r.resetSourceset_=function(){r.resetSourceset_=null,r.load=i,r.setAttribute=e,Object.defineProperty(r,"src",n),r.resetSourceWatch_&&r.resetSourceWatch_()}}}},Fo=function(t,r,n,e){e===void 0&&(e=!0);var i=function(u){return Object.defineProperty(t,r,{value:u,enumerable:!0,writable:!0})},s={configurable:!0,enumerable:!0,get:function(){var u=n();return i(u),u}};return e&&(s.set=i),Object.defineProperty(t,r,s)},K=function(a){G._inheritsLoose(t,a);function t(n,e){var i;i=a.call(this,n,e)||this;var s=n.source,o=!1;if(i.featuresVideoFrameCallback=i.featuresVideoFrameCallback&&i.el_.tagName==="VIDEO",s&&(i.el_.currentSrc!==s.src||n.tag&&n.tag.initNetworkState_===3)?i.setSource(s):i.handleLateInit_(i.el_),n.enableSourceset&&i.setupSourcesetHandling_(),i.isScrubbing_=!1,i.el_.hasChildNodes()){for(var u=i.el_.childNodes,l=u.length,c=[];l--;){var p=u[l],m=p.nodeName.toLowerCase();m==="track"&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(p),i.remoteTextTracks().addTrack(p.track),i.textTracks().addTrack(p.track),!o&&!i.el_.hasAttribute("crossorigin")&&xa(p.src)&&(o=!0)):c.push(p))}for(var _=0;_<c.length;_++)i.el_.removeChild(c[_])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&o&&ie.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
37
|
-
This may prevent text tracks from loading.`),i.restoreMetadataTracksInIOSNativePlayer_(),(Wr||uo||cc)&&n.nativeControlsForTouch===!0&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}var r=t.prototype;return r.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,a.prototype.dispose.call(this)},r.setupSourcesetHandling_=function(){hy(this)},r.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),i,s=function(){i=[];for(var l=0;l<e.length;l++){var c=e[l];c.kind==="metadata"&&i.push({track:c,storedMode:c.mode})}};s(),e.addEventListener("change",s),this.on("dispose",function(){return e.removeEventListener("change",s)});var o=function u(){for(var l=0;l<i.length;l++){var c=i[l];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}e.removeEventListener("change",u)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",s),e.removeEventListener("change",o),e.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",o)})},r.overrideNative_=function(e,i){var s=this;if(i===this["featuresNative"+e+"Tracks"]){var o=e.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(u){var l=s.el()[o+"Tracks"];l.removeEventListener(u,s[o+"TracksListeners_"][u])}),this["featuresNative"+e+"Tracks"]=!i,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},r.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},r.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},r.proxyNativeTracksForType_=function(e){var i=this,s=ot[e],o=this.el()[s.getterName],u=this[s.getterName]();if(!(!this["featuresNative"+s.capitalName+"Tracks"]||!o||!o.addEventListener)){var l={change:function(m){var _={type:"change",target:u,currentTarget:u,srcElement:u};u.trigger(_),e==="text"&&i[Kr.remoteText.getterName]().trigger(_)},addtrack:function(m){u.addTrack(m.track)},removetrack:function(m){u.removeTrack(m.track)}},c=function(){for(var m=[],_=0;_<u.length;_++){for(var b=!1,S=0;S<o.length;S++)if(o[S]===u[_]){b=!0;break}b||m.push(u[_])}for(;m.length;)u.removeTrack(m.shift())};this[s.getterName+"Listeners_"]=l,Object.keys(l).forEach(function(p){var m=l[p];o.addEventListener(p,m),i.on("dispose",function(_){return o.removeEventListener(p,m)})}),this.on("loadstart",c),this.on("dispose",function(p){return i.off("loadstart",c)})}},r.proxyNativeTracks_=function(){var e=this;ot.names.forEach(function(i){e.proxyNativeTracksForType_(i)})},r.createEl=function(){var e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=W.createElement("video");var s=this.options_.tag&&It(this.options_.tag),o=ve({},s);(!Wr||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,_c(e,be(o,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Gr(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var u=["loop","muted","playsinline","autoplay"],l=0;l<u.length;l++){var c=u[l],p=this.options_[c];typeof p<"u"&&(p?Gr(e,c,c):va(e,c),e[c]=p)}return e},r.handleLateInit_=function(e){if(!(e.networkState===0||e.networkState===3)){if(e.readyState===0){var i=!1,s=function(){i=!0};this.on("loadstart",s);var o=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",o),i||this.trigger("loadstart")});return}var u=["loadstart"];u.push("loadedmetadata"),e.readyState>=2&&u.push("loadeddata"),e.readyState>=3&&u.push("canplay"),e.readyState>=4&&u.push("canplaythrough"),this.ready(function(){u.forEach(function(l){this.trigger(l)},this)})}},r.setScrubbing=function(e){this.isScrubbing_=e},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ga?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){ie(i,"Video is not ready. (Video.js)")}},r.duration=function(){var e=this;if(this.el_.duration===1/0&&jt&&Wt&&this.el_.currentTime===0){var i=function s(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",s))};return this.on("timeupdate",i),NaN}return this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},s=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",s),this.on("dispose",function(){e.off("webkitbeginfullscreen",s),e.off("webkitendfullscreen",i)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=A.navigator&&A.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},r.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Tt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},r.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):a.prototype.requestVideoFrameCallback.call(this,e)},r.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):a.prototype.cancelVideoFrameCallback.call(this,e)},r.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},r.reset=function(){t.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(e){this.el_.controls=!!e},r.addTextTrack=function(e,i,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,s):a.prototype.addTextTrack.call(this,e,i,s)},r.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,e);var i=W.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},r.addRemoteTextTrack=function(e,i){var s=a.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(s),s},r.removeRemoteTextTrack=function(e){if(a.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),s=i.length;s--;)(e===i[s]||e===i[s].track)&&this.el().removeChild(i[s])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A.performance&&typeof A.performance.now=="function"?e.creationTime=A.performance.now():A.performance&&A.performance.timing&&typeof A.performance.timing.navigationStart=="number"&&(e.creationTime=A.Date.now()-A.performance.timing.navigationStart),e},t}(he);Fo(K,"TEST_VID",function(){if(Qr()){var a=W.createElement("video"),t=W.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",a.appendChild(t),a}});K.isSupported=function(){try{K.TEST_VID.volume=.5}catch{return!1}return!!(K.TEST_VID&&K.TEST_VID.canPlayType)};K.canPlayType=function(a){return K.TEST_VID.canPlayType(a)};K.canPlaySource=function(a,t){return K.canPlayType(a.type)};K.canControlVolume=function(){try{var a=K.TEST_VID.volume;K.TEST_VID.volume=a/2+.1;var t=a!==K.TEST_VID.volume;return t&&Ke?(A.setTimeout(function(){K&&K.prototype&&(K.prototype.featuresVolumeControl=a!==K.TEST_VID.volume)}),!1):t}catch{return!1}};K.canMuteVolume=function(){try{var a=K.TEST_VID.muted;return K.TEST_VID.muted=!a,K.TEST_VID.muted?Gr(K.TEST_VID,"muted","muted"):va(K.TEST_VID,"muted","muted"),a!==K.TEST_VID.muted}catch{return!1}};K.canControlPlaybackRate=function(){if(jt&&Wt&&hc<58)return!1;try{var a=K.TEST_VID.playbackRate;return K.TEST_VID.playbackRate=a/2+.1,a!==K.TEST_VID.playbackRate}catch{return!1}};K.canOverrideAttributes=function(){try{var a=function(){};Object.defineProperty(W.createElement("video"),"src",{get:a,set:a}),Object.defineProperty(W.createElement("audio"),"src",{get:a,set:a}),Object.defineProperty(W.createElement("video"),"innerHTML",{get:a,set:a}),Object.defineProperty(W.createElement("audio"),"innerHTML",{get:a,set:a})}catch{return!1}return!0};K.supportsNativeTextTracks=function(){return ga||Ke&&Wt};K.supportsNativeVideoTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.videoTracks)};K.supportsNativeAudioTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.audioTracks)};K.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(a){var t=a[0],r=a[1];Fo(K.prototype,t,function(){return K[r]()},!0)});K.prototype.featuresVolumeControl=K.canControlVolume();K.prototype.movingMediaElementInDOM=!Ke;K.prototype.featuresFullscreenResize=!0;K.prototype.featuresProgressEvents=!0;K.prototype.featuresTimeupdateEvents=!0;K.prototype.featuresVideoFrameCallback=!!(K.TEST_VID&&K.TEST_VID.requestVideoFrameCallback);var Xn;K.patchCanPlayType=function(){ao>=4&&!fc&&!Wt&&(Xn=K.TEST_VID&&K.TEST_VID.constructor.prototype.canPlayType,K.TEST_VID.constructor.prototype.canPlayType=function(a){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return a&&t.test(a)?"maybe":Xn.call(this,a)})};K.unpatchCanPlayType=function(){var a=K.TEST_VID.constructor.prototype.canPlayType;return Xn&&(K.TEST_VID.constructor.prototype.canPlayType=Xn),a};K.patchCanPlayType();K.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};K.resetMediaElement=function(a){if(a){for(var t=a.querySelectorAll("source"),r=t.length;r--;)a.removeChild(t[r]);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]||this.el_.hasAttribute(a)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t,t?this.el_.setAttribute(a,a):this.el_.removeAttribute(a)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t}});["pause","load","play"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]()}});he.withSourceHandlers(K);K.nativeSourceHandler={};K.nativeSourceHandler.canPlayType=function(a){try{return K.TEST_VID.canPlayType(a)}catch{return""}};K.nativeSourceHandler.canHandleSource=function(a,t){if(a.type)return K.nativeSourceHandler.canPlayType(a.type);if(a.src){var r=go(a.src);return K.nativeSourceHandler.canPlayType("video/"+r)}return""};K.nativeSourceHandler.handleSource=function(a,t,r){t.setSrc(a.src)};K.nativeSourceHandler.dispose=function(){};K.registerSourceHandler(K.nativeSourceHandler);he.registerTech("Html5",K);var hf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],as={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ds=["tiny","xsmall","small","medium","large","xlarge","huge"],Rn={};Ds.forEach(function(a){var t=a.charAt(0)==="x"?"x-"+a.substring(1):a;Rn[a]="vjs-layout-"+t});var py={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ae=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(n.id=n.id||e.id||"vjs_video_"+Gt(),e=be(t.getTagSettings(n),e),e.initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if(typeof n.closest=="function"){var o=n.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var u=n;u&&u.nodeType===1;){if(It(u).hasOwnProperty("lang")){e.language=u.getAttribute("lang");break}u=u.parentNode}if(s=a.call(this,null,e,i)||this,s.boundDocumentFullscreenChange_=function(m){return s.documentFullscreenChange_(m)},s.boundFullWindowOnEscKey_=function(m){return s.fullWindowOnEscKey(m)},s.boundUpdateStyleEl_=function(m){return s.updateStyleEl_(m)},s.boundApplyInitTime_=function(m){return s.applyInitTime_(m)},s.boundUpdateCurrentBreakpoint_=function(m){return s.updateCurrentBreakpoint_(m)},s.boundHandleTechClick_=function(m){return s.handleTechClick_(m)},s.boundHandleTechDoubleClick_=function(m){return s.handleTechDoubleClick_(m)},s.boundHandleTechTouchStart_=function(m){return s.handleTechTouchStart_(m)},s.boundHandleTechTouchMove_=function(m){return s.handleTechTouchMove_(m)},s.boundHandleTechTouchEnd_=function(m){return s.handleTechTouchEnd_(m)},s.boundHandleTechTap_=function(m){return s.handleTechTap_(m)},s.isFullscreen_=!1,s.log=uc(s.id_),s.fsApi_=Wn,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=n,s.tagAttributes=n&&It(n),s.language(s.options_.language),e.languages){var l={};Object.getOwnPropertyNames(e.languages).forEach(function(m){l[m.toLowerCase()]=e.languages[m]}),s.languages_=l}else s.languages_=t.prototype.options_.languages;s.resetCache_(),s.poster_=e.poster||"",s.controls_=!!e.controls,n.controls=!1,n.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],n.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(m){if(typeof s[m]!="function")throw new Error('plugin "'+m+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),ho(ee(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(nt(W,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var c=ve(s.options_);e.plugins&&Object.keys(e.plugins).forEach(function(m){s[m](e.plugins[m])}),e.debug&&s.debug(!0),s.options_.playerOptions=c,s.middleware_=[],s.playbackRates(e.playbackRates),s.initChildren(),s.isAudio(n.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),Wr&&s.addClass("vjs-touch-enabled"),Ke||s.addClass("vjs-workinghover"),t.players[s.id_]=ee(s);var p=ac.split(".")[0];return s.addClass("vjs-v"+p),s.userActive(!0),s.reportUserActivity(),s.one("play",function(m){return s.listenForUserActivity_(m)}),s.on("stageclick",function(m){return s.handleStageClick_(m)}),s.on("keydown",function(m){return s.handleKeyDown(m)}),s.on("languagechange",function(m){return s.handleLanguagechange(m)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}var r=t.prototype;return r.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Be(W,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Be(W,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),F0(this),je.names.forEach(function(i){var s=je[i],o=e[s.getterName]();o&&o.off&&o.off()}),a.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var e=this.tag,i,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";s?i=this.el_=e.parentNode:o||(i=this.el_=a.prototype.createEl.call(this,"div"));var u=It(e);if(o){for(i=this.el_=e,e=this.tag=W.createElement("video");i.children.length;)e.appendChild(i.firstChild);cr(i,"video-js")||Rt(i,"video-js"),i.appendChild(e),s=this.playerElIngest_=i,Object.keys(i).forEach(function(b){try{e[b]=i[b]}catch{}})}if(e.setAttribute("tabindex","-1"),u.tabindex="-1",(ji||Wt&&pc)&&(e.setAttribute("role","application"),u.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in u&&delete u.width,"height"in u&&delete u.height,Object.getOwnPropertyNames(u).forEach(function(b){o&&b==="class"||i.setAttribute(b,u[b]),o&&e.setAttribute(b,u[b])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),A.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=kc("vjs-styles-dimensions");var l=Yt(".vjs-styles-defaults"),c=Yt("head");c.insertBefore(this.styleEl_,l?l.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var p=e.getElementsByTagName("a"),m=0;m<p.length;m++){var _=p.item(m);Rt(_,"vjs-hidden"),_.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(i,e),_s(e,i),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=i,i},r.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");if(e!=="anonymous"&&e!=="use-credentials"){ie.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"');return}this.techCall_("setCrossOrigin",e)},r.width=function(e){return this.dimension("width",e)},r.height=function(e){return this.dimension("height",e)},r.dimension=function(e,i){var s=e+"_";if(i===void 0)return this[s]||0;if(i===""||i==="auto"){this[s]=void 0,this.updateStyleEl_();return}var o=parseFloat(i);if(isNaN(o)){ie.error('Improper value "'+i+'" supplied for for '+e);return}this[s]=o,this.updateStyleEl_()},r.fluid=function(e){var i=this;if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Mt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),a0(this,function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},r.fill=function(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},r.aspectRatio=function(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},r.updateStyleEl_=function(){if(A.VIDEOJS_NO_DYNAMIC_STYLE===!0){var e=typeof this.width_=="number"?this.width_:this.options_.width,i=typeof this.height_=="number"?this.height_:this.options_.height,s=this.tech_&&this.tech_.el();s&&(e>=0&&(s.width=e),i>=0&&(s.height=i));return}var o,u,l,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?l=this.aspectRatio_:this.videoWidth()>0?l=this.videoWidth()+":"+this.videoHeight():l="16:9";var p=l.split(":"),m=p[1]/p[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/m:o=this.videoWidth()||300,this.height_!==void 0?u=this.height_:u=o*m,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Pc(this.styleEl_,`
|
|
36
|
+
`+("createEl(type, properties, attributes). Attempting to set "+i+" to "+s+".")),e.setAttribute(i,s)):i==="textContent"?vr(e,s):(e[i]!==s||i==="tabIndex")&&(e[i]=s)}),Object.getOwnPropertyNames(r).forEach(function(i){e.setAttribute(i,r[i])}),n&&co(e,n),e}function vr(a,t){return typeof a.textContent>"u"?a.innerText=t:a.textContent=t,a}function _s(a,t){t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a)}function fr(a,t){return mc(t),a.classList?a.classList.contains(t):Qv(t).test(a.className)}function Rt(a,t){return a.classList?a.classList.add(t):fr(a,t)||(a.className=(a.className+" "+t).trim()),a}function Wi(a,t){return a?(a.classList?a.classList.remove(t):(mc(t),a.className=a.className.split(/\s+/).filter(function(r){return r!==t}).join(" ")),a):(ie.warn("removeClass was called with an element that doesn't exist"),null)}function yc(a,t,r){var n=fr(a,t);if(typeof r=="function"&&(r=r(a,t)),typeof r!="boolean"&&(r=!n),r!==n)return r?Rt(a,t):Wi(a,t),a}function _c(a,t){Object.getOwnPropertyNames(t).forEach(function(r){var n=t[r];n===null||typeof n>"u"||n===!1?a.removeAttribute(r):a.setAttribute(r,n===!0?"":n)})}function It(a){var t={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(a&&a.attributes&&a.attributes.length>0)for(var n=a.attributes,e=n.length-1;e>=0;e--){var i=n[e].name,s=n[e].value;(typeof a[i]=="boolean"||r.indexOf(","+i+",")!==-1)&&(s=s!==null),t[i]=s}return t}function Tc(a,t){return a.getAttribute(t)}function Gr(a,t,r){a.setAttribute(t,r)}function va(a,t){a.removeAttribute(t)}function bc(){W.body.focus(),W.onselectstart=function(){return!1}}function xc(){W.onselectstart=function(){return!0}}function zr(a){if(a&&a.getBoundingClientRect&&a.parentNode){var t=a.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(n){t[n]!==void 0&&(r[n]=t[n])}),r.height||(r.height=parseFloat(Fi(a,"height"))),r.width||(r.width=parseFloat(Fi(a,"width"))),r}}function Ri(a){if(!a||a&&!a.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=a.offsetWidth,r=a.offsetHeight,n=0,e=0;a.offsetParent&&a!==W[Wn.fullscreenElement];)n+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;return{left:n,top:e,width:t,height:r}}function ya(a,t){var r={x:0,y:0};if(Ke)for(var n=a;n&&n.nodeName.toLowerCase()!=="html";){var e=Fi(n,"transform");if(/^matrix/.test(e)){var i=e.slice(7,-1).split(/,\s/).map(Number);r.x+=i[4],r.y+=i[5]}else if(/^matrix3d/.test(e)){var s=e.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}n=n.parentNode}var o={},u=Ri(t.target),l=Ri(a),c=l.width,p=l.height,m=t.offsetY-(l.top-u.top),_=t.offsetX-(l.left-u.left);return t.changedTouches&&(_=t.changedTouches[0].pageX-l.left,m=t.changedTouches[0].pageY+l.top,Ke&&(_-=r.x,m-=r.y)),o.y=1-Math.max(0,Math.min(1,m/p)),o.x=Math.max(0,Math.min(1,_/c)),o}function Sc(a){return Vt(a)&&a.nodeType===3}function lo(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function Ec(a){return typeof a=="function"&&(a=a()),(Array.isArray(a)?a:[a]).map(function(t){if(typeof t=="function"&&(t=t()),Jr(t)||Sc(t))return t;if(typeof t=="string"&&/\S/.test(t))return W.createTextNode(t)}).filter(function(t){return t})}function co(a,t){return Ec(t).forEach(function(r){return a.appendChild(r)}),a}function Cc(a,t){return co(lo(a),t)}function Mi(a){return a.button===void 0&&a.buttons===void 0||a.button===0&&a.buttons===void 0||a.type==="mouseup"&&a.button===0&&a.buttons===0?!0:!(a.button!==0||a.buttons!==1)}var Yt=vc("querySelector"),Ac=vc("querySelectorAll"),Dc=Object.freeze({__proto__:null,isReal:Qr,isEl:Jr,isInFrame:gc,createEl:ne,textContent:vr,prependTo:_s,hasClass:fr,addClass:Rt,removeClass:Wi,toggleClass:yc,setAttributes:_c,getAttributes:It,getAttribute:Tc,setAttribute:Gr,removeAttribute:va,blockTextSelection:bc,unblockTextSelection:xc,getBoundingClientRect:zr,findPosition:Ri,getPointerPosition:ya,isTextNode:Sc,emptyEl:lo,normalizeContent:Ec,appendContent:co,insertContent:Cc,isSingleLeftClick:Mi,$:Yt,$$:Ac}),wc=!1,Ts,Jv=function(){if(Ts.options.autoSetup!==!1){var t=Array.prototype.slice.call(W.getElementsByTagName("video")),r=Array.prototype.slice.call(W.getElementsByTagName("audio")),n=Array.prototype.slice.call(W.getElementsByTagName("video-js")),e=t.concat(r,n);if(e&&e.length>0)for(var i=0,s=e.length;i<s;i++){var o=e[i];if(o&&o.getAttribute){if(o.player===void 0){var u=o.getAttribute("data-setup");u!==null&&Ts(o)}}else{bs(1);break}}else wc||bs(1)}};function bs(a,t){Qr()&&(t&&(Ts=t),A.setTimeout(Jv,a))}function xs(){wc=!0,A.removeEventListener("load",xs)}Qr()&&(W.readyState==="complete"?xs():A.addEventListener("load",xs));var kc=function(t){var r=W.createElement("style");return r.className=t,r},Pc=function(t,r){t.styleSheet?t.styleSheet.cssText=r:t.textContent=r},Zv=3,e0=Zv;function Gt(){return e0++}var Ic;A.WeakMap||(Ic=function(){function a(){this.vdata="vdata"+Math.floor(A.performance&&A.performance.now()||Date.now()),this.data={}}var t=a.prototype;return t.set=function(n,e){var i=n[this.vdata]||Gt();return n[this.vdata]||(n[this.vdata]=i),this.data[i]=e,this},t.get=function(n){var e=n[this.vdata];if(e)return this.data[e];ie("We have no data for this element",n)},t.has=function(n){var e=n[this.vdata];return e in this.data},t.delete=function(n){var e=n[this.vdata];e&&(delete this.data[e],delete n[this.vdata])},a}());var ze=A.WeakMap?new WeakMap:new Ic;function ml(a,t){if(ze.has(a)){var r=ze.get(a);r.handlers[t].length===0&&(delete r.handlers[t],a.removeEventListener?a.removeEventListener(t,r.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+t,r.dispatcher)),Object.getOwnPropertyNames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),Object.getOwnPropertyNames(r).length===0&&ze.delete(a)}}function fo(a,t,r,n){r.forEach(function(e){a(t,e,n)})}function _a(a){if(a.fixed_)return a;function t(){return!0}function r(){return!1}if(!a||!a.isPropagationStopped||!a.isImmediatePropagationStopped){var n=a||A.event;a={};for(var e in n)e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"&&(e==="returnValue"&&n.preventDefault||(a[e]=n[e]));if(a.target||(a.target=a.srcElement||W),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){n.preventDefault&&n.preventDefault(),a.returnValue=!1,n.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),a.cancelBubble=!0,n.cancelBubble=!0,a.isPropagationStopped=t},a.isPropagationStopped=r,a.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),a.isImmediatePropagationStopped=t,a.stopPropagation()},a.isImmediatePropagationStopped=r,a.clientX!==null&&a.clientX!==void 0){var i=W.documentElement,s=W.body;a.pageX=a.clientX+(i&&i.scrollLeft||s&&s.scrollLeft||0)-(i&&i.clientLeft||s&&s.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||s&&s.scrollTop||0)-(i&&i.clientTop||s&&s.clientTop||0)}a.which=a.charCode||a.keyCode,a.button!==null&&a.button!==void 0&&(a.button=a.button&1?0:a.button&4?1:a.button&2?2:0)}return a.fixed_=!0,a}var An,t0=function(){if(typeof An!="boolean"){An=!1;try{var t=Object.defineProperty({},"passive",{get:function(){An=!0}});A.addEventListener("test",null,t),A.removeEventListener("test",null,t)}catch{}}return An},r0=["touchstart","touchmove"];function nt(a,t,r){if(Array.isArray(t))return fo(nt,a,t,r);ze.has(a)||ze.set(a,{});var n=ze.get(a);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),r.guid||(r.guid=Gt()),n.handlers[t].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(i,s){if(!n.disabled){i=_a(i);var o=n.handlers[i.type];if(o)for(var u=o.slice(0),l=0,c=u.length;l<c&&!i.isImmediatePropagationStopped();l++)try{u[l].call(a,i,s)}catch(p){ie.error(p)}}}),n.handlers[t].length===1)if(a.addEventListener){var e=!1;t0()&&r0.indexOf(t)>-1&&(e={passive:!0}),a.addEventListener(t,n.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+t,n.dispatcher)}function Be(a,t,r){if(ze.has(a)){var n=ze.get(a);if(n.handlers){if(Array.isArray(t))return fo(Be,a,t,r);var e=function(l,c){n.handlers[c]=[],ml(l,c)};if(t===void 0){for(var i in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},i)&&e(a,i);return}var s=n.handlers[t];if(s){if(!r){e(a,t);return}if(r.guid)for(var o=0;o<s.length;o++)s[o].guid===r.guid&&s.splice(o--,1);ml(a,t)}}}}function Zr(a,t,r){var n=ze.has(a)?ze.get(a):{},e=a.parentNode||a.ownerDocument;if(typeof t=="string"?t={type:t,target:a}:t.target||(t.target=a),t=_a(t),n.dispatcher&&n.dispatcher.call(a,t,r),e&&!t.isPropagationStopped()&&t.bubbles===!0)Zr.call(null,e,t,r);else if(!e&&!t.defaultPrevented&&t.target&&t.target[t.type]){ze.has(t.target)||ze.set(t.target,{});var i=ze.get(t.target);t.target[t.type]&&(i.disabled=!0,typeof t.target[t.type]=="function"&&t.target[t.type](),i.disabled=!1)}return!t.defaultPrevented}function Ta(a,t,r){if(Array.isArray(t))return fo(Ta,a,t,r);var n=function e(){Be(a,t,e),r.apply(this,arguments)};n.guid=r.guid=r.guid||Gt(),nt(a,t,n)}function Lc(a,t,r){var n=function e(){Be(a,t,e),r.apply(this,arguments)};n.guid=r.guid=r.guid||Gt(),nt(a,t,n)}var i0=Object.freeze({__proto__:null,fixEvent:_a,on:nt,off:Be,trigger:Zr,one:Ta,any:Lc}),pt=30,ye=function(t,r,n){r.guid||(r.guid=Gt());var e=r.bind(t);return e.guid=n?n+"_"+r.guid:r.guid,e},Ht=function(t,r){var n=A.performance.now(),e=function(){var s=A.performance.now();s-n>=r&&(t.apply(void 0,arguments),n=s)};return e},n0=function(t,r,n,e){e===void 0&&(e=A);var i,s=function(){e.clearTimeout(i),i=null},o=function(){var l=this,c=arguments,p=function(){i=null,p=null,t.apply(l,c)};e.clearTimeout(i),i=e.setTimeout(p,r)};return o.cancel=s,o},Ie=function(){};Ie.prototype.allowedEvents_={};Ie.prototype.on=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},nt(this,a,t),this.addEventListener=r};Ie.prototype.addEventListener=Ie.prototype.on;Ie.prototype.off=function(a,t){Be(this,a,t)};Ie.prototype.removeEventListener=Ie.prototype.off;Ie.prototype.one=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},Ta(this,a,t),this.addEventListener=r};Ie.prototype.any=function(a,t){var r=this.addEventListener;this.addEventListener=function(){},Lc(this,a,t),this.addEventListener=r};Ie.prototype.trigger=function(a){var t=a.type||a;typeof a=="string"&&(a={type:t}),a=_a(a),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](a),Zr(this,a)};Ie.prototype.dispatchEvent=Ie.prototype.trigger;var mi;Ie.prototype.queueTrigger=function(a){var t=this;mi||(mi=new Map);var r=a.type||a,n=mi.get(this);n||(n=new Map,mi.set(this,n));var e=n.get(r);n.delete(r),A.clearTimeout(e);var i=A.setTimeout(function(){n.delete(r),n.size===0&&(n=null,mi.delete(t)),t.trigger(a)},0);n.set(r,i)};var ba=function(t){return typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},Mt=function(t){return t instanceof Ie||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(r){return typeof t[r]=="function"})},a0=function(t,r){Mt(t)?r():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(r))},Ss=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},Gn=function(t,r,n){if(!t||!t.nodeName&&!Mt(t))throw new Error("Invalid target for "+ba(r)+"#"+n+"; must be a DOM node or evented object.")},Oc=function(t,r,n){if(!Ss(t))throw new Error("Invalid event type for "+ba(r)+"#"+n+"; must be a non-empty string or array.")},Fc=function(t,r,n){if(typeof t!="function")throw new Error("Invalid listener for "+ba(r)+"#"+n+"; must be a function.")},$a=function(t,r,n){var e=r.length<3||r[0]===t||r[0]===t.eventBusEl_,i,s,o;return e?(i=t.eventBusEl_,r.length>=3&&r.shift(),s=r[0],o=r[1]):(i=r[0],s=r[1],o=r[2]),Gn(i,t,n),Oc(s,t,n),Fc(o,t,n),o=ye(t,o),{isTargetingSelf:e,target:i,type:s,listener:o}},sr=function(t,r,n,e){Gn(t,t,r),t.nodeName?i0[r](t,n,e):t[r](n,e)},s0={on:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"on"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(sr(o,"on",u,l),!s){var c=function(){return t.off(o,u,l)};c.guid=l.guid;var p=function(){return t.off("dispose",c)};p.guid=l.guid,sr(this,"on","dispose",c),sr(o,"on","dispose",p)}},one:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"one"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(s)sr(o,"one",u,l);else{var c=function p(){t.off(o,u,p);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,sr(o,"one",u,c)}},any:function(){for(var t=this,r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];var i=$a(this,n,"any"),s=i.isTargetingSelf,o=i.target,u=i.type,l=i.listener;if(s)sr(o,"any",u,l);else{var c=function p(){t.off(o,u,p);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,sr(o,"any",u,c)}},off:function(t,r,n){if(!t||Ss(t))Be(this.eventBusEl_,t,r);else{var e=t,i=r;Gn(e,this,"off"),Oc(i,this,"off"),Fc(n,this,"off"),n=ye(this,n),this.off("dispose",n),e.nodeName?(Be(e,i,n),Be(e,"dispose",n)):Mt(e)&&(e.off(i,n),e.off("dispose",n))}},trigger:function(t,r){Gn(this.eventBusEl_,this,"trigger");var n=t&&typeof t!="string"?t.type:t;if(!Ss(n)){var e="Invalid event type for "+ba(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(t)(this.log||ie).error(e);else throw new Error(e)}return Zr(this.eventBusEl_,t,r)}};function ho(a,t){t===void 0&&(t={});var r=t,n=r.eventBusKey;if(n){if(!a[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');a.eventBusEl_=a[n]}else a.eventBusEl_=ne("span",{className:"vjs-event-bus"});return be(a,s0),a.eventedCallbacks&&a.eventedCallbacks.forEach(function(e){e()}),a.on("dispose",function(){a.off(),[a,a.el_,a.eventBusEl_].forEach(function(e){e&&ze.has(e)&&ze.delete(e)}),A.setTimeout(function(){a.eventBusEl_=null},0)}),a}var o0={state:{},setState:function(t){var r=this;typeof t=="function"&&(t=t());var n;return Mr(t,function(e,i){r.state[i]!==e&&(n=n||{},n[i]={from:r.state[i],to:e}),r.state[i]=e}),n&&Mt(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function Rc(a,t){return be(a,o0),a.state=be({},a.state,t),typeof a.handleStateChanged=="function"&&Mt(a)&&a.on("statechanged",a.handleStateChanged),a}var Fn=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toLowerCase()})},Ee=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toUpperCase()})},u0=function(t,r){return Ee(t)===Ee(r)};function ve(){for(var a={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach(function(e){e&&Mr(e,function(i,s){if(!Oi(i)){a[s]=i;return}Oi(a[s])||(a[s]={}),a[s]=ve(a[s],i)})}),a}var l0=function(){function a(){this.map_={}}var t=a.prototype;return t.has=function(n){return n in this.map_},t.delete=function(n){var e=this.has(n);return delete this.map_[n],e},t.set=function(n,e){return this.map_[n]=e,this},t.forEach=function(n,e){for(var i in this.map_)n.call(e,this.map_[i],i,this)},a}(),d0=A.Map?A.Map:l0,c0=function(){function a(){this.set_={}}var t=a.prototype;return t.has=function(n){return n in this.set_},t.delete=function(n){var e=this.has(n);return delete this.set_[n],e},t.add=function(n){return this.set_[n]=1,this},t.forEach=function(n,e){for(var i in this.set_)n.call(e,i,i,this)},a}(),Ka=A.Set?A.Set:c0,V=function(){function a(r,n,e){var i=this;if(!r&&this.play?this.player_=r=this:this.player_=r,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ve({},this.options_),n=this.options_=ve(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var s=r&&r.id&&r.id()||"no_player";this.id_=s+"_component_"+Gt()}this.name_=n.name||null,n.el?this.el_=n.el:n.createEl!==!1&&(this.el_=this.createEl()),n.className&&this.el_&&n.className.split(" ").forEach(function(o){return i.addClass(o)}),n.evented!==!1&&(ho(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Rc(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Ka,this.setIntervalIds_=new Ka,this.rafIds_=new Ka,this.namedRafs_=new d0,this.clearingTimersOnDispose_=!1,n.initChildren!==!1&&this.initChildren(),this.ready(e),n.reportTouchActivity!==!1&&this.enableTouchActivity()}var t=a.prototype;return t.dispose=function(n){if(n===void 0&&(n={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(n.restoreEl?this.el_.parentNode.replaceChild(n.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return!!this.isDisposed_},t.player=function(){return this.player_},t.options=function(n){return n?(this.options_=ve(this.options_,n),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(n,e,i){return ne(n,e,i)},t.localize=function(n,e,i){i===void 0&&(i=n);var s=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),u=o&&o[s],l=s&&s.split("-")[0],c=o&&o[l],p=i;return u&&u[n]?p=u[n]:c&&c[n]&&(p=c[n]),e&&(p=p.replace(/\{(\d+)\}/g,function(m,_){var b=e[_-1],S=b;return typeof b>"u"&&(S=m),S})),p},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(n){return this.childIndex_[n]},t.getChild=function(n){if(n)return this.childNameIndex_[n]},t.getDescendant=function(){for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];e=e.reduce(function(u,l){return u.concat(l)},[]);for(var s=this,o=0;o<e.length;o++)if(s=s.getChild(e[o]),!s||!s.getChild)return;return s},t.addChild=function(n,e,i){e===void 0&&(e={}),i===void 0&&(i=this.children_.length);var s,o;if(typeof n=="string"){o=Ee(n);var u=e.componentClass||o;e.name=o;var l=a.getComponent(u);if(!l)throw new Error("Component "+u+" does not exist");if(typeof l!="function")return null;s=new l(this.player_||this,e)}else s=n;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,typeof s.id=="function"&&(this.childIndex_[s.id()]=s),o=o||s.name&&Ee(s.name()),o&&(this.childNameIndex_[o]=s,this.childNameIndex_[Fn(o)]=s),typeof s.el=="function"&&s.el()){var c=null;this.children_[i+1]&&(this.children_[i+1].el_?c=this.children_[i+1].el_:Jr(this.children_[i+1])&&(c=this.children_[i+1])),this.contentEl().insertBefore(s.el(),c)}return s},t.removeChild=function(n){if(typeof n=="string"&&(n=this.getChild(n)),!(!n||!this.children_)){for(var e=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===n){e=!0,this.children_.splice(i,1);break}if(e){n.parentComponent_=null,this.childIndex_[n.id()]=null,this.childNameIndex_[Ee(n.name())]=null,this.childNameIndex_[Fn(n.name())]=null;var s=n.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(n.el())}}},t.initChildren=function(){var n=this,e=this.options_.children;if(e){var i=this.options_,s=function(c){var p=c.name,m=c.opts;if(i[p]!==void 0&&(m=i[p]),m!==!1){m===!0&&(m={}),m.playerOptions=n.options_.playerOptions;var _=n.addChild(p,m);_&&(n[p]=_)}},o,u=a.getComponent("Tech");Array.isArray(e)?o=e:o=Object.keys(e),o.concat(Object.keys(this.options_).filter(function(l){return!o.some(function(c){return typeof c=="string"?l===c:l===c.name})})).map(function(l){var c,p;return typeof l=="string"?(c=l,p=e[c]||n.options_[c]||{}):(c=l.name,p=l),{name:c,opts:p}}).filter(function(l){var c=a.getComponent(l.opts.componentClass||Ee(l.name));return c&&!u.isTech(c)}).forEach(s)}},t.buildCSSClass=function(){return""},t.ready=function(n,e){if(e===void 0&&(e=!1),!!n){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(n);return}e?n.call(this):this.setTimeout(n,1)}},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var n=this.readyQueue_;this.readyQueue_=[],n&&n.length>0&&n.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(n,e){return Yt(n,e||this.contentEl())},t.$$=function(n,e){return Ac(n,e||this.contentEl())},t.hasClass=function(n){return fr(this.el_,n)},t.addClass=function(n){Rt(this.el_,n)},t.removeClass=function(n){Wi(this.el_,n)},t.toggleClass=function(n,e){yc(this.el_,n,e)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(n){return Tc(this.el_,n)},t.setAttribute=function(n,e){Gr(this.el_,n,e)},t.removeAttribute=function(n){va(this.el_,n)},t.width=function(n,e){return this.dimension("width",n,e)},t.height=function(n,e){return this.dimension("height",n,e)},t.dimensions=function(n,e){this.width(n,!0),this.height(e)},t.dimension=function(n,e,i){if(e!==void 0){(e===null||e!==e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[n]=e:e==="auto"?this.el_.style[n]="":this.el_.style[n]=e+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;var s=this.el_.style[n],o=s.indexOf("px");return parseInt(o!==-1?s.slice(0,o):this.el_["offset"+Ee(n)],10)},t.currentDimension=function(n){var e=0;if(n!=="width"&&n!=="height")throw new Error("currentDimension only accepts width or height value");if(e=Fi(this.el_,n),e=parseFloat(e),e===0||isNaN(e)){var i="offset"+Ee(n);e=this.el_[i]}return e},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(n){this.player_&&(te.isEventKey(n,"Tab")||n.stopPropagation(),this.player_.handleKeyDown(n))},t.handleKeyPress=function(n){this.handleKeyDown(n)},t.emitTapEvents=function(){var n=0,e=null,i=10,s=200,o;this.on("touchstart",function(l){l.touches.length===1&&(e={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},n=A.performance.now(),o=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)o=!1;else if(e){var c=l.touches[0].pageX-e.pageX,p=l.touches[0].pageY-e.pageY,m=Math.sqrt(c*c+p*p);m>i&&(o=!1)}});var u=function(){o=!1};this.on("touchleave",u),this.on("touchcancel",u),this.on("touchend",function(l){if(e=null,o===!0){var c=A.performance.now()-n;c<s&&(l.preventDefault(),this.trigger("tap"))}})},t.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var n=ye(this.player(),this.player().reportUserActivity),e;this.on("touchstart",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)});var i=function(o){n(),this.clearInterval(e)};this.on("touchmove",n),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(n,e){var i=this,s;return n=ye(this,n),this.clearTimersOnDispose_(),s=A.setTimeout(function(){i.setTimeoutIds_.has(s)&&i.setTimeoutIds_.delete(s),n()},e),this.setTimeoutIds_.add(s),s},t.clearTimeout=function(n){return this.setTimeoutIds_.has(n)&&(this.setTimeoutIds_.delete(n),A.clearTimeout(n)),n},t.setInterval=function(n,e){n=ye(this,n),this.clearTimersOnDispose_();var i=A.setInterval(n,e);return this.setIntervalIds_.add(i),i},t.clearInterval=function(n){return this.setIntervalIds_.has(n)&&(this.setIntervalIds_.delete(n),A.clearInterval(n)),n},t.requestAnimationFrame=function(n){var e=this;if(!this.supportsRaf_)return this.setTimeout(n,1e3/60);this.clearTimersOnDispose_();var i;return n=ye(this,n),i=A.requestAnimationFrame(function(){e.rafIds_.has(i)&&e.rafIds_.delete(i),n()}),this.rafIds_.add(i),i},t.requestNamedAnimationFrame=function(n,e){var i=this;if(!this.namedRafs_.has(n)){this.clearTimersOnDispose_(),e=ye(this,e);var s=this.requestAnimationFrame(function(){e(),i.namedRafs_.has(n)&&i.namedRafs_.delete(n)});return this.namedRafs_.set(n,s),n}},t.cancelNamedAnimationFrame=function(n){this.namedRafs_.has(n)&&(this.cancelAnimationFrame(this.namedRafs_.get(n)),this.namedRafs_.delete(n))},t.cancelAnimationFrame=function(n){return this.supportsRaf_?(this.rafIds_.has(n)&&(this.rafIds_.delete(n),A.cancelAnimationFrame(n)),n):this.clearTimeout(n)},t.clearTimersOnDispose_=function(){var n=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(e){var i=e[0],s=e[1];n[i].forEach(function(o,u){return n[s](u)})}),n.clearingTimersOnDispose_=!1}))},a.registerComponent=function(n,e){if(typeof n!="string"||!n)throw new Error('Illegal component name, "'+n+'"; must be a non-empty string.');var i=a.getComponent("Tech"),s=i&&i.isTech(e),o=a===e||a.prototype.isPrototypeOf(e.prototype);if(s||!o){var u;throw s?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error('Illegal component, "'+n+'"; '+u+".")}n=Ee(n),a.components_||(a.components_={});var l=a.getComponent("Player");if(n==="Player"&&l&&l.players){var c=l.players,p=Object.keys(c);if(c&&p.length>0&&p.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[n]=e,a.components_[Fn(n)]=e,e},a.getComponent=function(n){if(!(!n||!a.components_))return a.components_[n]},a}();V.prototype.supportsRaf_=typeof A.requestAnimationFrame=="function"&&typeof A.cancelAnimationFrame=="function";V.registerComponent("Component",V);function f0(a,t,r){if(typeof t!="number"||t<0||t>r)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+r+").")}function gl(a,t,r,n){return f0(a,n,r.length-1),r[n][t]}function Xa(a){var t;return a===void 0||a.length===0?t={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:t={length:a.length,start:gl.bind(null,"start",0,a),end:gl.bind(null,"end",1,a)},A.Symbol&&A.Symbol.iterator&&(t[A.Symbol.iterator]=function(){return(a||[]).values()}),t}function hr(a,t){return Array.isArray(a)?Xa(a):a===void 0||t===void 0?Xa():Xa([[a,t]])}function Mc(a,t){var r=0,n,e;if(!t)return 0;(!a||!a.length)&&(a=hr(0,0));for(var i=0;i<a.length;i++)n=a.start(i),e=a.end(i),e>t&&(e=t),r+=e-n;return r/t}function $e(a){if(a instanceof $e)return a;typeof a=="number"?this.code=a:typeof a=="string"?this.message=a:Vt(a)&&(typeof a.code=="number"&&(this.code=a.code),be(this,a)),this.message||(this.message=$e.defaultMessages[this.code]||"")}$e.prototype.code=0;$e.prototype.message="";$e.prototype.status=null;$e.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];$e.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var kr=0;kr<$e.errorTypes.length;kr++)$e[$e.errorTypes[kr]]=kr,$e.prototype[$e.errorTypes[kr]]=kr;function Ci(a){return a!=null&&typeof a.then=="function"}function Tt(a){Ci(a)&&a.then(null,function(t){})}var Es=function(t){var r=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(n,e,i){return t[e]&&(n[e]=t[e]),n},{cues:t.cues&&Array.prototype.map.call(t.cues,function(n){return{startTime:n.startTime,endTime:n.endTime,text:n.text,id:n.id}})});return r},h0=function(t){var r=t.$$("track"),n=Array.prototype.map.call(r,function(i){return i.track}),e=Array.prototype.map.call(r,function(i){var s=Es(i.track);return i.src&&(s.src=i.src),s});return e.concat(Array.prototype.filter.call(t.textTracks(),function(i){return n.indexOf(i)===-1}).map(Es))},p0=function(t,r){return t.forEach(function(n){var e=r.addRemoteTextTrack(n).track;!n.src&&n.cues&&n.cues.forEach(function(i){return e.addCue(i)})}),r.textTracks()},vl={textTracksToJson:h0,jsonToTextTracks:p0,trackToJson_:Es},Ya="vjs-modal-dialog",ei=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.close_=function(s){return i.close(s)},i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=ne("div",{className:Ya+"-content"},{role:"document"}),i.descEl_=ne("p",{className:Ya+"-description vjs-control-text",id:i.el().getAttribute("aria-describedby")}),vr(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},r.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,a.prototype.dispose.call(this)},r.buildCSSClass=function(){return Ya+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},r.label=function(){return this.localize(this.options_.label||"Modal Window")},r.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},r.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},r.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},r.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},r.closeable=function(e){if(typeof e=="boolean"){var i=this.closeable_=!!e,s=this.getChild("closeButton");if(i&&!s){var o=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(s,"close",this.close_)}!i&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_},r.fill=function(){this.fillWith(this.content())},r.fillWith=function(e){var i=this.contentEl(),s=i.parentNode,o=i.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(i),this.empty(),Cc(i,e),this.trigger("modalfill"),o?s.insertBefore(i,o):s.appendChild(i);var u=this.getChild("closeButton");u&&s.appendChild(u.el_)},r.empty=function(){this.trigger("beforemodalempty"),lo(this.contentEl()),this.trigger("modalempty")},r.content=function(e){return typeof e<"u"&&(this.content_=e),this.content_},r.conditionalFocus_=function(){var e=W.activeElement,i=this.player_.el_;this.previouslyActiveEl_=null,(i.contains(e)||i===e)&&(this.previouslyActiveEl_=e,this.focus())},r.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},r.handleKeyDown=function(e){if(e.stopPropagation(),te.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(te.isEventKey(e,"Tab")){for(var i=this.focusableEls_(),s=this.el_.querySelector(":focus"),o,u=0;u<i.length;u++)if(s===i[u]){o=u;break}W.activeElement===this.el_&&(o=0),e.shiftKey&&o===0?(i[i.length-1].focus(),e.preventDefault()):!e.shiftKey&&o===i.length-1&&(i[0].focus(),e.preventDefault())}},r.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(i){return(i instanceof A.HTMLAnchorElement||i instanceof A.HTMLAreaElement)&&i.hasAttribute("href")||(i instanceof A.HTMLInputElement||i instanceof A.HTMLSelectElement||i instanceof A.HTMLTextAreaElement||i instanceof A.HTMLButtonElement)&&!i.hasAttribute("disabled")||i instanceof A.HTMLIFrameElement||i instanceof A.HTMLObjectElement||i instanceof A.HTMLEmbedElement||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")!==-1||i.hasAttribute("contenteditable")})},t}(V);ei.prototype.options_={pauseOnOpen:!0,temporary:!0};V.registerComponent("ModalDialog",ei);var $r=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]),e=a.call(this)||this,e.tracks_=[],Object.defineProperty(ee(e),"length",{get:function(){return this.tracks_.length}});for(var i=0;i<n.length;i++)e.addTrack(n[i]);return e}var r=t.prototype;return r.addTrack=function(e){var i=this,s=this.tracks_.length;""+s in this||Object.defineProperty(this,s,{get:function(){return this.tracks_[s]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){i.trigger({track:e,type:"labelchange",target:i})},Mt(e)&&e.addEventListener("labelchange",e.labelchange_)},r.removeTrack=function(e){for(var i,s=0,o=this.length;s<o;s++)if(this[s]===e){i=this[s],i.off&&i.off(),this.tracks_.splice(s,1);break}i&&this.trigger({track:i,type:"removetrack",target:this})},r.getTrackById=function(e){for(var i=null,s=0,o=this.length;s<o;s++){var u=this[s];if(u.id===e){i=u;break}}return i},t}(Ie);$r.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var m0 in $r.prototype.allowedEvents_)$r.prototype["on"+m0]=null;var Qa=function(t,r){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||r.id===t[n].id||(t[n].enabled=!1)},g0=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]);for(var i=n.length-1;i>=0;i--)if(n[i].enabled){Qa(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,e}var r=t.prototype;return r.addTrack=function(e){var i=this;e.enabled&&Qa(this,e),a.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){i.changing_||(i.changing_=!0,Qa(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},t}($r),Ja=function(t,r){for(var n=0;n<t.length;n++)!Object.keys(t[n]).length||r.id===t[n].id||(t[n].selected=!1)},v0=function(a){G._inheritsLoose(t,a);function t(n){var e;n===void 0&&(n=[]);for(var i=n.length-1;i>=0;i--)if(n[i].selected){Ja(n,n[i]);break}return e=a.call(this,n)||this,e.changing_=!1,Object.defineProperty(ee(e),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),e}var r=t.prototype;return r.addTrack=function(e){var i=this;e.selected&&Ja(this,e),a.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){i.changing_||(i.changing_=!0,Ja(i,e),i.changing_=!1,i.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},t}($r),Nc=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.addTrack=function(e){var i=this;a.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return i.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return i.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);var s=["metadata","chapters"];s.indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},r.removeTrack=function(e){a.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}($r),y0=function(){function a(r){r===void 0&&(r=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var n=0,e=r.length;n<e;n++)this.addTrackElement_(r[n])}var t=a.prototype;return t.addTrackElement_=function(n){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}),this.trackElements_.indexOf(n)===-1&&this.trackElements_.push(n)},t.getTrackElementByTrack_=function(n){for(var e,i=0,s=this.trackElements_.length;i<s;i++)if(n===this.trackElements_[i].track){e=this.trackElements_[i];break}return e},t.removeTrackElement_=function(n){for(var e=0,i=this.trackElements_.length;e<i;e++)if(n===this.trackElements_[e]){this.trackElements_[e].track&&typeof this.trackElements_[e].track.off=="function"&&this.trackElements_[e].track.off(),typeof this.trackElements_[e].off=="function"&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}},a}(),yl=function(){function a(r){a.prototype.setCues_.call(this,r),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=a.prototype;return t.setCues_=function(n){var e=this.length||0,i=0,s=n.length;this.cues_=n,this.length_=n.length;var o=function(l){""+l in this||Object.defineProperty(this,""+l,{get:function(){return this.cues_[l]}})};if(e<s)for(i=e;i<s;i++)o.call(this,i)},t.getCueById=function(n){for(var e=null,i=0,s=this.length;i<s;i++){var o=this[i];if(o.id===n){e=o;break}}return e},a}(),_0={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},T0={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},b0={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},_l={disabled:"disabled",hidden:"hidden",showing:"showing"},po=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={}),n=a.call(this)||this;var e={id:r.id||"vjs_track_"+Gt(),kind:r.kind||"",language:r.language||""},i=r.label||"",s=function(l){Object.defineProperty(ee(n),l,{get:function(){return e[l]},set:function(){}})};for(var o in e)s(o);return Object.defineProperty(ee(n),"label",{get:function(){return i},set:function(l){l!==i&&(i=l,this.trigger("labelchange"))}}),n}return t}(Ie),mo=function(t){var r=["protocol","hostname","port","pathname","search","hash","host"],n=W.createElement("a");n.href=t;for(var e={},i=0;i<r.length;i++)e[r[i]]=n[r[i]];return e.protocol==="http:"&&(e.host=e.host.replace(/:80$/,"")),e.protocol==="https:"&&(e.host=e.host.replace(/:443$/,"")),e.protocol||(e.protocol=A.location.protocol),e.host||(e.host=A.location.host),e},Bc=function(t){if(!t.match(/^https?:\/\//)){var r=W.createElement("a");r.href=t,t=r.href}return t},go=function(t){if(typeof t=="string"){var r=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,n=r.exec(t);if(n)return n.pop().toLowerCase()}return""},xa=function(t,r){r===void 0&&(r=A.location);var n=mo(t),e=n.protocol===":"?r.protocol:n.protocol,i=e+n.host!==r.protocol+r.host;return i},x0=Object.freeze({__proto__:null,parseUrl:mo,getAbsoluteURL:Bc,getFileExtension:go,isCrossOrigin:xa}),Tl=function(t,r){var n=new A.WebVTT.Parser(A,A.vttjs,A.WebVTT.StringDecoder()),e=[];n.oncue=function(i){r.addCue(i)},n.onparsingerror=function(i){e.push(i)},n.onflush=function(){r.trigger({type:"loadeddata",target:r})},n.parse(t),e.length>0&&(A.console&&A.console.groupCollapsed&&A.console.groupCollapsed("Text Track parsing errors for "+r.src),e.forEach(function(i){return ie.error(i)}),A.console&&A.console.groupEnd&&A.console.groupEnd()),n.flush()},bl=function(t,r){var n={uri:t},e=xa(t);e&&(n.cors=e);var i=r.tech_.crossOrigin()==="use-credentials";i&&(n.withCredentials=i),dd(n,ye(this,function(s,o,u){if(s)return ie.error(s,o);r.loaded_=!0,typeof A.WebVTT!="function"?r.tech_&&r.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type==="vttjserror"){ie.error("vttjs failed to load, stopping trying to process "+r.src);return}return Tl(u,r)}):Tl(u,r)}))},Gi=function(a){G._inheritsLoose(t,a);function t(n){var e;if(n===void 0&&(n={}),!n.tech)throw new Error("A tech was not provided.");var i=ve(n,{kind:b0[n.kind]||"subtitles",language:n.language||n.srclang||""}),s=_l[i.mode]||"disabled",o=i.default;(i.kind==="metadata"||i.kind==="chapters")&&(s="hidden"),e=a.call(this,i)||this,e.tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=e.tech_.preloadTextTracks!==!1;var u=new yl(e.cues_),l=new yl(e.activeCues_),c=!1;e.timeupdateHandler=ye(ee(e),function(m){if(m===void 0&&(m={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var p=function(){e.stopTracking()};return e.tech_.one("dispose",p),s!=="disabled"&&e.startTracking(),Object.defineProperties(ee(e),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(_){_l[_]&&s!==_&&(s=_,!this.preload_&&s!=="disabled"&&this.cues.length===0&&bl(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?u:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return l;for(var _=this.tech_.currentTime(),b=[],S=0,x=this.cues.length;S<x;S++){var k=this.cues[S];(k.startTime<=_&&k.endTime>=_||k.startTime===k.endTime&&k.startTime<=_&&k.startTime+.5>=_)&&b.push(k)}if(c=!1,b.length!==this.activeCues_.length)c=!0;else for(var L=0;L<b.length;L++)this.activeCues_.indexOf(b[L])===-1&&(c=!0);return this.activeCues_=b,l.setCues_(this.activeCues_),l},set:function(){}}}),i.src?(e.src=i.src,e.preload_||(e.loaded_=!0),(e.preload_||i.kind!=="subtitles"&&i.kind!=="captions")&&bl(e.src,ee(e))):e.loaded_=!0,e}var r=t.prototype;return r.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},r.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},r.addCue=function(e){var i=e;if(A.vttjs&&!(e instanceof A.vttjs.VTTCue)){i=new A.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var s in e)s in i||(i[s]=e[s]);i.id=e.id,i.originalCue_=e}for(var o=this.tech_.textTracks(),u=0;u<o.length;u++)o[u]!==this&&o[u].removeCue(i);this.cues_.push(i),this.cues.setCues_(this.cues_)},r.removeCue=function(e){for(var i=this.cues_.length;i--;){var s=this.cues_[i];if(s===e||s.originalCue_&&s.originalCue_===e){this.cues_.splice(i,1),this.cues.setCues_(this.cues_);break}}},t}(po);Gi.prototype.allowedEvents_={cuechange:"cuechange"};var Uc=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={});var e=ve(r,{kind:T0[r.kind]||""});n=a.call(this,e)||this;var i=!1;return Object.defineProperty(ee(n),"enabled",{get:function(){return i},set:function(o){typeof o!="boolean"||o===i||(i=o,this.trigger("enabledchange"))}}),e.enabled&&(n.enabled=e.enabled),n.loaded_=!0,n}return t}(po),Vc=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={});var e=ve(r,{kind:_0[r.kind]||""});n=a.call(this,e)||this;var i=!1;return Object.defineProperty(ee(n),"selected",{get:function(){return i},set:function(o){typeof o!="boolean"||o===i||(i=o,this.trigger("selectedchange"))}}),e.selected&&(n.selected=e.selected),n}return t}(po),Hc=0,S0=1,qc=2,E0=3,ti=function(a){G._inheritsLoose(t,a);function t(r){var n;r===void 0&&(r={}),n=a.call(this)||this;var e,i=new Gi(r);return n.kind=i.kind,n.src=i.src,n.srclang=i.language,n.label=i.label,n.default=i.default,Object.defineProperties(ee(n),{readyState:{get:function(){return e}},track:{get:function(){return i}}}),e=Hc,i.addEventListener("loadeddata",function(){e=qc,n.trigger({type:"load",target:ee(n)})}),n}return t}(Ie);ti.prototype.allowedEvents_={load:"load"};ti.NONE=Hc;ti.LOADING=S0;ti.LOADED=qc;ti.ERROR=E0;var ot={audio:{ListClass:g0,TrackClass:Uc,capitalName:"Audio"},video:{ListClass:v0,TrackClass:Vc,capitalName:"Video"},text:{ListClass:Nc,TrackClass:Gi,capitalName:"Text"}};Object.keys(ot).forEach(function(a){ot[a].getterName=a+"Tracks",ot[a].privateName=a+"Tracks_"});var Kr={remoteText:{ListClass:Nc,TrackClass:Gi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:y0,TrackClass:ti,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},je=ht({},ot,Kr);Kr.names=Object.keys(Kr);ot.names=Object.keys(ot);je.names=[].concat(Kr.names).concat(ot.names);function C0(a,t,r,n,e){e===void 0&&(e={});var i=a.textTracks();e.kind=t,r&&(e.label=r),n&&(e.language=n),e.tech=a;var s=new je.text.TrackClass(e);return i.addTrack(s),s}var he=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return n===void 0&&(n={}),e===void 0&&(e=function(){}),n.reportTouchActivity=!1,i=a.call(this,null,n,e)||this,i.onDurationChange_=function(s){return i.onDurationChange(s)},i.trackProgress_=function(s){return i.trackProgress(s)},i.trackCurrentTime_=function(s){return i.trackCurrentTime(s)},i.stopTrackingCurrentTime_=function(s){return i.stopTrackingCurrentTime(s)},i.disposeSourceHandler_=function(s){return i.disposeSourceHandler(s)},i.queuedHanders_=new Set,i.hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),je.names.forEach(function(s){var o=je[s];n&&n[o.getterName]&&(i[o.privateName]=n[o.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(s){n["native"+s+"Tracks"]===!1&&(i["featuresNative"+s+"Tracks"]=!1)}),n.nativeCaptions===!1||n.nativeTextTracks===!1?i.featuresNativeTextTracks=!1:(n.nativeCaptions===!0||n.nativeTextTracks===!0)&&(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.preloadTextTracks=n.preloadTextTracks!==!1,i.autoRemoteTextTracks_=new je.text.ListClass,i.initTrackListeners(),n.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}var r=t.prototype;return r.triggerSourceset=function(e){var i=this;this.isReady_||this.one("ready",function(){return i.setTimeout(function(){return i.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},r.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},r.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ye(this,function(){var i=this.bufferedPercent();this.bufferedPercent_!==i&&this.trigger("progress"),this.bufferedPercent_=i,i===1&&this.stopTrackingProgress()}),500)},r.onDurationChange=function(e){this.duration_=this.duration()},r.buffered=function(){return hr(0,0)},r.bufferedPercent=function(){return Mc(this.buffered(),this.duration_)},r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},r.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.dispose=function(){this.clearTracks(ot.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},r.clearTracks=function(e){var i=this;e=[].concat(e),e.forEach(function(s){for(var o=i[s+"Tracks"]()||[],u=o.length;u--;){var l=o[u];s==="text"&&i.removeRemoteTextTrack(l),o.removeTrack(l)}})},r.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],i=e.length;i--;){var s=e[i];this.removeRemoteTextTrack(s)}},r.reset=function(){},r.crossOrigin=function(){},r.setCrossOrigin=function(){},r.error=function(e){return e!==void 0&&(this.error_=new $e(e),this.trigger("error")),this.error_},r.played=function(){return this.hasStarted_?hr(0,0):hr()},r.play=function(){},r.setScrubbing=function(){},r.scrubbing=function(){},r.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},r.initTrackListeners=function(){var e=this;ot.names.forEach(function(i){var s=ot[i],o=function(){e.trigger(i+"trackchange")},u=e[s.getterName]();u.addEventListener("removetrack",o),u.addEventListener("addtrack",o),e.on("dispose",function(){u.removeEventListener("removetrack",o),u.removeEventListener("addtrack",o)})})},r.addWebVttScript_=function(){var e=this;if(!A.WebVTT)if(W.body.contains(this.el())){if(!this.options_["vtt.js"]&&Oi(Mu)&&Object.keys(Mu).length>0){this.trigger("vttjsloaded");return}var i=W.createElement("script");i.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",i.onload=function(){e.trigger("vttjsloaded")},i.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){i.onload=null,i.onerror=null}),A.WebVTT=!0,this.el().parentNode.appendChild(i)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,i=this.textTracks(),s=this.remoteTextTracks(),o=function(m){return i.addTrack(m.track)},u=function(m){return i.removeTrack(m.track)};s.on("addtrack",o),s.on("removetrack",u),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var m=0;m<i.length;m++){var _=i[m];_.removeEventListener("cuechange",l),_.mode==="showing"&&_.addEventListener("cuechange",l)}};c(),i.addEventListener("change",c),i.addEventListener("addtrack",c),i.addEventListener("removetrack",c),this.on("dispose",function(){s.off("addtrack",o),s.off("removetrack",u),i.removeEventListener("change",c),i.removeEventListener("addtrack",c),i.removeEventListener("removetrack",c);for(var p=0;p<i.length;p++){var m=i[p];m.removeEventListener("cuechange",l)}})},r.addTextTrack=function(e,i,s){if(!e)throw new Error("TextTrack kind is required but was not provided");return C0(this,e,i,s)},r.createRemoteTextTrack=function(e){var i=ve(e,{tech:this});return new Kr.remoteTextEl.TrackClass(i)},r.addRemoteTextTrack=function(e,i){var s=this;e===void 0&&(e={});var o=this.createRemoteTextTrack(e);return i!==!0&&i!==!1&&(ie.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),i!==!0&&this.ready(function(){return s.autoRemoteTextTracks_.addTrack(o.track)}),o},r.removeRemoteTextTrack=function(e){var i=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(i),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},r.getVideoPlaybackQuality=function(){return{}},r.requestPictureInPicture=function(){var e=this.options_.Promise||A.Promise;if(e)return e.reject()},r.disablePictureInPicture=function(){return!0},r.setDisablePictureInPicture=function(){},r.requestVideoFrameCallback=function(e){var i=this,s=Gt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(s),this.one("playing",function(){i.queuedHanders_.has(s)&&(i.queuedHanders_.delete(s),e())})):this.requestNamedAnimationFrame(s,e),s},r.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},r.setPoster=function(){},r.playsinline=function(){},r.setPlaysinline=function(){},r.overrideNativeAudioTracks=function(){},r.overrideNativeVideoTracks=function(){},r.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ee(e),t.techs_[e]=i,t.techs_[Fn(e)]=i,e!=="Tech"&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e){if(t.techs_&&t.techs_[e])return t.techs_[e];if(e=Ee(e),A&&A.videojs&&A.videojs[e])return ie.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),A.videojs[e]}},t}(V);je.names.forEach(function(a){var t=je[a];he.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.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(a){a.registerSourceHandler=function(r,n){var e=a.sourceHandlers;e||(e=a.sourceHandlers=[]),n===void 0&&(n=e.length),e.splice(n,0,r)},a.canPlayType=function(r){for(var n=a.sourceHandlers||[],e,i=0;i<n.length;i++)if(e=n[i].canPlayType(r),e)return e;return""},a.selectSourceHandler=function(r,n){for(var e=a.sourceHandlers||[],i,s=0;s<e.length;s++)if(i=e[s].canHandleSource(r,n),i)return e[s];return null},a.canPlaySource=function(r,n){var e=a.selectSourceHandler(r,n);return e?e.canHandleSource(r,n):""};var t=["seekable","seeking","duration"];t.forEach(function(r){var n=this[r];typeof n=="function"&&(this[r]=function(){return this.sourceHandler_&&this.sourceHandler_[r]?this.sourceHandler_[r].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},a.prototype),a.prototype.setSource=function(r){var n=a.selectSourceHandler(r,this.options_);n||(a.nativeSourceHandler?n=a.nativeSourceHandler:ie.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==a.nativeSourceHandler&&(this.currentSource_=r),this.sourceHandler_=n.handleSource(r,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},a.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};V.registerComponent("Tech",he);he.registerTech("Tech",he);he.defaultTechOrder_=[];var pr={},Cs={},zn={};function A0(a,t){pr[a]=pr[a]||[],pr[a].push(t)}function D0(a,t,r){a.setTimeout(function(){return ur(t,pr[t.type],r,a)},1)}function w0(a,t){a.forEach(function(r){return r.setTech&&r.setTech(t)})}function k0(a,t,r){return a.reduceRight(vo(r),t[r]())}function P0(a,t,r,n){return t[r](a.reduce(vo(r),n))}function xl(a,t,r,n){n===void 0&&(n=null);var e="call"+Ee(r),i=a.reduce(vo(e),n),s=i===zn,o=s?null:t[r](i);return O0(a,r,o,s),o}var I0={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},L0={setCurrentTime:1,setMuted:1,setVolume:1},Sl={play:1,pause:1};function vo(a){return function(t,r){return t===zn?zn:r[a]?r[a](t):t}}function O0(a,t,r,n){for(var e=a.length-1;e>=0;e--){var i=a[e];i[t]&&i[t](n,r)}}function F0(a){Cs[a.id()]=null}function R0(a,t){var r=Cs[a.id()],n=null;if(r==null)return n=t(a),Cs[a.id()]=[[t,n]],n;for(var e=0;e<r.length;e++){var i=r[e],s=i[0],o=i[1];s===t&&(n=o)}return n===null&&(n=t(a),r.push([t,n])),n}function ur(a,t,r,n,e,i){a===void 0&&(a={}),t===void 0&&(t=[]),e===void 0&&(e=[]),i===void 0&&(i=!1);var s=t,o=s[0],u=s.slice(1);if(typeof o=="string")ur(a,pr[o],r,n,e,i);else if(o){var l=R0(n,o);if(!l.setSource)return e.push(l),ur(a,u,r,n,e,i);l.setSource(be({},a),function(c,p){if(c)return ur(a,u,r,n,e,i);e.push(l),ur(p,a.type===p.type?u:pr[p.type],r,n,e,i)})}else u.length?ur(a,u,r,n,e,i):i?r(a,e):ur(a,pr["*"],r,n,e,!0)}var M0={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"},$n=function(t){t===void 0&&(t="");var r=go(t),n=M0[r.toLowerCase()];return n||""},N0=function(t,r){if(!r)return"";if(t.cache_.source.src===r&&t.cache_.source.type)return t.cache_.source.type;var n=t.cache_.sources.filter(function(o){return o.src===r});if(n.length)return n[0].type;for(var e=t.$$("source"),i=0;i<e.length;i++){var s=e[i];if(s.type&&s.src&&s.src===r)return s.type}return $n(r)},B0=function a(t){if(Array.isArray(t)){var r=[];t.forEach(function(n){n=a(n),Array.isArray(n)?r=r.concat(n):Vt(n)&&r.push(n)}),t=r}else typeof t=="string"&&t.trim()?t=[El({src:t})]:Vt(t)&&typeof t.src=="string"&&t.src&&t.src.trim()?t=[El(t)]:t=[];return t};function El(a){if(!a.type){var t=$n(a.src);t&&(a.type=t)}return a}var U0=function(a){G._inheritsLoose(t,a);function t(r,n,e){var i,s=ve({createEl:!1},n);if(i=a.call(this,r,s,e)||this,!n.playerOptions.sources||n.playerOptions.sources.length===0)for(var o=0,u=n.playerOptions.techOrder;o<u.length;o++){var l=Ee(u[o]),c=he.getTech(l);if(l||(c=V.getComponent(l)),c&&c.isSupported()){r.loadTech_(l);break}}else r.src(n.playerOptions.sources);return i}return t}(V);V.registerComponent("MediaLoader",U0);var Sa=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.options_.controlText&&i.controlText(i.options_.controlText),i.handleMouseOver_=function(s){return i.handleMouseOver(s)},i.handleMouseOut_=function(s){return i.handleMouseOut(s)},i.handleClick_=function(s){return i.handleClick(s)},i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.emitTapEvents(),i.enable(),i}var r=t.prototype;return r.createEl=function(e,i,s){e===void 0&&(e="div"),i===void 0&&(i={}),s===void 0&&(s={}),i=be({className:this.buildCSSClass(),tabIndex:0},i),e==="button"&&ie.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),s=be({role:"button"},s),this.tabIndex_=i.tabIndex;var o=ne(e,i,s);return o.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},r.dispose=function(){this.controlTextEl_=null,a.prototype.dispose.call(this)},r.createControlTextEl=function(e){return this.controlTextEl_=ne("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},r.controlText=function(e,i){if(i===void 0&&(i=this.el()),e===void 0)return this.controlText_||"Need Text";var s=this.localize(e);this.controlText_=e,vr(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&i.setAttribute("title",s)},r.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},r.enable=function(){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_))},r.disable=function(){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_)},r.handleLanguagechange=function(){this.controlText(this.controlText_)},r.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},r.handleKeyDown=function(e){te.isEventKey(e,"Space")||te.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(V);V.registerComponent("ClickableComponent",Sa);var V0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update(),i.update_=function(s){return i.update(s)},n.on("posterchange",i.update_),i}var r=t.prototype;return r.dispose=function(){this.player().off("posterchange",this.update_),a.prototype.dispose.call(this)},r.createEl=function(){var e=ne("div",{className:"vjs-poster",tabIndex:-1});return e},r.update=function(e){var i=this.player().poster();this.setSrc(i),i?this.show():this.hide()},r.setSrc=function(e){var i="";e&&(i='url("'+e+'")'),this.el_.style.backgroundImage=i},r.handleClick=function(e){if(this.player_.controls()){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((ji||qi)&&i)&&this.player_.tech(!0).focus(),this.player_.paused()?Tt(this.player_.play()):this.player_.pause()}},t}(Sa);V.registerComponent("PosterImage",V0);var st="#222",Cl="#ccc",H0={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Za(a,t){var r;if(a.length===4)r=a[1]+a[1]+a[2]+a[2]+a[3]+a[3];else if(a.length===7)r=a.slice(1);else throw new Error("Invalid color code provided, "+a+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+t+")"}function es(a,t,r){try{a.style[t]=r}catch{return}}var q0=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;s=a.call(this,n,e,i)||this;var o=function(l){return s.updateDisplay(l)};return n.on("loadstart",function(u){return s.toggleDisplay(u)}),n.on("texttrackchange",o),n.on("loadedmetadata",function(u){return s.preselectTrack(u)}),n.ready(ye(ee(s),function(){if(n.tech_&&n.tech_.featuresNativeTextTracks){this.hide();return}n.on("fullscreenchange",o),n.on("playerresize",o),A.addEventListener("orientationchange",o),n.on("dispose",function(){return A.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],l=0;l<u.length;l++)this.player_.addRemoteTextTrack(u[l],!0);this.preselectTrack()})),s}var r=t.prototype;return r.preselectTrack=function(){for(var e={captions:1,subtitles:1},i=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,o,u,l,c=0;c<i.length;c++){var p=i[c];s&&s.enabled&&s.language&&s.language===p.language&&p.kind in e?p.kind===s.kind?l=p:l||(l=p):s&&!s.enabled?(l=null,o=null,u=null):p.default&&(p.kind==="descriptions"&&!o?o=p:p.kind in e&&!u&&(u=p))}l?l.mode="showing":u?u.mode="showing":o&&(o.mode="showing")},r.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},r.clearDisplay=function(){typeof A.WebVTT=="function"&&A.WebVTT.processCues(A,[],this.el_)},r.updateDisplay=function(){var e=this.player_.textTracks(),i=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),i){for(var s=[],o=0;o<e.length;++o){var u=e[o];u.mode==="showing"&&s.push(u)}this.updateForTrack(s);return}for(var l=null,c=null,p=e.length;p--;){var m=e[p];m.mode==="showing"&&(m.kind==="descriptions"?l=m:c=m)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):l&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(l))},r.updateDisplayState=function(e){for(var i=this.player_.textTrackSettings.getValues(),s=e.activeCues,o=s.length;o--;){var u=s[o];if(u){var l=u.displayState;if(i.color&&(l.firstChild.style.color=i.color),i.textOpacity&&es(l.firstChild,"color",Za(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(l.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&es(l.firstChild,"backgroundColor",Za(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?es(l,"backgroundColor",Za(i.windowColor,i.windowOpacity)):l.style.backgroundColor=i.windowColor),i.edgeStyle&&(i.edgeStyle==="dropshadow"?l.firstChild.style.textShadow="2px 2px 3px "+st+", 2px 2px 4px "+st+", 2px 2px 5px "+st:i.edgeStyle==="raised"?l.firstChild.style.textShadow="1px 1px "+st+", 2px 2px "+st+", 3px 3px "+st:i.edgeStyle==="depressed"?l.firstChild.style.textShadow="1px 1px "+Cl+", 0 1px "+Cl+", -1px -1px "+st+", 0 -1px "+st:i.edgeStyle==="uniform"&&(l.firstChild.style.textShadow="0 0 4px "+st+", 0 0 4px "+st+", 0 0 4px "+st+", 0 0 4px "+st)),i.fontPercent&&i.fontPercent!==1){var c=A.parseFloat(l.style.fontSize);l.style.fontSize=c*i.fontPercent+"px",l.style.height="auto",l.style.top="auto"}i.fontFamily&&i.fontFamily!=="default"&&(i.fontFamily==="small-caps"?l.firstChild.style.fontVariant="small-caps":l.firstChild.style.fontFamily=H0[i.fontFamily])}}},r.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),!(typeof A.WebVTT!="function"||e.every(function(_){return!_.activeCues}))){for(var i=[],s=0;s<e.length;++s)for(var o=e[s],u=0;u<o.activeCues.length;++u)i.push(o.activeCues[u]);A.WebVTT.processCues(A,i,this.el_);for(var l=0;l<e.length;++l){for(var c=e[l],p=0;p<c.activeCues.length;++p){var m=c.activeCues[p].displayState;Rt(m,"vjs-text-track-cue"),Rt(m,"vjs-text-track-cue-"+(c.language?c.language:l)),c.language&&Gr(m,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},t}(V);V.registerComponent("TextTrackDisplay",q0);var j0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=this.player_.isAudio(),i=this.localize(e?"Audio Player":"Video Player"),s=ne("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[i])}),o=a.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(s),o},t}(V);V.registerComponent("LoadingSpinner",j0);var ft=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(e,i,s){i===void 0&&(i={}),s===void 0&&(s={}),e="button",i=be({className:this.buildCSSClass()},i),s=be({type:"button"},s);var o=ne(e,i,s);return o.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},r.addChild=function(e,i){i===void 0&&(i={});var s=this.constructor.name;return ie.warn("Adding an actionable (user controllable) child to a Button ("+s+") is not supported; use a ClickableComponent instead."),V.prototype.addChild.call(this,e,i)},r.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},r.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},r.handleKeyDown=function(e){if(te.isEventKey(e,"Space")||te.isEventKey(e,"Enter")){e.stopPropagation();return}a.prototype.handleKeyDown.call(this,e)},t}(Sa);V.registerComponent("Button",ft);var jc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.mouseused_=!1,i.on("mousedown",function(s){return i.handleMouseDown(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-big-play-button"},r.handleClick=function(e){var i=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var s=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Tt(i),this.player_.tech(!0)&&!((ji||qi)&&s)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),u=o&&o.getChild("playToggle");if(!u){this.player_.tech(!0).focus();return}var l=function(){return u.focus()};Ci(i)?i.then(l,function(){}):this.setTimeout(l,1)},r.handleKeyDown=function(e){this.mouseused_=!1,a.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(e){this.mouseused_=!0},t}(ft);jc.prototype.controlText_="Play Video";V.registerComponent("BigPlayButton",jc);var W0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.controlText(e&&e.controlText||i.localize("Close")),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){te.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):a.prototype.handleKeyDown.call(this,e)},t}(ft);V.registerComponent("CloseButton",W0);var Wc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,e.replay=e.replay===void 0||e.replay,i.on(n,"play",function(s){return i.handlePlay(s)}),i.on(n,"pause",function(s){return i.handlePause(s)}),e.replay&&i.on(n,"ended",function(s){return i.handleEnded(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?Tt(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(e){var i=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(s){return i.handleSeeked(s)})},t}(ft);Wc.prototype.controlText_="Play";V.registerComponent("PlayToggle",Wc);var Gc=function(t,r){t=t<0?0:t;var n=Math.floor(t%60),e=Math.floor(t/60%60),i=Math.floor(t/3600),s=Math.floor(r/60%60),o=Math.floor(r/3600);return(isNaN(t)||t===1/0)&&(i=e=n="-"),i=i>0||o>0?i+":":"",e=((i||s>=10)&&e<10?"0"+e:e)+":",n=n<10?"0"+n:n,i+e+n},yo=Gc;function G0(a){yo=a}function z0(){yo=Gc}function Xr(a,t){return t===void 0&&(t=a),yo(a,t)}var ri=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["timeupdate","ended"],function(s){return i.updateContent(s)}),i.updateTextNode_(),i}var r=t.prototype;return r.createEl=function(){var e=this.buildCSSClass(),i=a.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),s=ne("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(s),this.contentEl_=ne("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},r.dispose=function(){this.contentEl_=null,this.textNode_=null,a.prototype.dispose.call(this)},r.updateTextNode_=function(e){var i=this;e===void 0&&(e=0),e=Xr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(i.contentEl_){var s=i.textNode_;s&&i.contentEl_.firstChild!==s&&(s=null,ie.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),i.textNode_=W.createTextNode(i.formattedTime_),i.textNode_&&(s?i.contentEl_.replaceChild(i.textNode_,s):i.contentEl_.appendChild(i.textNode_))}}))},r.updateContent=function(e){},t}(V);ri.prototype.labelText_="Time";ri.prototype.controlText_="Time";V.registerComponent("TimeDisplay",ri);var _o=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(e){var i;this.player_.ended()?i=this.player_.duration():i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)},t}(ri);_o.prototype.labelText_="Current Time";_o.prototype.controlText_="Current Time";V.registerComponent("CurrentTimeDisplay",_o);var To=function(a){G._inheritsLoose(t,a);function t(n,e){var i;i=a.call(this,n,e)||this;var s=function(u){return i.updateContent(u)};return i.on(n,"durationchange",s),i.on(n,"loadstart",s),i.on(n,"loadedmetadata",s),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var i=this.player_.duration();this.updateTextNode_(i)},t}(ri);To.prototype.labelText_="Duration";To.prototype.controlText_="Duration";V.registerComponent("DurationDisplay",To);var $0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=a.prototype.createEl.call(this,"div"),s=a.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(s),e.appendChild(i),e},t}(V);V.registerComponent("TimeDivider",$0);var bo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"durationchange",function(s){return i.updateContent(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=a.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(ne("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(e){if(typeof this.player_.duration()=="number"){var i;this.player_.ended()?i=0:this.player_.remainingTimeDisplay?i=this.player_.remainingTimeDisplay():i=this.player_.remainingTime(),this.updateTextNode_(i)}},t}(ri);bo.prototype.labelText_="Remaining Time";bo.prototype.controlText_="Remaining Time";V.registerComponent("RemainingTimeDisplay",bo);var K0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateShowing(),i.on(i.player(),"durationchange",function(s){return i.updateShowing(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ne("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ne("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(W.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(V);V.registerComponent("LiveDisplay",K0);var zc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(s){return i.updateLiveEdgeStatus(s)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=ne("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,a.prototype.dispose.call(this)},t}(ft);zc.prototype.controlText_="Seek to live, currently playing live";V.registerComponent("SeekToLive",zc);var Ea=function(t,r,n){return t=Number(t),Math.min(n,Math.max(r,isNaN(t)?r:t))},xo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseDown_=function(s){return i.handleMouseDown(s)},i.handleMouseUp_=function(s){return i.handleMouseUp(s)},i.handleKeyDown_=function(s){return i.handleKeyDown(s)},i.handleClick_=function(s){return i.handleClick(s)},i.handleMouseMove_=function(s){return i.handleMouseMove(s)},i.update_=function(s){return i.update(s)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}var r=t.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i.className=i.className+" vjs-slider",i=be({tabIndex:0},i),s=be({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},s),a.prototype.createEl.call(this,e,i,s)},r.handleMouseDown=function(e){var i=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Wt&&e.preventDefault(),bc(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;xc(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var e=this;if(!(!this.el_||!this.bar)){var i=this.getProgress();return i===this.progress_||(this.progress_=i,this.requestNamedAnimationFrame("Slider#update",function(){var s=e.vertical()?"height":"width";e.bar.el().style[s]=(i*100).toFixed(2)+"%"})),i}},r.getProgress=function(){return Number(Ea(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var i=ya(this.el_,e);return this.vertical()?i.y:i.x},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):te.isEventKey(e,"Right")||te.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):a.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(V);V.registerComponent("Slider",xo);var ts=function(t,r){return Ea(t/r*100,0,100).toFixed(2)+"%"},X0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.partEls_=[],i.on(n,"progress",function(s){return i.update(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=ne("span",{className:"vjs-control-text"}),s=ne("span",{textContent:this.localize("Loaded")}),o=W.createTextNode(": ");return this.percentageEl_=ne("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(s),i.appendChild(o),i.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,a.prototype.dispose.call(this)},r.update=function(e){var i=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var s=i.player_.liveTracker,o=i.player_.buffered(),u=s&&s.isLive()?s.seekableEnd():i.player_.duration(),l=i.player_.bufferedEnd(),c=i.partEls_,p=ts(l,u);i.percent_!==p&&(i.el_.style.width=p,vr(i.percentageEl_,p),i.percent_=p);for(var m=0;m<o.length;m++){var _=o.start(m),b=o.end(m),S=c[m];S||(S=i.el_.appendChild(ne()),c[m]=S),!(S.dataset.start===_&&S.dataset.end===b)&&(S.dataset.start=_,S.dataset.end=b,S.style.left=ts(_,l),S.style.width=ts(b-_,l))}for(var x=c.length;x>o.length;x--)i.el_.removeChild(c[x-1]);c.length=o.length})},t}(V);V.registerComponent("LoadProgressBar",X0);var Y0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s){var o=Ri(this.el_),u=zr(this.player_.el()),l=e.width*i;if(!(!u||!o)){var c=e.left-u.left+l,p=e.width-l+(u.right-e.right),m=o.width/2;c<m?m+=m-c:p<m&&(m=p),m<0?m=0:m>o.width&&(m=o.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(s)}},r.write=function(e){vr(this.el_,e)},r.updateTime=function(e,i,s,o){var u=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,c=u.player_.duration();if(u.player_.liveTracker&&u.player_.liveTracker.isLive()){var p=u.player_.liveTracker.liveWindow(),m=p-i*p;l=(m<1?"":"-")+Xr(m,p)}else l=Xr(s,c);u.update(e,i,l),o&&o()})},t}(V);V.registerComponent("TimeTooltip",Y0);var So=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,i){var s=this.getChild("timeTooltip");if(s){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,i,o)}},t}(V);So.prototype.options_={children:[]};!Ke&&!jt&&So.prototype.options_.children.push("timeTooltip");V.registerComponent("PlayProgressBar",So);var $c=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i){var s=this,o=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,o,function(){s.el_.style.left=e.width*i+"px"})},t}(V);$c.prototype.options_={children:["timeTooltip"]};V.registerComponent("MouseTimeDisplay",$c);var Dn=5,Al=12,Eo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.setEventHandlers_(),i}var r=t.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=ye(this,this.update),this.update=Ht(this.update_,pt),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(i){return e.enableInterval_(i)},this.disableIntervalHandler_=function(i){return e.disableInterval_(i)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in W&&"visibilityState"in W&&this.on(W,"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){W.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,pt))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var i=this;if(W.visibilityState!=="hidden"){var s=a.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),u=i.player_.liveTracker,l=i.player_.duration();u&&u.isLive()&&(l=i.player_.liveTracker.liveCurrentTime()),i.percent_!==s&&(i.el_.setAttribute("aria-valuenow",(s*100).toFixed(2)),i.percent_=s),(i.currentTime_!==o||i.duration_!==l)&&(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Xr(o,l),Xr(l,l)],"{1} of {2}")),i.currentTime_=o,i.duration_=l),i.bar&&i.bar.update(zr(i.el()),i.getProgress())}),s}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e=this.getCurrentTime_(),i,s=this.player_.liveTracker;return s&&s.isLive()?(i=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i},r.handleMouseDown=function(e){Mi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(e,i){if(i===void 0&&(i=!1),!!Mi(e)){!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var s,o=this.calculateDistance(e),u=this.player_.liveTracker;if(!u||!u.isLive())s=o*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(o>=.99){u.seekToLiveEdge();return}var l=u.seekableStart(),c=u.liveCurrentTime();if(s=l+o*u.liveWindow(),s>=c&&(s=c),s<=l&&(s=l+.1),s===1/0)return}this.userSeek_(s)}},r.enable=function(){a.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},r.disable=function(){a.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},r.handleMouseUp=function(e){a.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Tt(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+Dn)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-Dn)},r.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var i=this.player_.liveTracker;if(te.isEventKey(e,"Space")||te.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(te.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(te.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(te(e))){e.preventDefault(),e.stopPropagation();var s=(te.codes[te(e)]-te.codes[0])*10/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else te.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Dn*Al)):te.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Dn*Al)):a.prototype.handleKeyDown.call(this,e)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in W&&"visibilityState"in W&&this.off(W,"visibilitychange",this.toggleVisibility_),a.prototype.dispose.call(this)},t}(xo);Eo.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Ke&&!jt&&Eo.prototype.options_.children.splice(1,0,"mouseTimeDisplay");V.registerComponent("SeekBar",Eo);var Kc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.handleMouseMove=Ht(ye(ee(i),i.handleMouseMove),pt),i.throttledHandleMouseSeek=Ht(ye(ee(i),i.handleMouseSeek),pt),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.handleMouseDownHandler_=function(s){return i.handleMouseDown(s)},i.enable(),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var i=this.getChild("seekBar");if(i){var s=i.getChild("playProgressBar"),o=i.getChild("mouseTimeDisplay");if(!(!s&&!o)){var u=i.el(),l=Ri(u),c=ya(u,e).x;c=Ea(c,0,1),o&&o.update(l,c),s&&s.update(l,i.getProgress())}}},r.handleMouseSeek=function(e){var i=this.getChild("seekBar");i&&i.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(i){return i.disable&&i.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Tt(this.player_.play())}},r.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(e){var i=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(V);Kc.prototype.options_={children:["seekBar"]};V.registerComponent("ProgressControl",Kc);var Xc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,["enterpictureinpicture","leavepictureinpicture"],function(s){return i.handlePictureInPictureChange(s)}),i.on(n,["disablepictureinpicturechanged","loadedmetadata"],function(s){return i.handlePictureInPictureEnabledChange(s)}),i.on(n,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var s=n.currentType().substring(0,5)==="audio";s||n.audioPosterMode()||n.audioOnlyMode()?(n.isInPictureInPicture()&&n.exitPictureInPicture(),i.hide()):i.show()}),i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+a.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){W.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(ft);Xc.prototype.controlText_="Picture-in-Picture";V.registerComponent("PictureInPictureToggle",Xc);var Yc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"fullscreenchange",function(s){return i.handleFullscreenChange(s)}),W[n.fsApi_.fullscreenEnabled]===!1&&i.disable(),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ft);Yc.prototype.controlText_="Fullscreen";V.registerComponent("FullscreenToggle",Yc);var Q0=function(t,r){r.tech_&&!r.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},J0=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(a.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},t}(V);V.registerComponent("VolumeLevel",J0);var Z0=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,i,s,o){if(!s){var u=zr(this.el_),l=zr(this.player_.el()),c=e.width*i;if(!l||!u)return;var p=e.left-l.left+c,m=e.width-c+(l.right-e.right),_=u.width/2;p<_?_+=_-p:m<_&&(_=m),_<0?_=0:_>u.width&&(_=u.width),this.el_.style.right="-"+_+"px"}this.write(o+"%")},r.write=function(e){vr(this.el_,e)},r.updateVolume=function(e,i,s,o,u){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,i,s,o.toFixed(0)),u&&u()})},t}(V);V.registerComponent("VolumeLevelTooltip",Z0);var Qc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.update=Ht(ye(ee(i),i.update),pt),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,i,s){var o=this,u=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,s,u,function(){s?o.el_.style.bottom=e.height*i+"px":o.el_.style.left=e.width*i+"px"})},t}(V);Qc.prototype.options_={children:["volumeLevelTooltip"]};V.registerComponent("MouseVolumeLevelDisplay",Qc);var Ca=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on("slideractive",function(s){return i.updateLastVolume_(s)}),i.on(n,"volumechange",function(s){return i.updateARIAAttributes(s)}),n.ready(function(){return i.updateARIAAttributes()}),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){Mi(e)&&a.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(e){var i=this.getChild("mouseVolumeLevelDisplay");if(i){var s=this.el(),o=zr(s),u=this.vertical(),l=ya(s,e);l=u?l.y:l.x,l=Ea(l,0,1),i.update(o,l,u)}Mi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")},r.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},r.updateLastVolume_=function(){var e=this,i=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(i)})},t}(xo);Ca.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Ke&&!jt&&Ca.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Ca.prototype.playerEvent="volumechange";V.registerComponent("VolumeBar",Ca);var Jc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||Oi(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),i=a.call(this,n,e)||this,Q0(ee(i),n),i.throttledHandleMouseMove=Ht(ye(ee(i),i.handleMouseMove),pt),i.handleMouseUpHandler_=function(s){return i.handleMouseUp(s)},i.on("mousedown",function(s){return i.handleMouseDown(s)}),i.on("touchstart",function(s){return i.handleMouseDown(s)}),i.on("mousemove",function(s){return i.handleMouseMove(s)}),i.on(i.volumeBar,["focus","slideractive"],function(){i.volumeBar.addClass("vjs-slider-active"),i.addClass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumeBar,["blur","sliderinactive"],function(){i.volumeBar.removeClass("vjs-slider-active"),i.removeClass("vjs-slider-active"),i.trigger("sliderinactive")}),i}var r=t.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(e){var i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(V);Jc.prototype.options_={children:["volumeBar"]};V.registerComponent("VolumeControl",Jc);var ey=function(t,r){r.tech_&&!r.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(r,"loadstart",function(){r.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Zc=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,ey(ee(i),n),i.on(n,["loadstart","volumechange"],function(s){return i.update(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var i=this.player_.volume(),s=this.player_.lastVolume_();if(i===0){var o=s<.1?.1:s;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),i=3;Ke&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?i=0:e<.33?i=1:e<.67&&(i=2);for(var s=0;s<4;s++)Wi(this.el_,"vjs-vol-"+s);Rt(this.el_,"vjs-vol-"+i)},r.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0,i=e?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)},t}(ft);Zc.prototype.controlText_="Mute";V.registerComponent("MuteToggle",Zc);var ef=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),typeof e.inline<"u"?e.inline=e.inline:e.inline=!0,(typeof e.volumeControl>"u"||Oi(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),i=a.call(this,n,e)||this,i.handleKeyPressHandler_=function(s){return i.handleKeyPress(s)},i.on(n,["loadstart"],function(s){return i.volumePanelState_(s)}),i.on(i.muteToggle,"keyup",function(s){return i.handleKeyPress(s)}),i.on(i.volumeControl,"keyup",function(s){return i.handleVolumeControlKeyUp(s)}),i.on("keydown",function(s){return i.handleKeyPress(s)}),i.on("mouseover",function(s){return i.handleMouseOver(s)}),i.on("mouseout",function(s){return i.handleMouseOut(s)}),i.on(i.volumeControl,["slideractive"],i.sliderActive_),i.on(i.volumeControl,["sliderinactive"],i.sliderInactive_),i}var r=t.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),a.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){te.isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),nt(W,"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Be(W,"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){te.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(V);ef.prototype.options_={children:["muteToggle","volumeControl"]};V.registerComponent("VolumePanel",ef);var tf=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,e&&(i.menuButton_=e.menuButton),i.focusedChild_=-1,i.on("keydown",function(s){return i.handleKeyDown(s)}),i.boundHandleBlur_=function(s){return i.handleBlur(s)},i.boundHandleTapClick_=function(s){return i.handleTapClick(s)},i}var r=t.prototype;return r.addEventListenerForItem=function(e){e instanceof V&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof V&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),a.prototype.removeChild.call(this,e)},r.addItem=function(e){var i=this.addChild(e);i&&this.addEventListenerForItem(i)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=ne(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),nt(i,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),i},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,a.prototype.dispose.call(this)},r.handleBlur=function(e){var i=e.relatedTarget||W.activeElement;if(!this.children().some(function(o){return o.el()===i})){var s=this.menuButton_;s&&s.buttonPressed_&&i!==s.el().firstChild&&s.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var i=this.children();if(!Array.isArray(i))return;var s=i.filter(function(o){return o.el()===e.target})[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(e){te.isEventKey(e,"Left")||te.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(te.isEventKey(e,"Right")||te.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){e===void 0&&(e=0);var i=this.children().slice(),s=i.length&&i[0].hasClass("vjs-menu-title");s&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())},t}(V);V.registerComponent("Menu",tf);var Co=function(a){G._inheritsLoose(t,a);function t(n,e){var i;e===void 0&&(e={}),i=a.call(this,n,e)||this,i.menuButton_=new ft(n,e),i.menuButton_.controlText(i.controlText_),i.menuButton_.el_.setAttribute("aria-haspopup","true");var s=ft.prototype.buildCSSClass();i.menuButton_.el_.className=i.buildCSSClass()+" "+s,i.menuButton_.removeClass("vjs-control"),i.addChild(i.menuButton_),i.update(),i.enabled_=!0;var o=function(l){return i.handleClick(l)};return i.handleMenuKeyUp_=function(u){return i.handleMenuKeyUp(u)},i.on(i.menuButton_,"tap",o),i.on(i.menuButton_,"click",o),i.on(i.menuButton_,"keydown",function(u){return i.handleKeyDown(u)}),i.on(i.menuButton_,"mouseenter",function(){i.addClass("vjs-hover"),i.menu.show(),nt(W,"keyup",i.handleMenuKeyUp_)}),i.on("mouseleave",function(u){return i.handleMouseLeave(u)}),i.on("keydown",function(u){return i.handleSubmenuKeyDown(u)}),i}var r=t.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},r.createMenu=function(){var e=new tf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var i=ne("li",{className:"vjs-menu-title",textContent:Ee(this.options_.title),tabIndex:-1}),s=new V(this.player_,{el:i});e.addItem(s)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)e.addItem(this.items[o]);return e},r.createItems=function(){},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},r.buildWrapperCSSClass=function(){var e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";var i=ft.prototype.buildCSSClass();return"vjs-menu-button "+e+" "+i+" "+a.prototype.buildCSSClass.call(this)},r.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+a.prototype.buildCSSClass.call(this)},r.controlText=function(e,i){return i===void 0&&(i=this.menuButton_.el()),this.menuButton_.controlText(e,i)},r.dispose=function(){this.handleMouseLeave(),a.prototype.dispose.call(this)},r.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},r.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Be(W,"keyup",this.handleMenuKeyUp_)},r.focus=function(){this.menuButton_.focus()},r.blur=function(){this.menuButton_.blur()},r.handleKeyDown=function(e){te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),te.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(te.isEventKey(e,"Up")||te.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},r.handleMenuKeyUp=function(e){(te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},r.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},r.handleSubmenuKeyDown=function(e){(te.isEventKey(e,"Esc")||te.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),te.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},r.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ke&&gc())return;this.menu.focus()}},r.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},r.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},r.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(V);V.registerComponent("MenuButton",Co);var Ao=function(a){G._inheritsLoose(t,a);function t(r,n){var e,i=n.tracks;if(e=a.call(this,r,n)||this,e.items.length<=1&&e.hide(),!i)return ee(e);var s=ye(ee(e),e.update);return i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),e.player_.on("ready",s),e.player_.on("dispose",function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s)}),e}return t}(Co);V.registerComponent("TrackButton",Ao);var ty=["Tab","Esc","Up","Down","Right","Left"],zi=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.selectable=e.selectable,i.isSelected_=e.selected||!1,i.multiSelectable=e.multiSelectable,i.selected(i.isSelected_),i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}var r=t.prototype;return r.createEl=function(e,i,s){this.nonIconControl=!0;var o=a.prototype.createEl.call(this,"li",be({className:"vjs-menu-item",tabIndex:-1},i),s);return o.replaceChild(ne("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},r.handleKeyDown=function(e){ty.some(function(i){return te.isEventKey(e,i)})||a.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){this.selected(!0)},r.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Sa);V.registerComponent("MenuItem",zi);var $i=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=n.textTracks();e.label=s.label||s.language||"Unknown",e.selected=s.mode==="showing",i=a.call(this,n,e)||this,i.track=s,i.kinds=(e.kinds||[e.kind||i.track.kind]).filter(Boolean);var u=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];i.handleTracksChange.apply(ee(i),_)},l=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];i.handleSelectedLanguageChange.apply(ee(i),_)};if(n.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",l),i.on("dispose",function(){n.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",l)}),o.onchange===void 0){var c;i.on(["tap","click"],function(){if(typeof A.Event!="object")try{c=new A.Event("change")}catch{}c||(c=W.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return i.handleTracksChange(),i}var r=t.prototype;return r.handleClick=function(e){var i=this.track,s=this.player_.textTracks();if(a.prototype.handleClick.call(this,e),!!s)for(var o=0;o<s.length;o++){var u=s[o];this.kinds.indexOf(u.kind)!==-1&&(u===i?u.mode!=="showing"&&(u.mode="showing"):u.mode!=="disabled"&&(u.mode="disabled"))}},r.handleTracksChange=function(e){var i=this.track.mode==="showing";i!==this.isSelected_&&this.selected(i)},r.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var i=this.player_.cache_.selectedLanguage;if(i&&i.enabled&&i.language===this.track.language&&i.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},r.dispose=function(){this.track=null,a.prototype.dispose.call(this)},t}(zi);V.registerComponent("TextTrackMenuItem",$i);var rf=function(a){G._inheritsLoose(t,a);function t(n,e){return e.track={player:n,kind:e.kind,kinds:e.kinds,default:!1,mode:"disabled"},e.kinds||(e.kinds=[e.kind]),e.label?e.track.label=e.label:e.track.label=e.kinds.join(" and ")+" off",e.selectable=!0,e.multiSelectable=!1,a.call(this,n,e)||this}var r=t.prototype;return r.handleTracksChange=function(e){for(var i=this.player().textTracks(),s=!0,o=0,u=i.length;o<u;o++){var l=i[o];if(this.options_.kinds.indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)},r.handleSelectedLanguageChange=function(e){for(var i=this.player().textTracks(),s=!0,o=0,u=i.length;o<u;o++){var l=i[o];if(["captions","descriptions","subtitles"].indexOf(l.kind)>-1&&l.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}($i);V.registerComponent("OffTextTrackMenuItem",rf);var ii=function(a){G._inheritsLoose(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.textTracks(),a.call(this,n,e)||this}var r=t.prototype;return r.createItems=function(e,i){e===void 0&&(e=[]),i===void 0&&(i=$i);var s;this.label_&&(s=this.label_+" off"),e.push(new rf(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var u=0;u<o.length;u++){var l=o[u];if(this.kinds_.indexOf(l.kind)>-1){var c=new i(this.player_,{track:l,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+l.kind+"-menu-item"),e.push(c)}}return e},t}(Ao);V.registerComponent("TextTrackButton",ii);var nf=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=e.cue,u=n.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=u&&u<o.endTime,i=a.call(this,n,e)||this,i.track=s,i.cue=o,i}var r=t.prototype;return r.handleClick=function(e){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},t}(zi);V.registerComponent("ChaptersTrackMenuItem",nf);var Do=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;return s=a.call(this,n,e,i)||this,s.selectCurrentItem_=function(){s.items.forEach(function(o){o.selected(s.track_.activeCues[0]===o.cue)})},s}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildWrapperCSSClass.call(this)},r.update=function(e){if(!(e&&e.track&&e.track.kind!=="chapters")){var i=this.findChaptersTrack();i!==this.track_?(this.setTrack(i),a.prototype.update.call(this)):(!this.items||i&&i.cues&&i.cues.length!==this.items.length)&&a.prototype.update.call(this)}},r.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var s=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);s&&s.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},r.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],i=e.length-1;i>=0;i--){var s=e[i];if(s.kind===this.kind_)return s}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ee(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var i=this.track_.cues;if(!i)return e;for(var s=0,o=i.length;s<o;s++){var u=i[s],l=new nf(this.player_,{track:this.track_,cue:u});e.push(l)}return e},t}(ii);Do.prototype.kind_="chapters";Do.prototype.controlText_="Chapters";V.registerComponent("ChaptersButton",Do);var wo=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;s=a.call(this,n,e,i)||this;var o=n.textTracks(),u=ye(ee(s),s.handleTracksChange);return o.addEventListener("change",u),s.on("dispose",function(){o.removeEventListener("change",u)}),s}var r=t.prototype;return r.handleTracksChange=function(e){for(var i=this.player().textTracks(),s=!1,o=0,u=i.length;o<u;o++){var l=i[o];if(l.kind!==this.kind_&&l.mode==="showing"){s=!0;break}}s?this.disable():this.enable()},r.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ii);wo.prototype.kind_="descriptions";wo.prototype.controlText_="Descriptions";V.registerComponent("DescriptionsButton",wo);var ko=function(a){G._inheritsLoose(t,a);function t(n,e,i){return a.call(this,n,e,i)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildWrapperCSSClass.call(this)},t}(ii);ko.prototype.kind_="subtitles";ko.prototype.controlText_="Subtitles";V.registerComponent("SubtitlesButton",ko);var Po=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e.track={player:n,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",i=a.call(this,n,e)||this,i.addClass("vjs-texttrack-settings"),i.controlText(", opens "+e.kind+" settings dialog"),i}var r=t.prototype;return r.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}($i);V.registerComponent("CaptionSettingsMenuItem",Po);var Io=function(a){G._inheritsLoose(t,a);function t(n,e,i){return a.call(this,n,e,i)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-captions-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Po(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),a.prototype.createItems.call(this,e)},t}(ii);Io.prototype.kind_="captions";Io.prototype.controlText_="Captions";V.registerComponent("CaptionsButton",Io);var af=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(e,i,s){var o=a.prototype.createEl.call(this,e,i,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(u.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(ne("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},t}($i);V.registerComponent("SubsCapsMenuItem",af);var Lo=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,i.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(i.player_.language_)>-1&&(i.label_="captions"),i.menuButton_.controlText(Ee(i.label_)),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Po(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=a.prototype.createItems.call(this,e,af),e},t}(ii);Lo.prototype.kinds_=["captions","subtitles"];Lo.prototype.controlText_="Subtitles";V.registerComponent("SubsCapsButton",Lo);var sf=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.track,o=n.audioTracks();e.label=s.label||s.language||"Unknown",e.selected=s.enabled,i=a.call(this,n,e)||this,i.track=s,i.addClass("vjs-"+s.kind+"-menu-item");var u=function(){for(var c=arguments.length,p=new Array(c),m=0;m<c;m++)p[m]=arguments[m];i.handleTracksChange.apply(ee(i),p)};return o.addEventListener("change",u),i.on("dispose",function(){o.removeEventListener("change",u)}),i}var r=t.prototype;return r.createEl=function(e,i,s){var o=a.prototype.createEl.call(this,e,i,s),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(u.appendChild(ne("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(ne("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},r.handleClick=function(e){if(a.prototype.handleClick.call(this,e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var i=this.player_.audioTracks(),s=0;s<i.length;s++){var o=i[s];o!==this.track&&(o.enabled=o===this.track)}},r.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(zi);V.registerComponent("AudioTrackMenuItem",sf);var of=function(a){G._inheritsLoose(t,a);function t(n,e){return e===void 0&&(e={}),e.tracks=n.audioTracks(),a.call(this,n,e)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-audio-button "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var i=this.player_.audioTracks(),s=0;s<i.length;s++){var o=i[s];e.push(new sf(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return e},t}(Ao);of.prototype.controlText_="Audio Track";V.registerComponent("AudioTrackButton",of);var Oo=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.rate,o=parseFloat(s,10);return e.label=s,e.selected=o===n.playbackRate(),e.selectable=!0,e.multiSelectable=!1,i=a.call(this,n,e)||this,i.label=s,i.rate=o,i.on(n,"ratechange",function(u){return i.update(u)}),i}var r=t.prototype;return r.handleClick=function(e){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},r.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(zi);Oo.prototype.contentElType="button";V.registerComponent("PlaybackRateMenuItem",Oo);var uf=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.menuButton_.el_.setAttribute("aria-describedby",i.labelElId_),i.updateVisibility(),i.updateLabel(),i.on(n,"loadstart",function(s){return i.updateVisibility(s)}),i.on(n,"ratechange",function(s){return i.updateLabel(s)}),i.on(n,"playbackrateschange",function(s){return i.handlePlaybackRateschange(s)}),i}var r=t.prototype;return r.createEl=function(){var e=a.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ne("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e},r.dispose=function(){this.labelEl_=null,a.prototype.dispose.call(this)},r.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){for(var e=this.playbackRates(),i=[],s=e.length-1;s>=0;s--)i.push(new Oo(this.player(),{rate:e[s]+"x"}));return i},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){var i=this.player().playbackRate(),s=this.playbackRates(),o=s.indexOf(i),u=(o+1)%s.length;this.player().playbackRate(s[u])},r.handlePlaybackRateschange=function(e){this.update()},r.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Co);uf.prototype.controlText_="Playback Rate";V.registerComponent("PlaybackRateMenuButton",uf);var lf=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(e,i,s){return e===void 0&&(e="div"),i===void 0&&(i={}),s===void 0&&(s={}),i.className||(i.className=this.buildCSSClass()),a.prototype.createEl.call(this,e,i,s)},t}(V);V.registerComponent("Spacer",lf);var ry=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(lf);V.registerComponent("CustomControlSpacer",ry);var Kn=function(a){G._inheritsLoose(t,a);function t(){return a.apply(this,arguments)||this}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(V);Kn.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in W&&Kn.prototype.options_.children.splice(Kn.prototype.options_.children.length-1,0,"pictureInPictureToggle");V.registerComponent("ControlBar",Kn);var df=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return i=a.call(this,n,e)||this,i.on(n,"error",function(s){return i.open(s)}),i}var r=t.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(ei);df.prototype.options_=ht({},ei.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});V.registerComponent("ErrorDisplay",df);var rs="vjs-text-track-settings",Dl=["#000","Black"],wl=["#00F","Blue"],kl=["#0FF","Cyan"],Pl=["#0F0","Green"],Il=["#F0F","Magenta"],Ll=["#F00","Red"],Ol=["#FFF","White"],Fl=["#FF0","Yellow"],is=["1","Opaque"],ns=["0.5","Semi-Transparent"],Rl=["0","Transparent"],lr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Dl,Ol,Ll,Pl,wl,Fl,Il,kl]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[is,ns,Rl]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ol,Dl,Ll,Pl,wl,Fl,Il,kl]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[is,ns]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Rl,ns,is]}};lr.windowColor.options=lr.backgroundColor.options;function cf(a,t){if(t&&(a=t(a)),a&&a!=="none")return a}function iy(a,t){var r=a.options[a.options.selectedIndex].value;return cf(r,t)}function ny(a,t,r){if(t){for(var n=0;n<a.options.length;n++)if(cf(a.options[n].value,r)===t){a.selectedIndex=n;break}}}var ay=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e.temporary=!1,i=a.call(this,n,e)||this,i.updateDisplay=i.updateDisplay.bind(ee(i)),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.endDialog=ne("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),e.persistTextTrackSettings===void 0&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.on(i.$(".vjs-done-button"),"click",function(){i.saveSettings(),i.close()}),i.on(i.$(".vjs-default-button"),"click",function(){i.setDefaults(),i.updateDisplay()}),Mr(lr,function(s){i.on(i.$(s.selector),"change",i.updateDisplay)}),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}var r=t.prototype;return r.dispose=function(){this.endDialog=null,a.prototype.dispose.call(this)},r.createElSelect_=function(e,i,s){var o=this;i===void 0&&(i=""),s===void 0&&(s="label");var u=lr[e],l=u.id.replace("%s",this.id_),c=[i,l].join(" ").trim();return["<"+s+' id="'+l+'" class="'+(s==="label"?"vjs-label":"")+'">',this.localize(u.label),"</"+s+">",'<select aria-labelledby="'+c+'">'].concat(u.options.map(function(p){var m=l+"-"+p[1].replace(/\W+/g,"");return['<option id="'+m+'" value="'+p[0]+'" ','aria-labelledby="'+c+" "+m+'">',o.localize(p[1]),"</option>"].join("")})).concat("</select>").join("")},r.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},r.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},r.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},r.createElColors_=function(){return ne("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return ne("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},r.createElControls_=function(){var e=this.localize("restore all settings to the default values");return ne("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var e=this;return $v(lr,function(i,s,o){var u=iy(e.$(s.selector),s.parser);return u!==void 0&&(i[o]=u),i},{})},r.setValues=function(e){var i=this;Mr(lr,function(s,o){ny(i.$(s.selector),e[o],s.parser)})},r.setDefaults=function(){var e=this;Mr(lr,function(i){var s=i.hasOwnProperty("default")?i.default:0;e.$(i.selector).selectedIndex=s})},r.restoreSettings=function(){var e;try{e=JSON.parse(A.localStorage.getItem(rs))}catch(i){ie.warn(i)}e&&this.setValues(e)},r.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?A.localStorage.setItem(rs,JSON.stringify(e)):A.localStorage.removeItem(rs)}catch(i){ie.warn(i)}}},r.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,i=e&&e.subsCapsButton,s=e&&e.captionsButton;i?i.focus():s&&s.focus()},t}(ei);V.registerComponent("TextTrackSettings",ay);var sy=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=e.ResizeObserver||A.ResizeObserver;e.ResizeObserver===null&&(s=!1);var o=ve({createEl:!s,reportTouchActivity:!1},e);return i=a.call(this,n,o)||this,i.ResizeObserver=e.ResizeObserver||A.ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=n0(function(){i.resizeHandler()},100,!1,ee(i)),s?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(n.el())):(i.loadListener_=function(){if(!(!i.el_||!i.el_.contentWindow)){var u=i.debouncedHandler_,l=i.unloadListener_=function(){Be(this,"resize",u),Be(this,"unload",l),l=null};nt(i.el_.contentWindow,"unload",l),nt(i.el_.contentWindow,"resize",u)}},i.one("load",i.loadListener_)),i}var r=t.prototype;return r.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},r.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,a.prototype.dispose.call(this)},t}(V);V.registerComponent("ResizeManager",sy);var oy={trackingThreshold:20,liveTolerance:15},uy=function(a){G._inheritsLoose(t,a);function t(n,e){var i,s=ve(oy,e,{createEl:!1});return i=a.call(this,n,s)||this,i.handleVisibilityChange_=function(o){return i.handleVisibilityChange(o)},i.trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(o){return i.handlePlay(o)},i.handleFirstTimeupdate_=function(o){return i.handleFirstTimeupdate(o)},i.handleSeeked_=function(o){return i.handleSeeked(o)},i.seekToLiveEdge_=function(o){return i.seekToLiveEdge(o)},i.reset_(),i.on(i.player_,"durationchange",function(o){return i.handleDurationchange(o)}),i.on(i.player_,"canplay",function(){return i.toggleTracking()}),ji&&"hidden"in W&&"visibilityState"in W&&i.on(W,"visibilitychange",i.handleVisibilityChange_),i}var r=t.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(W.hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var e=this.player_.seekable();if(!(!e||!e.length)){var i=Number(A.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+s;var o=this.liveCurrentTime(),u=this.player_.currentTime(),l=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-u)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(l=!1),l!==this.behindLiveEdge_&&(this.behindLiveEdge_=l,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,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_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.end(s));return i.length?i.sort()[i.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),i=[],s=e?e.length:0;s--;)i.push(e.start(s));return i.length?i.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(W,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),a.prototype.dispose.call(this)},t}(V);V.registerComponent("LiveTracker",uy);var As=function(t){var r=t.el();if(r.hasAttribute("src"))return t.triggerSourceset(r.src),!0;var n=t.$$("source"),e=[],i="";if(!n.length)return!1;for(var s=0;s<n.length;s++){var o=n[s].src;o&&e.indexOf(o)===-1&&e.push(o)}return e.length?(e.length===1&&(i=e[0]),t.triggerSourceset(i),!0):!1},ly=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(t){var r=W.createElement(this.nodeName.toLowerCase());r.innerHTML=t;for(var n=W.createDocumentFragment();r.childNodes.length;)n.appendChild(r.childNodes[0]);return this.innerText="",A.Element.prototype.appendChild.call(this,n),this.innerHTML}}),ff=function(t,r){for(var n={},e=0;e<t.length&&(n=Object.getOwnPropertyDescriptor(t[e],r),!(n&&n.set&&n.get));e++);return n.enumerable=!0,n.configurable=!0,n},dy=function(t){return ff([t.el(),A.HTMLMediaElement.prototype,A.Element.prototype,ly],"innerHTML")},Ml=function(t){var r=t.el();if(!r.resetSourceWatch_){var n={},e=dy(t),i=function(o){return function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];var p=o.apply(r,l);return As(t),p}};["append","appendChild","insertAdjacentHTML"].forEach(function(s){r[s]&&(n[s]=r[s],r[s]=i(n[s]))}),Object.defineProperty(r,"innerHTML",ve(e,{set:i(e.set)})),r.resetSourceWatch_=function(){r.resetSourceWatch_=null,Object.keys(n).forEach(function(s){r[s]=n[s]}),Object.defineProperty(r,"innerHTML",e)},t.one("sourceset",r.resetSourceWatch_)}},cy=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Bc(A.Element.prototype.getAttribute.call(this,"src")):""},set:function(t){return A.Element.prototype.setAttribute.call(this,"src",t),t}}),fy=function(t){return ff([t.el(),A.HTMLMediaElement.prototype,cy],"src")},hy=function(t){if(t.featuresSourceset){var r=t.el();if(!r.resetSourceset_){var n=fy(t),e=r.setAttribute,i=r.load;Object.defineProperty(r,"src",ve(n,{set:function(o){var u=n.set.call(r,o);return t.triggerSourceset(r.src),u}})),r.setAttribute=function(s,o){var u=e.call(r,s,o);return/src/i.test(s)&&t.triggerSourceset(r.src),u},r.load=function(){var s=i.call(r);return As(t)||(t.triggerSourceset(""),Ml(t)),s},r.currentSrc?t.triggerSourceset(r.currentSrc):As(t)||Ml(t),r.resetSourceset_=function(){r.resetSourceset_=null,r.load=i,r.setAttribute=e,Object.defineProperty(r,"src",n),r.resetSourceWatch_&&r.resetSourceWatch_()}}}},Fo=function(t,r,n,e){e===void 0&&(e=!0);var i=function(u){return Object.defineProperty(t,r,{value:u,enumerable:!0,writable:!0})},s={configurable:!0,enumerable:!0,get:function(){var u=n();return i(u),u}};return e&&(s.set=i),Object.defineProperty(t,r,s)},K=function(a){G._inheritsLoose(t,a);function t(n,e){var i;i=a.call(this,n,e)||this;var s=n.source,o=!1;if(i.featuresVideoFrameCallback=i.featuresVideoFrameCallback&&i.el_.tagName==="VIDEO",s&&(i.el_.currentSrc!==s.src||n.tag&&n.tag.initNetworkState_===3)?i.setSource(s):i.handleLateInit_(i.el_),n.enableSourceset&&i.setupSourcesetHandling_(),i.isScrubbing_=!1,i.el_.hasChildNodes()){for(var u=i.el_.childNodes,l=u.length,c=[];l--;){var p=u[l],m=p.nodeName.toLowerCase();m==="track"&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(p),i.remoteTextTracks().addTrack(p.track),i.textTracks().addTrack(p.track),!o&&!i.el_.hasAttribute("crossorigin")&&xa(p.src)&&(o=!0)):c.push(p))}for(var _=0;_<c.length;_++)i.el_.removeChild(c[_])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&o&&ie.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
|
37
|
+
This may prevent text tracks from loading.`),i.restoreMetadataTracksInIOSNativePlayer_(),(Wr||uo||cc)&&n.nativeControlsForTouch===!0&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}var r=t.prototype;return r.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,a.prototype.dispose.call(this)},r.setupSourcesetHandling_=function(){hy(this)},r.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),i,s=function(){i=[];for(var l=0;l<e.length;l++){var c=e[l];c.kind==="metadata"&&i.push({track:c,storedMode:c.mode})}};s(),e.addEventListener("change",s),this.on("dispose",function(){return e.removeEventListener("change",s)});var o=function u(){for(var l=0;l<i.length;l++){var c=i[l];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}e.removeEventListener("change",u)};this.on("webkitbeginfullscreen",function(){e.removeEventListener("change",s),e.removeEventListener("change",o),e.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",o)})},r.overrideNative_=function(e,i){var s=this;if(i===this["featuresNative"+e+"Tracks"]){var o=e.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(u){var l=s.el()[o+"Tracks"];l.removeEventListener(u,s[o+"TracksListeners_"][u])}),this["featuresNative"+e+"Tracks"]=!i,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},r.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},r.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},r.proxyNativeTracksForType_=function(e){var i=this,s=ot[e],o=this.el()[s.getterName],u=this[s.getterName]();if(!(!this["featuresNative"+s.capitalName+"Tracks"]||!o||!o.addEventListener)){var l={change:function(m){var _={type:"change",target:u,currentTarget:u,srcElement:u};u.trigger(_),e==="text"&&i[Kr.remoteText.getterName]().trigger(_)},addtrack:function(m){u.addTrack(m.track)},removetrack:function(m){u.removeTrack(m.track)}},c=function(){for(var m=[],_=0;_<u.length;_++){for(var b=!1,S=0;S<o.length;S++)if(o[S]===u[_]){b=!0;break}b||m.push(u[_])}for(;m.length;)u.removeTrack(m.shift())};this[s.getterName+"Listeners_"]=l,Object.keys(l).forEach(function(p){var m=l[p];o.addEventListener(p,m),i.on("dispose",function(_){return o.removeEventListener(p,m)})}),this.on("loadstart",c),this.on("dispose",function(p){return i.off("loadstart",c)})}},r.proxyNativeTracks_=function(){var e=this;ot.names.forEach(function(i){e.proxyNativeTracksForType_(i)})},r.createEl=function(){var e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=W.createElement("video");var s=this.options_.tag&&It(this.options_.tag),o=ve({},s);(!Wr||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,_c(e,be(o,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Gr(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var u=["loop","muted","playsinline","autoplay"],l=0;l<u.length;l++){var c=u[l],p=this.options_[c];typeof p<"u"&&(p?Gr(e,c,c):va(e,c),e[c]=p)}return e},r.handleLateInit_=function(e){if(!(e.networkState===0||e.networkState===3)){if(e.readyState===0){var i=!1,s=function(){i=!0};this.on("loadstart",s);var o=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",s),this.off("loadedmetadata",o),i||this.trigger("loadstart")});return}var u=["loadstart"];u.push("loadedmetadata"),e.readyState>=2&&u.push("loadeddata"),e.readyState>=3&&u.push("canplay"),e.readyState>=4&&u.push("canplaythrough"),this.ready(function(){u.forEach(function(l){this.trigger(l)},this)})}},r.setScrubbing=function(e){this.isScrubbing_=e},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&ga?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){ie(i,"Video is not ready. (Video.js)")}},r.duration=function(){var e=this;if(this.el_.duration===1/0&&jt&&Wt&&this.el_.currentTime===0){var i=function s(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",s))};return this.on("timeupdate",i),NaN}return this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var i=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},s=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",i),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",s),this.on("dispose",function(){e.off("webkitbeginfullscreen",s),e.off("webkitendfullscreen",i)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=A.navigator&&A.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},r.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Tt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},r.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):a.prototype.requestVideoFrameCallback.call(this,e)},r.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):a.prototype.cancelVideoFrameCallback.call(this,e)},r.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},r.reset=function(){t.resetMediaElement(this.el_)},r.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(e){this.el_.controls=!!e},r.addTextTrack=function(e,i,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,s):a.prototype.addTextTrack.call(this,e,i,s)},r.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,e);var i=W.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i},r.addRemoteTextTrack=function(e,i){var s=a.prototype.addRemoteTextTrack.call(this,e,i);return this.featuresNativeTextTracks&&this.el().appendChild(s),s},r.removeRemoteTextTrack=function(e){if(a.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var i=this.$$("track"),s=i.length;s--;)(e===i[s]||e===i[s].track)&&this.el().removeChild(i[s])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A.performance&&typeof A.performance.now=="function"?e.creationTime=A.performance.now():A.performance&&A.performance.timing&&typeof A.performance.timing.navigationStart=="number"&&(e.creationTime=A.Date.now()-A.performance.timing.navigationStart),e},t}(he);Fo(K,"TEST_VID",function(){if(Qr()){var a=W.createElement("video"),t=W.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",a.appendChild(t),a}});K.isSupported=function(){try{K.TEST_VID.volume=.5}catch{return!1}return!!(K.TEST_VID&&K.TEST_VID.canPlayType)};K.canPlayType=function(a){return K.TEST_VID.canPlayType(a)};K.canPlaySource=function(a,t){return K.canPlayType(a.type)};K.canControlVolume=function(){try{var a=K.TEST_VID.volume;K.TEST_VID.volume=a/2+.1;var t=a!==K.TEST_VID.volume;return t&&Ke?(A.setTimeout(function(){K&&K.prototype&&(K.prototype.featuresVolumeControl=a!==K.TEST_VID.volume)}),!1):t}catch{return!1}};K.canMuteVolume=function(){try{var a=K.TEST_VID.muted;return K.TEST_VID.muted=!a,K.TEST_VID.muted?Gr(K.TEST_VID,"muted","muted"):va(K.TEST_VID,"muted","muted"),a!==K.TEST_VID.muted}catch{return!1}};K.canControlPlaybackRate=function(){if(jt&&Wt&&hc<58)return!1;try{var a=K.TEST_VID.playbackRate;return K.TEST_VID.playbackRate=a/2+.1,a!==K.TEST_VID.playbackRate}catch{return!1}};K.canOverrideAttributes=function(){try{var a=function(){};Object.defineProperty(W.createElement("video"),"src",{get:a,set:a}),Object.defineProperty(W.createElement("audio"),"src",{get:a,set:a}),Object.defineProperty(W.createElement("video"),"innerHTML",{get:a,set:a}),Object.defineProperty(W.createElement("audio"),"innerHTML",{get:a,set:a})}catch{return!1}return!0};K.supportsNativeTextTracks=function(){return ga||Ke&&Wt};K.supportsNativeVideoTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.videoTracks)};K.supportsNativeAudioTracks=function(){return!!(K.TEST_VID&&K.TEST_VID.audioTracks)};K.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(a){var t=a[0],r=a[1];Fo(K.prototype,t,function(){return K[r]()},!0)});K.prototype.featuresVolumeControl=K.canControlVolume();K.prototype.movingMediaElementInDOM=!Ke;K.prototype.featuresFullscreenResize=!0;K.prototype.featuresProgressEvents=!0;K.prototype.featuresTimeupdateEvents=!0;K.prototype.featuresVideoFrameCallback=!!(K.TEST_VID&&K.TEST_VID.requestVideoFrameCallback);var Xn;K.patchCanPlayType=function(){ao>=4&&!fc&&!Wt&&(Xn=K.TEST_VID&&K.TEST_VID.constructor.prototype.canPlayType,K.TEST_VID.constructor.prototype.canPlayType=function(a){var t=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return a&&t.test(a)?"maybe":Xn.call(this,a)})};K.unpatchCanPlayType=function(){var a=K.TEST_VID.constructor.prototype.canPlayType;return Xn&&(K.TEST_VID.constructor.prototype.canPlayType=Xn),a};K.patchCanPlayType();K.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};K.resetMediaElement=function(a){if(a){for(var t=a.querySelectorAll("source"),r=t.length;r--;)a.removeChild(t[r]);a.removeAttribute("src"),typeof a.load=="function"&&function(){try{a.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]||this.el_.hasAttribute(a)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t,t?this.el_.setAttribute(a,a):this.el_.removeAttribute(a)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(a){K.prototype["set"+Ee(a)]=function(t){this.el_[a]=t}});["pause","load","play"].forEach(function(a){K.prototype[a]=function(){return this.el_[a]()}});he.withSourceHandlers(K);K.nativeSourceHandler={};K.nativeSourceHandler.canPlayType=function(a){try{return K.TEST_VID.canPlayType(a)}catch{return""}};K.nativeSourceHandler.canHandleSource=function(a,t){if(a.type)return K.nativeSourceHandler.canPlayType(a.type);if(a.src){var r=go(a.src);return K.nativeSourceHandler.canPlayType("video/"+r)}return""};K.nativeSourceHandler.handleSource=function(a,t,r){t.setSrc(a.src)};K.nativeSourceHandler.dispose=function(){};K.registerSourceHandler(K.nativeSourceHandler);he.registerTech("Html5",K);var hf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],as={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ds=["tiny","xsmall","small","medium","large","xlarge","huge"],Rn={};Ds.forEach(function(a){var t=a.charAt(0)==="x"?"x-"+a.substring(1):a;Rn[a]="vjs-layout-"+t});var py={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ae=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(n.id=n.id||e.id||"vjs_video_"+Gt(),e=be(t.getTagSettings(n),e),e.initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if(typeof n.closest=="function"){var o=n.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var u=n;u&&u.nodeType===1;){if(It(u).hasOwnProperty("lang")){e.language=u.getAttribute("lang");break}u=u.parentNode}if(s=a.call(this,null,e,i)||this,s.boundDocumentFullscreenChange_=function(m){return s.documentFullscreenChange_(m)},s.boundFullWindowOnEscKey_=function(m){return s.fullWindowOnEscKey(m)},s.boundUpdateStyleEl_=function(m){return s.updateStyleEl_(m)},s.boundApplyInitTime_=function(m){return s.applyInitTime_(m)},s.boundUpdateCurrentBreakpoint_=function(m){return s.updateCurrentBreakpoint_(m)},s.boundHandleTechClick_=function(m){return s.handleTechClick_(m)},s.boundHandleTechDoubleClick_=function(m){return s.handleTechDoubleClick_(m)},s.boundHandleTechTouchStart_=function(m){return s.handleTechTouchStart_(m)},s.boundHandleTechTouchMove_=function(m){return s.handleTechTouchMove_(m)},s.boundHandleTechTouchEnd_=function(m){return s.handleTechTouchEnd_(m)},s.boundHandleTechTap_=function(m){return s.handleTechTap_(m)},s.isFullscreen_=!1,s.log=uc(s.id_),s.fsApi_=Wn,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(s.tag=n,s.tagAttributes=n&&It(n),s.language(s.options_.language),e.languages){var l={};Object.getOwnPropertyNames(e.languages).forEach(function(m){l[m.toLowerCase()]=e.languages[m]}),s.languages_=l}else s.languages_=t.prototype.options_.languages;s.resetCache_(),s.poster_=e.poster||"",s.controls_=!!e.controls,n.controls=!1,n.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],n.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(m){if(typeof s[m]!="function")throw new Error('plugin "'+m+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),ho(ee(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(nt(W,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var c=ve(s.options_);e.plugins&&Object.keys(e.plugins).forEach(function(m){s[m](e.plugins[m])}),e.debug&&s.debug(!0),s.options_.playerOptions=c,s.middleware_=[],s.playbackRates(e.playbackRates),s.initChildren(),s.isAudio(n.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),Wr&&s.addClass("vjs-touch-enabled"),Ke||s.addClass("vjs-workinghover"),t.players[s.id_]=ee(s);var p=ac.split(".")[0];return s.addClass("vjs-v"+p),s.userActive(!0),s.reportUserActivity(),s.one("play",function(m){return s.listenForUserActivity_(m)}),s.on("stageclick",function(m){return s.handleStageClick_(m)}),s.on("keydown",function(m){return s.handleKeyDown(m)}),s.on("languagechange",function(m){return s.handleLanguagechange(m)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}var r=t.prototype;return r.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Be(W,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Be(W,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),F0(this),je.names.forEach(function(i){var s=je[i],o=e[s.getterName]();o&&o.off&&o.off()}),a.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var e=this.tag,i,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";s?i=this.el_=e.parentNode:o||(i=this.el_=a.prototype.createEl.call(this,"div"));var u=It(e);if(o){for(i=this.el_=e,e=this.tag=W.createElement("video");i.children.length;)e.appendChild(i.firstChild);fr(i,"video-js")||Rt(i,"video-js"),i.appendChild(e),s=this.playerElIngest_=i,Object.keys(i).forEach(function(b){try{e[b]=i[b]}catch{}})}if(e.setAttribute("tabindex","-1"),u.tabindex="-1",(ji||Wt&&pc)&&(e.setAttribute("role","application"),u.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in u&&delete u.width,"height"in u&&delete u.height,Object.getOwnPropertyNames(u).forEach(function(b){o&&b==="class"||i.setAttribute(b,u[b]),o&&e.setAttribute(b,u[b])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused"),A.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=kc("vjs-styles-dimensions");var l=Yt(".vjs-styles-defaults"),c=Yt("head");c.insertBefore(this.styleEl_,l?l.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var p=e.getElementsByTagName("a"),m=0;m<p.length;m++){var _=p.item(m);Rt(_,"vjs-hidden"),_.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!s&&e.parentNode.insertBefore(i,e),_s(e,i),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=i,i},r.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");if(e!=="anonymous"&&e!=="use-credentials"){ie.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"');return}this.techCall_("setCrossOrigin",e)},r.width=function(e){return this.dimension("width",e)},r.height=function(e){return this.dimension("height",e)},r.dimension=function(e,i){var s=e+"_";if(i===void 0)return this[s]||0;if(i===""||i==="auto"){this[s]=void 0,this.updateStyleEl_();return}var o=parseFloat(i);if(isNaN(o)){ie.error('Improper value "'+i+'" supplied for for '+e);return}this[s]=o,this.updateStyleEl_()},r.fluid=function(e){var i=this;if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Mt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),a0(this,function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},r.fill=function(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},r.aspectRatio=function(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},r.updateStyleEl_=function(){if(A.VIDEOJS_NO_DYNAMIC_STYLE===!0){var e=typeof this.width_=="number"?this.width_:this.options_.width,i=typeof this.height_=="number"?this.height_:this.options_.height,s=this.tech_&&this.tech_.el();s&&(e>=0&&(s.width=e),i>=0&&(s.height=i));return}var o,u,l,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?l=this.aspectRatio_:this.videoWidth()>0?l=this.videoWidth()+":"+this.videoHeight():l="16:9";var p=l.split(":"),m=p[1]/p[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/m:o=this.videoWidth()||300,this.height_!==void 0?u=this.height_:u=o*m,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Pc(this.styleEl_,`
|
|
38
38
|
.`+c+` {
|
|
39
39
|
width: `+o+`px;
|
|
40
40
|
height: `+u+`px;
|
|
@@ -45,7 +45,7 @@ This may prevent text tracks from loading.`),i.restoreMetadataTracksInIOSNativeP
|
|
|
45
45
|
}
|
|
46
46
|
`)},r.loadTech_=function(e,i){var s=this;this.tech_&&this.unloadTech_();var o=Ee(e),u=e.charAt(0).toLowerCase()+e.slice(1);o!=="Html5"&&this.tag&&(he.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);var c={source:i,autoplay:l,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+u+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};je.names.forEach(function(m){var _=je[m];c[_.getterName]=s[_.privateName]}),be(c,this.options_[o]),be(c,this.options_[u]),be(c,this.options_[e.toLowerCase()]),this.tag&&(c.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var p=he.getTech(e);if(!p)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new p(c),this.tech_.ready(ye(this,this.handleTechReady_),!0),vl.jsonToTextTracks(this.textTracksJson_||[],this.tech_),hf.forEach(function(m){s.on(s.tech_,m,function(_){return s["handleTech"+Ee(m)+"_"](_)})}),Object.keys(as).forEach(function(m){s.on(s.tech_,m,function(_){if(s.tech_.playbackRate()===0&&s.tech_.seeking()){s.queuedCallbacks_.push({callback:s["handleTech"+as[m]+"_"].bind(s),event:_});return}s["handleTech"+as[m]+"_"](_)})}),this.on(this.tech_,"loadstart",function(m){return s.handleTechLoadStart_(m)}),this.on(this.tech_,"sourceset",function(m){return s.handleTechSourceset_(m)}),this.on(this.tech_,"waiting",function(m){return s.handleTechWaiting_(m)}),this.on(this.tech_,"ended",function(m){return s.handleTechEnded_(m)}),this.on(this.tech_,"seeking",function(m){return s.handleTechSeeking_(m)}),this.on(this.tech_,"play",function(m){return s.handleTechPlay_(m)}),this.on(this.tech_,"firstplay",function(m){return s.handleTechFirstPlay_(m)}),this.on(this.tech_,"pause",function(m){return s.handleTechPause_(m)}),this.on(this.tech_,"durationchange",function(m){return s.handleTechDurationChange_(m)}),this.on(this.tech_,"fullscreenchange",function(m,_){return s.handleTechFullscreenChange_(m,_)}),this.on(this.tech_,"fullscreenerror",function(m,_){return s.handleTechFullscreenError_(m,_)}),this.on(this.tech_,"enterpictureinpicture",function(m){return s.handleTechEnterPictureInPicture_(m)}),this.on(this.tech_,"leavepictureinpicture",function(m){return s.handleTechLeavePictureInPicture_(m)}),this.on(this.tech_,"error",function(m){return s.handleTechError_(m)}),this.on(this.tech_,"posterchange",function(m){return s.handleTechPosterChange_(m)}),this.on(this.tech_,"textdata",function(m){return s.handleTechTextData_(m)}),this.on(this.tech_,"ratechange",function(m){return s.handleTechRateChange_(m)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(o!=="Html5"||!this.tag)&&_s(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var e=this;je.names.forEach(function(i){var s=je[i];e[s.privateName]=e[s.getterName]()}),this.textTracksJson_=vl.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(e){return e===void 0&&ie.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
|
47
47
|
See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
48
|
-
`),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var i=this;if(!(!this.tech_||typeof e!="string")){var s=function(){var l=i.muted();i.muted(!0);var c=function(){i.muted(l)};i.playTerminatedQueue_.push(c);var p=i.play();if(Ci(p))return p.catch(function(m){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(m||""))})},o;if(e==="any"&&!this.muted()?(o=this.play(),Ci(o)&&(o=o.catch(s))):e==="muted"&&!this.muted()?o=s():o=this.play(),!!Ci(o))return o.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){e===void 0&&(e="");var i=e,s="";typeof i!="string"&&(i=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!s&&(s=N0(this,i)),this.cache_.source=ve({},e,{src:i,type:s});for(var o=this.cache_.sources.filter(function(_){return _.src&&_.src===i}),u=[],l=this.$$("source"),c=[],p=0;p<l.length;p++){var m=It(l[p]);u.push(m),m.src&&m.src===i&&c.push(m.src)}c.length&&!o.length?this.cache_.sources=u:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=i},r.handleTechSourceset_=function(e){var i=this;if(!this.changingSrc_){var s=function(c){return i.updateSourceCaches_(c)},o=this.currentSource().src,u=e.src;o&&!/^blob:/.test(o)&&/^blob:/.test(u)&&(!this.lastSource_||this.lastSource_.tech!==u&&this.lastSource_.player!==o)&&(s=function(){}),s(u),e.src||this.tech_.any(["sourceset","loadstart"],function(l){if(l.type!=="sourceset"){var c=i.techGet("currentSrc");i.lastSource_.tech=c,i.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},r.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},r.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},r.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime(),s=function o(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))};this.on("timeupdate",s)},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(ie.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Tt(this.play()):this.pause())},r.handleTechDoubleClick_=function(e){if(this.controls_){var i=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(s){return s.contains(e.target)});i||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var i=e.target.player;if(!(i&&i!==this)){var s=this.el(),o=W[this.fsApi_.fullscreenElement]===s;!o&&s.matches?o=s.matches(":"+this.fsApi_.fullscreen):!o&&s.msMatchesSelector&&(o=s.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},r.handleTechFullscreenChange_=function(e,i){var s=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){s.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},r.handleTechFullscreenError_=function(e,i){this.trigger("fullscreenerror",i)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,i){this.ready(function(){if(e in L0)return P0(this.middleware_,this.tech_,e,i);if(e in Sl)return xl(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(s){throw ie(s),s}},!0)},r.techGet_=function(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in I0)return k0(this.middleware_,this.tech_,e);if(e in Sl)return xl(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw this.tech_[e]===void 0?(ie("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",i),i):i.name==="TypeError"?(ie("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(ie(i),i)}}},r.play=function(){var e=this,i=this.options_.Promise||A.Promise;return i?new i(function(s){e.play_(s)}):this.play_()},r.play_=function(e){var i=this;e===void 0&&(e=Tt),this.playCallbacks_.push(e);var s=!!(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!s){this.waitToPlay_=function(u){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!s&&(ga||Ke)&&this.load();return}var o=this.techGet_("play");o===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})},r.runPlayCallbacks_=function(e){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(s){s(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||fr(0,0)},r.scrubbing=function(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){if(typeof e<"u"){if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=fr(0,0)),e},r.bufferedPercent=function(){return Mc(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),i=this.duration(),s=e.end(e.length-1);return s>i&&(s=i),s},r.volume=function(e){var i;if(e!==void 0){i=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i},r.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},r.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(e!==void 0){var i=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},r.requestFullscreen=function(e){var i=this.options_.Promise||A.Promise;if(i){var s=this;return new i(function(o,u){function l(){s.off("fullscreenerror",p),s.off("fullscreenchange",c)}function c(){l(),o()}function p(_,b){l(),u(b)}s.one("fullscreenchange",c),s.one("fullscreenerror",p);var m=s.requestFullscreenHelper_(e);m&&(m.then(l,l),m.then(o,u))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var i=this,s;if(this.fsApi_.prefixed||(s=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(s=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](s);return o&&o.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||A.Promise;if(e){var i=this;return new e(function(s,o){function u(){i.off("fullscreenerror",c),i.off("fullscreenchange",l)}function l(){u(),s()}function c(m,_){u(),o(_)}i.one("fullscreenchange",l),i.one("fullscreenerror",c);var p=i.exitFullscreenHelper_();p&&(p.then(u,u),p.then(s,o))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var i=W[this.fsApi_.exitFullscreen]();return i&&Tt(i.then(function(){return e.isFullscreen(!1)})),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=W.documentElement.style.overflow,nt(W,"keydown",this.boundFullWindowOnEscKey_),W.documentElement.style.overflow="hidden",Rt(W.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){te.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Be(W,"keydown",this.boundFullWindowOnEscKey_),W.documentElement.style.overflow=this.docOrigOverflow,Wi(W.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in W&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in W)return W.exitPictureInPicture()},r.handleKeyDown=function(e){var i=this.options_.userActions;if(!(!i||!i.hotkeys)){var s=function(u){var l=u.tagName.toLowerCase();if(u.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(l==="input")return c.indexOf(u.type)===-1;var p=["textarea"];return p.indexOf(l)!==-1};s(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,e):this.handleHotkeys(e))}},r.handleHotkeys=function(e){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},s=i.fullscreenKey,o=s===void 0?function(S){return te.isEventKey(S,"f")}:s,u=i.muteKey,l=u===void 0?function(S){return te.isEventKey(S,"m")}:u,c=i.playPauseKey,p=c===void 0?function(S){return te.isEventKey(S,"k")||te.isEventKey(S,"Space")}:c;if(o.call(this,e)){e.preventDefault(),e.stopPropagation();var m=V.getComponent("FullscreenToggle");W[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation();var _=V.getComponent("MuteToggle");_.prototype.handleClick.call(this,e)}else if(p.call(this,e)){e.preventDefault(),e.stopPropagation();var b=V.getComponent("PlayToggle");b.prototype.handleClick.call(this,e)}},r.canPlayType=function(e){for(var i,s=0,o=this.options_.techOrder;s<o.length;s++){var u=o[s],l=he.getTech(u);if(l||(l=V.getComponent(u)),!l){ie.error('The "'+u+'" tech is undefined. Skipped browser support check for that tech.');continue}if(l.isSupported()&&(i=l.canPlayType(e),i))return i}return""},r.selectSource=function(e){var i=this,s=this.options_.techOrder.map(function(p){return[p,he.getTech(p)]}).filter(function(p){var m=p[0],_=p[1];return _?_.isSupported():(ie.error('The "'+m+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(m,_,b){var S;return m.some(function(x){return _.some(function(k){if(S=b(x,k),S)return!0})}),S},u,l=function(m){return function(_,b){return m(b,_)}},c=function(m,_){var b=m[0],S=m[1];if(S.canPlaySource(_,i.options_[b.toLowerCase()]))return{source:_,tech:b}};return this.options_.sourceOrder?u=o(e,s,l(c)):u=o(s,e,c),u||!1},r.handleSrc_=function(e,i){var s=this;if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=B0(e);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),D0(this,o[0],function(c,p){s.middleware_=p,i||(s.cache_.sources=o),s.updateSourceCaches_(c);var m=s.src_(c);if(m){if(o.length>1)return s.handleSrc_(o.slice(1));s.changingSrc_=!1,s.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),s.triggerReady();return}w0(p,s.tech_)}),this.options_.retryOnError&&o.length>1){var u=function(){s.error(null),s.handleSrc_(o.slice(1),!0)},l=function(){s.off("error",u)};this.one("error",u),this.one("playing",l),this.resetRetryOnError_=function(){s.off("error",u),s.off("playing",l)}}},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var i=this,s=this.selectSource([e]);return s?u0(s.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(s.tech,s.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1):!0},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,i=this.options_.Promise||A.Promise;if(this.paused()||!i)this.doReset_();else{var s=this.play();Tt(s.then(function(){return e.doReset_()}))}},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mt(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},i=e.durationDisplay,s=e.remainingTimeDisplay;i&&i.updateContent(),s&&s.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),i=[];return Object.keys(e).length!==0&&i.push(e),this.cache_.sources||i},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},r.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var i;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),i=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},r.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},r.poster=function(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(e){var i=this;if(e===void 0)return this.error_||null;if(Xt("beforeerror").forEach(function(o){var u=o(i,e);if(!(Vt(u)&&!Array.isArray(u)||typeof u=="string"||typeof u=="number"||u===null)){i.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=u}),this.options_.suppressNotSupportedError&&e&&e.code===4){var s=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],s),this.one("loadstart",function(){this.off(["click","touchstart"],s)});return}if(e===null){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new $e(e),this.addClass("vjs-error"),ie.error("(CODE:"+this.error_.code+" "+$e.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Xt("error").forEach(function(o){return o(i,i.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,i,s,o=ye(this,this.reportUserActivity),u=function(b){(b.screenX!==i||b.screenY!==s)&&(i=b.screenX,s=b.screenY,o())},l=function(){o(),this.clearInterval(e),e=this.setInterval(o,250)},c=function(b){o(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",u),this.on("mouseup",c),this.on("mouseleave",c);var p=this.getChild("controlBar");p&&!Ke&&!jt&&(p.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),p.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var m;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);var _=this.options_.inactivityTimeout;_<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))}},250)},r.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},r.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var i=this.children(),s=this.getChild("ControlBar"),o=s&&s.currentHeight();i.forEach(function(u){u!==s&&u.el_&&!u.hasClass("vjs-hidden")&&(u.hide(),e.audioOnlyCache_.hiddenChildren.push(u))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),s.all(o).then(function(){return i.enableAudioOnlyUI_()})}return s.resolve().then(function(){return i.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.disablePosterModeUI_()})}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},r.addTextTrack=function(e,i,s){if(this.tech_)return this.tech_.addTextTrack(e,i,s)},r.addRemoteTextTrack=function(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)},r.removeRemoteTextTrack=function(e){e===void 0&&(e={});var i=e,s=i.track;if(s||(s=e),this.tech_)return this.tech_.removeRemoteTextTrack(s)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mt(this)&&this.trigger("languagechange"))},r.languages=function(){return ve(t.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=ve(this.options_),i=e.tracks;e.tracks=[];for(var s=0;s<i.length;s++){var o=i[s];o=ve(o),o.player=void 0,e.tracks[s]=o}return e},r.createModal=function(e,i){var s=this;i=i||{},i.content=e||"";var o=new ei(this,i);return this.addChild(o),o.on("dispose",function(){s.removeChild(o)}),o.open(),o},r.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),i=this.currentWidth(),s=0;s<Ds.length;s++){var o=Ds[s],u=this.breakpoints_[o];if(i<=u){if(e===o)return;e&&this.removeClass(Rn[e]),this.addClass(Rn[o]),this.breakpoint_=o;break}}},r.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},r.breakpoints=function(e){return e===void 0?be(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=be({},py,e),this.updateCurrentBreakpoint_(),be(this.breakpoints_))},r.responsive=function(e){if(e===void 0)return this.responsive_;e=!!e;var i=this.responsive_;if(e!==i)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e},r.currentBreakpoint=function(){return this.breakpoint_},r.currentBreakpointClass=function(){return Rn[this.breakpoint_]||""},r.loadMedia=function(e,i){var s=this;if(!(!e||typeof e!="object")){this.reset(),this.cache_.media=ve(e);var o=this.cache_.media,u=o.artwork,l=o.poster,c=o.src,p=o.textTracks;!u&&l&&(this.cache_.media.artwork=[{src:l,type:$n(l)}]),c&&this.src(c),l&&this.poster(l),Array.isArray(p)&&p.forEach(function(m){return s.addRemoteTextTrack(m,!1)}),this.ready(i)}},r.getMedia=function(){if(!this.cache_.media){var e=this.poster(),i=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),function(u){return{kind:u.kind,label:u.label,language:u.language,src:u.src}}),o={src:i,textTracks:s};return e&&(o.poster=e,o.artwork=[{src:o.poster,type:$n(o.poster)}]),o}return ve(this.cache_.media)},t.getTagSettings=function(e){var i={sources:[],tracks:[]},s=It(e),o=s["data-setup"];if(cr(e,"vjs-fill")&&(s.fill=!0),cr(e,"vjs-fluid")&&(s.fluid=!0),o!==null){var u=zp(o||"{}"),l=u[0],c=u[1];l&&ie.error(l),be(s,c)}if(be(i,s),e.hasChildNodes())for(var p=e.childNodes,m=0,_=p.length;m<_;m++){var b=p[m],S=b.nodeName.toLowerCase();S==="source"?i.sources.push(It(b)):S==="track"&&i.tracks.push(It(b))}return i},r.flexNotSupported_=function(){var e=W.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},r.debug=function(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},r.playbackRates=function(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(function(i){return typeof i=="number"})&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(V);je.names.forEach(function(a){var t=je[a];Ae.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}});Ae.prototype.crossorigin=Ae.prototype.crossOrigin;Ae.players={};var gi=A.navigator;Ae.prototype.options_={techOrder:he.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:gi&&(gi.languages&&gi.languages[0]||gi.userLanguage||gi.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(a){Ae.prototype[a]=function(){return this.techGet_(a)}});hf.forEach(function(a){Ae.prototype["handleTech"+Ee(a)+"_"]=function(){return this.trigger(a)}});V.registerComponent("Player",Ae);var Yn="plugin",Nr="activePlugins_",Or={},Qn=function(t){return Or.hasOwnProperty(t)},Mn=function(t){return Qn(t)?Or[t]:void 0},pf=function(t,r){t[Nr]=t[Nr]||{},t[Nr][r]=!0},Jn=function(t,r,n){var e=(n?"before":"")+"pluginsetup";t.trigger(e,r),t.trigger(e+":"+r.name,r)},my=function(t,r){var n=function(){Jn(this,{name:t,plugin:r,instance:null},!0);var i=r.apply(this,arguments);return pf(this,t),Jn(this,{name:t,plugin:r,instance:i}),i};return Object.keys(r).forEach(function(e){n[e]=r[e]}),n},Nl=function(t,r){return r.prototype.name=t,function(){Jn(this,{name:t,plugin:r,instance:null},!0);for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];var s=md(r,[this].concat(e));return this[t]=function(){return s},Jn(this,s.getEventHash()),s}},At=function(){function a(r){if(this.constructor===a)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=r,this.log||(this.log=this.player.log.createLogger(this.name)),ho(this),delete this.trigger,Rc(this,this.constructor.defaultState),pf(r,this.name),this.dispose=this.dispose.bind(this),r.on("dispose",this.dispose)}var t=a.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(n){return n===void 0&&(n={}),n.name=this.name,n.plugin=this.constructor,n.instance=this,n},t.trigger=function(n,e){return e===void 0&&(e={}),Zr(this.eventBusEl_,n,this.getEventHash(e))},t.handleStateChanged=function(n){},t.dispose=function(){var n=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[Nr][n]=!1,this.player=this.state=null,e[n]=Nl(n,Or[n])},a.isBasic=function(n){var e=typeof n=="string"?Mn(n):n;return typeof e=="function"&&!a.prototype.isPrototypeOf(e.prototype)},a.registerPlugin=function(n,e){if(typeof n!="string")throw new Error('Illegal plugin name, "'+n+'", must be a string, was '+typeof n+".");if(Qn(n))ie.warn('A plugin named "'+n+'" already exists. You may want to avoid re-registering plugins!');else if(Ae.prototype.hasOwnProperty(n))throw new Error('Illegal plugin name, "'+n+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+n+'", must be a function, was '+typeof e+".");return Or[n]=e,n!==Yn&&(a.isBasic(e)?Ae.prototype[n]=my(n,e):Ae.prototype[n]=Nl(n,e)),e},a.deregisterPlugin=function(n){if(n===Yn)throw new Error("Cannot de-register base plugin.");Qn(n)&&(delete Or[n],delete Ae.prototype[n])},a.getPlugins=function(n){n===void 0&&(n=Object.keys(Or));var e;return n.forEach(function(i){var s=Mn(i);s&&(e=e||{},e[i]=s)}),e},a.getPluginVersion=function(n){var e=Mn(n);return e&&e.VERSION||""},a}();At.getPlugin=Mn;At.BASE_PLUGIN_NAME=Yn;At.registerPlugin(Yn,At);Ae.prototype.usingPlugin=function(a){return!!this[Nr]&&this[Nr][a]===!0};Ae.prototype.hasPlugin=function(a){return!!Qn(a)};var Bl=!1,gy=function(t,r){r===void 0&&(r={}),Bl||(ie.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),Bl=!0);var n=function(){t.apply(this,arguments)},e={};typeof r=="object"?(r.constructor!==Object.prototype.constructor&&(n=r.constructor),e=r):typeof r=="function"&&(n=r),Fm(n,t),t&&(n.super_=t);for(var i in e)e.hasOwnProperty(i)&&(n.prototype[i]=e[i]);return n},mf=function(t){return t.indexOf("#")===0?t.slice(1):t};function I(a,t,r){var n=I.getPlayer(a);if(n)return t&&ie.warn('Player "'+a+'" is already initialised. Options will not be applied.'),r&&n.ready(r),n;var e=typeof a=="string"?Yt("#"+mf(a)):a;if(!Jr(e))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!e.ownerDocument.defaultView||!e.ownerDocument.body.contains(e))&&ie.warn("The element supplied is not included in the DOM"),t=t||{},t.restoreEl===!0&&(t.restoreEl=(e.parentNode&&e.parentNode.hasAttribute("data-vjs-player")?e.parentNode:e).cloneNode(!0)),Xt("beforesetup").forEach(function(s){var o=s(e,ve(t));if(!Vt(o)||Array.isArray(o)){ie.error("please return an object in beforesetup hooks");return}t=ve(t,o)});var i=V.getComponent("Player");return n=new i(e,t,r),Xt("setup").forEach(function(s){return s(n)}),n}I.hooks_=Lt;I.hooks=Xt;I.hook=jv;I.hookOnce=Wv;I.removeHook=sc;if(A.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Qr()){var wn=Yt(".vjs-styles-defaults");if(!wn){wn=kc("vjs-styles-defaults");var ss=Yt("head");ss&&ss.insertBefore(wn,ss.firstChild),Pc(wn,`
|
|
48
|
+
`),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var i=this;if(!(!this.tech_||typeof e!="string")){var s=function(){var l=i.muted();i.muted(!0);var c=function(){i.muted(l)};i.playTerminatedQueue_.push(c);var p=i.play();if(Ci(p))return p.catch(function(m){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(m||""))})},o;if(e==="any"&&!this.muted()?(o=this.play(),Ci(o)&&(o=o.catch(s))):e==="muted"&&!this.muted()?o=s():o=this.play(),!!Ci(o))return o.then(function(){i.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){i.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){e===void 0&&(e="");var i=e,s="";typeof i!="string"&&(i=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!s&&(s=N0(this,i)),this.cache_.source=ve({},e,{src:i,type:s});for(var o=this.cache_.sources.filter(function(_){return _.src&&_.src===i}),u=[],l=this.$$("source"),c=[],p=0;p<l.length;p++){var m=It(l[p]);u.push(m),m.src&&m.src===i&&c.push(m.src)}c.length&&!o.length?this.cache_.sources=u:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=i},r.handleTechSourceset_=function(e){var i=this;if(!this.changingSrc_){var s=function(c){return i.updateSourceCaches_(c)},o=this.currentSource().src,u=e.src;o&&!/^blob:/.test(o)&&/^blob:/.test(u)&&(!this.lastSource_||this.lastSource_.tech!==u&&this.lastSource_.player!==o)&&(s=function(){}),s(u),e.src||this.tech_.any(["sourceset","loadstart"],function(l){if(l.type!=="sourceset"){var c=i.techGet("currentSrc");i.lastSource_.tech=c,i.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},r.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},r.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},r.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var i=this.currentTime(),s=function o(){i!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))};this.on("timeupdate",s)},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(ie.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Tt(this.play()):this.pause())},r.handleTechDoubleClick_=function(e){if(this.controls_){var i=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(s){return s.contains(e.target)});i||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var i=e.target.player;if(!(i&&i!==this)){var s=this.el(),o=W[this.fsApi_.fullscreenElement]===s;!o&&s.matches?o=s.matches(":"+this.fsApi_.fullscreen):!o&&s.msMatchesSelector&&(o=s.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},r.handleTechFullscreenChange_=function(e,i){var s=this;i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){s.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))},r.handleTechFullscreenError_=function(e,i){this.trigger("fullscreenerror",i)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,i){this.ready(function(){if(e in L0)return P0(this.middleware_,this.tech_,e,i);if(e in Sl)return xl(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(s){throw ie(s),s}},!0)},r.techGet_=function(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in I0)return k0(this.middleware_,this.tech_,e);if(e in Sl)return xl(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw this.tech_[e]===void 0?(ie("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",i),i):i.name==="TypeError"?(ie("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",i),this.tech_.isReady_=!1,i):(ie(i),i)}}},r.play=function(){var e=this,i=this.options_.Promise||A.Promise;return i?new i(function(s){e.play_(s)}):this.play_()},r.play_=function(e){var i=this;e===void 0&&(e=Tt),this.playCallbacks_.push(e);var s=!!(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!s){this.waitToPlay_=function(u){i.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!s&&(ga||Ke)&&this.load();return}var o=this.techGet_("play");o===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(o)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})},r.runPlayCallbacks_=function(e){var i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(s){s(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||hr(0,0)},r.scrubbing=function(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){if(typeof e<"u"){if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=hr(0,0)),e},r.bufferedPercent=function(){return Mc(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),i=this.duration(),s=e.end(e.length-1);return s>i&&(s=i),s},r.volume=function(e){var i;if(e!==void 0){i=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i},r.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},r.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(e!==void 0){var i=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},r.requestFullscreen=function(e){var i=this.options_.Promise||A.Promise;if(i){var s=this;return new i(function(o,u){function l(){s.off("fullscreenerror",p),s.off("fullscreenchange",c)}function c(){l(),o()}function p(_,b){l(),u(b)}s.one("fullscreenchange",c),s.one("fullscreenerror",p);var m=s.requestFullscreenHelper_(e);m&&(m.then(l,l),m.then(o,u))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var i=this,s;if(this.fsApi_.prefixed||(s=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(s=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](s);return o&&o.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||A.Promise;if(e){var i=this;return new e(function(s,o){function u(){i.off("fullscreenerror",c),i.off("fullscreenchange",l)}function l(){u(),s()}function c(m,_){u(),o(_)}i.one("fullscreenchange",l),i.one("fullscreenerror",c);var p=i.exitFullscreenHelper_();p&&(p.then(u,u),p.then(s,o))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var i=W[this.fsApi_.exitFullscreen]();return i&&Tt(i.then(function(){return e.isFullscreen(!1)})),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=W.documentElement.style.overflow,nt(W,"keydown",this.boundFullWindowOnEscKey_),W.documentElement.style.overflow="hidden",Rt(W.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){te.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Be(W,"keydown",this.boundFullWindowOnEscKey_),W.documentElement.style.overflow=this.docOrigOverflow,Wi(W.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in W&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in W)return W.exitPictureInPicture()},r.handleKeyDown=function(e){var i=this.options_.userActions;if(!(!i||!i.hotkeys)){var s=function(u){var l=u.tagName.toLowerCase();if(u.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(l==="input")return c.indexOf(u.type)===-1;var p=["textarea"];return p.indexOf(l)!==-1};s(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,e):this.handleHotkeys(e))}},r.handleHotkeys=function(e){var i=this.options_.userActions?this.options_.userActions.hotkeys:{},s=i.fullscreenKey,o=s===void 0?function(S){return te.isEventKey(S,"f")}:s,u=i.muteKey,l=u===void 0?function(S){return te.isEventKey(S,"m")}:u,c=i.playPauseKey,p=c===void 0?function(S){return te.isEventKey(S,"k")||te.isEventKey(S,"Space")}:c;if(o.call(this,e)){e.preventDefault(),e.stopPropagation();var m=V.getComponent("FullscreenToggle");W[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation();var _=V.getComponent("MuteToggle");_.prototype.handleClick.call(this,e)}else if(p.call(this,e)){e.preventDefault(),e.stopPropagation();var b=V.getComponent("PlayToggle");b.prototype.handleClick.call(this,e)}},r.canPlayType=function(e){for(var i,s=0,o=this.options_.techOrder;s<o.length;s++){var u=o[s],l=he.getTech(u);if(l||(l=V.getComponent(u)),!l){ie.error('The "'+u+'" tech is undefined. Skipped browser support check for that tech.');continue}if(l.isSupported()&&(i=l.canPlayType(e),i))return i}return""},r.selectSource=function(e){var i=this,s=this.options_.techOrder.map(function(p){return[p,he.getTech(p)]}).filter(function(p){var m=p[0],_=p[1];return _?_.isSupported():(ie.error('The "'+m+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(m,_,b){var S;return m.some(function(x){return _.some(function(k){if(S=b(x,k),S)return!0})}),S},u,l=function(m){return function(_,b){return m(b,_)}},c=function(m,_){var b=m[0],S=m[1];if(S.canPlaySource(_,i.options_[b.toLowerCase()]))return{source:_,tech:b}};return this.options_.sourceOrder?u=o(e,s,l(c)):u=o(s,e,c),u||!1},r.handleSrc_=function(e,i){var s=this;if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=B0(e);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),D0(this,o[0],function(c,p){s.middleware_=p,i||(s.cache_.sources=o),s.updateSourceCaches_(c);var m=s.src_(c);if(m){if(o.length>1)return s.handleSrc_(o.slice(1));s.changingSrc_=!1,s.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),s.triggerReady();return}w0(p,s.tech_)}),this.options_.retryOnError&&o.length>1){var u=function(){s.error(null),s.handleSrc_(o.slice(1),!0)},l=function(){s.off("error",u)};this.one("error",u),this.one("playing",l),this.resetRetryOnError_=function(){s.off("error",u),s.off("playing",l)}}},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var i=this,s=this.selectSource([e]);return s?u0(s.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(s.tech,s.source),this.tech_.ready(function(){i.changingSrc_=!1}),!1):!0},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,i=this.options_.Promise||A.Promise;if(this.paused()||!i)this.doReset_();else{var s=this.play();Tt(s.then(function(){return e.doReset_()}))}},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Mt(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},i=e.durationDisplay,s=e.remainingTimeDisplay;i&&i.updateContent(),s&&s.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),i=[];return Object.keys(e).length!==0&&i.push(e),this.cache_.sources||i},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},r.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var i;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),i=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)},r.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},r.poster=function(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},r.usingNativeControls=function(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},r.error=function(e){var i=this;if(e===void 0)return this.error_||null;if(Xt("beforeerror").forEach(function(o){var u=o(i,e);if(!(Vt(u)&&!Array.isArray(u)||typeof u=="string"||typeof u=="number"||u===null)){i.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=u}),this.options_.suppressNotSupportedError&&e&&e.code===4){var s=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],s),this.one("loadstart",function(){this.off(["click","touchstart"],s)});return}if(e===null){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new $e(e),this.addClass("vjs-error"),ie.error("(CODE:"+this.error_.code+" "+$e.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Xt("error").forEach(function(o){return o(i,i.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,i,s,o=ye(this,this.reportUserActivity),u=function(b){(b.screenX!==i||b.screenY!==s)&&(i=b.screenX,s=b.screenY,o())},l=function(){o(),this.clearInterval(e),e=this.setInterval(o,250)},c=function(b){o(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",u),this.on("mouseup",c),this.on("mouseleave",c);var p=this.getChild("controlBar");p&&!Ke&&!jt&&(p.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),p.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var m;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);var _=this.options_.inactivityTimeout;_<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))}},250)},r.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},r.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var i=this.children(),s=this.getChild("ControlBar"),o=s&&s.currentHeight();i.forEach(function(u){u!==s&&u.el_&&!u.hasClass("vjs-hidden")&&(u.hide(),e.audioOnlyCache_.hiddenChildren.push(u))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),s.all(o).then(function(){return i.enableAudioOnlyUI_()})}return s.resolve().then(function(){return i.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var i=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var s=this.options_.Promise||A.Promise;if(s){if(e){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.enablePosterModeUI_()})}return s.resolve().then(function(){i.disablePosterModeUI_()})}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},r.addTextTrack=function(e,i,s){if(this.tech_)return this.tech_.addTextTrack(e,i,s)},r.addRemoteTextTrack=function(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)},r.removeRemoteTextTrack=function(e){e===void 0&&(e={});var i=e,s=i.track;if(s||(s=e),this.tech_)return this.tech_.removeRemoteTextTrack(s)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Mt(this)&&this.trigger("languagechange"))},r.languages=function(){return ve(t.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=ve(this.options_),i=e.tracks;e.tracks=[];for(var s=0;s<i.length;s++){var o=i[s];o=ve(o),o.player=void 0,e.tracks[s]=o}return e},r.createModal=function(e,i){var s=this;i=i||{},i.content=e||"";var o=new ei(this,i);return this.addChild(o),o.on("dispose",function(){s.removeChild(o)}),o.open(),o},r.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),i=this.currentWidth(),s=0;s<Ds.length;s++){var o=Ds[s],u=this.breakpoints_[o];if(i<=u){if(e===o)return;e&&this.removeClass(Rn[e]),this.addClass(Rn[o]),this.breakpoint_=o;break}}},r.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},r.breakpoints=function(e){return e===void 0?be(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=be({},py,e),this.updateCurrentBreakpoint_(),be(this.breakpoints_))},r.responsive=function(e){if(e===void 0)return this.responsive_;e=!!e;var i=this.responsive_;if(e!==i)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e},r.currentBreakpoint=function(){return this.breakpoint_},r.currentBreakpointClass=function(){return Rn[this.breakpoint_]||""},r.loadMedia=function(e,i){var s=this;if(!(!e||typeof e!="object")){this.reset(),this.cache_.media=ve(e);var o=this.cache_.media,u=o.artwork,l=o.poster,c=o.src,p=o.textTracks;!u&&l&&(this.cache_.media.artwork=[{src:l,type:$n(l)}]),c&&this.src(c),l&&this.poster(l),Array.isArray(p)&&p.forEach(function(m){return s.addRemoteTextTrack(m,!1)}),this.ready(i)}},r.getMedia=function(){if(!this.cache_.media){var e=this.poster(),i=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),function(u){return{kind:u.kind,label:u.label,language:u.language,src:u.src}}),o={src:i,textTracks:s};return e&&(o.poster=e,o.artwork=[{src:o.poster,type:$n(o.poster)}]),o}return ve(this.cache_.media)},t.getTagSettings=function(e){var i={sources:[],tracks:[]},s=It(e),o=s["data-setup"];if(fr(e,"vjs-fill")&&(s.fill=!0),fr(e,"vjs-fluid")&&(s.fluid=!0),o!==null){var u=zp(o||"{}"),l=u[0],c=u[1];l&&ie.error(l),be(s,c)}if(be(i,s),e.hasChildNodes())for(var p=e.childNodes,m=0,_=p.length;m<_;m++){var b=p[m],S=b.nodeName.toLowerCase();S==="source"?i.sources.push(It(b)):S==="track"&&i.tracks.push(It(b))}return i},r.flexNotSupported_=function(){var e=W.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},r.debug=function(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},r.playbackRates=function(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(function(i){return typeof i=="number"})&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(V);je.names.forEach(function(a){var t=je[a];Ae.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}});Ae.prototype.crossorigin=Ae.prototype.crossOrigin;Ae.players={};var gi=A.navigator;Ae.prototype.options_={techOrder:he.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:gi&&(gi.languages&&gi.languages[0]||gi.userLanguage||gi.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(a){Ae.prototype[a]=function(){return this.techGet_(a)}});hf.forEach(function(a){Ae.prototype["handleTech"+Ee(a)+"_"]=function(){return this.trigger(a)}});V.registerComponent("Player",Ae);var Yn="plugin",Nr="activePlugins_",Or={},Qn=function(t){return Or.hasOwnProperty(t)},Mn=function(t){return Qn(t)?Or[t]:void 0},pf=function(t,r){t[Nr]=t[Nr]||{},t[Nr][r]=!0},Jn=function(t,r,n){var e=(n?"before":"")+"pluginsetup";t.trigger(e,r),t.trigger(e+":"+r.name,r)},my=function(t,r){var n=function(){Jn(this,{name:t,plugin:r,instance:null},!0);var i=r.apply(this,arguments);return pf(this,t),Jn(this,{name:t,plugin:r,instance:i}),i};return Object.keys(r).forEach(function(e){n[e]=r[e]}),n},Nl=function(t,r){return r.prototype.name=t,function(){Jn(this,{name:t,plugin:r,instance:null},!0);for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];var s=md(r,[this].concat(e));return this[t]=function(){return s},Jn(this,s.getEventHash()),s}},At=function(){function a(r){if(this.constructor===a)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=r,this.log||(this.log=this.player.log.createLogger(this.name)),ho(this),delete this.trigger,Rc(this,this.constructor.defaultState),pf(r,this.name),this.dispose=this.dispose.bind(this),r.on("dispose",this.dispose)}var t=a.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(n){return n===void 0&&(n={}),n.name=this.name,n.plugin=this.constructor,n.instance=this,n},t.trigger=function(n,e){return e===void 0&&(e={}),Zr(this.eventBusEl_,n,this.getEventHash(e))},t.handleStateChanged=function(n){},t.dispose=function(){var n=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[Nr][n]=!1,this.player=this.state=null,e[n]=Nl(n,Or[n])},a.isBasic=function(n){var e=typeof n=="string"?Mn(n):n;return typeof e=="function"&&!a.prototype.isPrototypeOf(e.prototype)},a.registerPlugin=function(n,e){if(typeof n!="string")throw new Error('Illegal plugin name, "'+n+'", must be a string, was '+typeof n+".");if(Qn(n))ie.warn('A plugin named "'+n+'" already exists. You may want to avoid re-registering plugins!');else if(Ae.prototype.hasOwnProperty(n))throw new Error('Illegal plugin name, "'+n+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+n+'", must be a function, was '+typeof e+".");return Or[n]=e,n!==Yn&&(a.isBasic(e)?Ae.prototype[n]=my(n,e):Ae.prototype[n]=Nl(n,e)),e},a.deregisterPlugin=function(n){if(n===Yn)throw new Error("Cannot de-register base plugin.");Qn(n)&&(delete Or[n],delete Ae.prototype[n])},a.getPlugins=function(n){n===void 0&&(n=Object.keys(Or));var e;return n.forEach(function(i){var s=Mn(i);s&&(e=e||{},e[i]=s)}),e},a.getPluginVersion=function(n){var e=Mn(n);return e&&e.VERSION||""},a}();At.getPlugin=Mn;At.BASE_PLUGIN_NAME=Yn;At.registerPlugin(Yn,At);Ae.prototype.usingPlugin=function(a){return!!this[Nr]&&this[Nr][a]===!0};Ae.prototype.hasPlugin=function(a){return!!Qn(a)};var Bl=!1,gy=function(t,r){r===void 0&&(r={}),Bl||(ie.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),Bl=!0);var n=function(){t.apply(this,arguments)},e={};typeof r=="object"?(r.constructor!==Object.prototype.constructor&&(n=r.constructor),e=r):typeof r=="function"&&(n=r),Fm(n,t),t&&(n.super_=t);for(var i in e)e.hasOwnProperty(i)&&(n.prototype[i]=e[i]);return n},mf=function(t){return t.indexOf("#")===0?t.slice(1):t};function I(a,t,r){var n=I.getPlayer(a);if(n)return t&&ie.warn('Player "'+a+'" is already initialised. Options will not be applied.'),r&&n.ready(r),n;var e=typeof a=="string"?Yt("#"+mf(a)):a;if(!Jr(e))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!e.ownerDocument.defaultView||!e.ownerDocument.body.contains(e))&&ie.warn("The element supplied is not included in the DOM"),t=t||{},t.restoreEl===!0&&(t.restoreEl=(e.parentNode&&e.parentNode.hasAttribute("data-vjs-player")?e.parentNode:e).cloneNode(!0)),Xt("beforesetup").forEach(function(s){var o=s(e,ve(t));if(!Vt(o)||Array.isArray(o)){ie.error("please return an object in beforesetup hooks");return}t=ve(t,o)});var i=V.getComponent("Player");return n=new i(e,t,r),Xt("setup").forEach(function(s){return s(n)}),n}I.hooks_=Lt;I.hooks=Xt;I.hook=jv;I.hookOnce=Wv;I.removeHook=sc;if(A.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Qr()){var wn=Yt(".vjs-styles-defaults");if(!wn){wn=kc("vjs-styles-defaults");var ss=Yt("head");ss&&ss.insertBefore(wn,ss.firstChild),Pc(wn,`
|
|
49
49
|
.video-js {
|
|
50
50
|
width: 300px;
|
|
51
51
|
height: 150px;
|
|
@@ -54,13 +54,13 @@ See https://github.com/videojs/video.js/issues/2617 for more info.
|
|
|
54
54
|
.vjs-fluid:not(.vjs-audio-only-mode) {
|
|
55
55
|
padding-top: 56.25%
|
|
56
56
|
}
|
|
57
|
-
`)}}bs(1,I);I.VERSION=ac;I.options=Ae.prototype.options_;I.getPlayers=function(){return Ae.players};I.getPlayer=function(a){var t=Ae.players,r;if(typeof a=="string"){var n=mf(a),e=t[n];if(e)return e;r=Yt("#"+n)}else r=a;if(Jr(r)){var i=r,s=i.player,o=i.playerId;if(s||t[o])return s||t[o]}};I.getAllPlayers=function(){return Object.keys(Ae.players).map(function(a){return Ae.players[a]}).filter(Boolean)};I.players=Ae.players;I.getComponent=V.getComponent;I.registerComponent=function(a,t){he.isTech(t)&&ie.warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),V.registerComponent.call(V,a,t)};I.getTech=he.getTech;I.registerTech=he.registerTech;I.use=A0;Object.defineProperty(I,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(I.middleware,"TERMINATOR",{value:zn,writeable:!1,enumerable:!0});I.browser=Yv;I.TOUCH_ENABLED=Wr;I.extend=gy;I.mergeOptions=ve;I.bind=ye;I.registerPlugin=At.registerPlugin;I.deregisterPlugin=At.deregisterPlugin;I.plugin=function(a,t){return ie.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),At.registerPlugin(a,t)};I.getPlugins=At.getPlugins;I.getPlugin=At.getPlugin;I.getPluginVersion=At.getPluginVersion;I.addLanguage=function(a,t){var r;return a=(""+a).toLowerCase(),I.options.languages=ve(I.options.languages,(r={},r[a]=t,r)),I.options.languages[a]};I.log=ie;I.createLogger=uc;I.createTimeRange=I.createTimeRanges=fr;I.formatTime=Xr;I.setFormatTime=G0;I.resetFormatTime=z0;I.parseUrl=mo;I.isCrossOrigin=xa;I.EventTarget=Ie;I.on=nt;I.one=Ta;I.off=Be;I.trigger=Zr;I.xhr=dd;I.TextTrack=Gi;I.AudioTrack=Uc;I.VideoTrack=Vc;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(a){I[a]=function(){return ie.warn("videojs."+a+"() is deprecated; use videojs.dom."+a+"() instead"),Dc[a].apply(null,arguments)}});I.computedStyle=Fi;I.dom=Dc;I.url=x0;I.defineLazyProperty=Fo;I.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.0 @license Apache-2.0 */var dt=la,Zn=function(t,r,n){return t&&n&&n.responseURL&&r!==n.responseURL?n.responseURL:r},mt=function(t){return I.log.debug?I.log.debug.bind(I,"VHS:",t+" >"):function(){}},Qt=1/30,bt=Qt*3,gf=function(t,r){var n=[],e;if(t&&t.length)for(e=0;e<t.length;e++)r(t.start(e),t.end(e))&&n.push([t.start(e),t.end(e)]);return I.createTimeRanges(n)},Fr=function(t,r){return gf(t,function(n,e){return n-bt<=r&&e+bt>=r})},kn=function(t,r){return gf(t,function(n){return n-Qt>=r})},vy=function(t){if(t.length<2)return I.createTimeRanges();for(var r=[],n=1;n<t.length;n++){var e=t.end(n-1),i=t.start(n);r.push([e,i])}return I.createTimeRanges(r)},yy=function(t,r){var n=null,e=null,i=0,s=[],o=[];if(!t||!t.length||!r||!r.length)return I.createTimeRange();for(var u=t.length;u--;)s.push({time:t.start(u),type:"start"}),s.push({time:t.end(u),type:"end"});for(u=r.length;u--;)s.push({time:r.start(u),type:"start"}),s.push({time:r.end(u),type:"end"});for(s.sort(function(l,c){return l.time-c.time}),u=0;u<s.length;u++)s[u].type==="start"?(i++,i===2&&(n=s[u].time)):s[u].type==="end"&&(i--,i===1&&(e=s[u].time)),n!==null&&e!==null&&(o.push([n,e]),n=null,e=null);return I.createTimeRanges(o)},vf=function(t){var r=[];if(!t||!t.length)return"";for(var n=0;n<t.length;n++)r.push(t.start(n)+" => "+t.end(n));return r.join(", ")},_y=function(t,r,n){n===void 0&&(n=1);var e=t.length?t.end(t.length-1):0;return(e-r)/n},lr=function(t){for(var r=[],n=0;n<t.length;n++)r.push({start:t.start(n),end:t.end(n)});return r},Ty=function(t,r){if(t===r)return!1;if(!t&&r||!r&&t||t.length!==r.length)return!0;for(var n=0;n<t.length;n++)if(t.start(n)!==r.start(n)||t.end(n)!==r.end(n))return!0;return!1},Ul=function(t){if(!(!t||!t.length||!t.end))return t.end(t.length-1)},Ro=function(t,r){var n=0;if(!t||!t.length)return n;for(var e=0;e<t.length;e++){var i=t.start(e),s=t.end(e);if(!(r>s)){if(r>i&&r<=s){n+=s-r;continue}n+=s-i}}return n},Vl=I.createTimeRange,Mo=function(t,r){if(!r.preload)return r.duration;var n=0;return(r.parts||[]).forEach(function(e){n+=e.duration}),(r.preloadHints||[]).forEach(function(e){e.type==="PART"&&(n+=t.partTargetDuration)}),n},ws=function(t){return(t.segments||[]).reduce(function(r,n,e){return n.parts?n.parts.forEach(function(i,s){r.push({duration:i.duration,segmentIndex:e,partIndex:s,part:i,segment:n})}):r.push({duration:n.duration,segmentIndex:e,partIndex:null,segment:n,part:null}),r},[])},yf=function(t){var r=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return r&&r.parts||[]},_f=function(t){var r=t.preloadSegment;if(r){var n=r.parts,e=r.preloadHints,i=(e||[]).reduce(function(s,o){return s+(o.type==="PART"?1:0)},0);return i+=n&&n.length?n.length:0,i}},Tf=function(t,r){if(r.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var n=yf(r).length>0;return n&&r.serverControl&&r.serverControl.partHoldBack?r.serverControl.partHoldBack:n&&r.partTargetDuration?r.partTargetDuration*3:r.serverControl&&r.serverControl.holdBack?r.serverControl.holdBack:r.targetDuration?r.targetDuration*3:0},by=function(t,r){var n=0,e=r-t.mediaSequence,i=t.segments[e];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;e--;){if(i=t.segments[e],typeof i.end<"u")return{result:n+i.end,precise:!0};if(n+=Mo(t,i),typeof i.start<"u")return{result:n+i.start,precise:!0}}return{result:n,precise:!1}},xy=function(t,r){for(var n=0,e,i=r-t.mediaSequence;i<t.segments.length;i++){if(e=t.segments[i],typeof e.start<"u")return{result:e.start-n,precise:!0};if(n+=Mo(t,e),typeof e.end<"u")return{result:e.end-n,precise:!0}}return{result:-1,precise:!1}},bf=function(t,r,n){if(typeof r>"u"&&(r=t.mediaSequence+t.segments.length),r<t.mediaSequence)return 0;var e=by(t,r);if(e.precise)return e.result;var i=xy(t,r);return i.precise?i.result:e.result+n},xf=function(t,r,n){if(!t)return 0;if(typeof n!="number"&&(n=0),typeof r>"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return A.Infinity}return bf(t,r,n)},Ai=function(t){var r=t.defaultDuration,n=t.durationList,e=t.startIndex,i=t.endIndex,s=0;if(e>i){var o=[i,e];e=o[0],i=o[1]}if(e<0){for(var u=e;u<Math.min(0,i);u++)s+=r;e=0}for(var l=e;l<i;l++)s+=n[l].duration;return s},Sf=function(t,r,n,e){if(!t||!t.segments)return null;if(t.endList)return xf(t);if(r===null)return null;r=r||0;var i=bf(t,t.mediaSequence+t.segments.length,r);return n&&(e=typeof e=="number"?e:Tf(null,t),i-=e),Math.max(0,i)},Sy=function(t,r,n){var e=!0,i=r||0,s=Sf(t,r,e,n);return s===null?Vl():Vl(i,s)},Ey=function(t){for(var r=t.playlist,n=t.currentTime,e=t.startingSegmentIndex,i=t.startingPartIndex,s=t.startTime,o=t.experimentalExactManifestTimings,u=n-s,l=ws(r),c=0,p=0;p<l.length;p++){var m=l[p];if(e===m.segmentIndex&&!(typeof i=="number"&&typeof m.partIndex=="number"&&i!==m.partIndex)){c=p;break}}if(u<0){if(c>0)for(var _=c-1;_>=0;_--){var b=l[_];if(u+=b.duration,o){if(u<0)continue}else if(u+Qt<=0)continue;return{partIndex:b.partIndex,segmentIndex:b.segmentIndex,startTime:s-Ai({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:_})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n}}if(c<0){for(var S=c;S<0;S++)if(u-=r.targetDuration,u<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n};c=0}for(var x=c;x<l.length;x++){var k=l[x];if(u-=k.duration,o){if(u>0)continue}else if(u-Qt>=0)continue;return{partIndex:k.partIndex,segmentIndex:k.segmentIndex,startTime:s+Ai({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:x})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:n}},Ef=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},No=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Aa=function(t){var r=Ef(t);return!t.disabled&&!r},Cy=function(t){return t.disabled},Ay=function(t){for(var r=0;r<t.segments.length;r++)if(t.segments[r].key)return!0;return!1},Cf=function(t,r){return r.attributes&&r.attributes[t]},Dy=function(t,r,n,e){if(e===void 0&&(e=0),!Cf("BANDWIDTH",n))return NaN;var i=t*n.attributes.BANDWIDTH;return(i-e*8)/r},ks=function(t,r){if(t.playlists.length===1)return!0;var n=r.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){return Aa(e)?(e.attributes.BANDWIDTH||0)<n:!1}).length===0},Bo=function(t,r){return!t&&!r||!t&&r||t&&!r?!1:!!(t===r||t.id&&r.id&&t.id===r.id||t.resolvedUri&&r.resolvedUri&&t.resolvedUri===r.resolvedUri||t.uri&&r.uri&&t.uri===r.uri)},Hl=function(t,r){var n=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{},e=!1;for(var i in n){for(var s in n[i])if(e=r(n[i][s]),e)break;if(e)break}return!!e},Ki=function(t){if(!t||!t.playlists||!t.playlists.length){var r=Hl(t,function(s){return s.playlists&&s.playlists.length||s.uri});return r}for(var n=function(o){var u=t.playlists[o],l=u.attributes&&u.attributes.CODECS;if(l&&l.split(",").every(function(p){return _d(p)}))return"continue";var c=Hl(t,function(p){return Bo(u,p)});return c?"continue":{v:!1}},e=0;e<t.playlists.length;e++){var i=n(e);if(i!=="continue"&&typeof i=="object")return i.v}return!0},Qe={liveEdgeDelay:Tf,duration:xf,seekable:Sy,getMediaInfoForTime:Ey,isEnabled:Aa,isDisabled:Cy,isBlacklisted:Ef,isIncompatible:No,playlistEnd:Sf,isAes:Ay,hasAttribute:Cf,estimateSegmentRequestTime:Dy,isLowestEnabledRendition:ks,isAudioOnly:Ki,playlistMatch:Bo,segmentDurationWithParts:Mo},Af=I.log,Uo=function(t,r){return t+"-"+r},wy=function(t){var r=t.onwarn,n=t.oninfo,e=t.manifestString,i=t.customTagParsers,s=i===void 0?[]:i,o=t.customTagMappers,u=o===void 0?[]:o,l=t.experimentalLLHLS,c=new qm;r&&c.on("warn",r),n&&c.on("info",n),s.forEach(function(S){return c.addParser(S)}),u.forEach(function(S){return c.addTagMapper(S)}),c.push(e),c.end();var p=c.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(S){p.hasOwnProperty(S)&&delete p[S]}),p.segments&&p.segments.forEach(function(S){["parts","preloadHints"].forEach(function(x){S.hasOwnProperty(x)&&delete S[x]})})),!p.targetDuration){var m=10;p.segments&&p.segments.length&&(m=p.segments.reduce(function(S,x){return Math.max(S,x.duration)},0)),r&&r("manifest has no targetDuration defaulting to "+m),p.targetDuration=m}var _=yf(p);if(_.length&&!p.partTargetDuration){var b=_.reduce(function(S,x){return Math.max(S,x.duration)},0);r&&(r("manifest has no partTargetDuration defaulting to "+b),Af.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.")),p.partTargetDuration=b}return p},Xi=function(t,r){t.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(n){if(t.mediaGroups[n])for(var e in t.mediaGroups[n])for(var i in t.mediaGroups[n][e]){var s=t.mediaGroups[n][e][i];r(s,n,e,i)}})},Df=function(t){var r=t.playlist,n=t.uri,e=t.id;r.id=e,r.playlistErrors_=0,n&&(r.uri=n),r.attributes=r.attributes||{}},ky=function(t){for(var r=t.playlists.length;r--;){var n=t.playlists[r];Df({playlist:n,id:Uo(r,n.uri)}),n.resolvedUri=dt(t.uri,n.uri),t.playlists[n.id]=n,t.playlists[n.uri]=n,n.attributes.BANDWIDTH||Af.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Py=function(t){Xi(t,function(r){r.uri&&(r.resolvedUri=dt(t.uri,r.uri))})},Iy=function(t,r){var n=Uo(0,r),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A.location.href,resolvedUri:A.location.href,playlists:[{uri:r,id:n,resolvedUri:r,attributes:{}}]};return e.playlists[n]=e.playlists[0],e.playlists[r]=e.playlists[0],e},wf=function(t,r){t.uri=r;for(var n=0;n<t.playlists.length;n++)if(!t.playlists[n].uri){var e="placeholder-uri-"+n;t.playlists[n].uri=e}var i=Ki(t);Xi(t,function(s,o,u,l){var c="placeholder-uri-"+o+"-"+u+"-"+l;if(!s.playlists||!s.playlists.length){if(i&&o==="AUDIO"&&!s.uri)for(var p=0;p<t.playlists.length;p++){var m=t.playlists[p];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===u)return}s.playlists=[ht({},s)]}s.playlists.forEach(function(_,b){var S=Uo(b,c);_.uri?_.resolvedUri=_.resolvedUri||dt(t.uri,_.uri):(_.uri=b===0?c:S,_.resolvedUri=_.uri),_.id=_.id||S,_.attributes=_.attributes||{},t.playlists[_.id]=_,t.playlists[_.uri]=_})}),ky(t),Py(t)},ea=I.mergeOptions,Ly=I.EventTarget,Oy=function(t,r){if(r.endList||!r.serverControl)return t;var n={};if(r.serverControl.canBlockReload){var e=r.preloadSegment,i=r.mediaSequence+r.segments.length;if(e){var s=e.parts||[],o=_f(r)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&i--}n._HLS_msn=i}if(r.serverControl&&r.serverControl.canSkipUntil&&(n._HLS_skip=r.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var u=new A.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){n.hasOwnProperty(l)&&u.searchParams.set(l,n[l])}),t=u.toString()}return t},Fy=function(t,r){if(!t)return r;var n=ea(t,r);if(t.preloadHints&&!r.preloadHints&&delete n.preloadHints,t.parts&&!r.parts)delete n.parts;else if(t.parts&&r.parts)for(var e=0;e<r.parts.length;e++)t.parts&&t.parts[e]&&(n.parts[e]=ea(t.parts[e],r.parts[e]));return!t.skipped&&r.skipped&&(n.skipped=!1),t.preload&&!r.preload&&(n.preload=!1),n},Ry=function(t,r,n){var e=t.slice(),i=r.slice();n=n||0;for(var s=[],o,u=0;u<i.length;u++){var l=e[u+n],c=i[u];l?(o=l.map||o,s.push(Fy(l,c))):(o&&!c.map&&(c.map=o),s.push(c))}return s},kf=function(t,r){!t.resolvedUri&&t.uri&&(t.resolvedUri=dt(r,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=dt(r,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=dt(r,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=dt(r,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(function(n){n.resolvedUri||(n.resolvedUri=dt(r,n.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(function(n){n.resolvedUri||(n.resolvedUri=dt(r,n.uri))})},Pf=function(t){var r=t.segments||[],n=t.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(var e=0;e<n.preloadHints.length;e++)if(n.preloadHints[e].type==="MAP")return r}n.duration=t.targetDuration,n.preload=!0,r.push(n)}return r},If=function(t,r){return t===r||t.segments&&r.segments&&t.segments.length===r.segments.length&&t.endList===r.endList&&t.mediaSequence===r.mediaSequence&&t.preloadSegment===r.preloadSegment},Ps=function(t,r,n){n===void 0&&(n=If);var e=ea(t,{}),i=e.playlists[r.id];if(!i||n(i,r))return null;r.segments=Pf(r);var s=ea(i,r);if(s.preloadSegment&&!r.preloadSegment&&delete s.preloadSegment,i.segments){if(r.skip){r.segments=r.segments||[];for(var o=0;o<r.skip.skippedSegments;o++)r.segments.unshift({skipped:!0})}s.segments=Ry(i.segments,r.segments,r.mediaSequence-i.mediaSequence)}s.segments.forEach(function(l){kf(l,s.resolvedUri)});for(var u=0;u<e.playlists.length;u++)e.playlists[u].id===r.id&&(e.playlists[u]=s);return e.playlists[r.id]=s,e.playlists[r.uri]=s,Xi(t,function(l,c,p,m){if(l.playlists)for(var _=0;_<l.playlists.length;_++)r.id===l.playlists[_].id&&(l.playlists[_]=s)}),e},Is=function(t,r){var n=t.segments||[],e=n[n.length-1],i=e&&e.parts&&e.parts[e.parts.length-1],s=i&&i.duration||e&&e.duration;return r&&s?s*1e3:(t.partTargetDuration||t.targetDuration||10)*500},Rr=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(i===void 0&&(i={}),s=a.call(this)||this,!n)throw new Error("A non-empty playlist URL or object is required");s.logger_=mt("PlaylistLoader");var o=i,u=o.withCredentials,l=u===void 0?!1:u,c=o.handleManifestRedirects,p=c===void 0?!1:c;s.src=n,s.vhs_=e,s.withCredentials=l,s.handleManifestRedirects=p;var m=e.options_;return s.customTagParsers=m&&m.customTagParsers||[],s.customTagMappers=m&&m.customTagMappers||[],s.experimentalLLHLS=m&&m.experimentalLLHLS||!1,I.browser.IE_VERSION&&(s.experimentalLLHLS=!1),s.state="HAVE_NOTHING",s.handleMediaupdatetimeout_=s.handleMediaupdatetimeout_.bind(ee(s)),s.on("mediaupdatetimeout",s.handleMediaupdatetimeout_),s}var r=t.prototype;return r.handleMediaupdatetimeout_=function(){var e=this;if(this.state==="HAVE_METADATA"){var i=this.media(),s=dt(this.master.uri,i.uri);this.experimentalLLHLS&&(s=Oy(s,i)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:s,withCredentials:this.withCredentials},function(o,u){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},r.playlistRequestError=function(e,i,s){var o=i.uri,u=i.id;this.request=null,s&&(this.state=s),this.error={playlist:this.master.playlists[u],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},r.parseManifest_=function(e){var i=this,s=e.url,o=e.manifestString;return wy({onwarn:function(l){var c=l.message;return i.logger_("m3u8-parser warn for "+s+": "+c)},oninfo:function(l){var c=l.message;return i.logger_("m3u8-parser info for "+s+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(e){var i=e.playlistString,s=e.playlistObject,o=e.url,u=e.id;this.request=null,this.state="HAVE_METADATA";var l=s||this.parseManifest_({url:o,manifestString:i});l.lastRequest=Date.now(),Df({playlist:l,uri:o,id:u});var c=Ps(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[u]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Is(this.media(),!!c)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),A.clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e,i){var s=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(A.clearTimeout(this.finalRenditionTimeout),i){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A.setTimeout(this.media.bind(this,e,!1),o);return}var u=this.state,l=!this.media_||e.id!==this.media_.id,c=this.master.playlists[e.id];if(c&&c.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,l&&(this.trigger("mediachanging"),u==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Is(e,!0)),!!l){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(p,m){if(s.request){if(e.lastRequest=Date.now(),e.resolvedUri=Zn(s.handleManifestRedirects,e.resolvedUri,m),p)return s.playlistRequestError(s.request,e,u);s.haveMetadata({playlistString:m.responseText,url:e.uri,id:e.id}),u==="HAVE_MASTER"?s.trigger("loadedmetadata"):s.trigger("mediachange")}})}},r.pause=function(){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var s=this.media();if(e){var o=s?(s.partTargetDuration||s.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},r.updateMediaUpdateTimeout_=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(e)},e))},r.start=function(){var e=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=A.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){e.setupInitialPlaylist(e.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,s){if(e.request){if(e.request=null,i)return e.error={status:s.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:s.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=Zn(e.handleManifestRedirects,e.src,s);var o=e.parseManifest_({manifestString:s.responseText,url:e.src});e.setupInitialPlaylist(o)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,wf(this.master,this.srcUri()),e.playlists.forEach(function(s){s.segments=Pf(s),s.segments.forEach(function(o){kf(o,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var i=this.srcUri()||A.location.href;this.master=Iy(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Ly),My=I.xhr,Ny=I.mergeOptions,Ls=function(t,r,n,e){var i=t.responseType==="arraybuffer"?t.response:t.responseText;!r&&i&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=i.byteLength||i.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),n.headers&&(t.responseHeaders=n.headers),r&&r.code==="ETIMEDOUT"&&(t.timedout=!0),!r&&!t.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(r=new Error("XHR Failed with a response of: "+(t&&(i||t.responseText)))),e(r,t)},Lf=function(){var t=function r(n,e){n=Ny({timeout:45e3},n);var i=r.beforeRequest||I.Vhs.xhr.beforeRequest;if(i&&typeof i=="function"){var s=i(n);s&&(n=s)}var o=I.Vhs.xhr.original===!0?My:I.Vhs.xhr,u=o(n,function(c,p){return Ls(u,c,p,e)}),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=n.uri,u.requestTime=Date.now(),u};return t.original=!0,t},By=function(t){var r,n=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?r=A.BigInt(t.offset)+A.BigInt(t.length)-A.BigInt(1):r=t.offset+t.length-1,"bytes="+n+"-"+r},Os=function(t){var r={};return t.byterange&&(r.Range=By(t.byterange)),r},Uy=function(t,r){return t.start(r)+"-"+t.end(r)},Vy=function(t,r){var n=t.toString(16);return"00".substring(0,2-n.length)+n+(r%2?" ":"")},Hy=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Of=function(t){var r={};return Object.keys(t).forEach(function(n){var e=t[n];bd(e)?r[n]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:r[n]=e}),r},ta=function(t){var r=t.byterange||{length:1/0,offset:0};return[r.length,r.offset,t.resolvedUri].join(",")},Ff=function(t){return t.resolvedUri},Rf=function(t){for(var r=Array.prototype.slice.call(t),n=16,e="",i,s,o=0;o<r.length/n;o++)i=r.slice(o*n,o*n+n).map(Vy).join(""),s=r.slice(o*n,o*n+n).map(Hy).join(""),e+=i+" "+s+`
|
|
57
|
+
`)}}bs(1,I);I.VERSION=ac;I.options=Ae.prototype.options_;I.getPlayers=function(){return Ae.players};I.getPlayer=function(a){var t=Ae.players,r;if(typeof a=="string"){var n=mf(a),e=t[n];if(e)return e;r=Yt("#"+n)}else r=a;if(Jr(r)){var i=r,s=i.player,o=i.playerId;if(s||t[o])return s||t[o]}};I.getAllPlayers=function(){return Object.keys(Ae.players).map(function(a){return Ae.players[a]}).filter(Boolean)};I.players=Ae.players;I.getComponent=V.getComponent;I.registerComponent=function(a,t){he.isTech(t)&&ie.warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),V.registerComponent.call(V,a,t)};I.getTech=he.getTech;I.registerTech=he.registerTech;I.use=A0;Object.defineProperty(I,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(I.middleware,"TERMINATOR",{value:zn,writeable:!1,enumerable:!0});I.browser=Yv;I.TOUCH_ENABLED=Wr;I.extend=gy;I.mergeOptions=ve;I.bind=ye;I.registerPlugin=At.registerPlugin;I.deregisterPlugin=At.deregisterPlugin;I.plugin=function(a,t){return ie.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),At.registerPlugin(a,t)};I.getPlugins=At.getPlugins;I.getPlugin=At.getPlugin;I.getPluginVersion=At.getPluginVersion;I.addLanguage=function(a,t){var r;return a=(""+a).toLowerCase(),I.options.languages=ve(I.options.languages,(r={},r[a]=t,r)),I.options.languages[a]};I.log=ie;I.createLogger=uc;I.createTimeRange=I.createTimeRanges=hr;I.formatTime=Xr;I.setFormatTime=G0;I.resetFormatTime=z0;I.parseUrl=mo;I.isCrossOrigin=xa;I.EventTarget=Ie;I.on=nt;I.one=Ta;I.off=Be;I.trigger=Zr;I.xhr=dd;I.TextTrack=Gi;I.AudioTrack=Uc;I.VideoTrack=Vc;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(a){I[a]=function(){return ie.warn("videojs."+a+"() is deprecated; use videojs.dom."+a+"() instead"),Dc[a].apply(null,arguments)}});I.computedStyle=Fi;I.dom=Dc;I.url=x0;I.defineLazyProperty=Fo;I.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.0 @license Apache-2.0 */var dt=la,Zn=function(t,r,n){return t&&n&&n.responseURL&&r!==n.responseURL?n.responseURL:r},mt=function(t){return I.log.debug?I.log.debug.bind(I,"VHS:",t+" >"):function(){}},Qt=1/30,bt=Qt*3,gf=function(t,r){var n=[],e;if(t&&t.length)for(e=0;e<t.length;e++)r(t.start(e),t.end(e))&&n.push([t.start(e),t.end(e)]);return I.createTimeRanges(n)},Fr=function(t,r){return gf(t,function(n,e){return n-bt<=r&&e+bt>=r})},kn=function(t,r){return gf(t,function(n){return n-Qt>=r})},vy=function(t){if(t.length<2)return I.createTimeRanges();for(var r=[],n=1;n<t.length;n++){var e=t.end(n-1),i=t.start(n);r.push([e,i])}return I.createTimeRanges(r)},yy=function(t,r){var n=null,e=null,i=0,s=[],o=[];if(!t||!t.length||!r||!r.length)return I.createTimeRange();for(var u=t.length;u--;)s.push({time:t.start(u),type:"start"}),s.push({time:t.end(u),type:"end"});for(u=r.length;u--;)s.push({time:r.start(u),type:"start"}),s.push({time:r.end(u),type:"end"});for(s.sort(function(l,c){return l.time-c.time}),u=0;u<s.length;u++)s[u].type==="start"?(i++,i===2&&(n=s[u].time)):s[u].type==="end"&&(i--,i===1&&(e=s[u].time)),n!==null&&e!==null&&(o.push([n,e]),n=null,e=null);return I.createTimeRanges(o)},vf=function(t){var r=[];if(!t||!t.length)return"";for(var n=0;n<t.length;n++)r.push(t.start(n)+" => "+t.end(n));return r.join(", ")},_y=function(t,r,n){n===void 0&&(n=1);var e=t.length?t.end(t.length-1):0;return(e-r)/n},dr=function(t){for(var r=[],n=0;n<t.length;n++)r.push({start:t.start(n),end:t.end(n)});return r},Ty=function(t,r){if(t===r)return!1;if(!t&&r||!r&&t||t.length!==r.length)return!0;for(var n=0;n<t.length;n++)if(t.start(n)!==r.start(n)||t.end(n)!==r.end(n))return!0;return!1},Ul=function(t){if(!(!t||!t.length||!t.end))return t.end(t.length-1)},Ro=function(t,r){var n=0;if(!t||!t.length)return n;for(var e=0;e<t.length;e++){var i=t.start(e),s=t.end(e);if(!(r>s)){if(r>i&&r<=s){n+=s-r;continue}n+=s-i}}return n},Vl=I.createTimeRange,Mo=function(t,r){if(!r.preload)return r.duration;var n=0;return(r.parts||[]).forEach(function(e){n+=e.duration}),(r.preloadHints||[]).forEach(function(e){e.type==="PART"&&(n+=t.partTargetDuration)}),n},ws=function(t){return(t.segments||[]).reduce(function(r,n,e){return n.parts?n.parts.forEach(function(i,s){r.push({duration:i.duration,segmentIndex:e,partIndex:s,part:i,segment:n})}):r.push({duration:n.duration,segmentIndex:e,partIndex:null,segment:n,part:null}),r},[])},yf=function(t){var r=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return r&&r.parts||[]},_f=function(t){var r=t.preloadSegment;if(r){var n=r.parts,e=r.preloadHints,i=(e||[]).reduce(function(s,o){return s+(o.type==="PART"?1:0)},0);return i+=n&&n.length?n.length:0,i}},Tf=function(t,r){if(r.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var n=yf(r).length>0;return n&&r.serverControl&&r.serverControl.partHoldBack?r.serverControl.partHoldBack:n&&r.partTargetDuration?r.partTargetDuration*3:r.serverControl&&r.serverControl.holdBack?r.serverControl.holdBack:r.targetDuration?r.targetDuration*3:0},by=function(t,r){var n=0,e=r-t.mediaSequence,i=t.segments[e];if(i){if(typeof i.start<"u")return{result:i.start,precise:!0};if(typeof i.end<"u")return{result:i.end-i.duration,precise:!0}}for(;e--;){if(i=t.segments[e],typeof i.end<"u")return{result:n+i.end,precise:!0};if(n+=Mo(t,i),typeof i.start<"u")return{result:n+i.start,precise:!0}}return{result:n,precise:!1}},xy=function(t,r){for(var n=0,e,i=r-t.mediaSequence;i<t.segments.length;i++){if(e=t.segments[i],typeof e.start<"u")return{result:e.start-n,precise:!0};if(n+=Mo(t,e),typeof e.end<"u")return{result:e.end-n,precise:!0}}return{result:-1,precise:!1}},bf=function(t,r,n){if(typeof r>"u"&&(r=t.mediaSequence+t.segments.length),r<t.mediaSequence)return 0;var e=by(t,r);if(e.precise)return e.result;var i=xy(t,r);return i.precise?i.result:e.result+n},xf=function(t,r,n){if(!t)return 0;if(typeof n!="number"&&(n=0),typeof r>"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return A.Infinity}return bf(t,r,n)},Ai=function(t){var r=t.defaultDuration,n=t.durationList,e=t.startIndex,i=t.endIndex,s=0;if(e>i){var o=[i,e];e=o[0],i=o[1]}if(e<0){for(var u=e;u<Math.min(0,i);u++)s+=r;e=0}for(var l=e;l<i;l++)s+=n[l].duration;return s},Sf=function(t,r,n,e){if(!t||!t.segments)return null;if(t.endList)return xf(t);if(r===null)return null;r=r||0;var i=bf(t,t.mediaSequence+t.segments.length,r);return n&&(e=typeof e=="number"?e:Tf(null,t),i-=e),Math.max(0,i)},Sy=function(t,r,n){var e=!0,i=r||0,s=Sf(t,r,e,n);return s===null?Vl():Vl(i,s)},Ey=function(t){for(var r=t.playlist,n=t.currentTime,e=t.startingSegmentIndex,i=t.startingPartIndex,s=t.startTime,o=t.experimentalExactManifestTimings,u=n-s,l=ws(r),c=0,p=0;p<l.length;p++){var m=l[p];if(e===m.segmentIndex&&!(typeof i=="number"&&typeof m.partIndex=="number"&&i!==m.partIndex)){c=p;break}}if(u<0){if(c>0)for(var _=c-1;_>=0;_--){var b=l[_];if(u+=b.duration,o){if(u<0)continue}else if(u+Qt<=0)continue;return{partIndex:b.partIndex,segmentIndex:b.segmentIndex,startTime:s-Ai({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:_})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n}}if(c<0){for(var S=c;S<0;S++)if(u-=r.targetDuration,u<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n};c=0}for(var x=c;x<l.length;x++){var k=l[x];if(u-=k.duration,o){if(u>0)continue}else if(u-Qt>=0)continue;return{partIndex:k.partIndex,segmentIndex:k.segmentIndex,startTime:s+Ai({defaultDuration:r.targetDuration,durationList:l,startIndex:c,endIndex:x})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:n}},Ef=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},No=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Aa=function(t){var r=Ef(t);return!t.disabled&&!r},Cy=function(t){return t.disabled},Ay=function(t){for(var r=0;r<t.segments.length;r++)if(t.segments[r].key)return!0;return!1},Cf=function(t,r){return r.attributes&&r.attributes[t]},Dy=function(t,r,n,e){if(e===void 0&&(e=0),!Cf("BANDWIDTH",n))return NaN;var i=t*n.attributes.BANDWIDTH;return(i-e*8)/r},ks=function(t,r){if(t.playlists.length===1)return!0;var n=r.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(function(e){return Aa(e)?(e.attributes.BANDWIDTH||0)<n:!1}).length===0},Bo=function(t,r){return!t&&!r||!t&&r||t&&!r?!1:!!(t===r||t.id&&r.id&&t.id===r.id||t.resolvedUri&&r.resolvedUri&&t.resolvedUri===r.resolvedUri||t.uri&&r.uri&&t.uri===r.uri)},Hl=function(t,r){var n=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{},e=!1;for(var i in n){for(var s in n[i])if(e=r(n[i][s]),e)break;if(e)break}return!!e},Ki=function(t){if(!t||!t.playlists||!t.playlists.length){var r=Hl(t,function(s){return s.playlists&&s.playlists.length||s.uri});return r}for(var n=function(o){var u=t.playlists[o],l=u.attributes&&u.attributes.CODECS;if(l&&l.split(",").every(function(p){return _d(p)}))return"continue";var c=Hl(t,function(p){return Bo(u,p)});return c?"continue":{v:!1}},e=0;e<t.playlists.length;e++){var i=n(e);if(i!=="continue"&&typeof i=="object")return i.v}return!0},Qe={liveEdgeDelay:Tf,duration:xf,seekable:Sy,getMediaInfoForTime:Ey,isEnabled:Aa,isDisabled:Cy,isBlacklisted:Ef,isIncompatible:No,playlistEnd:Sf,isAes:Ay,hasAttribute:Cf,estimateSegmentRequestTime:Dy,isLowestEnabledRendition:ks,isAudioOnly:Ki,playlistMatch:Bo,segmentDurationWithParts:Mo},Af=I.log,Uo=function(t,r){return t+"-"+r},wy=function(t){var r=t.onwarn,n=t.oninfo,e=t.manifestString,i=t.customTagParsers,s=i===void 0?[]:i,o=t.customTagMappers,u=o===void 0?[]:o,l=t.experimentalLLHLS,c=new qm;r&&c.on("warn",r),n&&c.on("info",n),s.forEach(function(S){return c.addParser(S)}),u.forEach(function(S){return c.addTagMapper(S)}),c.push(e),c.end();var p=c.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(S){p.hasOwnProperty(S)&&delete p[S]}),p.segments&&p.segments.forEach(function(S){["parts","preloadHints"].forEach(function(x){S.hasOwnProperty(x)&&delete S[x]})})),!p.targetDuration){var m=10;p.segments&&p.segments.length&&(m=p.segments.reduce(function(S,x){return Math.max(S,x.duration)},0)),r&&r("manifest has no targetDuration defaulting to "+m),p.targetDuration=m}var _=yf(p);if(_.length&&!p.partTargetDuration){var b=_.reduce(function(S,x){return Math.max(S,x.duration)},0);r&&(r("manifest has no partTargetDuration defaulting to "+b),Af.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.")),p.partTargetDuration=b}return p},Xi=function(t,r){t.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(n){if(t.mediaGroups[n])for(var e in t.mediaGroups[n])for(var i in t.mediaGroups[n][e]){var s=t.mediaGroups[n][e][i];r(s,n,e,i)}})},Df=function(t){var r=t.playlist,n=t.uri,e=t.id;r.id=e,r.playlistErrors_=0,n&&(r.uri=n),r.attributes=r.attributes||{}},ky=function(t){for(var r=t.playlists.length;r--;){var n=t.playlists[r];Df({playlist:n,id:Uo(r,n.uri)}),n.resolvedUri=dt(t.uri,n.uri),t.playlists[n.id]=n,t.playlists[n.uri]=n,n.attributes.BANDWIDTH||Af.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Py=function(t){Xi(t,function(r){r.uri&&(r.resolvedUri=dt(t.uri,r.uri))})},Iy=function(t,r){var n=Uo(0,r),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A.location.href,resolvedUri:A.location.href,playlists:[{uri:r,id:n,resolvedUri:r,attributes:{}}]};return e.playlists[n]=e.playlists[0],e.playlists[r]=e.playlists[0],e},wf=function(t,r){t.uri=r;for(var n=0;n<t.playlists.length;n++)if(!t.playlists[n].uri){var e="placeholder-uri-"+n;t.playlists[n].uri=e}var i=Ki(t);Xi(t,function(s,o,u,l){var c="placeholder-uri-"+o+"-"+u+"-"+l;if(!s.playlists||!s.playlists.length){if(i&&o==="AUDIO"&&!s.uri)for(var p=0;p<t.playlists.length;p++){var m=t.playlists[p];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===u)return}s.playlists=[ht({},s)]}s.playlists.forEach(function(_,b){var S=Uo(b,c);_.uri?_.resolvedUri=_.resolvedUri||dt(t.uri,_.uri):(_.uri=b===0?c:S,_.resolvedUri=_.uri),_.id=_.id||S,_.attributes=_.attributes||{},t.playlists[_.id]=_,t.playlists[_.uri]=_})}),ky(t),Py(t)},ea=I.mergeOptions,Ly=I.EventTarget,Oy=function(t,r){if(r.endList||!r.serverControl)return t;var n={};if(r.serverControl.canBlockReload){var e=r.preloadSegment,i=r.mediaSequence+r.segments.length;if(e){var s=e.parts||[],o=_f(r)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&i--}n._HLS_msn=i}if(r.serverControl&&r.serverControl.canSkipUntil&&(n._HLS_skip=r.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var u=new A.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){n.hasOwnProperty(l)&&u.searchParams.set(l,n[l])}),t=u.toString()}return t},Fy=function(t,r){if(!t)return r;var n=ea(t,r);if(t.preloadHints&&!r.preloadHints&&delete n.preloadHints,t.parts&&!r.parts)delete n.parts;else if(t.parts&&r.parts)for(var e=0;e<r.parts.length;e++)t.parts&&t.parts[e]&&(n.parts[e]=ea(t.parts[e],r.parts[e]));return!t.skipped&&r.skipped&&(n.skipped=!1),t.preload&&!r.preload&&(n.preload=!1),n},Ry=function(t,r,n){var e=t.slice(),i=r.slice();n=n||0;for(var s=[],o,u=0;u<i.length;u++){var l=e[u+n],c=i[u];l?(o=l.map||o,s.push(Fy(l,c))):(o&&!c.map&&(c.map=o),s.push(c))}return s},kf=function(t,r){!t.resolvedUri&&t.uri&&(t.resolvedUri=dt(r,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=dt(r,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=dt(r,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=dt(r,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(function(n){n.resolvedUri||(n.resolvedUri=dt(r,n.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(function(n){n.resolvedUri||(n.resolvedUri=dt(r,n.uri))})},Pf=function(t){var r=t.segments||[],n=t.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints){for(var e=0;e<n.preloadHints.length;e++)if(n.preloadHints[e].type==="MAP")return r}n.duration=t.targetDuration,n.preload=!0,r.push(n)}return r},If=function(t,r){return t===r||t.segments&&r.segments&&t.segments.length===r.segments.length&&t.endList===r.endList&&t.mediaSequence===r.mediaSequence&&t.preloadSegment===r.preloadSegment},Ps=function(t,r,n){n===void 0&&(n=If);var e=ea(t,{}),i=e.playlists[r.id];if(!i||n(i,r))return null;r.segments=Pf(r);var s=ea(i,r);if(s.preloadSegment&&!r.preloadSegment&&delete s.preloadSegment,i.segments){if(r.skip){r.segments=r.segments||[];for(var o=0;o<r.skip.skippedSegments;o++)r.segments.unshift({skipped:!0})}s.segments=Ry(i.segments,r.segments,r.mediaSequence-i.mediaSequence)}s.segments.forEach(function(l){kf(l,s.resolvedUri)});for(var u=0;u<e.playlists.length;u++)e.playlists[u].id===r.id&&(e.playlists[u]=s);return e.playlists[r.id]=s,e.playlists[r.uri]=s,Xi(t,function(l,c,p,m){if(l.playlists)for(var _=0;_<l.playlists.length;_++)r.id===l.playlists[_].id&&(l.playlists[_]=s)}),e},Is=function(t,r){var n=t.segments||[],e=n[n.length-1],i=e&&e.parts&&e.parts[e.parts.length-1],s=i&&i.duration||e&&e.duration;return r&&s?s*1e3:(t.partTargetDuration||t.targetDuration||10)*500},Rr=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(i===void 0&&(i={}),s=a.call(this)||this,!n)throw new Error("A non-empty playlist URL or object is required");s.logger_=mt("PlaylistLoader");var o=i,u=o.withCredentials,l=u===void 0?!1:u,c=o.handleManifestRedirects,p=c===void 0?!1:c;s.src=n,s.vhs_=e,s.withCredentials=l,s.handleManifestRedirects=p;var m=e.options_;return s.customTagParsers=m&&m.customTagParsers||[],s.customTagMappers=m&&m.customTagMappers||[],s.experimentalLLHLS=m&&m.experimentalLLHLS||!1,I.browser.IE_VERSION&&(s.experimentalLLHLS=!1),s.state="HAVE_NOTHING",s.handleMediaupdatetimeout_=s.handleMediaupdatetimeout_.bind(ee(s)),s.on("mediaupdatetimeout",s.handleMediaupdatetimeout_),s}var r=t.prototype;return r.handleMediaupdatetimeout_=function(){var e=this;if(this.state==="HAVE_METADATA"){var i=this.media(),s=dt(this.master.uri,i.uri);this.experimentalLLHLS&&(s=Oy(s,i)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:s,withCredentials:this.withCredentials},function(o,u){if(e.request){if(o)return e.playlistRequestError(e.request,e.media(),"HAVE_METADATA");e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}})}},r.playlistRequestError=function(e,i,s){var o=i.uri,u=i.id;this.request=null,s&&(this.state=s),this.error={playlist:this.master.playlists[u],status:e.status,message:"HLS playlist request error at URL: "+o+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},r.parseManifest_=function(e){var i=this,s=e.url,o=e.manifestString;return wy({onwarn:function(l){var c=l.message;return i.logger_("m3u8-parser warn for "+s+": "+c)},oninfo:function(l){var c=l.message;return i.logger_("m3u8-parser info for "+s+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(e){var i=e.playlistString,s=e.playlistObject,o=e.url,u=e.id;this.request=null,this.state="HAVE_METADATA";var l=s||this.parseManifest_({url:o,manifestString:i});l.lastRequest=Date.now(),Df({playlist:l,uri:o,id:u});var c=Ps(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[u]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Is(this.media(),!!c)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),A.clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e,i){var s=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(A.clearTimeout(this.finalRenditionTimeout),i){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A.setTimeout(this.media.bind(this,e,!1),o);return}var u=this.state,l=!this.media_||e.id!==this.media_.id,c=this.master.playlists[e.id];if(c&&c.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,l&&(this.trigger("mediachanging"),u==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Is(e,!0)),!!l){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(p,m){if(s.request){if(e.lastRequest=Date.now(),e.resolvedUri=Zn(s.handleManifestRedirects,e.resolvedUri,m),p)return s.playlistRequestError(s.request,e,u);s.haveMetadata({playlistString:m.responseText,url:e.uri,id:e.id}),u==="HAVE_MASTER"?s.trigger("loadedmetadata"):s.trigger("mediachange")}})}},r.pause=function(){this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var s=this.media();if(e){var o=s?(s.partTargetDuration||s.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},r.updateMediaUpdateTimeout_=function(e){var i=this;this.mediaUpdateTimeout&&(A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=A.setTimeout(function(){i.mediaUpdateTimeout=null,i.trigger("mediaupdatetimeout"),i.updateMediaUpdateTimeout_(e)},e))},r.start=function(){var e=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=A.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){e.setupInitialPlaylist(e.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(i,s){if(e.request){if(e.request=null,i)return e.error={status:s.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:s.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=Zn(e.handleManifestRedirects,e.src,s);var o=e.parseManifest_({manifestString:s.responseText,url:e.src});e.setupInitialPlaylist(o)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,wf(this.master,this.srcUri()),e.playlists.forEach(function(s){s.segments=Pf(s),s.segments.forEach(function(o){kf(o,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var i=this.srcUri()||A.location.href;this.master=Iy(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Ly),My=I.xhr,Ny=I.mergeOptions,Ls=function(t,r,n,e){var i=t.responseType==="arraybuffer"?t.response:t.responseText;!r&&i&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=i.byteLength||i.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),n.headers&&(t.responseHeaders=n.headers),r&&r.code==="ETIMEDOUT"&&(t.timedout=!0),!r&&!t.aborted&&n.statusCode!==200&&n.statusCode!==206&&n.statusCode!==0&&(r=new Error("XHR Failed with a response of: "+(t&&(i||t.responseText)))),e(r,t)},Lf=function(){var t=function r(n,e){n=Ny({timeout:45e3},n);var i=r.beforeRequest||I.Vhs.xhr.beforeRequest;if(i&&typeof i=="function"){var s=i(n);s&&(n=s)}var o=I.Vhs.xhr.original===!0?My:I.Vhs.xhr,u=o(n,function(c,p){return Ls(u,c,p,e)}),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=n.uri,u.requestTime=Date.now(),u};return t.original=!0,t},By=function(t){var r,n=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?r=A.BigInt(t.offset)+A.BigInt(t.length)-A.BigInt(1):r=t.offset+t.length-1,"bytes="+n+"-"+r},Os=function(t){var r={};return t.byterange&&(r.Range=By(t.byterange)),r},Uy=function(t,r){return t.start(r)+"-"+t.end(r)},Vy=function(t,r){var n=t.toString(16);return"00".substring(0,2-n.length)+n+(r%2?" ":"")},Hy=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Of=function(t){var r={};return Object.keys(t).forEach(function(n){var e=t[n];bd(e)?r[n]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:r[n]=e}),r},ta=function(t){var r=t.byterange||{length:1/0,offset:0};return[r.length,r.offset,t.resolvedUri].join(",")},Ff=function(t){return t.resolvedUri},Rf=function(t){for(var r=Array.prototype.slice.call(t),n=16,e="",i,s,o=0;o<r.length/n;o++)i=r.slice(o*n,o*n+n).map(Vy).join(""),s=r.slice(o*n,o*n+n).map(Hy).join(""),e+=i+" "+s+`
|
|
58
58
|
`;return e},qy=function(t){var r=t.bytes;return Rf(r)},jy=function(t){var r="",n;for(n=0;n<t.length;n++)r+=Uy(t,n)+" ";return r},Wy=Object.freeze({__proto__:null,createTransferableMessage:Of,initSegmentId:ta,segmentKeyId:Ff,hexDump:Rf,tagDump:qy,textRanges:jy}),Mf=.25,Gy=function(t,r){if(!r.dateTimeObject)return null;var n=r.videoTimingInfo.transmuxerPrependedSeconds,e=r.videoTimingInfo.transmuxedPresentationStart,i=e+n,s=t-i;return new Date(r.dateTimeObject.getTime()+s*1e3)},zy=function(t){return t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds},$y=function(t,r){var n;try{n=new Date(t)}catch{return null}if(!r||!r.segments||r.segments.length===0)return null;var e=r.segments[0];if(n<e.dateTimeObject)return null;for(var i=0;i<r.segments.length-1;i++){e=r.segments[i];var s=r.segments[i+1].dateTimeObject;if(n<s)break}var o=r.segments[r.segments.length-1],u=o.dateTimeObject,l=o.videoTimingInfo?zy(o.videoTimingInfo):o.duration+o.duration*Mf,c=new Date(u.getTime()+l*1e3);return n>c?null:(n>u&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:Qe.duration(r,r.mediaSequence+r.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},Ky=function(t,r){if(!r||!r.segments||r.segments.length===0)return null;for(var n=0,e,i=0;i<r.segments.length&&(e=r.segments[i],n=e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationEnd:n+e.duration,!(t<=n));i++);var s=r.segments[r.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<t)return null;if(t>n){if(t>n+s.duration*Mf)return null;e=s}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:n-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}},Xy=function(t,r){var n,e;try{n=new Date(t),e=new Date(r)}catch{}var i=n.getTime(),s=e.getTime();return(s-i)/1e3},Yy=function(t){if(!t.segments||t.segments.length===0)return!1;for(var r=0;r<t.segments.length;r++){var n=t.segments[r];if(!n.dateTimeObject)return!1}return!0},Qy=function(t){var r=t.playlist,n=t.time,e=n===void 0?void 0:n,i=t.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!r||e===void 0)return i({message:"getProgramTime: playlist and time must be provided"});var s=Ky(e,r);if(!s)return i({message:"valid programTime was not found"});if(s.type==="estimate")return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});var o={mediaSeconds:e},u=Gy(e,s.segment);return u&&(o.programDateTime=u.toISOString()),i(null,o)},Jy=function a(t){var r=t.programTime,n=t.playlist,e=t.retryCount,i=e===void 0?2:e,s=t.seekTo,o=t.pauseAfterSeek,u=o===void 0?!0:o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof r>"u"||!n||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!Yy(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var p=$y(r,n);if(!p)return c({message:r+" was not found in the stream"});var m=p.segment,_=Xy(m.dateTimeObject,r);if(p.type==="estimate"){if(i===0)return c({message:r+" is not buffered yet. Try again"});s(p.estimatedStart+_),l.one("seeked",function(){a({programTime:r,playlist:n,retryCount:i-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})});return}var b=m.start+_,S=function(){return c(null,l.currentTime())};l.one("seeked",S),u&&l.pause(),s(b)},os=function(t,r){if(t.readyState===4)return r()},Zy=function(t,r,n){var e=[],i,s=!1,o=function(m,_,b,S){return _.abort(),s=!0,n(m,_,b,S)},u=function(m,_){if(!s){if(m)return o(m,_,"",e);var b=_.responseText.substring(e&&e.byteLength||0,_.responseText.length);if(e=eg(e,xd(b,!0)),i=i||bi(e),e.length<10||i&&e.length<i+2)return os(_,function(){return o(m,_,"",e)});var S=no(e);return S==="ts"&&e.length<188?os(_,function(){return o(m,_,"",e)}):!S&&e.length<376?os(_,function(){return o(m,_,"",e)}):o(null,_,S,e)}},l={uri:t,beforeSend:function(m){m.overrideMimeType("text/plain; charset=x-user-defined"),m.addEventListener("progress",function(_){return _.total,_.loaded,Ls(m,null,{statusCode:m.status},u)})}},c=r(l,function(p,m){return Ls(c,p,m,u)});return c},e_=I.EventTarget,Nf=I.mergeOptions,ql=function(t,r){if(!If(t,r)||t.sidx&&r.sidx&&(t.sidx.offset!==r.sidx.offset||t.sidx.length!==r.sidx.length))return!1;if(!t.sidx&&r.sidx||t.sidx&&!r.sidx||t.segments&&!r.segments||!t.segments&&r.segments)return!1;if(!t.segments&&!r.segments)return!0;for(var n=0;n<t.segments.length;n++){var e=t.segments[n],i=r.segments[n];if(e.uri!==i.uri)return!1;if(!(!e.byterange&&!i.byterange)){var s=e.byterange,o=i.byterange;if(s&&!o||!s&&o||s.offset!==o.offset||s.length!==o.length)return!1}}return!0},t_=function(t){var r=t.masterXml,n=t.srcUrl,e=t.clientOffset,i=t.sidxMapping,s=t.previousManifest,o=_v(r,{manifestUri:n,clientOffset:e,sidxMapping:i,previousManifest:s});return wf(o,n),o},r_=function(t,r,n){for(var e=!0,i=Nf(t,{duration:r.duration,minimumUpdatePeriod:r.minimumUpdatePeriod,timelineStarts:r.timelineStarts}),s=0;s<r.playlists.length;s++){var o=r.playlists[s];if(o.sidx){var u=pa(o.sidx);n&&n[u]&&n[u].sidx&&eo(o,n[u].sidx,o.sidx.resolvedUri)}var l=Ps(i,o,ql);l&&(i=l,e=!1)}return Xi(r,function(c,p,m,_){if(c.playlists&&c.playlists.length){var b=c.playlists[0].id,S=Ps(i,c.playlists[0],ql);S&&(i=S,i.mediaGroups[p][m][_].playlists[0]=i.playlists[b],e=!1)}}),r.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(e=!1),e?null:i},i_=function(t,r){var n=!t.map&&!r.map,e=n||!!(t.map&&r.map&&t.map.byterange.offset===r.map.byterange.offset&&t.map.byterange.length===r.map.byterange.length);return e&&t.uri===r.uri&&t.byterange.offset===r.byterange.offset&&t.byterange.length===r.byterange.length},jl=function(t,r){var n={};for(var e in t){var i=t[e],s=i.sidx;if(s){var o=pa(s);if(!r[o])break;var u=r[o].sidxInfo;i_(u,s)&&(n[o]=r[o])}}return n},n_=function(t,r){var n=jl(t.playlists,r),e=n;return Xi(t,function(i,s,o,u){if(i.playlists&&i.playlists.length){var l=i.playlists;e=Nf(e,jl(l,r))}}),e},Fs=function(a){G._inheritsLoose(t,a);function t(n,e,i,s){var o;i===void 0&&(i={}),o=a.call(this)||this,o.masterPlaylistLoader_=s||ee(o),s||(o.isMaster_=!0);var u=i,l=u.withCredentials,c=l===void 0?!1:l,p=u.handleManifestRedirects,m=p===void 0?!1:p;if(o.vhs_=e,o.withCredentials=c,o.handleManifestRedirects=m,!n)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=mt("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=n,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=n,o}var r=t.prototype;return r.requestErrored_=function(e,i,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:i.status,message:"DASH request error at URL: "+i.uri,response:i.response,code:2},s&&(this.state=s),this.trigger("error"),!0},r.addSidxSegments_=function(e,i,s){var o=this,u=e.sidx&&pa(e.sidx);if(!e.sidx||!u||this.masterPlaylistLoader_.sidxMapping_[u]){this.mediaRequest_=A.setTimeout(function(){return s(!1)},0);return}var l=Zn(this.handleManifestRedirects,e.sidx.resolvedUri),c=function(m,_){if(!o.requestErrored_(m,_,i)){var b=o.masterPlaylistLoader_.sidxMapping_,S;try{S=Av(Q(_.response).subarray(8))}catch(x){o.requestErrored_(x,_,i);return}return b[u]={sidxInfo:e.sidx,sidx:S},eo(e,S,e.sidx.resolvedUri),s(!0)}};this.request=Zy(l,this.vhs_.xhr,function(p,m,_,b){if(p)return c(p,m);if(!_||_!=="mp4")return c({status:m.status,message:"Unsupported "+(_||"unknown")+" container type for sidx segment at URL: "+l,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},m);var S=e.sidx.byterange,x=S.offset,k=S.length;if(b.length>=k+x)return c(p,{response:b.subarray(x,x+k),status:m.status,uri:m.uri});o.request=o.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:Os({byterange:e.sidx.byterange})},c)})},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A.clearTimeout(this.minimumUpdatePeriodTimeout_),A.clearTimeout(this.mediaRequest_),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e){var i=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var s=this.state;if(typeof e=="string"){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var o=!this.media_||e.id!==this.media_.id;if(o&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,s,function(u){i.haveMetadata({startingState:s,playlist:e})}))},r.haveMetadata=function(e){var i=e.startingState,s=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[s.id]=s,this.mediaRequest_=null,this.refreshMedia_(s.id),i==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},r.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(A.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(e){var i=this;A.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var s=this.media();if(e){var o=s?s.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A.setTimeout(function(){return i.load()},o);return}if(!this.started){this.start();return}s&&!s.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},r.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=A.setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(i,s){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])})},r.requestMaster_=function(e){var i=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(s,o){if(i.requestErrored_(s,o)){i.state==="HAVE_NOTHING"&&(i.started=!1);return}var u=o.responseText!==i.masterPlaylistLoader_.masterXml_;if(i.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?i.masterLoaded_=Date.parse(o.responseHeaders.date):i.masterLoaded_=Date.now(),i.masterPlaylistLoader_.srcUrl=Zn(i.handleManifestRedirects,i.masterPlaylistLoader_.srcUrl,o),u){i.handleMaster_(),i.syncClientServerClock_(function(){return e(o,u)});return}return e(o,u)})},r.syncClientServerClock_=function(e){var i=this,s=Tv(this.masterPlaylistLoader_.masterXml_);if(s===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e();if(s.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=s.value-Date.now(),e();this.request=this.vhs_.xhr({uri:dt(this.masterPlaylistLoader_.srcUrl,s.value),method:s.method,withCredentials:this.withCredentials},function(o,u){if(i.request){if(o)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),e();var l;s.method==="HEAD"?!u.responseHeaders||!u.responseHeaders.date?l=i.masterLoaded_:l=Date.parse(u.responseHeaders.date):l=Date.parse(u.responseText),i.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}})},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,i=t_({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(i=r_(e,i,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=i||e;var s=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return s&&s!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=s),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!i},r.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(A.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var i=e.master&&e.master.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_("found invalid minimumUpdatePeriod of "+i+", not setting a timeout");return}this.createMUPTimeout_(i)},r.createMUPTimeout_=function(e){var i=this.masterPlaylistLoader_;i.minimumUpdatePeriodTimeout_=A.setTimeout(function(){i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)},r.refreshXml_=function(){var e=this;this.requestMaster_(function(i,s){s&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=n_(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(o){e.refreshMedia_(e.media().id)}))})},r.refreshMedia_=function(e){var i=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var s=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==s[e];if(o?this.media_=s[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var u=function l(){i.media().endList||(i.mediaUpdateTimeout=A.setTimeout(function(){i.trigger("mediaupdatetimeout"),l()},Is(i.media(),!!o)))};u()}this.trigger("loadedplaylist")},t}(e_),we={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},a_=function(t){for(var r=new Uint8Array(new ArrayBuffer(t.length)),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer},Bf=function(t){return t.on=t.addEventListener,t.off=t.removeEventListener,t},s_=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch{var r=new BlobBuilder;return r.append(t),URL.createObjectURL(r.getBlob())}},Uf=function(t){return function(){var r=s_(t),n=Bf(new Worker(r));n.objURL=r;var e=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(r),e.call(this)},n}},Vf=function(t){return"var browserWorkerPolyFill = "+Bf.toString()+`;
|
|
59
59
|
browserWorkerPolyFill(self);
|
|
60
|
-
`+t},Hf=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},o_=Vf(Hf(function(){var a=function(){this.init=function(){var d={};this.on=function(h,f){d[h]||(d[h]=[]),d[h]=d[h].concat(f)},this.off=function(h,f){var g;return d[h]?(g=d[h].indexOf(f),d[h]=d[h].slice(),d[h].splice(g,1),g>-1):!1},this.trigger=function(h){var f,g,v,y;if(f=d[h],!!f)if(arguments.length===2)for(v=f.length,g=0;g<v;++g)f[g].call(this,arguments[1]);else{for(y=[],g=arguments.length,g=1;g<arguments.length;++g)y.push(arguments[g]);for(v=f.length,g=0;g<v;++g)f[g].apply(this,y)}},this.dispose=function(){d={}}}};a.prototype.pipe=function(T){return this.on("data",function(d){T.push(d)}),this.on("done",function(d){T.flush(d)}),this.on("partialdone",function(d){T.partialFlush(d)}),this.on("endedtimeline",function(d){T.endTimeline(d)}),this.on("reset",function(d){T.reset(d)}),T},a.prototype.push=function(T){this.trigger("data",T)},a.prototype.flush=function(T){this.trigger("done",T)},a.prototype.partialFlush=function(T){this.trigger("partialdone",T)},a.prototype.endTimeline=function(T){this.trigger("endedtimeline",T)},a.prototype.reset=function(T){this.trigger("reset",T)};var t=a,r=Math.pow(2,32),n=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f;return h.getBigUint64?(f=h.getBigUint64(0),f<Number.MAX_SAFE_INTEGER?Number(f):f):h.getUint32(0)*r+h.getUint32(4)},e={getUint64:n,MAX_UINT32:r},i=e.MAX_UINT32,s,o,u,l,c,p,m,_,b,S,x,k,L,H,O,F,q,B,R,U,N,X,$,J,oe,fe,re,ae,pe,Me,ue,Yi,at,Dt,zt,Zt;(function(){var T;if($={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(T in $)$.hasOwnProperty(T)&&($[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);J=new Uint8Array([105,115,111,109]),fe=new Uint8Array([97,118,99,49]),oe=new Uint8Array([0,0,0,1]),re=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ae=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),pe={video:re,audio:ae},Yi=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ue=new Uint8Array([0,0,0,0,0,0,0,0]),at=new Uint8Array([0,0,0,0,0,0,0,0]),Dt=at,zt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Zt=at,Me=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),s=function(d){var h=[],f=0,g,v,y;for(g=1;g<arguments.length;g++)h.push(arguments[g]);for(g=h.length;g--;)f+=h[g].byteLength;for(v=new Uint8Array(f+8),y=new DataView(v.buffer,v.byteOffset,v.byteLength),y.setUint32(0,v.byteLength),v.set(d,4),g=0,f=8;g<h.length;g++)v.set(h[g],f),f+=h[g].byteLength;return v},o=function(){return s($.dinf,s($.dref,Yi))},u=function(d){return s($.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,d.audioobjecttype<<3|d.samplingfrequencyindex>>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},l=function(){return s($.ftyp,J,oe,J,fe)},F=function(d){return s($.hdlr,pe[d])},c=function(d){return s($.mdat,d)},O=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,d.duration>>>24&255,d.duration>>>16&255,d.duration>>>8&255,d.duration&255,85,196,0,0]);return d.samplerate&&(h[12]=d.samplerate>>>24&255,h[13]=d.samplerate>>>16&255,h[14]=d.samplerate>>>8&255,h[15]=d.samplerate&255),s($.mdhd,h)},H=function(d){return s($.mdia,O(d),F(d.type),m(d))},p=function(d){return s($.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},m=function(d){return s($.minf,d.type==="video"?s($.vmhd,Me):s($.smhd,ue),o(),B(d))},_=function(d,h){for(var f=[],g=h.length;g--;)f[g]=U(h[g]);return s.apply(null,[$.moof,p(d)].concat(f))},b=function(d){for(var h=d.length,f=[];h--;)f[h]=k(d[h]);return s.apply(null,[$.moov,x(4294967295)].concat(f).concat(S(d)))},S=function(d){for(var h=d.length,f=[];h--;)f[h]=N(d[h]);return s.apply(null,[$.mvex].concat(f))},x=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return s($.mvhd,h)},q=function(d){var h=d.samples||[],f=new Uint8Array(4+h.length),g,v;for(v=0;v<h.length;v++)g=h[v].flags,f[v+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return s($.sdtp,f)},B=function(d){return s($.stbl,R(d),s($.stts,Zt),s($.stsc,Dt),s($.stsz,zt),s($.stco,at))},function(){var T,d;R=function(f){return s($.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),f.type==="video"?T(f):d(f))},T=function(f){var g=f.sps||[],v=f.pps||[],y=[],E=[],C,w;for(C=0;C<g.length;C++)y.push((g[C].byteLength&65280)>>>8),y.push(g[C].byteLength&255),y=y.concat(Array.prototype.slice.call(g[C]));for(C=0;C<v.length;C++)E.push((v[C].byteLength&65280)>>>8),E.push(v[C].byteLength&255),E=E.concat(Array.prototype.slice.call(v[C]));if(w=[$.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(f.width&65280)>>8,f.width&255,(f.height&65280)>>8,f.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s($.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([g.length],y,[v.length],E))),s($.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var D=f.sarRatio[0],P=f.sarRatio[1];w.push(s($.pasp,new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return s.apply(null,w)},d=function(f){return s($.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(f.channelcount&65280)>>8,f.channelcount&255,(f.samplesize&65280)>>8,f.samplesize&255,0,0,0,0,(f.samplerate&65280)>>8,f.samplerate&255,0,0]),u(f))}}(),L=function(d){var h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,0,(d.duration&4278190080)>>24,(d.duration&16711680)>>16,(d.duration&65280)>>8,d.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(d.width&65280)>>8,d.width&255,0,0,(d.height&65280)>>8,d.height&255,0,0]);return s($.tkhd,h)},U=function(d){var h,f,g,v,y,E,C;return h=s($.tfhd,new Uint8Array([0,0,0,58,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),E=Math.floor(d.baseMediaDecodeTime/i),C=Math.floor(d.baseMediaDecodeTime%i),f=s($.tfdt,new Uint8Array([1,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255])),y=92,d.type==="audio"?(g=X(d,y),s($.traf,h,f,g)):(v=q(d),g=X(d,v.length+y),s($.traf,h,f,g,v))},k=function(d){return d.duration=d.duration||4294967295,s($.trak,L(d),H(d))},N=function(d){var h=new Uint8Array([0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return d.type!=="video"&&(h[h.length-1]=0),s($.trex,h)},function(){var T,d,h;h=function(g,v){var y=0,E=0,C=0,w=0;return g.length&&(g[0].duration!==void 0&&(y=1),g[0].size!==void 0&&(E=2),g[0].flags!==void 0&&(C=4),g[0].compositionTimeOffset!==void 0&&(w=8)),[0,0,y|E|C|w,1,(g.length&4278190080)>>>24,(g.length&16711680)>>>16,(g.length&65280)>>>8,g.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]},d=function(g,v){var y,E,C,w,D,P;for(w=g.samples||[],v+=20+16*w.length,C=h(w,v),E=new Uint8Array(C.length+w.length*16),E.set(C),y=C.length,P=0;P<w.length;P++)D=w[P],E[y++]=(D.duration&4278190080)>>>24,E[y++]=(D.duration&16711680)>>>16,E[y++]=(D.duration&65280)>>>8,E[y++]=D.duration&255,E[y++]=(D.size&4278190080)>>>24,E[y++]=(D.size&16711680)>>>16,E[y++]=(D.size&65280)>>>8,E[y++]=D.size&255,E[y++]=D.flags.isLeading<<2|D.flags.dependsOn,E[y++]=D.flags.isDependedOn<<6|D.flags.hasRedundancy<<4|D.flags.paddingValue<<1|D.flags.isNonSyncSample,E[y++]=D.flags.degradationPriority&61440,E[y++]=D.flags.degradationPriority&15,E[y++]=(D.compositionTimeOffset&4278190080)>>>24,E[y++]=(D.compositionTimeOffset&16711680)>>>16,E[y++]=(D.compositionTimeOffset&65280)>>>8,E[y++]=D.compositionTimeOffset&255;return s($.trun,E)},T=function(g,v){var y,E,C,w,D,P;for(w=g.samples||[],v+=20+8*w.length,C=h(w,v),y=new Uint8Array(C.length+w.length*8),y.set(C),E=C.length,P=0;P<w.length;P++)D=w[P],y[E++]=(D.duration&4278190080)>>>24,y[E++]=(D.duration&16711680)>>>16,y[E++]=(D.duration&65280)>>>8,y[E++]=D.duration&255,y[E++]=(D.size&4278190080)>>>24,y[E++]=(D.size&16711680)>>>16,y[E++]=(D.size&65280)>>>8,y[E++]=D.size&255;return s($.trun,y)},X=function(g,v){return g.type==="audio"?T(g,v):d(g,v)}}();var gt={ftyp:l,mdat:c,moof:_,moov:b,initSegment:function(d){var h=l(),f=b(d),g;return g=new Uint8Array(h.byteLength+f.byteLength),g.set(h),g.set(f,h.byteLength),g}},vr=function(d){var h,f,g=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,g.byteLength=0,h=0;h<d.length;h++)f=d[h],f.nalUnitType==="access_unit_delimiter_rbsp"?(g.length&&(g.duration=f.dts-g.dts,v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g)),g=[f],g.byteLength=f.data.byteLength,g.pts=f.pts,g.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(g.keyFrame=!0),g.duration=f.dts-g.dts,g.byteLength+=f.data.byteLength,g.push(f));return v.length&&(!g.duration||g.duration<=0)&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g),v},yr=function(d){var h,f,g=[],v=[];for(g.byteLength=0,g.nalCount=0,g.duration=0,g.pts=d[0].pts,g.dts=d[0].dts,v.byteLength=0,v.nalCount=0,v.duration=0,v.pts=d[0].pts,v.dts=d[0].dts,h=0;h<d.length;h++)f=d[h],f.keyFrame?(g.length&&(v.push(g),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration),g=[f],g.nalCount=f.length,g.byteLength=f.byteLength,g.pts=f.pts,g.dts=f.dts,g.duration=f.duration):(g.duration+=f.duration,g.nalCount+=f.length,g.byteLength+=f.byteLength,g.push(f));return v.length&&g.duration<=0&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration,v.push(g),v},_r=function(d){var h;return!d[0][0].keyFrame&&d.length>1&&(h=d.shift(),d.byteLength-=h.byteLength,d.nalCount-=h.nalCount,d[0][0].dts=h.dts,d[0][0].pts=h.pts,d[0][0].duration+=h.duration),d},ah=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Wo=function(d,h){var f=ah();return f.dataOffset=h,f.compositionTimeOffset=d.pts-d.dts,f.duration=d.duration,f.size=4*d.length,f.size+=d.byteLength,d.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},sh=function(d,h){var f,g,v,y,E,C=h||0,w=[];for(f=0;f<d.length;f++)for(y=d[f],g=0;g<y.length;g++)E=y[g],v=Wo(E,C),C+=v.size,w.push(v);return w},oh=function(d){var h,f,g,v,y,E,C=0,w=d.byteLength,D=d.nalCount,P=w+4*D,M=new Uint8Array(P),z=new DataView(M.buffer);for(h=0;h<d.length;h++)for(v=d[h],f=0;f<v.length;f++)for(y=v[f],g=0;g<y.length;g++)E=y[g],z.setUint32(C,E.data.byteLength),C+=4,M.set(E.data,C),C+=E.data.byteLength;return M},uh=function(d,h){var f,g=h||0,v=[];return f=Wo(d,g),v.push(f),v},lh=function(d){var h,f,g=0,v=d.byteLength,y=d.length,E=v+4*y,C=new Uint8Array(E),w=new DataView(C.buffer);for(h=0;h<d.length;h++)f=d[h],w.setUint32(g,f.data.byteLength),g+=4,C.set(f.data,g),g+=f.data.byteLength;return C},ni={groupNalsIntoFrames:vr,groupFramesIntoGops:yr,extendFirstKeyFrame:_r,generateSampleTable:sh,concatenateNalData:oh,generateSampleTableForFrame:uh,concatenateNalDataForFrame:lh},$t=[33,16,5,32,164,27],Da=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],le=function(d){for(var h=[];d--;)h.push(0);return h},dh=function(d){return Object.keys(d).reduce(function(h,f){return h[f]=new Uint8Array(d[f].reduce(function(g,v){return g.concat(v)},[])),h},{})},wa,ch=function(){if(!wa){var d={96e3:[$t,[227,64],le(154),[56]],88200:[$t,[231],le(170),[56]],64e3:[$t,[248,192],le(240),[56]],48e3:[$t,[255,192],le(268),[55,148,128],le(54),[112]],44100:[$t,[255,192],le(268),[55,163,128],le(84),[112]],32e3:[$t,[255,192],le(268),[55,234],le(226),[112]],24e3:[$t,[255,192],le(268),[55,255,128],le(268),[111,112],le(126),[224]],16e3:[$t,[255,192],le(268),[55,255,128],le(268),[111,255],le(269),[223,108],le(195),[1,192]],12e3:[Da,le(268),[3,127,248],le(268),[6,255,240],le(268),[13,255,224],le(268),[27,253,128],le(259),[56]],11025:[Da,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:[Da,le(268),[3,121,16],le(47),[7]]};wa=dh(d)}return wa},ka=9e4,Pa,Ia,Qi,La,Go,zo,$o;Pa=function(d){return d*ka},Ia=function(d,h){return d*h},Qi=function(d){return d/ka},La=function(d,h){return d/h},Go=function(d,h){return Pa(La(d,h))},zo=function(d,h){return Ia(Qi(d),h)},$o=function(d,h,f){return Qi(f?d:d-h)};var se={ONE_SECOND_IN_TS:ka,secondsToVideoTs:Pa,secondsToAudioTs:Ia,videoTsToSeconds:Qi,audioTsToSeconds:La,audioTsToVideoTs:Go,videoTsToAudioTs:zo,metadataTsToSeconds:$o},fh=function(d){var h,f,g=0;for(h=0;h<d.length;h++)f=d[h],g+=f.data.byteLength;return g},hh=function(d,h,f,g){var v,y=0,E=0,C=0,w=0,D,P,M;if(h.length&&(v=se.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),y=Math.ceil(se.ONE_SECOND_IN_TS/(d.samplerate/1024)),f&&g&&(E=v-Math.max(f,g),C=Math.floor(E/y),w=C*y),!(C<1||w>se.ONE_SECOND_IN_TS/2))){for(D=ch()[d.samplerate],D||(D=h[0].data),P=0;P<C;P++)M=h[0],h.splice(0,0,{data:D,dts:M.dts-y,pts:M.pts-y});return d.baseMediaDecodeTime-=Math.floor(se.videoTsToAudioTs(w,d.samplerate)),w}},ph=function(d,h,f){return h.minSegmentDts>=f?d:(h.minSegmentDts=1/0,d.filter(function(g){return g.dts>=f?(h.minSegmentDts=Math.min(h.minSegmentDts,g.dts),h.minSegmentPts=h.minSegmentDts,!0):!1}))},mh=function(d){var h,f,g=[];for(h=0;h<d.length;h++)f=d[h],g.push({size:f.data.byteLength,duration:1024});return g},gh=function(d){var h,f,g=0,v=new Uint8Array(fh(d));for(h=0;h<d.length;h++)f=d[h],v.set(f.data,g),g+=f.data.byteLength;return v},Ji={prefixWithSilence:hh,trimAdtsFramesByEarliestDts:ph,generateSampleTable:mh,concatenateFrameData:gh},vh=se.ONE_SECOND_IN_TS,yh=function(d,h){typeof h.pts=="number"&&(d.timelineStartInfo.pts===void 0&&(d.timelineStartInfo.pts=h.pts),d.minSegmentPts===void 0?d.minSegmentPts=h.pts:d.minSegmentPts=Math.min(d.minSegmentPts,h.pts),d.maxSegmentPts===void 0?d.maxSegmentPts=h.pts:d.maxSegmentPts=Math.max(d.maxSegmentPts,h.pts)),typeof h.dts=="number"&&(d.timelineStartInfo.dts===void 0&&(d.timelineStartInfo.dts=h.dts),d.minSegmentDts===void 0?d.minSegmentDts=h.dts:d.minSegmentDts=Math.min(d.minSegmentDts,h.dts),d.maxSegmentDts===void 0?d.maxSegmentDts=h.dts:d.maxSegmentDts=Math.max(d.maxSegmentDts,h.dts))},_h=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},Th=function(d,h){var f,g,v=d.minSegmentDts;return h||(v-=d.timelineStartInfo.dts),f=d.timelineStartInfo.baseMediaDecodeTime,f+=v,f=Math.max(0,f),d.type==="audio"&&(g=d.samplerate/vh,f*=g,f=Math.floor(f)),f},ut={clearDtsInfo:_h,calculateTrackBaseMediaDecodeTime:Th,collectDtsInfo:yh},Ko=4,bh=128,xh=function(d){for(var h=0,f={payloadType:-1,payloadSize:0},g=0,v=0;h<d.byteLength&&d[h]!==bh;){for(;d[h]===255;)g+=255,h++;for(g+=d[h++];d[h]===255;)v+=255,h++;if(v+=d[h++],!f.payload&&g===Ko){var y=String.fromCharCode(d[h+3],d[h+4],d[h+5],d[h+6]);if(y==="GA94"){f.payloadType=g,f.payloadSize=v,f.payload=d.subarray(h,h+v);break}else f.payload=void 0}h+=v,g=0,v=0}return f},Sh=function(d){return d.payload[0]!==181||(d.payload[1]<<8|d.payload[2])!==49||String.fromCharCode(d.payload[3],d.payload[4],d.payload[5],d.payload[6])!=="GA94"||d.payload[7]!==3?null:d.payload.subarray(8,d.payload.length-1)},Eh=function(d,h){var f=[],g,v,y,E;if(!(h[0]&64))return f;for(v=h[0]&31,g=0;g<v;g++)y=g*3,E={type:h[y+2]&3,pts:d},h[y+2]&4&&(E.ccData=h[y+3]<<8|h[y+4],f.push(E));return f},Ch=function(d){for(var h=d.byteLength,f=[],g=1,v,y;g<h-2;)d[g]===0&&d[g+1]===0&&d[g+2]===3?(f.push(g+2),g+=2):g++;if(f.length===0)return d;v=h-f.length,y=new Uint8Array(v);var E=0;for(g=0;g<v;E++,g++)E===f[0]&&(E++,f.shift()),y[g]=d[E];return y},ai={parseSei:xh,parseUserData:Sh,parseCaptionPackets:Eh,discardEmulationPreventionBytes:Ch,USER_DATA_REGISTERED_ITU_T_T35:Ko},et=function T(d){d=d||{},T.prototype.init.call(this),this.parse708captions_=typeof d.parse708captions=="boolean"?d.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Te(0,0),new Te(0,1),new Te(1,0),new Te(1,1)],this.parse708captions_&&(this.cc708Stream_=new me({captionServices:d.captionServices})),this.reset(),this.ccStreams_.forEach(function(h){h.on("data",this.trigger.bind(this,"data")),h.on("partialdone",this.trigger.bind(this,"partialdone")),h.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};et.prototype=new t,et.prototype.push=function(T){var d,h,f;if(T.nalUnitType==="sei_rbsp"&&(d=ai.parseSei(T.escapedRBSP),!!d.payload&&d.payloadType===ai.USER_DATA_REGISTERED_ITU_T_T35&&(h=ai.parseUserData(d),!!h))){if(T.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(T.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}f=ai.parseCaptionPackets(T.pts,h),this.captionPackets_=this.captionPackets_.concat(f),this.latestDts_!==T.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=T.dts}},et.prototype.flushCCStreams=function(T){this.ccStreams_.forEach(function(d){return T==="flush"?d.flush():d.partialFlush()},this)},et.prototype.flushStream=function(T){if(!this.captionPackets_.length){this.flushCCStreams(T);return}this.captionPackets_.forEach(function(d,h){d.presortIndex=h}),this.captionPackets_.sort(function(d,h){return d.pts===h.pts?d.presortIndex-h.presortIndex:d.pts-h.pts}),this.captionPackets_.forEach(function(d){d.type<2?this.dispatchCea608Packet(d):this.dispatchCea708Packet(d)},this),this.captionPackets_.length=0,this.flushCCStreams(T)},et.prototype.flush=function(){return this.flushStream("flush")},et.prototype.partialFlush=function(){return this.flushStream("partialFlush")},et.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(T){T.reset()})},et.prototype.dispatchCea608Packet=function(T){this.setsTextOrXDSActive(T)?this.activeCea608Channel_[T.type]=null:this.setsChannel1Active(T)?this.activeCea608Channel_[T.type]=0:this.setsChannel2Active(T)&&(this.activeCea608Channel_[T.type]=1),this.activeCea608Channel_[T.type]!==null&&this.ccStreams_[(T.type<<1)+this.activeCea608Channel_[T.type]].push(T)},et.prototype.setsChannel1Active=function(T){return(T.ccData&30720)===4096},et.prototype.setsChannel2Active=function(T){return(T.ccData&30720)===6144},et.prototype.setsTextOrXDSActive=function(T){return(T.ccData&28928)===256||(T.ccData&30974)===4138||(T.ccData&30974)===6186},et.prototype.dispatchCea708Packet=function(T){this.parse708captions_&&this.cc708Stream_.push(T)};var Ah={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},Dh=function(d){var h=Ah[d]||d;return d&4096&&d===h?"":String.fromCharCode(h)},Zi=function(d){return 32<=d&&d<=127||160<=d&&d<=255},wt=function(d){this.windowNum=d,this.reset()};wt.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},wt.prototype.getText=function(){return this.rows.join(`
|
|
60
|
+
`+t},Hf=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},o_=Vf(Hf(function(){var a=function(){this.init=function(){var d={};this.on=function(h,f){d[h]||(d[h]=[]),d[h]=d[h].concat(f)},this.off=function(h,f){var g;return d[h]?(g=d[h].indexOf(f),d[h]=d[h].slice(),d[h].splice(g,1),g>-1):!1},this.trigger=function(h){var f,g,v,y;if(f=d[h],!!f)if(arguments.length===2)for(v=f.length,g=0;g<v;++g)f[g].call(this,arguments[1]);else{for(y=[],g=arguments.length,g=1;g<arguments.length;++g)y.push(arguments[g]);for(v=f.length,g=0;g<v;++g)f[g].apply(this,y)}},this.dispose=function(){d={}}}};a.prototype.pipe=function(T){return this.on("data",function(d){T.push(d)}),this.on("done",function(d){T.flush(d)}),this.on("partialdone",function(d){T.partialFlush(d)}),this.on("endedtimeline",function(d){T.endTimeline(d)}),this.on("reset",function(d){T.reset(d)}),T},a.prototype.push=function(T){this.trigger("data",T)},a.prototype.flush=function(T){this.trigger("done",T)},a.prototype.partialFlush=function(T){this.trigger("partialdone",T)},a.prototype.endTimeline=function(T){this.trigger("endedtimeline",T)},a.prototype.reset=function(T){this.trigger("reset",T)};var t=a,r=Math.pow(2,32),n=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f;return h.getBigUint64?(f=h.getBigUint64(0),f<Number.MAX_SAFE_INTEGER?Number(f):f):h.getUint32(0)*r+h.getUint32(4)},e={getUint64:n,MAX_UINT32:r},i=e.MAX_UINT32,s,o,u,l,c,p,m,_,b,S,x,k,L,H,O,F,q,B,R,U,N,X,$,J,oe,fe,re,ae,pe,Me,ue,Yi,at,Dt,zt,Zt;(function(){var T;if($={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(T in $)$.hasOwnProperty(T)&&($[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);J=new Uint8Array([105,115,111,109]),fe=new Uint8Array([97,118,99,49]),oe=new Uint8Array([0,0,0,1]),re=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ae=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),pe={video:re,audio:ae},Yi=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ue=new Uint8Array([0,0,0,0,0,0,0,0]),at=new Uint8Array([0,0,0,0,0,0,0,0]),Dt=at,zt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Zt=at,Me=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),s=function(d){var h=[],f=0,g,v,y;for(g=1;g<arguments.length;g++)h.push(arguments[g]);for(g=h.length;g--;)f+=h[g].byteLength;for(v=new Uint8Array(f+8),y=new DataView(v.buffer,v.byteOffset,v.byteLength),y.setUint32(0,v.byteLength),v.set(d,4),g=0,f=8;g<h.length;g++)v.set(h[g],f),f+=h[g].byteLength;return v},o=function(){return s($.dinf,s($.dref,Yi))},u=function(d){return s($.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,d.audioobjecttype<<3|d.samplingfrequencyindex>>>1,d.samplingfrequencyindex<<7|d.channelcount<<3,6,1,2]))},l=function(){return s($.ftyp,J,oe,J,fe)},F=function(d){return s($.hdlr,pe[d])},c=function(d){return s($.mdat,d)},O=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,d.duration>>>24&255,d.duration>>>16&255,d.duration>>>8&255,d.duration&255,85,196,0,0]);return d.samplerate&&(h[12]=d.samplerate>>>24&255,h[13]=d.samplerate>>>16&255,h[14]=d.samplerate>>>8&255,h[15]=d.samplerate&255),s($.mdhd,h)},H=function(d){return s($.mdia,O(d),F(d.type),m(d))},p=function(d){return s($.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},m=function(d){return s($.minf,d.type==="video"?s($.vmhd,Me):s($.smhd,ue),o(),B(d))},_=function(d,h){for(var f=[],g=h.length;g--;)f[g]=U(h[g]);return s.apply(null,[$.moof,p(d)].concat(f))},b=function(d){for(var h=d.length,f=[];h--;)f[h]=k(d[h]);return s.apply(null,[$.moov,x(4294967295)].concat(f).concat(S(d)))},S=function(d){for(var h=d.length,f=[];h--;)f[h]=N(d[h]);return s.apply(null,[$.mvex].concat(f))},x=function(d){var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return s($.mvhd,h)},q=function(d){var h=d.samples||[],f=new Uint8Array(4+h.length),g,v;for(v=0;v<h.length;v++)g=h[v].flags,f[v+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return s($.sdtp,f)},B=function(d){return s($.stbl,R(d),s($.stts,Zt),s($.stsc,Dt),s($.stsz,zt),s($.stco,at))},function(){var T,d;R=function(f){return s($.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),f.type==="video"?T(f):d(f))},T=function(f){var g=f.sps||[],v=f.pps||[],y=[],E=[],C,w;for(C=0;C<g.length;C++)y.push((g[C].byteLength&65280)>>>8),y.push(g[C].byteLength&255),y=y.concat(Array.prototype.slice.call(g[C]));for(C=0;C<v.length;C++)E.push((v[C].byteLength&65280)>>>8),E.push(v[C].byteLength&255),E=E.concat(Array.prototype.slice.call(v[C]));if(w=[$.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(f.width&65280)>>8,f.width&255,(f.height&65280)>>8,f.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),s($.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([g.length],y,[v.length],E))),s($.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var D=f.sarRatio[0],P=f.sarRatio[1];w.push(s($.pasp,new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return s.apply(null,w)},d=function(f){return s($.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(f.channelcount&65280)>>8,f.channelcount&255,(f.samplesize&65280)>>8,f.samplesize&255,0,0,0,0,(f.samplerate&65280)>>8,f.samplerate&255,0,0]),u(f))}}(),L=function(d){var h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,0,(d.duration&4278190080)>>24,(d.duration&16711680)>>16,(d.duration&65280)>>8,d.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(d.width&65280)>>8,d.width&255,0,0,(d.height&65280)>>8,d.height&255,0,0]);return s($.tkhd,h)},U=function(d){var h,f,g,v,y,E,C;return h=s($.tfhd,new Uint8Array([0,0,0,58,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),E=Math.floor(d.baseMediaDecodeTime/i),C=Math.floor(d.baseMediaDecodeTime%i),f=s($.tfdt,new Uint8Array([1,0,0,0,E>>>24&255,E>>>16&255,E>>>8&255,E&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255])),y=92,d.type==="audio"?(g=X(d,y),s($.traf,h,f,g)):(v=q(d),g=X(d,v.length+y),s($.traf,h,f,g,v))},k=function(d){return d.duration=d.duration||4294967295,s($.trak,L(d),H(d))},N=function(d){var h=new Uint8Array([0,0,0,0,(d.id&4278190080)>>24,(d.id&16711680)>>16,(d.id&65280)>>8,d.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return d.type!=="video"&&(h[h.length-1]=0),s($.trex,h)},function(){var T,d,h;h=function(g,v){var y=0,E=0,C=0,w=0;return g.length&&(g[0].duration!==void 0&&(y=1),g[0].size!==void 0&&(E=2),g[0].flags!==void 0&&(C=4),g[0].compositionTimeOffset!==void 0&&(w=8)),[0,0,y|E|C|w,1,(g.length&4278190080)>>>24,(g.length&16711680)>>>16,(g.length&65280)>>>8,g.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]},d=function(g,v){var y,E,C,w,D,P;for(w=g.samples||[],v+=20+16*w.length,C=h(w,v),E=new Uint8Array(C.length+w.length*16),E.set(C),y=C.length,P=0;P<w.length;P++)D=w[P],E[y++]=(D.duration&4278190080)>>>24,E[y++]=(D.duration&16711680)>>>16,E[y++]=(D.duration&65280)>>>8,E[y++]=D.duration&255,E[y++]=(D.size&4278190080)>>>24,E[y++]=(D.size&16711680)>>>16,E[y++]=(D.size&65280)>>>8,E[y++]=D.size&255,E[y++]=D.flags.isLeading<<2|D.flags.dependsOn,E[y++]=D.flags.isDependedOn<<6|D.flags.hasRedundancy<<4|D.flags.paddingValue<<1|D.flags.isNonSyncSample,E[y++]=D.flags.degradationPriority&61440,E[y++]=D.flags.degradationPriority&15,E[y++]=(D.compositionTimeOffset&4278190080)>>>24,E[y++]=(D.compositionTimeOffset&16711680)>>>16,E[y++]=(D.compositionTimeOffset&65280)>>>8,E[y++]=D.compositionTimeOffset&255;return s($.trun,E)},T=function(g,v){var y,E,C,w,D,P;for(w=g.samples||[],v+=20+8*w.length,C=h(w,v),y=new Uint8Array(C.length+w.length*8),y.set(C),E=C.length,P=0;P<w.length;P++)D=w[P],y[E++]=(D.duration&4278190080)>>>24,y[E++]=(D.duration&16711680)>>>16,y[E++]=(D.duration&65280)>>>8,y[E++]=D.duration&255,y[E++]=(D.size&4278190080)>>>24,y[E++]=(D.size&16711680)>>>16,y[E++]=(D.size&65280)>>>8,y[E++]=D.size&255;return s($.trun,y)},X=function(g,v){return g.type==="audio"?T(g,v):d(g,v)}}();var gt={ftyp:l,mdat:c,moof:_,moov:b,initSegment:function(d){var h=l(),f=b(d),g;return g=new Uint8Array(h.byteLength+f.byteLength),g.set(h),g.set(f,h.byteLength),g}},yr=function(d){var h,f,g=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,g.byteLength=0,h=0;h<d.length;h++)f=d[h],f.nalUnitType==="access_unit_delimiter_rbsp"?(g.length&&(g.duration=f.dts-g.dts,v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g)),g=[f],g.byteLength=f.data.byteLength,g.pts=f.pts,g.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(g.keyFrame=!0),g.duration=f.dts-g.dts,g.byteLength+=f.data.byteLength,g.push(f));return v.length&&(!g.duration||g.duration<=0)&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.length,v.duration+=g.duration,v.push(g),v},_r=function(d){var h,f,g=[],v=[];for(g.byteLength=0,g.nalCount=0,g.duration=0,g.pts=d[0].pts,g.dts=d[0].dts,v.byteLength=0,v.nalCount=0,v.duration=0,v.pts=d[0].pts,v.dts=d[0].dts,h=0;h<d.length;h++)f=d[h],f.keyFrame?(g.length&&(v.push(g),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration),g=[f],g.nalCount=f.length,g.byteLength=f.byteLength,g.pts=f.pts,g.dts=f.dts,g.duration=f.duration):(g.duration+=f.duration,g.nalCount+=f.length,g.byteLength+=f.byteLength,g.push(f));return v.length&&g.duration<=0&&(g.duration=v[v.length-1].duration),v.byteLength+=g.byteLength,v.nalCount+=g.nalCount,v.duration+=g.duration,v.push(g),v},Tr=function(d){var h;return!d[0][0].keyFrame&&d.length>1&&(h=d.shift(),d.byteLength-=h.byteLength,d.nalCount-=h.nalCount,d[0][0].dts=h.dts,d[0][0].pts=h.pts,d[0][0].duration+=h.duration),d},ah=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Wo=function(d,h){var f=ah();return f.dataOffset=h,f.compositionTimeOffset=d.pts-d.dts,f.duration=d.duration,f.size=4*d.length,f.size+=d.byteLength,d.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},sh=function(d,h){var f,g,v,y,E,C=h||0,w=[];for(f=0;f<d.length;f++)for(y=d[f],g=0;g<y.length;g++)E=y[g],v=Wo(E,C),C+=v.size,w.push(v);return w},oh=function(d){var h,f,g,v,y,E,C=0,w=d.byteLength,D=d.nalCount,P=w+4*D,M=new Uint8Array(P),z=new DataView(M.buffer);for(h=0;h<d.length;h++)for(v=d[h],f=0;f<v.length;f++)for(y=v[f],g=0;g<y.length;g++)E=y[g],z.setUint32(C,E.data.byteLength),C+=4,M.set(E.data,C),C+=E.data.byteLength;return M},uh=function(d,h){var f,g=h||0,v=[];return f=Wo(d,g),v.push(f),v},lh=function(d){var h,f,g=0,v=d.byteLength,y=d.length,E=v+4*y,C=new Uint8Array(E),w=new DataView(C.buffer);for(h=0;h<d.length;h++)f=d[h],w.setUint32(g,f.data.byteLength),g+=4,C.set(f.data,g),g+=f.data.byteLength;return C},ni={groupNalsIntoFrames:yr,groupFramesIntoGops:_r,extendFirstKeyFrame:Tr,generateSampleTable:sh,concatenateNalData:oh,generateSampleTableForFrame:uh,concatenateNalDataForFrame:lh},$t=[33,16,5,32,164,27],Da=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],le=function(d){for(var h=[];d--;)h.push(0);return h},dh=function(d){return Object.keys(d).reduce(function(h,f){return h[f]=new Uint8Array(d[f].reduce(function(g,v){return g.concat(v)},[])),h},{})},wa,ch=function(){if(!wa){var d={96e3:[$t,[227,64],le(154),[56]],88200:[$t,[231],le(170),[56]],64e3:[$t,[248,192],le(240),[56]],48e3:[$t,[255,192],le(268),[55,148,128],le(54),[112]],44100:[$t,[255,192],le(268),[55,163,128],le(84),[112]],32e3:[$t,[255,192],le(268),[55,234],le(226),[112]],24e3:[$t,[255,192],le(268),[55,255,128],le(268),[111,112],le(126),[224]],16e3:[$t,[255,192],le(268),[55,255,128],le(268),[111,255],le(269),[223,108],le(195),[1,192]],12e3:[Da,le(268),[3,127,248],le(268),[6,255,240],le(268),[13,255,224],le(268),[27,253,128],le(259),[56]],11025:[Da,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:[Da,le(268),[3,121,16],le(47),[7]]};wa=dh(d)}return wa},ka=9e4,Pa,Ia,Qi,La,Go,zo,$o;Pa=function(d){return d*ka},Ia=function(d,h){return d*h},Qi=function(d){return d/ka},La=function(d,h){return d/h},Go=function(d,h){return Pa(La(d,h))},zo=function(d,h){return Ia(Qi(d),h)},$o=function(d,h,f){return Qi(f?d:d-h)};var se={ONE_SECOND_IN_TS:ka,secondsToVideoTs:Pa,secondsToAudioTs:Ia,videoTsToSeconds:Qi,audioTsToSeconds:La,audioTsToVideoTs:Go,videoTsToAudioTs:zo,metadataTsToSeconds:$o},fh=function(d){var h,f,g=0;for(h=0;h<d.length;h++)f=d[h],g+=f.data.byteLength;return g},hh=function(d,h,f,g){var v,y=0,E=0,C=0,w=0,D,P,M;if(h.length&&(v=se.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),y=Math.ceil(se.ONE_SECOND_IN_TS/(d.samplerate/1024)),f&&g&&(E=v-Math.max(f,g),C=Math.floor(E/y),w=C*y),!(C<1||w>se.ONE_SECOND_IN_TS/2))){for(D=ch()[d.samplerate],D||(D=h[0].data),P=0;P<C;P++)M=h[0],h.splice(0,0,{data:D,dts:M.dts-y,pts:M.pts-y});return d.baseMediaDecodeTime-=Math.floor(se.videoTsToAudioTs(w,d.samplerate)),w}},ph=function(d,h,f){return h.minSegmentDts>=f?d:(h.minSegmentDts=1/0,d.filter(function(g){return g.dts>=f?(h.minSegmentDts=Math.min(h.minSegmentDts,g.dts),h.minSegmentPts=h.minSegmentDts,!0):!1}))},mh=function(d){var h,f,g=[];for(h=0;h<d.length;h++)f=d[h],g.push({size:f.data.byteLength,duration:1024});return g},gh=function(d){var h,f,g=0,v=new Uint8Array(fh(d));for(h=0;h<d.length;h++)f=d[h],v.set(f.data,g),g+=f.data.byteLength;return v},Ji={prefixWithSilence:hh,trimAdtsFramesByEarliestDts:ph,generateSampleTable:mh,concatenateFrameData:gh},vh=se.ONE_SECOND_IN_TS,yh=function(d,h){typeof h.pts=="number"&&(d.timelineStartInfo.pts===void 0&&(d.timelineStartInfo.pts=h.pts),d.minSegmentPts===void 0?d.minSegmentPts=h.pts:d.minSegmentPts=Math.min(d.minSegmentPts,h.pts),d.maxSegmentPts===void 0?d.maxSegmentPts=h.pts:d.maxSegmentPts=Math.max(d.maxSegmentPts,h.pts)),typeof h.dts=="number"&&(d.timelineStartInfo.dts===void 0&&(d.timelineStartInfo.dts=h.dts),d.minSegmentDts===void 0?d.minSegmentDts=h.dts:d.minSegmentDts=Math.min(d.minSegmentDts,h.dts),d.maxSegmentDts===void 0?d.maxSegmentDts=h.dts:d.maxSegmentDts=Math.max(d.maxSegmentDts,h.dts))},_h=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},Th=function(d,h){var f,g,v=d.minSegmentDts;return h||(v-=d.timelineStartInfo.dts),f=d.timelineStartInfo.baseMediaDecodeTime,f+=v,f=Math.max(0,f),d.type==="audio"&&(g=d.samplerate/vh,f*=g,f=Math.floor(f)),f},ut={clearDtsInfo:_h,calculateTrackBaseMediaDecodeTime:Th,collectDtsInfo:yh},Ko=4,bh=128,xh=function(d){for(var h=0,f={payloadType:-1,payloadSize:0},g=0,v=0;h<d.byteLength&&d[h]!==bh;){for(;d[h]===255;)g+=255,h++;for(g+=d[h++];d[h]===255;)v+=255,h++;if(v+=d[h++],!f.payload&&g===Ko){var y=String.fromCharCode(d[h+3],d[h+4],d[h+5],d[h+6]);if(y==="GA94"){f.payloadType=g,f.payloadSize=v,f.payload=d.subarray(h,h+v);break}else f.payload=void 0}h+=v,g=0,v=0}return f},Sh=function(d){return d.payload[0]!==181||(d.payload[1]<<8|d.payload[2])!==49||String.fromCharCode(d.payload[3],d.payload[4],d.payload[5],d.payload[6])!=="GA94"||d.payload[7]!==3?null:d.payload.subarray(8,d.payload.length-1)},Eh=function(d,h){var f=[],g,v,y,E;if(!(h[0]&64))return f;for(v=h[0]&31,g=0;g<v;g++)y=g*3,E={type:h[y+2]&3,pts:d},h[y+2]&4&&(E.ccData=h[y+3]<<8|h[y+4],f.push(E));return f},Ch=function(d){for(var h=d.byteLength,f=[],g=1,v,y;g<h-2;)d[g]===0&&d[g+1]===0&&d[g+2]===3?(f.push(g+2),g+=2):g++;if(f.length===0)return d;v=h-f.length,y=new Uint8Array(v);var E=0;for(g=0;g<v;E++,g++)E===f[0]&&(E++,f.shift()),y[g]=d[E];return y},ai={parseSei:xh,parseUserData:Sh,parseCaptionPackets:Eh,discardEmulationPreventionBytes:Ch,USER_DATA_REGISTERED_ITU_T_T35:Ko},et=function T(d){d=d||{},T.prototype.init.call(this),this.parse708captions_=typeof d.parse708captions=="boolean"?d.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Te(0,0),new Te(0,1),new Te(1,0),new Te(1,1)],this.parse708captions_&&(this.cc708Stream_=new me({captionServices:d.captionServices})),this.reset(),this.ccStreams_.forEach(function(h){h.on("data",this.trigger.bind(this,"data")),h.on("partialdone",this.trigger.bind(this,"partialdone")),h.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};et.prototype=new t,et.prototype.push=function(T){var d,h,f;if(T.nalUnitType==="sei_rbsp"&&(d=ai.parseSei(T.escapedRBSP),!!d.payload&&d.payloadType===ai.USER_DATA_REGISTERED_ITU_T_T35&&(h=ai.parseUserData(d),!!h))){if(T.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(T.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}f=ai.parseCaptionPackets(T.pts,h),this.captionPackets_=this.captionPackets_.concat(f),this.latestDts_!==T.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=T.dts}},et.prototype.flushCCStreams=function(T){this.ccStreams_.forEach(function(d){return T==="flush"?d.flush():d.partialFlush()},this)},et.prototype.flushStream=function(T){if(!this.captionPackets_.length){this.flushCCStreams(T);return}this.captionPackets_.forEach(function(d,h){d.presortIndex=h}),this.captionPackets_.sort(function(d,h){return d.pts===h.pts?d.presortIndex-h.presortIndex:d.pts-h.pts}),this.captionPackets_.forEach(function(d){d.type<2?this.dispatchCea608Packet(d):this.dispatchCea708Packet(d)},this),this.captionPackets_.length=0,this.flushCCStreams(T)},et.prototype.flush=function(){return this.flushStream("flush")},et.prototype.partialFlush=function(){return this.flushStream("partialFlush")},et.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(T){T.reset()})},et.prototype.dispatchCea608Packet=function(T){this.setsTextOrXDSActive(T)?this.activeCea608Channel_[T.type]=null:this.setsChannel1Active(T)?this.activeCea608Channel_[T.type]=0:this.setsChannel2Active(T)&&(this.activeCea608Channel_[T.type]=1),this.activeCea608Channel_[T.type]!==null&&this.ccStreams_[(T.type<<1)+this.activeCea608Channel_[T.type]].push(T)},et.prototype.setsChannel1Active=function(T){return(T.ccData&30720)===4096},et.prototype.setsChannel2Active=function(T){return(T.ccData&30720)===6144},et.prototype.setsTextOrXDSActive=function(T){return(T.ccData&28928)===256||(T.ccData&30974)===4138||(T.ccData&30974)===6186},et.prototype.dispatchCea708Packet=function(T){this.parse708captions_&&this.cc708Stream_.push(T)};var Ah={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},Dh=function(d){var h=Ah[d]||d;return d&4096&&d===h?"":String.fromCharCode(h)},Zi=function(d){return 32<=d&&d<=127||160<=d&&d<=255},wt=function(d){this.windowNum=d,this.reset()};wt.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},wt.prototype.getText=function(){return this.rows.join(`
|
|
61
61
|
`)},wt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},wt.prototype.newLine=function(T){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(T),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},wt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},wt.prototype.addText=function(T){this.rows[this.rowIdx]+=T},wt.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var en=function(d,h,f){this.serviceNum=d,this.text="",this.currentWindow=new wt(-1),this.windows=[],this.stream=f,typeof h=="string"&&this.createTextDecoder(h)};en.prototype.init=function(T,d){this.startPts=T;for(var h=0;h<8;h++)this.windows[h]=new wt(h),typeof d=="function"&&(this.windows[h].beforeRowOverflow=d)},en.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},en.prototype.createTextDecoder=function(T){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(T)}catch(d){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+T+" encoding. "+d})}};var me=function T(d){d=d||{},T.prototype.init.call(this);var h=this,f=d.captionServices||{},g={},v;Object.keys(f).forEach(function(y){v=f[y],/^SERVICE/.test(y)&&(g[y]=v.encoding)}),this.serviceEncodings=g,this.current708Packet=null,this.services={},this.push=function(y){y.type===3?(h.new708Packet(),h.add708Bytes(y)):(h.current708Packet===null&&h.new708Packet(),h.add708Bytes(y))}};me.prototype=new t,me.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},me.prototype.add708Bytes=function(T){var d=T.ccData,h=d>>>8,f=d&255;this.current708Packet.ptsVals.push(T.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(f)},me.prototype.push708Packet=function(){var T=this.current708Packet,d=T.data,h=null,f=null,g=0,v=d[g++];for(T.seq=v>>6,T.sizeCode=v&63;g<d.length;g++)v=d[g++],h=v>>5,f=v&31,h===7&&f>0&&(v=d[g++],h=v),this.pushServiceBlock(h,g,f),f>0&&(g+=f-1)},me.prototype.pushServiceBlock=function(T,d,h){var f,g=d,v=this.current708Packet.data,y=this.services[T];for(y||(y=this.initService(T,g));g<d+h&&g<v.length;g++)f=v[g],Zi(f)?g=this.handleText(g,y):f===24?g=this.multiByteCharacter(g,y):f===16?g=this.extendedCommands(g,y):128<=f&&f<=135?g=this.setCurrentWindow(g,y):152<=f&&f<=159?g=this.defineWindow(g,y):f===136?g=this.clearWindows(g,y):f===140?g=this.deleteWindows(g,y):f===137?g=this.displayWindows(g,y):f===138?g=this.hideWindows(g,y):f===139?g=this.toggleWindows(g,y):f===151?g=this.setWindowAttributes(g,y):f===144?g=this.setPenAttributes(g,y):f===145?g=this.setPenColor(g,y):f===146?g=this.setPenLocation(g,y):f===143?y=this.reset(g,y):f===8?y.currentWindow.backspace():f===12?y.currentWindow.clearText():f===13?y.currentWindow.pendingNewLine=!0:f===14?y.currentWindow.clearText():f===141&&g++},me.prototype.extendedCommands=function(T,d){var h=this.current708Packet.data,f=h[++T];return Zi(f)&&(T=this.handleText(T,d,{isExtended:!0})),T},me.prototype.getPts=function(T){return this.current708Packet.ptsVals[Math.floor(T/2)]},me.prototype.initService=function(T,d){var f="SERVICE"+T,h=this,f,g;return f in this.serviceEncodings&&(g=this.serviceEncodings[f]),this.services[T]=new en(T,g,h),this.services[T].init(this.getPts(d),function(v){h.flushDisplayed(v,h.services[T])}),this.services[T]},me.prototype.handleText=function(T,d,h){var f=h&&h.isExtended,g=h&&h.isMultiByte,v=this.current708Packet.data,y=f?4096:0,E=v[T],C=v[T+1],w=d.currentWindow,D,P;return d.textDecoder_&&!f?(g?(P=[E,C],T++):P=[E],D=d.textDecoder_.decode(new Uint8Array(P))):D=Dh(y|E),w.pendingNewLine&&!w.isEmpty()&&w.newLine(this.getPts(T)),w.pendingNewLine=!1,w.addText(D),T},me.prototype.multiByteCharacter=function(T,d){var h=this.current708Packet.data,f=h[T+1],g=h[T+2];return Zi(f)&&Zi(g)&&(T=this.handleText(++T,d,{isMultiByte:!0})),T},me.prototype.setCurrentWindow=function(T,d){var h=this.current708Packet.data,f=h[T],g=f&7;return d.setCurrentWindow(g),T},me.prototype.defineWindow=function(T,d){var h=this.current708Packet.data,f=h[T],g=f&7;d.setCurrentWindow(g);var v=d.currentWindow;return f=h[++T],v.visible=(f&32)>>5,v.rowLock=(f&16)>>4,v.columnLock=(f&8)>>3,v.priority=f&7,f=h[++T],v.relativePositioning=(f&128)>>7,v.anchorVertical=f&127,f=h[++T],v.anchorHorizontal=f,f=h[++T],v.anchorPoint=(f&240)>>4,v.rowCount=f&15,f=h[++T],v.columnCount=f&63,f=h[++T],v.windowStyle=(f&56)>>3,v.penStyle=f&7,v.virtualRowCount=v.rowCount+1,T},me.prototype.setWindowAttributes=function(T,d){var h=this.current708Packet.data,f=h[T],g=d.currentWindow.winAttr;return f=h[++T],g.fillOpacity=(f&192)>>6,g.fillRed=(f&48)>>4,g.fillGreen=(f&12)>>2,g.fillBlue=f&3,f=h[++T],g.borderType=(f&192)>>6,g.borderRed=(f&48)>>4,g.borderGreen=(f&12)>>2,g.borderBlue=f&3,f=h[++T],g.borderType+=(f&128)>>5,g.wordWrap=(f&64)>>6,g.printDirection=(f&48)>>4,g.scrollDirection=(f&12)>>2,g.justify=f&3,f=h[++T],g.effectSpeed=(f&240)>>4,g.effectDirection=(f&12)>>2,g.displayEffect=f&3,T},me.prototype.flushDisplayed=function(T,d){for(var h=[],f=0;f<8;f++)d.windows[f].visible&&!d.windows[f].isEmpty()&&h.push(d.windows[f].getText());d.endPts=T,d.text=h.join(`
|
|
62
62
|
|
|
63
63
|
`),this.pushCaption(d),d.startPts=T},me.prototype.pushCaption=function(T){T.text!==""&&(this.trigger("data",{startPts:T.startPts,endPts:T.endPts,text:T.text,stream:"cc708_"+T.serviceNum}),T.text="",T.startPts=T.endPts)},me.prototype.displayWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],g=this.getPts(T);this.flushDisplayed(g,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=1);return T},me.prototype.hideWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],g=this.getPts(T);this.flushDisplayed(g,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=0);return T},me.prototype.toggleWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],g=this.getPts(T);this.flushDisplayed(g,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible^=1);return T},me.prototype.clearWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],g=this.getPts(T);this.flushDisplayed(g,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].clearText();return T},me.prototype.deleteWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],g=this.getPts(T);this.flushDisplayed(g,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].reset();return T},me.prototype.setPenAttributes=function(T,d){var h=this.current708Packet.data,f=h[T],g=d.currentWindow.penAttr;return f=h[++T],g.textTag=(f&240)>>4,g.offset=(f&12)>>2,g.penSize=f&3,f=h[++T],g.italics=(f&128)>>7,g.underline=(f&64)>>6,g.edgeType=(f&56)>>3,g.fontStyle=f&7,T},me.prototype.setPenColor=function(T,d){var h=this.current708Packet.data,f=h[T],g=d.currentWindow.penColor;return f=h[++T],g.fgOpacity=(f&192)>>6,g.fgRed=(f&48)>>4,g.fgGreen=(f&12)>>2,g.fgBlue=f&3,f=h[++T],g.bgOpacity=(f&192)>>6,g.bgRed=(f&48)>>4,g.bgGreen=(f&12)>>2,g.bgBlue=f&3,f=h[++T],g.edgeRed=(f&48)>>4,g.edgeGreen=(f&12)>>2,g.edgeBlue=f&3,T},me.prototype.setPenLocation=function(T,d){var h=this.current708Packet.data,f=h[T],g=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,f=h[++T],g.row=f&15,f=h[++T],g.column=f&63,T},me.prototype.reset=function(T,d){var h=this.getPts(T);return this.flushDisplayed(h,d),this.initService(d.serviceNum,T)};var wh={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},tn=function(d){return d===null?"":(d=wh[d]||d,String.fromCharCode(d))},rn=14,kh=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],er=function(){for(var d=[],h=rn+1;h--;)d.push("");return d},Te=function T(d,h){T.prototype.init.call(this),this.field_=d||0,this.dataChannel_=h||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var g,v,y,E,C;if(g=f.ccData&32639,g===this.lastControlCode_){this.lastControlCode_=null;return}if((g&61440)===4096?this.lastControlCode_=g:g!==this.PADDING_&&(this.lastControlCode_=null),y=g>>>8,E=g&255,g!==this.PADDING_)if(g===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(g===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),v=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=v,this.startPts_=f.pts;else if(g===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(g===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(g===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(g===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(g===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(g===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=er();else if(g===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=er();else if(g===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=er()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(y,E))y=(y&3)<<8,C=tn(y|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isExtCharacter(y,E))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),y=(y&3)<<8,C=tn(y|E),this[this.mode_](f.pts,C),this.column_++;else if(this.isMidRowCode(y,E))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(E&14)===14&&this.addFormatting(f.pts,["i"]),(E&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(y,E))this.column_+=E&3;else if(this.isPAC(y,E)){var w=kh.indexOf(g&7968);this.mode_==="rollUp"&&(w-this.rollUpRows_+1<0&&(w=this.rollUpRows_-1),this.setRollUp(f.pts,w)),w!==this.row_&&(this.clearFormatting(f.pts),this.row_=w),E&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(g&16)===16&&(this.column_=((g&14)>>1)*4),this.isColorPAC(E)&&(E&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(y)&&(E===0&&(E=null),C=tn(y),C+=tn(E),this[this.mode_](f.pts,C),this.column_+=C.length)}};Te.prototype=new t,Te.prototype.flushDisplayed=function(T){var d=this.displayed_.map(function(h,f){try{return h.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+f+"."}),""}},this).join(`
|
|
64
|
-
`).replace(/^\n+|\n+$/g,"");d.length&&this.trigger("data",{startPts:this.startPts_,endPts:T,text:d,stream:this.name_})},Te.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=er(),this.nonDisplayed_=er(),this.lastControlCode_=null,this.column_=0,this.row_=rn,this.rollUpRows_=2,this.formatting_=[]},Te.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Te.prototype.isSpecialCharacter=function(T,d){return T===this.EXT_&&d>=48&&d<=63},Te.prototype.isExtCharacter=function(T,d){return(T===this.EXT_+1||T===this.EXT_+2)&&d>=32&&d<=63},Te.prototype.isMidRowCode=function(T,d){return T===this.EXT_&&d>=32&&d<=47},Te.prototype.isOffsetControlCode=function(T,d){return T===this.OFFSET_&&d>=33&&d<=35},Te.prototype.isPAC=function(T,d){return T>=this.BASE_&&T<this.BASE_+8&&d>=64&&d<=127},Te.prototype.isColorPAC=function(T){return T>=64&&T<=79||T>=96&&T<=127},Te.prototype.isNormalChar=function(T){return T>=32&&T<=127},Te.prototype.setRollUp=function(T,d){if(this.mode_!=="rollUp"&&(this.row_=rn,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=er(),this.displayed_=er()),d!==void 0&&d!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[d-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]="";d===void 0&&(d=this.row_),this.topRow_=d-this.rollUpRows_+1},Te.prototype.addFormatting=function(T,d){this.formatting_=this.formatting_.concat(d);var h=d.reduce(function(f,g){return f+"<"+g+">"},"");this[this.mode_](T,h)},Te.prototype.clearFormatting=function(T){if(this.formatting_.length){var d=this.formatting_.reverse().reduce(function(h,f){return h+"</"+f+">"},"");this.formatting_=[],this[this.mode_](T,d)}},Te.prototype.popOn=function(T,d){var h=this.nonDisplayed_[this.row_];h+=d,this.nonDisplayed_[this.row_]=h},Te.prototype.rollUp=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h},Te.prototype.shiftRowsUp_=function(){var T;for(T=0;T<this.topRow_;T++)this.displayed_[T]="";for(T=this.row_+1;T<rn+1;T++)this.displayed_[T]="";for(T=this.topRow_;T<this.row_;T++)this.displayed_[T]=this.displayed_[T+1];this.displayed_[this.row_]=""},Te.prototype.paintOn=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h};var nn={CaptionStream:et,Cea608Stream:Te,Cea708Stream:me},Le={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ph=8589934592,Ih=4294967296,Xo="shared",Oa=function(d,h){var f=1;for(d>h&&(f=-1);Math.abs(h-d)>Ih;)d+=f*Ph;return d},Yo=function T(d){var h,f;T.prototype.init.call(this),this.type_=d||Xo,this.push=function(g){this.type_!==Xo&&g.type!==this.type_||(f===void 0&&(f=g.dts),g.dts=Oa(g.dts,f),g.pts=Oa(g.pts,f),h=g.dts,this.trigger("data",g))},this.flush=function(){f=h,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,h=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Yo.prototype=new t;var Qo={TimestampRolloverStream:Yo,handleRollover:Oa},Jo=function(d,h,f){var g,v="";for(g=h;g<f;g++)v+="%"+("00"+d[g].toString(16)).slice(-2);return v},an=function(d,h,f){return decodeURIComponent(Jo(d,h,f))},Lh=function(d,h,f){return unescape(Jo(d,h,f))},sn=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Zo={TXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=an(d.data,1,h),d.value=an(d.data,h+1,d.data.length).replace(/\0*$/,"");break}d.data=d.value}},WXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=an(d.data,1,h),d.url=an(d.data,h+1,d.data.length);break}}},PRIV:function(d){var h;for(h=0;h<d.data.length;h++)if(d.data[h]===0){d.owner=Lh(d.data,0,h);break}d.privateData=d.data.subarray(h+1),d.data=d.privateData}},on;on=function(d){var h={descriptor:d&&d.descriptor},f=0,g=[],v=0,y;if(on.prototype.init.call(this),this.dispatchType=Le.METADATA_STREAM_TYPE.toString(16),h.descriptor)for(y=0;y<h.descriptor.length;y++)this.dispatchType+=("00"+h.descriptor[y].toString(16)).slice(-2);this.push=function(E){var C,w,D,P,M,z;if(E.type==="timed-metadata"){if(E.dataAlignmentIndicator&&(v=0,g.length=0),g.length===0&&(E.data.length<10||E.data[0]!==73||E.data[1]!==68||E.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(g.push(E),v+=E.data.byteLength,g.length===1&&(f=sn(E.data.subarray(6,10)),f+=10),!(v<f)){for(C={data:new Uint8Array(f),frames:[],pts:g[0].pts,dts:g[0].dts},M=0;M<f;)C.data.set(g[0].data.subarray(0,f-M),M),M+=g[0].data.byteLength,v-=g[0].data.byteLength,g.shift();w=10,C.data[5]&64&&(w+=4,w+=sn(C.data.subarray(10,14)),f-=sn(C.data.subarray(16,20)));do{if(D=sn(C.data.subarray(w+4,w+8)),D<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(z=String.fromCharCode(C.data[w],C.data[w+1],C.data[w+2],C.data[w+3]),P={id:z,data:C.data.subarray(w+10,w+D+10)},P.key=P.id,Zo[P.id]&&(Zo[P.id](P),P.owner==="com.apple.streaming.transportStreamTimestamp")){var Y=P.data,j=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;j*=4,j+=Y[7]&3,P.timeStamp=j,C.pts===void 0&&C.dts===void 0&&(C.pts=P.timeStamp,C.dts=P.timeStamp),this.trigger("timestamp",P)}C.frames.push(P),w+=10,w+=D}while(w<f);this.trigger("data",C)}}}},on.prototype=new t;var Oh=on,Fh=Qo.TimestampRolloverStream,un,si,ln,Tr=188,Fa=71;un=function(){var d=new Uint8Array(Tr),h=0;un.prototype.init.call(this),this.push=function(f){var g=0,v=Tr,y;for(h?(y=new Uint8Array(f.byteLength+h),y.set(d.subarray(0,h)),y.set(f,h),h=0):y=f;v<y.byteLength;){if(y[g]===Fa&&y[v]===Fa){this.trigger("data",y.subarray(g,v)),g+=Tr,v+=Tr;continue}g++,v++}g<y.byteLength&&(d.set(y.subarray(g),0),h=y.byteLength-g)},this.flush=function(){h===Tr&&d[0]===Fa&&(this.trigger("data",d),h=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){h=0,this.trigger("reset")}},un.prototype=new t,si=function(){var d,h,f,g;si.prototype.init.call(this),g=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(y,E){var C=0;E.payloadUnitStartIndicator&&(C+=y[C]+1),E.type==="pat"?h(y.subarray(C),E):f(y.subarray(C),E)},h=function(y,E){E.section_number=y[7],E.last_section_number=y[8],g.pmtPid=(y[10]&31)<<8|y[11],E.pmtPid=g.pmtPid},f=function(y,E){var C,w,D,P;if(y[5]&1){for(g.programMapTable={video:null,audio:null,"timed-metadata":{}},C=(y[1]&15)<<8|y[2],w=3+C-4,D=(y[10]&15)<<8|y[11],P=12+D;P<w;){var M=y[P],z=(y[P+1]&31)<<8|y[P+2];M===Le.H264_STREAM_TYPE&&g.programMapTable.video===null?g.programMapTable.video=z:M===Le.ADTS_STREAM_TYPE&&g.programMapTable.audio===null?g.programMapTable.audio=z:M===Le.METADATA_STREAM_TYPE&&(g.programMapTable["timed-metadata"][z]=M),P+=((y[P+3]&15)<<8|y[P+4])+5}E.programMapTable=g.programMapTable}},this.push=function(v){var y={},E=4;if(y.payloadUnitStartIndicator=!!(v[1]&64),y.pid=v[1]&31,y.pid<<=8,y.pid|=v[2],(v[3]&48)>>>4>1&&(E+=v[E]+1),y.pid===0)y.type="pat",d(v.subarray(E),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",d(v.subarray(E),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,E,y]):this.processPes_(v,E,y)},this.processPes_=function(v,y,E){E.pid===this.programMapTable.video?E.streamType=Le.H264_STREAM_TYPE:E.pid===this.programMapTable.audio?E.streamType=Le.ADTS_STREAM_TYPE:E.streamType=this.programMapTable["timed-metadata"][E.pid],E.type="pes",E.data=v.subarray(y),this.trigger("data",E)}},si.prototype=new t,si.STREAM_TYPES={h264:27,adts:15},ln=function(){var d=this,h=!1,f={data:[],size:0},g={data:[],size:0},v={data:[],size:0},y,E=function(D,P){var M,z=D[0]<<16|D[1]<<8|D[2];P.data=new Uint8Array,z===1&&(P.packetLength=6+(D[4]<<8|D[5]),P.dataAlignmentIndicator=(D[6]&4)!==0,M=D[7],M&192&&(P.pts=(D[9]&14)<<27|(D[10]&255)<<20|(D[11]&254)<<12|(D[12]&255)<<5|(D[13]&254)>>>3,P.pts*=4,P.pts+=(D[13]&6)>>>1,P.dts=P.pts,M&64&&(P.dts=(D[14]&14)<<27|(D[15]&255)<<20|(D[16]&254)<<12|(D[17]&255)<<5|(D[18]&254)>>>3,P.dts*=4,P.dts+=(D[18]&6)>>>1)),P.data=D.subarray(9+D[8]))},C=function(D,P,M){var z=new Uint8Array(D.size),Y={type:P},j=0,Z=0,De=!1,He;if(!(!D.data.length||D.size<9)){for(Y.trackId=D.data[0].pid,j=0;j<D.data.length;j++)He=D.data[j],z.set(He.data,Z),Z+=He.data.byteLength;E(z,Y),De=P==="video"||Y.packetLength<=D.size,(M||De)&&(D.size=0,D.data.length=0),De&&d.trigger("data",Y)}};ln.prototype.init.call(this),this.push=function(w){({pat:function(){},pes:function(){var P,M;switch(w.streamType){case Le.H264_STREAM_TYPE:P=f,M="video";break;case Le.ADTS_STREAM_TYPE:P=g,M="audio";break;case Le.METADATA_STREAM_TYPE:P=v,M="timed-metadata";break;default:return}w.payloadUnitStartIndicator&&C(P,M,!0),P.data.push(w),P.size+=w.data.byteLength},pmt:function(){var P={type:"metadata",tracks:[]};y=w.programMapTable,y.video!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),y.audio!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),h=!0,d.trigger("data",P)}})[w.type]()},this.reset=function(){f.size=0,f.data.length=0,g.size=0,g.data.length=0,this.trigger("reset")},this.flushStreams_=function(){C(f,"video"),C(g,"audio"),C(v,"timed-metadata")},this.flush=function(){if(!h&&y){var w={type:"metadata",tracks:[]};y.video!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),y.audio!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),d.trigger("data",w)}h=!1,this.flushStreams_(),this.trigger("done")}},ln.prototype=new t;var eu={PAT_PID:0,MP2T_PACKET_LENGTH:Tr,TransportPacketStream:un,TransportParseStream:si,ElementaryStream:ln,TimestampRolloverStream:Fh,CaptionStream:nn.CaptionStream,Cea608Stream:nn.Cea608Stream,Cea708Stream:nn.Cea708Stream,MetadataStream:Oh};for(var Ra in Le)Le.hasOwnProperty(Ra)&&(eu[Ra]=Le[Ra]);var kt=eu,Rh=se.ONE_SECOND_IN_TS,dn,tu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];dn=function(d){var h,f=0;dn.prototype.init.call(this),this.skipWarn_=function(g,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+g+" to "+v+" in frame "+f+" outside syncword"})},this.push=function(g){var v=0,y,E,C,w,D;if(d||(f=0),g.type==="audio"){h&&h.length?(C=h,h=new Uint8Array(C.byteLength+g.data.byteLength),h.set(C),h.set(g.data,C.byteLength)):h=g.data;for(var P;v+7<h.length;){if(h[v]!==255||(h[v+1]&246)!==240){typeof P!="number"&&(P=v),v++;continue}if(typeof P=="number"&&(this.skipWarn_(P,v),P=null),E=(~h[v+1]&1)*2,y=(h[v+3]&3)<<11|h[v+4]<<3|(h[v+5]&224)>>5,w=((h[v+6]&3)+1)*1024,D=w*Rh/tu[(h[v+2]&60)>>>2],h.byteLength-v<y)break;this.trigger("data",{pts:g.pts+f*D,dts:g.dts+f*D,sampleCount:w,audioobjecttype:(h[v+2]>>>6&3)+1,channelcount:(h[v+2]&1)<<2|(h[v+3]&192)>>>6,samplerate:tu[(h[v+2]&60)>>>2],samplingfrequencyindex:(h[v+2]&60)>>>2,samplesize:16,data:h.subarray(v+7+E,v+y)}),f++,v+=y}typeof P=="number"&&(this.skipWarn_(P,v),P=null),h=h.subarray(v)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},dn.prototype=new t;var ru=dn,iu;iu=function(d){var h=d.byteLength,f=0,g=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+g},this.loadWord=function(){var v=d.byteLength-h,y=new Uint8Array(4),E=Math.min(4,h);if(E===0)throw new Error("no bytes available");y.set(d.subarray(v,v+E)),f=new DataView(y.buffer).getUint32(0),g=E*8,h-=E},this.skipBits=function(v){var y;g>v?(f<<=v,g-=v):(v-=g,y=Math.floor(v/8),v-=y*8,h-=y,this.loadWord(),f<<=v,g-=v)},this.readBits=function(v){var y=Math.min(g,v),E=f>>>32-y;return g-=y,g>0?f<<=y:h>0&&this.loadWord(),y=v-y,y>0?E<<y|this.readBits(y):E},this.skipLeadingZeros=function(){var v;for(v=0;v<g;++v)if(f&2147483648>>>v)return f<<=v,g-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Mh=iu,cn,fn,nu;fn=function(){var d=0,h,f;fn.prototype.init.call(this),this.push=function(g){var v;f?(v=new Uint8Array(f.byteLength+g.data.byteLength),v.set(f),v.set(g.data,f.byteLength),f=v):f=g.data;for(var y=f.byteLength;d<y-3;d++)if(f[d+2]===1){h=d+5;break}for(;h<y;)switch(f[h]){case 0:if(f[h-1]!==0){h+=2;break}else if(f[h-2]!==0){h++;break}d+3!==h-2&&this.trigger("data",f.subarray(d+3,h-2));do h++;while(f[h]!==1&&h<y);d=h-2,h+=3;break;case 1:if(f[h-1]!==0||f[h-2]!==0){h+=3;break}this.trigger("data",f.subarray(d+3,h-2)),d=h-2,h+=3;break;default:h+=3;break}f=f.subarray(d),h-=d,d=0},this.reset=function(){f=null,d=0,this.trigger("reset")},this.flush=function(){f&&f.byteLength>3&&this.trigger("data",f.subarray(d+3)),f=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},fn.prototype=new t,nu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},cn=function(){var d=new fn,h,f,g,v,y,E,C;cn.prototype.init.call(this),h=this,this.push=function(w){w.type==="video"&&(f=w.trackId,g=w.pts,v=w.dts,d.push(w))},d.on("data",function(w){var D={trackId:f,pts:g,dts:v,data:w,nalUnitTypeCode:w[0]&31};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=y(w.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=y(w.subarray(1)),D.config=E(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp";break}h.trigger("data",D)}),d.on("done",function(){h.trigger("done")}),d.on("partialdone",function(){h.trigger("partialdone")}),d.on("reset",function(){h.trigger("reset")}),d.on("endedtimeline",function(){h.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},C=function(D,P){var M=8,z=8,Y,j;for(Y=0;Y<D;Y++)z!==0&&(j=P.readExpGolomb(),z=(M+j+256)%256),M=z===0?M:z},y=function(D){for(var P=D.byteLength,M=[],z=1,Y,j;z<P-2;)D[z]===0&&D[z+1]===0&&D[z+2]===3?(M.push(z+2),z+=2):z++;if(M.length===0)return D;Y=P-M.length,j=new Uint8Array(Y);var Z=0;for(z=0;z<Y;Z++,z++)Z===M[0]&&(Z++,M.shift()),j[z]=D[Z];return j},E=function(D){var P=0,M=0,z=0,Y=0,j,Z,De,He,nr,Ba,Au,Du,wu,Ua,ku,xe=[1,1],Pu,ar;if(j=new Mh(D),Z=j.readUnsignedByte(),He=j.readUnsignedByte(),De=j.readUnsignedByte(),j.skipUnsignedExpGolomb(),nu[Z]&&(nr=j.readUnsignedExpGolomb(),nr===3&&j.skipBits(1),j.skipUnsignedExpGolomb(),j.skipUnsignedExpGolomb(),j.skipBits(1),j.readBoolean()))for(ku=nr!==3?8:12,ar=0;ar<ku;ar++)j.readBoolean()&&(ar<6?C(16,j):C(64,j));if(j.skipUnsignedExpGolomb(),Ba=j.readUnsignedExpGolomb(),Ba===0)j.readUnsignedExpGolomb();else if(Ba===1)for(j.skipBits(1),j.skipExpGolomb(),j.skipExpGolomb(),Au=j.readUnsignedExpGolomb(),ar=0;ar<Au;ar++)j.skipExpGolomb();if(j.skipUnsignedExpGolomb(),j.skipBits(1),Du=j.readUnsignedExpGolomb(),wu=j.readUnsignedExpGolomb(),Ua=j.readBits(1),Ua===0&&j.skipBits(1),j.skipBits(1),j.readBoolean()&&(P=j.readUnsignedExpGolomb(),M=j.readUnsignedExpGolomb(),z=j.readUnsignedExpGolomb(),Y=j.readUnsignedExpGolomb()),j.readBoolean()&&j.readBoolean()){switch(Pu=j.readUnsignedByte(),Pu){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=[j.readUnsignedByte()<<8|j.readUnsignedByte(),j.readUnsignedByte()<<8|j.readUnsignedByte()];break}}xe&&xe[0]/xe[1]}return{profileIdc:Z,levelIdc:De,profileCompatibility:He,width:(Du+1)*16-P*2-M*2,height:(2-Ua)*(wu+1)*16-z*2-Y*2,sarRatio:xe}}},cn.prototype=new t;var Nh={H264Stream:cn},Bh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],au=function(d,h){var f=d[h+6]<<21|d[h+7]<<14|d[h+8]<<7|d[h+9],g=d[h+5],v=(g&16)>>4;return f=f>=0?f:0,v?f+20:f+10},Uh=function T(d,h){return d.length-h<10||d[h]!==73||d[h+1]!==68||d[h+2]!==51?h:(h+=au(d,h),T(d,h))},Vh=function(d){var h=Uh(d,0);return d.length>=h+2&&(d[h]&255)===255&&(d[h+1]&240)===240&&(d[h+1]&22)===16},su=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Hh=function(d,h,f){var g,v="";for(g=h;g<f;g++)v+="%"+("00"+d[g].toString(16)).slice(-2);return v},qh=function(d,h,f){return unescape(Hh(d,h,f))},jh=function(d,h){var f=(d[h+5]&224)>>5,g=d[h+4]<<3,v=d[h+3]&6144;return v|g|f},Wh=function(d,h){return d[h]===73&&d[h+1]===68&&d[h+2]===51?"timed-metadata":d[h]&!0&&(d[h+1]&240)===240?"audio":null},Gh=function(d){for(var h=0;h+5<d.length;){if(d[h]!==255||(d[h+1]&246)!==240){h++;continue}return Bh[(d[h+2]&60)>>>2]}return null},zh=function(d){var h,f,g,v;h=10,d[5]&64&&(h+=4,h+=su(d.subarray(10,14)));do{if(f=su(d.subarray(h+4,h+8)),f<1)return null;if(v=String.fromCharCode(d[h],d[h+1],d[h+2],d[h+3]),v==="PRIV"){g=d.subarray(h+10,h+f+10);for(var y=0;y<g.byteLength;y++)if(g[y]===0){var E=qh(g,0,y);if(E==="com.apple.streaming.transportStreamTimestamp"){var C=g.subarray(y+1),w=(C[3]&1)<<30|C[4]<<22|C[5]<<14|C[6]<<6|C[7]>>>2;return w*=4,w+=C[7]&3,w}break}}h+=10,h+=f}while(h<d.byteLength);return null},hn={isLikelyAacData:Vh,parseId3TagSize:au,parseAdtsSize:jh,parseType:Wh,parseSampleRate:Gh,parseAacTimestamp:zh},pn;pn=function(){var d=new Uint8Array,h=0;pn.prototype.init.call(this),this.setTimestamp=function(f){h=f},this.push=function(f){var g=0,v=0,y,E,C,w;for(d.length?(w=d.length,d=new Uint8Array(f.byteLength+w),d.set(d.subarray(0,w)),d.set(f,w)):d=f;d.length-v>=3;){if(d[v]===73&&d[v+1]===68&&d[v+2]===51){if(d.length-v<10||(g=hn.parseId3TagSize(d,v),v+g>d.length))break;E={type:"timed-metadata",data:d.subarray(v,v+g)},this.trigger("data",E),v+=g;continue}else if((d[v]&255)===255&&(d[v+1]&240)===240){if(d.length-v<7||(g=hn.parseAdtsSize(d,v),v+g>d.length))break;C={type:"audio",data:d.subarray(v,v+g),pts:h,dts:h},this.trigger("data",C),v+=g;continue}v++}y=d.length-v,y>0?d=d.subarray(v):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},pn.prototype=new t;var $h=pn,Kh=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ou=Kh,Xh=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],uu=Xh,Yh=Nh.H264Stream,Qh=hn.isLikelyAacData,Jh=se.ONE_SECOND_IN_TS,mn,oi,gn,tr,Zh=function(d,h){h.stream=d,this.trigger("log",h)},lu=function(d,h){for(var f=Object.keys(h),g=0;g<f.length;g++){var v=f[g];v==="headOfPipeline"||!h[v].on||h[v].on("log",Zh.bind(d,v))}},du=function(d,h){var f;if(d.length!==h.length)return!1;for(f=0;f<d.length;f++)if(d[f]!==h[f])return!1;return!0},cu=function(d,h,f,g,v,y){var E=f-h,C=g-h,w=v-f;return{start:{dts:d,pts:d+E},end:{dts:d+C,pts:d+w},prependedContentDuration:y,baseMediaDecodeTime:d}};oi=function(d,h){var f=[],g,v=0,y=0,E=1/0;h=h||{},g=h.firstSequenceNumber||0,oi.prototype.init.call(this),this.push=function(C){ut.collectDtsInfo(d,C),d&&ou.forEach(function(w){d[w]=C[w]}),f.push(C)},this.setEarliestDts=function(C){v=C},this.setVideoBaseMediaDecodeTime=function(C){E=C},this.setAudioAppendStart=function(C){y=C},this.flush=function(){var C,w,D,P,M,z,Y;if(f.length===0){this.trigger("done","AudioSegmentStream");return}C=Ji.trimAdtsFramesByEarliestDts(f,d,v),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),Y=Ji.prefixWithSilence(d,C,y,E),d.samples=Ji.generateSampleTable(C),D=gt.mdat(Ji.concatenateFrameData(C)),f=[],w=gt.moof(g,[d]),P=new Uint8Array(w.byteLength+D.byteLength),g++,P.set(w),P.set(D,w.byteLength),ut.clearDtsInfo(d),M=Math.ceil(Jh*1024/d.samplerate),C.length&&(z=C.length*M,this.trigger("segmentTimingInfo",cu(se.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),C[0].dts,C[0].pts,C[0].dts+z,C[0].pts+z,Y||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+z})),this.trigger("data",{track:d,boxes:P}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ut.clearDtsInfo(d),f=[],this.trigger("reset")}},oi.prototype=new t,mn=function(d,h){var f,g=[],v=[],y,E;h=h||{},f=h.firstSequenceNumber||0,mn.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(C){ut.collectDtsInfo(d,C),C.nalUnitType==="seq_parameter_set_rbsp"&&!y&&(y=C.config,d.sps=[C.data],uu.forEach(function(w){d[w]=y[w]},this)),C.nalUnitType==="pic_parameter_set_rbsp"&&!E&&(E=C.data,d.pps=[C.data]),g.push(C)},this.flush=function(){for(var C,w,D,P,M,z,Y=0,j,Z;g.length&&g[0].nalUnitType!=="access_unit_delimiter_rbsp";)g.shift();if(g.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(C=ni.groupNalsIntoFrames(g),D=ni.groupFramesIntoGops(C),D[0][0].keyFrame||(w=this.getGopForFusion_(g[0],d),w?(Y=w.duration,D.unshift(w),D.byteLength+=w.byteLength,D.nalCount+=w.nalCount,D.pts=w.pts,D.dts=w.dts,D.duration+=w.duration):D=ni.extendFirstKeyFrame(D)),v.length){var De;if(h.alignGopsAtEnd?De=this.alignGopsAtEnd_(D):De=this.alignGopsAtStart_(D),!De){this.gopCache_.unshift({gop:D.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),g=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ut.clearDtsInfo(d),D=De}ut.collectDtsInfo(d,D),d.samples=ni.generateSampleTable(D),M=gt.mdat(ni.concatenateNalData(D)),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),this.trigger("processedGopsInfo",D.map(function(He){return{pts:He.pts,dts:He.dts,byteLength:He.byteLength}})),j=D[0],Z=D[D.length-1],this.trigger("segmentTimingInfo",cu(d.baseMediaDecodeTime,j.dts,j.pts,Z.dts+Z.duration,Z.pts+Z.duration,Y)),this.trigger("timingInfo",{start:D[0].pts,end:D[D.length-1].pts+D[D.length-1].duration}),this.gopCache_.unshift({gop:D.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),g=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),P=gt.moof(f,[d]),z=new Uint8Array(P.byteLength+M.byteLength),f++,z.set(P),z.set(M,P.byteLength),this.trigger("data",{track:d,boxes:z}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),g=[],this.gopCache_.length=0,v.length=0,this.trigger("reset")},this.resetStream_=function(){ut.clearDtsInfo(d),y=void 0,E=void 0},this.getGopForFusion_=function(C){var w=45e3,D=1/0,P,M,z,Y,j;for(j=0;j<this.gopCache_.length;j++)Y=this.gopCache_[j],z=Y.gop,!(!(d.pps&&du(d.pps[0],Y.pps[0]))||!(d.sps&&du(d.sps[0],Y.sps[0])))&&(z.dts<d.timelineStartInfo.dts||(P=C.dts-z.dts-z.duration,P>=-1e4&&P<=w&&(!M||D>P)&&(M=Y,D=P)));return M?M.gop:null},this.alignGopsAtStart_=function(C){var w,D,P,M,z,Y,j,Z;for(z=C.byteLength,Y=C.nalCount,j=C.duration,w=D=0;w<v.length&&D<C.length&&(P=v[w],M=C[D],P.pts!==M.pts);){if(M.pts>P.pts){w++;continue}D++,z-=M.byteLength,Y-=M.nalCount,j-=M.duration}return D===0?C:D===C.length?null:(Z=C.slice(D),Z.byteLength=z,Z.duration=j,Z.nalCount=Y,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z)},this.alignGopsAtEnd_=function(C){var w,D,P,M,z,Y;for(w=v.length-1,D=C.length-1,z=null,Y=!1;w>=0&&D>=0;){if(P=v[w],M=C[D],P.pts===M.pts){Y=!0;break}if(P.pts>M.pts){w--;continue}w===v.length-1&&(z=D),D--}if(!Y&&z===null)return null;var j;if(Y?j=D:j=z,j===0)return C;var Z=C.slice(j),De=Z.reduce(function(He,nr){return He.byteLength+=nr.byteLength,He.duration+=nr.duration,He.nalCount+=nr.nalCount,He},{byteLength:0,duration:0,nalCount:0});return Z.byteLength=De.byteLength,Z.duration=De.duration,Z.nalCount=De.nalCount,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z},this.alignGopsWith=function(C){v=C}},mn.prototype=new t,tr=function(d,h){this.numberOfTracks=0,this.metadataStream=h,d=d||{},typeof d.remux<"u"?this.remuxTracks=!!d.remux:this.remuxTracks=!0,typeof d.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=d.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,tr.prototype.init.call(this),this.push=function(f){if(f.text)return this.pendingCaptions.push(f);if(f.frames)return this.pendingMetadata.push(f);this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))}},tr.prototype=new t,tr.prototype.flush=function(T){var d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},f,g,v,y=0,E;if(this.pendingTracks.length<this.numberOfTracks){if(T!=="VideoSegmentStream"&&T!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,uu.forEach(function(C){h.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,ou.forEach(function(C){h.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,v=gt.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)h.data.set(this.pendingBoxes[E],d),d+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)f=this.pendingCaptions[E],f.startTime=se.metadataTsToSeconds(f.startPts,y,this.keepOriginalTimestamps),f.endTime=se.metadataTsToSeconds(f.endPts,y,this.keepOriginalTimestamps),h.captionStreams[f.stream]=!0,h.captions.push(f);for(E=0;E<this.pendingMetadata.length;E++)g=this.pendingMetadata[E],g.cueTime=se.metadataTsToSeconds(g.pts,y,this.keepOriginalTimestamps),h.metadata.push(g);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),E=0;E<h.captions.length;E++)f=h.captions[E],this.trigger("caption",f);for(E=0;E<h.metadata.length;E++)g=h.metadata[E],this.trigger("id3Frame",g)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},tr.prototype.setRemux=function(T){this.remuxTracks=T},gn=function(d){var h=this,f=!0,g,v;gn.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new kt.MetadataStream,y.aacStream=new $h,y.audioTimestampRolloverStream=new kt.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new kt.TimestampRolloverStream("timed-metadata"),y.adtsStream=new ru,y.coalesceStream=new tr(d,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(E){y.aacStream.setTimestamp(E.timeStamp)}),y.aacStream.on("data",function(E){E.type!=="timed-metadata"&&E.type!=="audio"||y.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new oi(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!g}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),lu(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new kt.MetadataStream,y.packetStream=new kt.TransportPacketStream,y.parseStream=new kt.TransportParseStream,y.elementaryStream=new kt.ElementaryStream,y.timestampRolloverStream=new kt.TimestampRolloverStream,y.adtsStream=new ru,y.h264Stream=new Yh,y.captionStream=new kt.CaptionStream(d),y.coalesceStream=new tr(d,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(E){var C;if(E.type==="metadata"){for(C=E.tracks.length;C--;)!g&&E.tracks[C].type==="video"?(g=E.tracks[C],g.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):!v&&E.tracks[C].type==="audio"&&(v=E.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime);g&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new mn(g,d),y.videoSegmentStream.on("log",h.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(w){v&&!d.keepOriginalTimestamps&&(v.timelineStartInfo=w,y.audioSegmentStream.setEarliestDts(w.dts-h.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",h.trigger.bind(h,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(w){v&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(w)}),y.videoSegmentStream.on("timingInfo",h.trigger.bind(h,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),v&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new oi(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!g})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(E){E.dispatchType=y.metadataStream.dispatchType,h.trigger("id3Frame",E)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),lu(this,y)},this.setBaseMediaDecodeTime=function(y){var E=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,ut.clearDtsInfo(v),E.audioTimestampRolloverStream&&E.audioTimestampRolloverStream.discontinuity()),g&&(E.videoSegmentStream&&(E.videoSegmentStream.gopCache_=[]),g.timelineStartInfo.dts=void 0,g.timelineStartInfo.pts=void 0,ut.clearDtsInfo(g),E.captionStream.reset()),E.timestampRolloverStream&&E.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var E=this.transmuxPipeline_;d.remux=y,E&&E.coalesceStream&&E.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){g&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var E=this;return function(C){C.stream=y,E.trigger("log",C)}},this.push=function(y){if(f){var E=Qh(y);E&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!E&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){f=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},gn.prototype=new t;var ep={Transmuxer:gn},tp=function(d){return d>>>0},rp=function(d){return("00"+d.toString(16)).slice(-2)},vn={toUnsigned:tp,toHexString:rp},ip=function(d){var h="";return h+=String.fromCharCode(d[0]),h+=String.fromCharCode(d[1]),h+=String.fromCharCode(d[2]),h+=String.fromCharCode(d[3]),h},rr=ip,np=vn.toUnsigned,ap=function T(d,h){var f=[],g,v,y,E,C;if(!h.length)return null;for(g=0;g<d.byteLength;)v=np(d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3]),y=rr(d.subarray(g+4,g+8)),E=v>1?g+v:d.byteLength,y===h[0]&&(h.length===1?f.push(d.subarray(g+8,E)):(C=T(d.subarray(g+8,E),h.slice(1)),C.length&&(f=f.concat(C)))),g=E;return f},ge=ap,sp=vn.toUnsigned,op=e.getUint64,up=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=op(d.subarray(4)):h.baseMediaDecodeTime=sp(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),h},fu=up,lp=function(d){return{isLeading:(d[0]&12)>>>2,dependsOn:d[0]&3,isDependedOn:(d[1]&192)>>>6,hasRedundancy:(d[1]&48)>>>4,paddingValue:(d[1]&14)>>>1,isNonSyncSample:d[1]&1,degradationPriority:d[2]<<8|d[3]}},hu=lp,dp=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},f=new DataView(d.buffer,d.byteOffset,d.byteLength),g=h.flags[2]&1,v=h.flags[2]&4,y=h.flags[1]&1,E=h.flags[1]&2,C=h.flags[1]&4,w=h.flags[1]&8,D=f.getUint32(4),P=8,M;for(g&&(h.dataOffset=f.getInt32(P),P+=4),v&&D&&(M={flags:hu(d.subarray(P,P+4))},P+=4,y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),w&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M),D--);D--;)M={},y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),C&&(M.flags=hu(d.subarray(P,P+4)),P+=4),w&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M);return h},pu=dp,cp=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:h.getUint32(4)},g=f.flags[2]&1,v=f.flags[2]&2,y=f.flags[2]&8,E=f.flags[2]&16,C=f.flags[2]&32,w=f.flags[0]&65536,D=f.flags[0]&131072,P;return P=8,g&&(P+=4,f.baseDataOffset=h.getUint32(12),P+=4),v&&(f.sampleDescriptionIndex=h.getUint32(P),P+=4),y&&(f.defaultSampleDuration=h.getUint32(P),P+=4),E&&(f.defaultSampleSize=h.getUint32(P),P+=4),C&&(f.defaultSampleFlags=h.getUint32(P)),w&&(f.durationIsEmpty=!0),!g&&D&&(f.baseDataOffsetIsMoof=!0),f},mu=cp,gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ui;typeof window<"u"?ui=window:typeof gu<"u"?ui=gu:typeof self<"u"?ui=self:ui={};var li=ui,fp=ai.discardEmulationPreventionBytes,hp=nn.CaptionStream,pp=function(d,h){for(var f=d,g=0;g<h.length;g++){var v=h[g];if(f<v.size)return v;f-=v.size}return null},mp=function(d,h,f){var g=new DataView(d.buffer,d.byteOffset,d.byteLength),v={logs:[],seiNals:[]},y,E,C,w;for(E=0;E+4<d.length;E+=C)if(C=g.getUint32(E),E+=4,!(C<=0))switch(d[E]&31){case 6:var D=d.subarray(E+1,E+1+C),P=pp(E,h);if(y={nalUnitType:"sei_rbsp",size:C,data:D,escapedRBSP:fp(D),trackId:f},P)y.pts=P.pts,y.dts=P.dts,w=P;else if(w)y.pts=w.pts,y.dts=w.dts;else{v.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+E+" for trackId "+f+". See mux.js#223."});break}v.seiNals.push(y);break}return v},gp=function(d,h,f){var g=h,v=f.defaultSampleDuration||0,y=f.defaultSampleSize||0,E=f.trackId,C=[];return d.forEach(function(w){var D=pu(w),P=D.samples;P.forEach(function(M){M.duration===void 0&&(M.duration=v),M.size===void 0&&(M.size=y),M.trackId=E,M.dts=g,M.compositionTimeOffset===void 0&&(M.compositionTimeOffset=0),typeof g=="bigint"?(M.pts=g+li.BigInt(M.compositionTimeOffset),g+=li.BigInt(M.duration)):(M.pts=g+M.compositionTimeOffset,g+=M.duration)}),C=C.concat(P)}),C},vp=function(d,h){var f=ge(d,["moof","traf"]),g=ge(d,["mdat"]),v={},y=[];return g.forEach(function(E,C){var w=f[C];y.push({mdat:E,traf:w})}),y.forEach(function(E){var C=E.mdat,w=E.traf,D=ge(w,["tfhd"]),P=mu(D[0]),M=P.trackId,z=ge(w,["tfdt"]),Y=z.length>0?fu(z[0]).baseMediaDecodeTime:0,j=ge(w,["trun"]),Z,De;h===M&&j.length>0&&(Z=gp(j,Y,P),De=mp(C,Z,M),v[M]||(v[M]={seiNals:[],logs:[]}),v[M].seiNals=v[M].seiNals.concat(De.seiNals),v[M].logs=v[M].logs.concat(De.logs))}),v},yp=function(d,h,f){var g;if(h===null)return null;g=vp(d,h);var v=g[h]||{};return{seiNals:v.seiNals,logs:v.logs,timescale:f}},_p=function(){var d=!1,h,f,g,v,y,E;this.isInitialized=function(){return d},this.init=function(C){h=new hp,d=!0,E=C?C.isPartial:!1,h.on("data",function(w){w.startTime=w.startPts/v,w.endTime=w.endPts/v,y.captions.push(w),y.captionStreams[w.stream]=!0}),h.on("log",function(w){y.logs.push(w)})},this.isNewInit=function(C,w){return C&&C.length===0||w&&typeof w=="object"&&Object.keys(w).length===0?!1:g!==C[0]||v!==w[g]},this.parse=function(C,w,D){var P;if(this.isInitialized()){if(!w||!D)return null;if(this.isNewInit(w,D))g=w[0],v=D[g];else if(g===null||!v)return f.push(C),null}else return null;for(;f.length>0;){var M=f.shift();this.parse(M,w,D)}return P=yp(C,g,v),P&&P.logs&&(y.logs=y.logs.concat(P.logs)),P===null||!P.seiNals?y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),y)},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(w){h.push(w)})},this.flushStream=function(){if(!this.isInitialized())return null;E?h.partialFlush():h.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;h.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],g=null,v=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Tp=_p,yn=vn.toUnsigned,di=vn.toHexString,bp=e.getUint64,vu,yu,_u,Tu,bu,Ma;vu=function(d){var h={},f=ge(d,["moov","trak"]);return f.reduce(function(g,v){var y,E,C,w,D;return y=ge(v,["tkhd"])[0],!y||(E=y[0],C=E===0?12:20,w=yn(y[C]<<24|y[C+1]<<16|y[C+2]<<8|y[C+3]),D=ge(v,["mdia","mdhd"])[0],!D)?null:(E=D[0],C=E===0?12:20,g[w]=yn(D[C]<<24|D[C+1]<<16|D[C+2]<<8|D[C+3]),g)},h)},yu=function(d,h){var f;f=ge(h,["moof","traf"]);var g=f.reduce(function(v,y){var E=ge(y,["tfhd"])[0],C=yn(E[4]<<24|E[5]<<16|E[6]<<8|E[7]),w=d[C]||9e4,D=ge(y,["tfdt"])[0],P=new DataView(D.buffer,D.byteOffset,D.byteLength),M;D[0]===1?M=bp(D.subarray(4,12)):M=P.getUint32(4);var z;return typeof M=="bigint"?z=M/li.BigInt(w):typeof M=="number"&&!isNaN(M)&&(z=M/w),z<Number.MAX_SAFE_INTEGER&&(z=Number(z)),z<v&&(v=z),v},1/0);return typeof g=="bigint"||isFinite(g)?g:0},_u=function(d,h){var f=ge(h,["moof","traf"]),g=0,v=0,y;if(f&&f.length){var E=ge(f[0],["tfhd"])[0],C=ge(f[0],["trun"])[0],w=ge(f[0],["tfdt"])[0];if(E){var D=mu(E);y=D.trackId}if(w){var P=fu(w);g=P.baseMediaDecodeTime}if(C){var M=pu(C);M.samples&&M.samples.length&&(v=M.samples[0].compositionTimeOffset||0)}}var z=d[y]||9e4;typeof g=="bigint"&&(v=li.BigInt(v),z=li.BigInt(z));var Y=(g+v)/z;return typeof Y=="bigint"&&Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y},Tu=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(g){var v=ge(g,["mdia","hdlr"]),y=ge(g,["tkhd"]);v.forEach(function(E,C){var w=rr(E.subarray(8,12)),D=y[C],P,M,z;w==="vide"&&(P=new DataView(D.buffer,D.byteOffset,D.byteLength),M=P.getUint8(0),z=M===0?P.getUint32(12):P.getUint32(20),f.push(z))})}),f},Ma=function(d){var h=d[0],f=h===0?12:20;return yn(d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])},bu=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(g){var v={},y=ge(g,["tkhd"])[0],E,C;y&&(E=new DataView(y.buffer,y.byteOffset,y.byteLength),C=E.getUint8(0),v.id=C===0?E.getUint32(12):E.getUint32(20));var w=ge(g,["mdia","hdlr"])[0];if(w){var D=rr(w.subarray(8,12));D==="vide"?v.type="video":D==="soun"?v.type="audio":v.type=D}var P=ge(g,["mdia","minf","stbl","stsd"])[0];if(P){var M=P.subarray(8);v.codec=rr(M.subarray(4,8));var z=ge(M,[v.codec])[0],Y,j;z&&(/^[asm]vc[1-9]$/i.test(v.codec)?(Y=z.subarray(78),j=rr(Y.subarray(4,8)),j==="avcC"&&Y.length>11?(v.codec+=".",v.codec+=di(Y[9]),v.codec+=di(Y[10]),v.codec+=di(Y[11])):v.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(v.codec)?(Y=z.subarray(28),j=rr(Y.subarray(4,8)),j==="esds"&&Y.length>20&&Y[19]!==0?(v.codec+="."+di(Y[19]),v.codec+="."+di(Y[20]>>>2&63).replace(/^0/,"")):v.codec="mp4a.40.2"):v.codec=v.codec.toLowerCase())}var Z=ge(g,["mdia","mdhd"])[0];Z&&(v.timescale=Ma(Z)),f.push(v)}),f};var xu={findBox:ge,parseType:rr,timescale:vu,startTime:yu,compositionStartTime:_u,videoTrackIds:Tu,tracks:bu,getTimescaleFromMediaHeader:Ma},Su=function(d){var h=d[1]&31;return h<<=8,h|=d[2],h},_n=function(d){return!!(d[1]&64)},Tn=function(d){var h=0;return(d[3]&48)>>>4>1&&(h+=d[4]+1),h},xp=function(d,h){var f=Su(d);return f===0?"pat":f===h?"pmt":h?"pes":null},Sp=function(d){var h=_n(d),f=4+Tn(d);return h&&(f+=d[f]+1),(d[f+10]&31)<<8|d[f+11]},Ep=function(d){var h={},f=_n(d),g=4+Tn(d);if(f&&(g+=d[g]+1),!!(d[g+5]&1)){var v,y,E;v=(d[g+1]&15)<<8|d[g+2],y=3+v-4,E=(d[g+10]&15)<<8|d[g+11];for(var C=12+E;C<y;){var w=g+C;h[(d[w+1]&31)<<8|d[w+2]]=d[w],C+=((d[w+3]&15)<<8|d[w+4])+5}return h}},Cp=function(d,h){var f=Su(d),g=h[f];switch(g){case Le.H264_STREAM_TYPE:return"video";case Le.ADTS_STREAM_TYPE:return"audio";case Le.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Ap=function(d){var h=_n(d);if(!h)return null;var f=4+Tn(d);if(f>=d.byteLength)return null;var g=null,v;return v=d[f+7],v&192&&(g={},g.pts=(d[f+9]&14)<<27|(d[f+10]&255)<<20|(d[f+11]&254)<<12|(d[f+12]&255)<<5|(d[f+13]&254)>>>3,g.pts*=4,g.pts+=(d[f+13]&6)>>>1,g.dts=g.pts,v&64&&(g.dts=(d[f+14]&14)<<27|(d[f+15]&255)<<20|(d[f+16]&254)<<12|(d[f+17]&255)<<5|(d[f+18]&254)>>>3,g.dts*=4,g.dts+=(d[f+18]&6)>>>1)),g},Na=function(d){switch(d){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Dp=function(d){for(var h=4+Tn(d),f=d.subarray(h),g=0,v=0,y=!1,E;v<f.byteLength-3;v++)if(f[v+2]===1){g=v+5;break}for(;g<f.byteLength;)switch(f[g]){case 0:if(f[g-1]!==0){g+=2;break}else if(f[g-2]!==0){g++;break}v+3!==g-2&&(E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0));do g++;while(f[g]!==1&&g<f.length);v=g-2,g+=3;break;case 1:if(f[g-1]!==0||f[g-2]!==0){g+=3;break}E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0),v=g-2,g+=3;break;default:g+=3;break}return f=f.subarray(v),g-=v,v=0,f&&f.byteLength>3&&(E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0)),y},wp={parseType:xp,parsePat:Sp,parsePmt:Ep,parsePayloadUnitStartIndicator:_n,parsePesType:Cp,parsePesTime:Ap,videoPacketContainsKeyFrame:Dp},br=Qo.handleRollover,de={};de.ts=wp,de.aac=hn;var ir=se.ONE_SECOND_IN_TS,Ve=188,vt=71,kp=function(d,h){for(var f=0,g=Ve,v,y;g<d.byteLength;){if(d[f]===vt&&d[g]===vt){switch(v=d.subarray(f,g),y=de.ts.parseType(v,h.pid),y){case"pat":h.pid=de.ts.parsePat(v);break;case"pmt":var E=de.ts.parsePmt(v);h.table=h.table||{},Object.keys(E).forEach(function(C){h.table[C]=E[C]});break}f+=Ve,g+=Ve;continue}f++,g++}},Eu=function(d,h,f){for(var g=0,v=Ve,y,E,C,w,D,P=!1;v<=d.byteLength;){if(d[g]===vt&&(d[v]===vt||v===d.byteLength)){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="audio",f.audio.push(D),P=!0));break}if(P)break;g+=Ve,v+=Ve;continue}g++,v++}for(v=d.byteLength,g=v-Ve,P=!1;g>=0;){if(d[g]===vt&&(d[v]===vt||v===d.byteLength)){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="audio",f.audio.push(D),P=!0));break}if(P)break;g-=Ve,v-=Ve;continue}g--,v--}},Pp=function(d,h,f){for(var g=0,v=Ve,y,E,C,w,D,P,M,z,Y=!1,j={data:[],size:0};v<d.byteLength;){if(d[g]===vt&&d[v]===vt){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":if(C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="video"&&(w&&!Y&&(D=de.ts.parsePesTime(y),D&&(D.type="video",f.video.push(D),Y=!0)),!f.firstKeyFrame)){if(w&&j.size!==0){for(P=new Uint8Array(j.size),M=0;j.data.length;)z=j.data.shift(),P.set(z,M),M+=z.byteLength;if(de.ts.videoPacketContainsKeyFrame(P)){var Z=de.ts.parsePesTime(P);Z?(f.firstKeyFrame=Z,f.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}j.size=0}j.data.push(y),j.size+=y.byteLength}break}if(Y&&f.firstKeyFrame)break;g+=Ve,v+=Ve;continue}g++,v++}for(v=d.byteLength,g=v-Ve,Y=!1;g>=0;){if(d[g]===vt&&d[v]===vt){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="video"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="video",f.video.push(D),Y=!0));break}if(Y)break;g-=Ve,v-=Ve;continue}g--,v--}},Ip=function(d,h){if(d.audio&&d.audio.length){var f=h;(typeof f>"u"||isNaN(f))&&(f=d.audio[0].dts),d.audio.forEach(function(y){y.dts=br(y.dts,f),y.pts=br(y.pts,f),y.dtsTime=y.dts/ir,y.ptsTime=y.pts/ir})}if(d.video&&d.video.length){var g=h;if((typeof g>"u"||isNaN(g))&&(g=d.video[0].dts),d.video.forEach(function(y){y.dts=br(y.dts,g),y.pts=br(y.pts,g),y.dtsTime=y.dts/ir,y.ptsTime=y.pts/ir}),d.firstKeyFrame){var v=d.firstKeyFrame;v.dts=br(v.dts,g),v.pts=br(v.pts,g),v.dtsTime=v.dts/ir,v.ptsTime=v.pts/ir}}},Lp=function(d){for(var h=!1,f=0,g=null,v=null,y=0,E=0,C;d.length-E>=3;){var w=de.aac.parseType(d,E);switch(w){case"timed-metadata":if(d.length-E<10){h=!0;break}if(y=de.aac.parseId3TagSize(d,E),y>d.length){h=!0;break}v===null&&(C=d.subarray(E,E+y),v=de.aac.parseAacTimestamp(C)),E+=y;break;case"audio":if(d.length-E<7){h=!0;break}if(y=de.aac.parseAdtsSize(d,E),y>d.length){h=!0;break}g===null&&(C=d.subarray(E,E+y),g=de.aac.parseSampleRate(C)),f++,E+=y;break;default:E++;break}if(h)return null}if(g===null||v===null)return null;var D=ir/g,P={audio:[{type:"audio",dts:v,pts:v},{type:"audio",dts:v+f*1024*D,pts:v+f*1024*D}]};return P},Op=function(d){var h={pid:null,table:null},f={};kp(d,h);for(var g in h.table)if(h.table.hasOwnProperty(g)){var v=h.table[g];switch(v){case Le.H264_STREAM_TYPE:f.video=[],Pp(d,h,f),f.video.length===0&&delete f.video;break;case Le.ADTS_STREAM_TYPE:f.audio=[],Eu(d,h,f),f.audio.length===0&&delete f.audio;break}}return f},Fp=function(d,h){var f=de.aac.isLikelyAacData(d),g;return f?g=Lp(d):g=Op(d),!g||!g.audio&&!g.video?null:(Ip(g,h),g)},Rp={inspect:Fp,parseAudioPes_:Eu},Mp=function(d,h){h.on("data",function(f){var g=f.initSegment;f.initSegment={data:g.buffer,byteOffset:g.byteOffset,byteLength:g.byteLength};var v=f.data;f.data=v.buffer,d.postMessage({action:"data",segment:f,byteOffset:v.byteOffset,byteLength:v.byteLength},[f.data])}),h.on("done",function(f){d.postMessage({action:"done"})}),h.on("gopInfo",function(f){d.postMessage({action:"gopInfo",gopInfo:f})}),h.on("videoSegmentTimingInfo",function(f){var g={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(g.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:g})}),h.on("audioSegmentTimingInfo",function(f){var g={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(g.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:g})}),h.on("id3Frame",function(f){d.postMessage({action:"id3Frame",id3Frame:f})}),h.on("caption",function(f){d.postMessage({action:"caption",caption:f})}),h.on("trackinfo",function(f){d.postMessage({action:"trackinfo",trackInfo:f})}),h.on("audioTimingInfo",function(f){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("videoTimingInfo",function(f){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("log",function(f){d.postMessage({action:"log",log:f})})},Cu=function(){function T(h,f){this.options=f||{},this.self=h,this.init()}var d=T.prototype;return d.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ep.Transmuxer(this.options),Mp(this.self,this.transmuxer)},d.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Tp,this.captionParser.init());var g=new Uint8Array(f.data,f.byteOffset,f.byteLength),v=this.captionParser.parse(g,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:g.buffer},[g.buffer])},d.probeMp4StartTime=function(f){var g=f.timescales,v=f.data,y=xu.startTime(g,v);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:v},[v.buffer])},d.probeMp4Tracks=function(f){var g=f.data,v=xu.tracks(g);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:g},[g.buffer])},d.probeTs=function(f){var g=f.data,v=f.baseStartTime,y=typeof v=="number"&&!isNaN(v)?v*se.ONE_SECOND_IN_TS:void 0,E=Rp.inspect(g,y),C=null;E&&(C={hasVideo:E.video&&E.video.length===2||!1,hasAudio:E.audio&&E.audio.length===2||!1},C.hasVideo&&(C.videoStart=E.video[0].ptsTime),C.hasAudio&&(C.audioStart=E.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:g},[g.buffer])},d.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},d.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},d.push=function(f){var g=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(g)},d.reset=function(){this.transmuxer.reset()},d.setTimestampOffset=function(f){var g=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(se.secondsToVideoTs(g)))},d.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(se.secondsToVideoTs(f.appendStart)))},d.setRemux=function(f){this.transmuxer.setRemux(f.remux)},d.flush=function(f){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},d.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},d.alignGopsWith=function(f){this.transmuxer.alignGopsWith(f.gopsToAlignWith.slice())},T}();self.onmessage=function(T){if(T.data.action==="init"&&T.data.options){this.messageHandlers=new Cu(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new Cu(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}})),u_=Uf(o_),l_=function(t,r,n){var e=t.data.segment,i=e.type,s=e.initSegment,o=e.captions,u=e.captionStreams,l=e.metadata,c=e.videoFrameDtsTime,p=e.videoFramePtsTime;r.buffer.push({captions:o,captionStreams:u,metadata:l});var m=t.data.segment.boxes||{data:t.data.segment.data},_={type:i,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof p<"u"&&(_.videoFramePtsTime=p),n(_)},d_=function(t){var r=t.transmuxedData,n=t.callback;r.buffer=[],n(r)},c_=function(t,r){r.gopInfo=t.data.gopInfo},qf=function(t){var r=t.transmuxer,n=t.bytes,e=t.audioAppendStart,i=t.gopsToAlignWith,s=t.remux,o=t.onData,u=t.onTrackInfo,l=t.onAudioTimingInfo,c=t.onVideoTimingInfo,p=t.onVideoSegmentTimingInfo,m=t.onAudioSegmentTimingInfo,_=t.onId3,b=t.onCaptions,S=t.onDone,x=t.onEndedTimeline,k=t.onTransmuxerLog,L=t.isEndOfTimeline,H={buffer:[]},O=L,F=function(U){r.currentTransmux===t&&(U.data.action==="data"&&l_(U,H,o),U.data.action==="trackinfo"&&u(U.data.trackInfo),U.data.action==="gopInfo"&&c_(U,H),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&c(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&p(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&m(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&_([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&b(U.data.caption),U.data.action==="endedtimeline"&&(O=!1,x()),U.data.action==="log"&&k(U.data.log),U.data.type==="transmuxed"&&(O||(r.onmessage=null,d_({transmuxedData:H,callback:S}),jf(r))))};if(r.onmessage=F,e&&r.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(i)&&r.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),typeof s<"u"&&r.postMessage({action:"setRemux",remux:s}),n.byteLength){var q=n instanceof ArrayBuffer?n:n.buffer,B=n instanceof ArrayBuffer?0:n.byteOffset;r.postMessage({action:"push",data:q,byteOffset:B,byteLength:n.byteLength},[q])}L&&r.postMessage({action:"endTimeline"}),r.postMessage({action:"flush"})},jf=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():qf(t.currentTransmux))},Wl=function(t,r){t.postMessage({action:r}),jf(t)},Wf=function(t,r){if(!r.currentTransmux){r.currentTransmux=t,Wl(r,t);return}r.transmuxQueue.push(Wl.bind(null,r,t))},f_=function(t){Wf("reset",t)},h_=function(t){Wf("endTimeline",t)},Gf=function(t){if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,qf(t);return}t.transmuxer.transmuxQueue.push(t)},p_=function(t){var r=new u_;r.currentTransmux=null,r.transmuxQueue=[];var n=r.terminate;return r.terminate=function(){return r.currentTransmux=null,r.transmuxQueue.length=0,n.call(r)},r.postMessage({action:"init",options:t}),r},us={reset:f_,endTimeline:h_,transmux:Gf,createTransmuxer:p_},ra=function(t){var r=t.transmuxer,n=t.endAction||t.action,e=t.callback,i=ht({},t,{endAction:null,transmuxer:null,callback:null}),s=function l(c){c.data.action===n&&(r.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,t.byteOffset||0,t.byteLength||c.data.data.byteLength),t.data&&(t.data=c.data.data)),e(c.data))};if(r.addEventListener("message",s),t.data){var o=t.data instanceof ArrayBuffer;i.byteOffset=o?0:t.data.byteOffset,i.byteLength=t.data.byteLength;var u=[o?t.data:t.data.buffer];r.postMessage(i,u)}else r.postMessage(i)},xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Rs=function(t){t.forEach(function(r){r.abort()})},m_=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},g_=function(t){var r=t.target,n=Date.now()-r.requestTime,e={bandwidth:1/0,bytesReceived:0,roundTripTime:n||0};return e.bytesReceived=t.loaded,e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3),e},Vo=function(t,r){return r.timedout?{status:r.status,message:"HLS request timed-out at URL: "+r.uri,code:xt.TIMEOUT,xhr:r}:r.aborted?{status:r.status,message:"HLS request aborted at URL: "+r.uri,code:xt.ABORTED,xhr:r}:t?{status:r.status,message:"HLS request errored at URL: "+r.uri,code:xt.FAILURE,xhr:r}:r.responseType==="arraybuffer"&&r.response.byteLength===0?{status:r.status,message:"Empty HLS response at URL: "+r.uri,code:xt.FAILURE,xhr:r}:null},Gl=function(t,r,n){return function(e,i){var s=i.response,o=Vo(e,i);if(o)return n(o,t);if(s.byteLength!==16)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:xt.FAILURE,xhr:i},t);for(var u=new DataView(s),l=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]),c=0;c<r.length;c++)r[c].bytes=l;return n(null,t)}},zf=function(t,r){var n=no(t.map.bytes);if(n!=="mp4"){var e=t.map.resolvedUri||t.map.uri;return r({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+e,code:xt.FAILURE})}ra({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:function(s){var o=s.tracks,u=s.data;return t.map.bytes=u,o.forEach(function(l){t.map.tracks=t.map.tracks||{},!t.map.tracks[l.type]&&(t.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[l.id]=l.timescale))}),r(null)}})},v_=function(t){var r=t.segment,n=t.finishProcessingFn;return function(e,i){var s=Vo(e,i);if(s)return n(s,r);var o=new Uint8Array(i.response);if(r.map.key)return r.map.encryptedBytes=o,n(null,r);r.map.bytes=o,zf(r,function(u){if(u)return u.xhr=i,u.status=i.status,n(u,r);n(null,r)})}},y_=function(t){var r=t.segment,n=t.finishProcessingFn,e=t.responseType;return function(i,s){var o=Vo(i,s);if(o)return n(o,r);var u=e==="arraybuffer"||!s.responseText?s.response:a_(s.responseText.substring(r.lastReachedChar||0));return r.stats=m_(s),r.key?r.encryptedBytes=new Uint8Array(u):r.bytes=new Uint8Array(u),n(null,r)}},__=function(t){var r=t.segment,n=t.bytes,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=r.map&&r.map.tracks||{},x=!!(S.audio&&S.video),k=i.bind(null,r,"audio","start"),L=i.bind(null,r,"audio","end"),H=i.bind(null,r,"video","start"),O=i.bind(null,r,"video","end"),F=function(){return Gf({bytes:n,transmuxer:r.transmuxer,audioAppendStart:r.audioAppendStart,gopsToAlignWith:r.gopsToAlignWith,remux:x,onData:function(R){R.type=R.type==="combined"?"video":R.type,m(r,R)},onTrackInfo:function(R){e&&(x&&(R.isMuxed=!0),e(r,R))},onAudioTimingInfo:function(R){k&&typeof R.start<"u"&&(k(R.start),k=null),L&&typeof R.end<"u"&&L(R.end)},onVideoTimingInfo:function(R){H&&typeof R.start<"u"&&(H(R.start),H=null),O&&typeof R.end<"u"&&O(R.end)},onVideoSegmentTimingInfo:function(R){s(R)},onAudioSegmentTimingInfo:function(R){o(R)},onId3:function(R,U){u(r,R,U)},onCaptions:function(R){l(r,[R])},isEndOfTimeline:c,onEndedTimeline:function(){p()},onTransmuxerLog:b,onDone:function(R){_&&(R.type=R.type==="combined"?"video":R.type,_(null,r,R))}})};ra({action:"probeTs",transmuxer:r.transmuxer,data:n,baseStartTime:r.baseStartTime,callback:function(B){r.bytes=n=B.data;var R=B.result;R&&(e(r,{hasAudio:R.hasAudio,hasVideo:R.hasVideo,isMuxed:x}),e=null,R.hasAudio&&!x&&k(R.audioStart),R.hasVideo&&H(R.videoStart),k=null,H=null),F()}})},$f=function(t){var r=t.segment,n=t.bytes,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=new Uint8Array(n);if(Hv(S)){r.isFmp4=!0;var x=r.map.tracks,k={isFmp4:!0,hasVideo:!!x.video,hasAudio:!!x.audio};x.audio&&x.audio.codec&&x.audio.codec!=="enca"&&(k.audioCodec=x.audio.codec),x.video&&x.video.codec&&x.video.codec!=="encv"&&(k.videoCodec=x.video.codec),x.video&&x.audio&&(k.isMuxed=!0),e(r,k);var L=function(O){m(r,{data:S,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),O&&O.length&&l(r,O),_(null,r,{})};ra({action:"probeMp4StartTime",timescales:r.map.timescales,data:S,transmuxer:r.transmuxer,callback:function(O){var F=O.data,q=O.startTime;if(n=F.buffer,r.bytes=S=F,k.hasAudio&&!k.isMuxed&&i(r,"audio","start",q),k.hasVideo&&i(r,"video","start",q),!x.video||!F.byteLength||!r.transmuxer){L();return}ra({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:r.transmuxer,data:S,timescales:r.map.timescales,trackIds:[x.video.id],callback:function(R){n=R.data.buffer,r.bytes=S=R.data,R.logs.forEach(function(U){b(I.mergeOptions(U,{stream:"mp4CaptionParser"}))}),L(R.captions)}})}});return}if(!r.transmuxer){_(null,r,{});return}if(typeof r.container>"u"&&(r.container=no(S)),r.container!=="ts"&&r.container!=="aac"){e(r,{hasAudio:!1,hasVideo:!1}),_(null,r,{});return}__({segment:r,bytes:n,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})},Kf=function(t,r){var n=t.id,e=t.key,i=t.encryptedBytes,s=t.decryptionWorker,o=function l(c){if(c.data.source===n){s.removeEventListener("message",l);var p=c.data.decrypted;r(new Uint8Array(p.bytes,p.byteOffset,p.byteLength))}};s.addEventListener("message",o);var u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Of({source:n,encrypted:i,key:u,iv:e.iv}),[i.buffer,u.buffer])},T_=function(t){var r=t.decryptionWorker,n=t.segment,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog;Kf({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:r},function(S){n.bytes=S,$f({segment:n,bytes:n.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})})},b_=function(t){var r=t.activeXhrs,n=t.decryptionWorker,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=0,x=!1;return function(k,L){if(!x){if(k)return x=!0,Rs(r),_(k,L);if(S+=1,S===r.length){var H=function(){if(L.encryptedBytes)return T_({decryptionWorker:n,segment:L,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b});$f({segment:L,bytes:L.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return Kf({decryptionWorker:n,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key},function(O){L.map.bytes=O,zf(L,function(F){if(F)return Rs(r),_(F,L);H()})});H()}}}},x_=function(t){var r=t.loadendState,n=t.abortFn;return function(e){var i=e.target;i.aborted&&n&&!r.calledAbortFn&&(n(),r.calledAbortFn=!0)}},S_=function(t){var r=t.segment,n=t.progressFn;return function(e){var i=e.target;if(!i.aborted)return r.stats=I.mergeOptions(r.stats,g_(e)),!r.stats.firstBytesReceivedAt&&r.stats.bytesReceived&&(r.stats.firstBytesReceivedAt=Date.now()),n(e,r)}},E_=function(t){var r=t.xhr,n=t.xhrOptions,e=t.decryptionWorker,i=t.segment,s=t.abortFn,o=t.progressFn,u=t.trackInfoFn,l=t.timingInfoFn,c=t.videoSegmentTimingInfoFn,p=t.audioSegmentTimingInfoFn,m=t.id3Fn,_=t.captionsFn,b=t.isEndOfTimeline,S=t.endedTimelineFn,x=t.dataFn,k=t.doneFn,L=t.onTransmuxerLog,H=[],O=b_({activeXhrs:H,decryptionWorker:e,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:p,id3Fn:m,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x,doneFn:k,onTransmuxerLog:L});if(i.key&&!i.key.bytes){var F=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&F.push(i.map.key);var q=I.mergeOptions(n,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),B=Gl(i,F,O),R=r(q,B);H.push(R)}if(i.map&&!i.map.bytes){var U=i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri);if(U){var N=I.mergeOptions(n,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),X=Gl(i,[i.map.key],O),$=r(N,X);H.push($)}var J=I.mergeOptions(n,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Os(i.map)}),oe=v_({segment:i,finishProcessingFn:O}),fe=r(J,oe);H.push(fe)}var re=I.mergeOptions(n,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Os(i)}),ae=y_({segment:i,finishProcessingFn:O,responseType:re.responseType}),pe=r(re,ae);pe.addEventListener("progress",S_({segment:i,progressFn:o})),H.push(pe);var Me={};return H.forEach(function(ue){ue.addEventListener("loadend",x_({loadendState:Me,abortFn:s}))}),function(){return Rs(H)}},C_=mt("CodecUtils"),A_=function(t){var r=t.attributes||{};if(r.CODECS)return yt(r.CODECS)},Xf=function(t,r){var n=r.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&n.AUDIO&&t.mediaGroups.AUDIO[n.AUDIO]},D_=function(t,r){if(!Xf(t,r))return!0;var n=r.attributes||{},e=t.mediaGroups.AUDIO[n.AUDIO];for(var i in e)if(!e[i].uri&&!e[i].playlists)return!0;return!1},ia=function(t){var r={};return t.forEach(function(n){var e=n.mediaType,i=n.type,s=n.details;r[e]=r[e]||[],r[e].push(yd(""+i+s))}),Object.keys(r).forEach(function(n){if(r[n].length>1){C_("multiple "+n+" codecs found as attributes: "+r[n].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),r[n]=null;return}r[n]=r[n][0]}),r},zl=function(t){var r=0;return t.audio&&r++,t.video&&r++,r},Di=function(t,r){var n=r.attributes||{},e=ia(A_(r)||[]);if(Xf(t,r)&&!e.audio&&!D_(t,r)){var i=ia(Wm(t,n.AUDIO)||[]);i.audio&&(e.audio=i.audio)}return e},Pn=mt("PlaylistSelector"),$l=function(t){if(!(!t||!t.playlist)){var r=t.playlist;return JSON.stringify({id:r.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:r.attributes&&r.attributes.CODECS||""})}},na=function(t,r){if(!t)return"";var n=A.getComputedStyle(t);return n?n[r]:""},Br=function(t,r){var n=t.slice();t.sort(function(e,i){var s=r(e,i);return s===0?n.indexOf(e)-n.indexOf(i):s})},Ho=function(t,r){var n,e;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||A.Number.MAX_VALUE,r.attributes.BANDWIDTH&&(e=r.attributes.BANDWIDTH),e=e||A.Number.MAX_VALUE,n-e},w_=function(t,r){var n,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||A.Number.MAX_VALUE,r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(e=r.attributes.RESOLUTION.width),e=e||A.Number.MAX_VALUE,n===e&&t.attributes.BANDWIDTH&&r.attributes.BANDWIDTH?t.attributes.BANDWIDTH-r.attributes.BANDWIDTH:n-e},Yf=function(t,r,n,e,i,s){if(t){var o={bandwidth:r,width:n,height:e,limitRenditionByPlayerDimensions:i},u=t.playlists;Qe.isAudioOnly(t)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map(function(N){var X,$=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,J=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return X=N.attributes&&N.attributes.BANDWIDTH,X=X||A.Number.MAX_VALUE,{bandwidth:X,width:$,height:J,playlist:N}});Br(l,function(N,X){return N.bandwidth-X.bandwidth}),l=l.filter(function(N){return!Qe.isIncompatible(N.playlist)});var c=l.filter(function(N){return Qe.isEnabled(N.playlist)});c.length||(c=l.filter(function(N){return!Qe.isDisabled(N.playlist)}));var p=c.filter(function(N){return N.bandwidth*we.BANDWIDTH_VARIANCE<r}),m=p[p.length-1],_=p.filter(function(N){return N.bandwidth===m.bandwidth})[0];if(i===!1){var b=_||c[0]||l[0];if(b&&b.playlist){var S="sortedPlaylistReps";return _&&(S="bandwidthBestRep"),c[0]&&(S="enabledPlaylistReps"),Pn("choosing "+$l(b)+" using "+S+" with options",o),b.playlist}return Pn("could not choose a playlist with options",o),null}var x=p.filter(function(N){return N.width&&N.height});Br(x,function(N,X){return N.width-X.width});var k=x.filter(function(N){return N.width===n&&N.height===e});m=k[k.length-1];var L=k.filter(function(N){return N.bandwidth===m.bandwidth})[0],H,O,F;L||(H=x.filter(function(N){return N.width>n||N.height>e}),O=H.filter(function(N){return N.width===H[0].width&&N.height===H[0].height}),m=O[O.length-1],F=O.filter(function(N){return N.bandwidth===m.bandwidth})[0]);var q;if(s.experimentalLeastPixelDiffSelector){var B=x.map(function(N){return N.pixelDiff=Math.abs(N.width-n)+Math.abs(N.height-e),N});Br(B,function(N,X){return N.pixelDiff===X.pixelDiff?X.bandwidth-N.bandwidth:N.pixelDiff-X.pixelDiff}),q=B[0]}var R=q||F||L||_||c[0]||l[0];if(R&&R.playlist){var U="sortedPlaylistReps";return q?U="leastPixelDiffRep":F?U="resolutionPlusOneRep":L?U="resolutionBestRep":_?U="bandwidthBestRep":c[0]&&(U="enabledPlaylistReps"),Pn("choosing "+$l(R)+" using "+U+" with options",o),R.playlist}return Pn("could not choose a playlist with options",o),null}},Kl=function(){var t=this.useDevicePixelRatio&&A.devicePixelRatio||1;return Yf(this.playlists.master,this.systemBandwidth,parseInt(na(this.tech_.el(),"width"),10)*t,parseInt(na(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},k_=function(t){var r=-1,n=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&A.devicePixelRatio||1;return r<0&&(r=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(r=t*this.systemBandwidth+(1-t)*r,n=this.systemBandwidth),Yf(this.playlists.master,r,parseInt(na(this.tech_.el(),"width"),10)*e,parseInt(na(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},P_=function(t){var r=t.master,n=t.currentTime,e=t.bandwidth,i=t.duration,s=t.segmentDuration,o=t.timeUntilRebuffer,u=t.currentTimeline,l=t.syncController,c=r.playlists.filter(function(S){return!Qe.isIncompatible(S)}),p=c.filter(Qe.isEnabled);p.length||(p=c.filter(function(S){return!Qe.isDisabled(S)}));var m=p.filter(Qe.hasAttribute.bind(null,"BANDWIDTH")),_=m.map(function(S){var x=l.getSyncPoint(S,i,u,n),k=x?1:2,L=Qe.estimateSegmentRequestTime(s,e,S),H=L*k-o;return{playlist:S,rebufferingImpact:H}}),b=_.filter(function(S){return S.rebufferingImpact<=0});return Br(b,function(S,x){return Ho(x.playlist,S.playlist)}),b.length?b[0]:(Br(_,function(S,x){return S.rebufferingImpact-x.rebufferingImpact}),_[0]||null)},I_=function(){var t=this,r=this.playlists.master.playlists.filter(Qe.isEnabled);Br(r,function(e,i){return Ho(e,i)});var n=r.filter(function(e){return!!Di(t.playlists.master,e).video});return n[0]||null},L_=function(t){var r=0,n;return t.bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(function(e){n.set(e,r),r+=e.byteLength})),n},O_=function(t,r,n){if(!t[n]){r.trigger({type:"usage",name:"vhs-608"}),r.trigger({type:"usage",name:"hls-608"});var e=n;/^cc708_/.test(n)&&(e="SERVICE"+n.split("_")[1]);var i=r.textTracks().getTrackById(e);if(i)t[n]=i;else{var s=r.options_.vhs&&r.options_.vhs.captionServices||{},o=n,u=n,l=!1,c=s[e];c&&(o=c.label,u=c.language,l=c.default),t[n]=r.addRemoteTextTrack({kind:"captions",id:e,default:l,label:o,language:u},!1).track}}},F_=function(t){var r=t.inbandTextTracks,n=t.captionArray,e=t.timestampOffset;if(n){var i=A.WebKitDataCue||A.VTTCue;n.forEach(function(s){var o=s.stream;r[o].addCue(new i(s.startTime+e,s.endTime+e,s.text))})}},R_=function(t){Object.defineProperties(t.frame,{id:{get:function(){return I.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return I.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return I.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},M_=function(t){var r=t.inbandTextTracks,n=t.metadataArray,e=t.timestampOffset,i=t.videoDuration;if(n){var s=A.WebKitDataCue||A.VTTCue,o=r.metadataTrack_;if(o&&(n.forEach(function(_){var b=_.cueTime+e;typeof b!="number"||A.isNaN(b)||b<0||!(b<1/0)||_.frames.forEach(function(S){var x=new s(b,b,S.value||S.url||S.data||"");x.frame=S,x.value=S,R_(x),o.addCue(x)})}),!(!o.cues||!o.cues.length))){for(var u=o.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var p=l.reduce(function(_,b){var S=_[b.startTime]||[];return S.push(b),_[b.startTime]=S,_},{}),m=Object.keys(p).sort(function(_,b){return Number(_)-Number(b)});m.forEach(function(_,b){var S=p[_],x=Number(m[b+1])||i;S.forEach(function(k){k.endTime=x})})}}},N_=function(t,r,n){t.metadataTrack_||(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=r)},Si=function(t,r,n){var e,i;if(n&&n.cues)for(e=n.cues.length;e--;)i=n.cues[e],i.startTime>=t&&i.endTime<=r&&n.removeCue(i)},B_=function(t){var r=t.cues;if(r)for(var n=0;n<r.length;n++){for(var e=[],i=0,s=0;s<r.length;s++)r[n].startTime===r[s].startTime&&r[n].endTime===r[s].endTime&&r[n].text===r[s].text&&(i++,i>1&&e.push(r[s]));e.length&&e.forEach(function(o){return t.removeCue(o)})}},U_=function(t,r,n){if(typeof r>"u"||r===null||!t.length)return[];var e=Math.ceil((r-n+3)*jn.ONE_SECOND_IN_TS),i;for(i=0;i<t.length&&!(t[i].pts>e);i++);return t.slice(i)},V_=function(t,r,n){if(!r.length)return t;if(n)return r.slice();var e=r[0].pts,i=0;for(i;i<t.length&&!(t[i].pts>=e);i++);return t.slice(0,i).concat(r)},H_=function(t,r,n,e){for(var i=Math.ceil((r-e)*jn.ONE_SECOND_IN_TS),s=Math.ceil((n-e)*jn.ONE_SECOND_IN_TS),o=t.slice(),u=t.length;u--&&!(t[u].pts<=s););if(u===-1)return o;for(var l=u+1;l--&&!(t[l].pts<=i););return l=Math.max(l,0),o.splice(l,u-l+1),o},q_=function(t,r){if(!t&&!r||!t&&r||t&&!r)return!1;if(t===r)return!0;var n=Object.keys(t).sort(),e=Object.keys(r).sort();if(n.length!==e.length)return!1;for(var i=0;i<n.length;i++){var s=n[i];if(s!==e[i]||t[s]!==r[s])return!1}return!0},Qf=22,j_=function(t,r,n){r=r||[];for(var e=[],i=0,s=0;s<r.length;s++){var o=r[s];if(t===o.timeline&&(e.push(s),i+=o.duration,i>n))return s}return e.length===0?0:e[e.length-1]},vi=1,W_=500,Xl=function(t){return typeof t=="number"&&isFinite(t)},In=1/60,G_=function(t,r,n){return t!=="main"||!r||!n?null:!n.hasAudio&&!n.hasVideo?"Neither audio nor video found in segment.":r.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!r.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null},z_=function(t,r,n){var e=r-we.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var i=r-n;return Math.min(i,e)},kr=function(t){var r=t.startOfSegment,n=t.duration,e=t.segment,i=t.part,s=t.playlist,o=s.mediaSequence,u=s.id,l=s.segments,c=l===void 0?[]:l,p=t.mediaIndex,m=t.partIndex,_=t.timeline,b=c.length-1,S="mediaIndex/partIndex increment";t.getMediaInfoForTime?S="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(S="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(S+=" with independent "+t.independent);var x=typeof m=="number",k=t.segment.uri?"segment":"pre-segment",L=x?_f({preloadSegment:e})-1:0;return k+" ["+(o+p)+"/"+(o+b)+"]"+(x?" part ["+m+"/"+L+"]":"")+(" segment start/end ["+e.start+" => "+e.end+"]")+(x?" part start/end ["+i.start+" => "+i.end+"]":"")+(" startOfSegment ["+r+"]")+(" duration ["+n+"]")+(" timeline ["+_+"]")+(" selected by ["+S+"]")+(" playlist ["+u+"]")},Yl=function(t){return t+"TimingInfo"},$_=function(t){var r=t.segmentTimeline,n=t.currentTimeline,e=t.startOfSegment,i=t.buffered,s=t.overrideCheck;return!s&&r===n?null:r<n?e:i.length?i.end(i.length-1):e},Ql=function(t){var r=t.timelineChangeController,n=t.currentTimeline,e=t.segmentTimeline,i=t.loaderType,s=t.audioDisabled;if(n===e)return!1;if(i==="audio"){var o=r.lastTimelineChange({type:"main"});return!o||o.to!==e}if(i==="main"&&s){var u=r.pendingTimelineChange({type:"audio"});return!(u&&u.to===e)}return!1},K_=function(t){var r=0;return["video","audio"].forEach(function(n){var e=t[n+"TimingInfo"];if(e){var i=e.start,s=e.end,o;typeof i=="bigint"||typeof s=="bigint"?o=A.BigInt(s)-A.BigInt(i):typeof i=="number"&&typeof s=="number"&&(o=s-i),typeof o<"u"&&o>r&&(r=o)}}),typeof r=="bigint"&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r},Jl=function(t){var r=t.segmentDuration,n=t.maxDuration;return r?Math.round(r)>n+Qt:!1},X_=function(t,r){if(r!=="hls")return null;var n=K_({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!n)return null;var e=t.playlist.targetDuration,i=Jl({segmentDuration:n,maxDuration:e*2}),s=Jl({segmentDuration:n,maxDuration:e}),o="Segment with index "+t.mediaIndex+" "+("from playlist "+t.playlist.id+" ")+("has a duration of "+n+" ")+("when the reported duration is "+t.duration+" ")+("and the target duration is "+e+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return i||s?{severity:i?"warn":"info",message:o}:null},Ms=function(a){G._inheritsLoose(t,a);function t(n,e){var i;if(i=a.call(this)||this,!n)throw new TypeError("Initialization settings are required");if(typeof n.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!n.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=n.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=n.hasPlayed,i.currentTime_=n.currentTime,i.seekable_=n.seekable,i.seeking_=n.seeking,i.duration_=n.duration,i.mediaSource_=n.mediaSource,i.vhs_=n.vhs,i.loaderType_=n.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=n.segmentMetadataTrack,i.goalBufferLength_=n.goalBufferLength,i.sourceType_=n.sourceType,i.sourceUpdater_=n.sourceUpdater,i.inbandTextTracks_=n.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=n.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=n.parse708captions,i.useDtsForTimestampOffset_=n.useDtsForTimestampOffset,i.captionServices_=n.captionServices,i.experimentalExactManifestTimings=n.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=I.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=n.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=n.decrypter,i.syncController_=n.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=mt("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(ee(i),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="main"&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="audio"&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}var r=t.prototype;return r.createTransmuxer_=function(){return us.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,A.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e},r.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&us.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return I.createTimeRanges();if(this.loaderType_==="main"){var i=e.hasAudio,s=e.hasVideo,o=e.isMuxed;if(s&&i&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=ta(e),o=this.initSegments_[s];return i&&!o&&e.bytes&&(this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},r.segmentKey=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=Ff(e),o=this.keyCache_[s];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[s]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var u={resolvedUri:(o||e).resolvedUri};return o&&(u.bytes=o.bytes),u},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(e,i){if(i===void 0&&(i={}),!!e){var s=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var u=null;if(s&&(s.id?u=s.id:s.uri&&(u=s.uri)),this.logger_("playlist update ["+u+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var l=e.mediaSequence-s.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var p=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=p}}o&&(o.mediaIndex-=l,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}},r.pause=function(){this.checkBufferTimeout_&&(A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&us.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(e,i,s,o){if(s===void 0&&(s=function(){}),o===void 0&&(o=!1),i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var u=1,l=function(){u--,u===0&&s()};(o||!this.audioDisabled_)&&(u++,this.sourceUpdater_.removeAudio(e,i,l)),(o||this.loaderType_==="main")&&(this.gopBuffer_=H_(this.gopBuffer_,e,i,this.timeMapping_),u++,this.sourceUpdater_.removeVideo(e,i,l));for(var c in this.inbandTextTracks_)Si(e,i,this.inbandTextTracks_[c]);Si(e,i,this.segmentMetadataTrack_),l()},r.monitorBuffer_=function(){this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),W_)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},r.isEndOfStream_=function(e,i,s){if(e===void 0&&(e=this.mediaIndex),i===void 0&&(i=this.playlist_),s===void 0&&(s=this.partIndex),!i||!this.mediaSource_)return!1;var o=typeof e=="number"&&i.segments[e],u=e+1===i.segments.length,l=!o||!o.parts||s+1===o.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&u&&l},r.chooseNextRequest_=function(){var e=this.buffered_(),i=Ul(e)||0,s=Ro(e,this.currentTime_()),o=!this.hasPlayed_()&&s>=1,u=s>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||o||u)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=j_(this.currentTimeline_,l,i);else if(this.mediaIndex!==null){var p=l[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=p.end?p.end:i,p.parts&&p.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var _=Qe.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?i:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=_.segmentIndex,S=_.startTime,x=_.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+i:"currentTime "+this.currentTime_(),c.mediaIndex=b,c.startOfSegment=S,c.partIndex=x}var k=l[c.mediaIndex],L=k&&typeof c.partIndex=="number"&&k.parts&&k.parts[c.partIndex];if(!k||typeof c.partIndex=="number"&&!L)return null;if(typeof c.partIndex!="number"&&k.parts&&(c.partIndex=0,L=k.parts[0]),!s&&L&&!L.independent)if(c.partIndex===0){var H=l[c.mediaIndex-1],O=H.parts&&H.parts.length&&H.parts[H.parts.length-1];O&&O.independent&&(c.mediaIndex-=1,c.partIndex=H.parts.length-1,c.independent="previous segment")}else k.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var F=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=l.length-1&&F&&!this.seeking_()?null:this.generateSegmentInfo_(c)},r.generateSegmentInfo_=function(e){var i=e.independent,s=e.playlist,o=e.mediaIndex,u=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,p=e.forceTimestampOffset,m=e.getMediaInfoForTime,_=s.segments[o],b=typeof c=="number"&&_.parts[c],S={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||_.resolvedUri,mediaIndex:o,partIndex:b?c:null,isSyncRequest:l,startOfSegment:u,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:b&&b.duration||_.duration,segment:_,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:i},x=typeof p<"u"?p:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:u,buffered:this.buffered_(),overrideCheck:x});var k=Ul(this.sourceUpdater_.audioBuffered());return typeof k=="number"&&(S.audioAppendStart=k-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=U_(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S},r.timestampOffsetForSegment_=function(e){return $_(e)},r.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var i=this.currentTime_(),s=e.bandwidth,o=this.pendingSegment_.duration,u=Qe.estimateSegmentRequestTime(o,s,this.playlist_,e.bytesReceived),l=_y(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(!(u<=l)){var c=P_({master:this.vhs_.playlists.master,currentTime:i,bandwidth:s,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var p=u-l,m=p-c.rebufferingImpact,_=.5;l<=Qt&&(_=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||m<_)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*we.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},r.handleAbort_=function(e){this.logger_("Aborting "+kr(e)),this.mediaRequestsAborted+=1},r.handleProgress_=function(e,i){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&this.trigger("progress")},r.handleTrackInfo_=function(e,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(i)||(i=i||{},q_(this.currentMediaInfo_,i)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=i,this.currentMediaInfo_=i,this.logger_("trackinfo update",i),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=i,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},r.handleTimingInfo_=function(e,i,s,o){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var u=this.pendingSegment_,l=Yl(i);u[l]=u[l]||{},u[l][s]=o,this.logger_("timinginfo: "+i+" - "+s+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},r.handleCaptions_=function(e,i){var s=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(i.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,i));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),l={};i.forEach(function(c){l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};var p=l[c.stream];p.startTime=Math.min(p.startTime,c.startTime+u),p.endTime=Math.max(p.endTime,c.endTime+u),p.captions.push(c)}),Object.keys(l).forEach(function(c){var p=l[c],m=p.startTime,_=p.endTime,b=p.captions,S=s.inbandTextTracks_;s.logger_("adding cues from "+m+" -> "+_+" for "+c),O_(S,s.vhs_.tech_,c),Si(m,_,S[c]),F_({captionArray:b,inbandTextTracks:S,timestampOffset:u})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},r.handleId3_=function(e,i,s){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,s));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();N_(this.inbandTextTracks_,s,this.vhs_.tech_),M_({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:u,videoDuration:this.duration_()})}},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(i){return i()})},r.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(i){return i()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},r.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed;return!(o&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!u&&!e.audioTimingInfo||Ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.handleData_=function(e,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,i));return}var s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Yl(i.type)].start;else{var o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo,l;u&&(l=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:l,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,i.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==s.mediaIndex||c.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,i)}}},r.updateAppendInitSegmentStatus=function(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)},r.getInitSegmentAndUpdateState_=function(e){var i=e.type,s=e.initSegment,o=e.map,u=e.playlist;if(o){var l=ta(o);if(this.activeInitSegmentId_===l)return null;s=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=l}return s&&this.appendInitSegment_[i]?(this.playlistOfLastInitSegment_[i]=u,this.appendInitSegment_[i]=!1,this.activeInitSegmentId_=null,s):null},r.handleQuotaExceededError_=function(e,i){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes,c=this.sourceUpdater_.audioBuffered(),p=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+lr(c).join(", ")),p.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+lr(p).join(", "));var m=c.length?c.start(0):0,_=c.length?c.end(c.length-1):0,b=p.length?p.start(0):0,S=p.length?p.end(p.length-1):0;if(_-m<=vi&&S-b<=vi){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+l.byteLength+", ")+("audio buffer: "+lr(c).join(", ")+", ")+("video buffer: "+lr(p).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:u,bytes:l}));var x=this.currentTime_(),k=x-vi;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+k),this.remove(0,k,function(){s.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+vi+"s"),s.waitingOnRemove_=!1,s.quotaExceededErrorRetryTimeout_=A.setTimeout(function(){s.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),s.quotaExceededErrorRetryTimeout_=null,s.processCallQueue_()},vi*1e3)},!0)},r.handleAppendError_=function(e,i){var s=e.segmentInfo,o=e.type,u=e.bytes;if(i){if(i.code===Qf){this.handleQuotaExceededError_({segmentInfo:s,type:o,bytes:u});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(o+" append of "+u.length+"b failed for segment "+("#"+s.mediaIndex+" in playlist "+s.playlist.id)),this.trigger("appenderror")}},r.appendToSourceBuffer_=function(e){var i=e.segmentInfo,s=e.type,o=e.initSegment,u=e.data,l=e.bytes;if(!l){var c=[u],p=u.byteLength;o&&(c.unshift(o),p+=o.byteLength),l=L_({bytes:p,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:s,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:i,type:s,bytes:l}))},r.handleSegmentTimingInfo_=function(e,i,s){if(!(!this.pendingSegment_||i!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,u=e+"TimingInfo";o[u]||(o[u]={}),o[u].transmuxerPrependedSeconds=s.prependedContentDuration||0,o[u].transmuxedPresentationStart=s.start.presentation,o[u].transmuxedDecodeStart=s.start.decode,o[u].transmuxedPresentationEnd=s.end.presentation,o[u].transmuxedDecodeEnd=s.end.decode,o[u].baseMediaDecodeTime=s.baseMediaDecodeTime}},r.appendData_=function(e,i){var s=i.type,o=i.data;if(!(!o||!o.byteLength)&&!(s==="audio"&&this.audioDisabled_)){var u=this.getInitSegmentAndUpdateState_({type:s,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:u,data:o})}},r.loadSegment_=function(e){var i=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var s=ht({},e,{forceTimestampOffset:!0});ht(e,i.generateSegmentInfo_(s)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},r.updateTransmuxerAndRequestSegment_=function(e){var i=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var s=this.createSimplifiedSegmentObj_(e),o=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),u=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=o||u&&l;this.logger_("Requesting "+kr(e)),s.map&&!s.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=E_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:s,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){i.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(m){var _=m.message,b=m.level,S=m.stream;i.logger_(kr(e)+" logged from transmuxer stream "+S+" as a "+b+": "+_)}})},r.trimBackBuffer_=function(e){var i=z_(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)},r.createSimplifiedSegmentObj_=function(e){var i=e.segment,s=e.part,o={resolvedUri:s?s.resolvedUri:i.resolvedUri,byterange:s?s.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===i.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),i.key){var l=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=l}return i.map&&(o.map=this.initSegmentForMap(i.map)),o},r.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},r.saveBandwidthRelatedStats_=function(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e<In){this.logger_("Ignoring segment's bandwidth because its duration of "+e+(" is less than the min to record "+In));return}this.bandwidth=i.bandwidth,this.roundTrip=i.roundTripTime},r.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},r.segmentRequestFinished_=function(e,i,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,i,s));return}if(this.saveTransferStats_(i.stats),!!this.pendingSegment_&&i.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===xt.ABORTED)return;if(this.pause(),e.code===xt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,i.stats),o.endOfAllRequests=i.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=V_(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},r.setTimeMapping_=function(e){var i=this.syncController_.mappingForTimeline(e);i!==null&&(this.timeMapping_=i)},r.updateMediaSecondsLoaded_=function(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},r.shouldUpdateTransmuxerTimestampOffset_=function(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()},r.trueSegmentStart_=function(e){var i=e.currentStart,s=e.playlist,o=e.mediaIndex,u=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,c=e.useVideoTimingInfo,p=e.videoTimingInfo,m=e.audioTimingInfo;if(typeof i<"u")return i;if(!c)return m.start;var _=s.segments[o-1];return o===0||!_||typeof _.start>"u"||_.end!==u+l?u:p.start},r.waitForAppendsToComplete_=function(e){var i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed,l=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&s&&!u;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}l&&e.waitingOnAppends++,c&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},r.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(e){var i=G_(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,blacklistDuration:1/0}),this.trigger("error"),!0):!1},r.updateSourceBufferTimestampOffset_=function(e){if(!(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")){var i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var i=e.videoTimingInfo,s=e.audioTimingInfo,o=e.timingInfo;return this.useDtsForTimestampOffset_?i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:s&&typeof s.transmuxedDecodeStart=="number"?s.transmuxedDecodeStart:o.start:o.start},r.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var i=this.getMediaInfo_(),s=this.loaderType_==="main"&&i&&i.hasVideo,o=s&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});var i=X_(e,this.sourceType_);if(i&&(i.severity==="warn"?I.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+kr(e));return}this.logger_("Appended "+kr(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var s=e.segment,o=e.part,u=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,l=o&&o.end&&this.currentTime_()-o.end>e.playlist.partTargetDuration*3;if(u||l){this.logger_("bad "+(u?"segment":"part")+" "+kr(e)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},r.recordThroughput_=function(e){if(e.duration<In){this.logger_("Ignoring segment's throughput because its duration of "+e.duration+(" is less than the min to record "+In));return}var i=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,o=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(o-i)/++this.throughput.count},r.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var i=e.segment,s=i.start,o=i.end;if(!(!Xl(s)||!Xl(o))){Si(s,o,this.segmentMetadataTrack_);var u=A.WebKitDataCue||A.VTTCue,l={custom:i.custom,dateTimeObject:i.dateTimeObject,dateTimeString:i.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:o},c=JSON.stringify(l),p=new u(s,o,c);p.value=l,this.segmentMetadataTrack_.addCue(p)}}},t}(I.EventTarget);function Ot(){}var Jf=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toUpperCase()})},Y_=["video","audio"],Ns=function(t,r){var n=r[t+"Buffer"];return n&&n.updating||r.queuePending[t]},Q_=function(t,r){for(var n=0;n<r.length;n++){var e=r[n];if(e.type==="mediaSource")return null;if(e.type===t)return n}return null},qo=function a(t,r){if(r.queue.length!==0){var n=0,e=r.queue[n];if(e.type==="mediaSource"){!r.updating()&&r.mediaSource.readyState!=="closed"&&(r.queue.shift(),e.action(r),e.doneFn&&e.doneFn(),a("audio",r),a("video",r));return}if(t!=="mediaSource"&&!(!r.ready()||r.mediaSource.readyState==="closed"||Ns(t,r))){if(e.type!==t){if(n=Q_(t,r.queue),n===null)return;e=r.queue[n]}if(r.queue.splice(n,1),r.queuePending[t]=e,e.action(t,r),!e.doneFn){r.queuePending[t]=null,a(t,r);return}}}},Zf=function(t,r){var n=r[t+"Buffer"],e=Jf(t);n&&(n.removeEventListener("updateend",r["on"+e+"UpdateEnd_"]),n.removeEventListener("error",r["on"+e+"Error_"]),r.codecs[t]=null,r[t+"Buffer"]=null)},_t=function(t,r){return t&&r&&Array.prototype.indexOf.call(t.sourceBuffers,r)!==-1},tt={appendBuffer:function(t,r,n){return function(e,i){var s=i[e+"Buffer"];if(_t(i.mediaSource,s)){i.logger_("Appending segment "+r.mediaIndex+"'s "+t.length+" bytes to "+e+"Buffer");try{s.appendBuffer(t)}catch(o){i.logger_("Error with code "+o.code+" "+(o.code===Qf?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+r.mediaIndex+" to "+e+"Buffer")),i.queuePending[e]=null,n(o)}}}},remove:function(t,r){return function(n,e){var i=e[n+"Buffer"];if(_t(e.mediaSource,i)){e.logger_("Removing "+t+" to "+r+" from "+n+"Buffer");try{i.remove(t,r)}catch{e.logger_("Remove "+t+" to "+r+" from "+n+"Buffer failed")}}}},timestampOffset:function(t){return function(r,n){var e=n[r+"Buffer"];_t(n.mediaSource,e)&&(n.logger_("Setting "+r+"timestampOffset to "+t),e.timestampOffset=t)}},callback:function(t){return function(r,n){t()}},endOfStream:function(t){return function(r){if(r.mediaSource.readyState==="open"){r.logger_("Calling mediaSource endOfStream("+(t||"")+")");try{r.mediaSource.endOfStream(t)}catch(n){I.log.warn("Failed to call media source endOfStream",n)}}}},duration:function(t){return function(r){r.logger_("Setting mediaSource duration to "+t);try{r.mediaSource.duration=t}catch(n){I.log.warn("Failed to set media source duration",n)}}},abort:function(){return function(t,r){if(r.mediaSource.readyState==="open"){var n=r[t+"Buffer"];if(_t(r.mediaSource,n)){r.logger_("calling abort on "+t+"Buffer");try{n.abort()}catch(e){I.log.warn("Failed to abort on "+t+"Buffer",e)}}}}},addSourceBuffer:function(t,r){return function(n){var e=Jf(t),i=wi(r);n.logger_("Adding "+t+"Buffer with codec "+r+" to mediaSource");var s=n.mediaSource.addSourceBuffer(i);s.addEventListener("updateend",n["on"+e+"UpdateEnd_"]),s.addEventListener("error",n["on"+e+"Error_"]),n.codecs[t]=r,n[t+"Buffer"]=s}},removeSourceBuffer:function(t){return function(r){var n=r[t+"Buffer"];if(Zf(t,r),!!_t(r.mediaSource,n)){r.logger_("Removing "+t+"Buffer with codec "+r.codecs[t]+" from mediaSource");try{r.mediaSource.removeSourceBuffer(n)}catch(e){I.log.warn("Failed to removeSourceBuffer "+t+"Buffer",e)}}}},changeType:function(t){return function(r,n){var e=n[r+"Buffer"],i=wi(t);_t(n.mediaSource,e)&&n.codecs[r]!==t&&(n.logger_("changing "+r+"Buffer codec from "+n.codecs[r]+" to "+t),e.changeType(i),n.codecs[r]=t)}}},rt=function(t){var r=t.type,n=t.sourceUpdater,e=t.action,i=t.doneFn,s=t.name;n.queue.push({type:r,action:e,doneFn:i,name:s}),qo(r,n)},Zl=function(t,r){return function(n){if(r.queuePending[t]){var e=r.queuePending[t].doneFn;r.queuePending[t]=null,e&&e(r[t+"Error_"])}qo(t,r)}},eh=function(a){G._inheritsLoose(t,a);function t(n){var e;return e=a.call(this)||this,e.mediaSource=n,e.sourceopenListener_=function(){return qo("mediaSource",ee(e))},e.mediaSource.addEventListener("sourceopen",e.sourceopenListener_),e.logger_=mt("SourceUpdater"),e.audioTimestampOffset_=0,e.videoTimestampOffset_=0,e.queue=[],e.queuePending={audio:null,video:null},e.delayedAudioAppendQueue_=[],e.videoAppendQueued_=!1,e.codecs={},e.onVideoUpdateEnd_=Zl("video",ee(e)),e.onAudioUpdateEnd_=Zl("audio",ee(e)),e.onVideoError_=function(i){e.videoError_=i},e.onAudioError_=function(i){e.audioError_=i},e.createdSourceBuffers_=!1,e.initializedEme_=!1,e.triggeredReady_=!1,e}var r=t.prototype;return r.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},r.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},r.hasInitializedAnyEme=function(){return this.initializedEme_},r.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},r.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},r.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},r.addSourceBuffer=function(e,i){rt({type:"mediaSource",sourceUpdater:this,action:tt.addSourceBuffer(e,i),name:"addSourceBuffer"})},r.abort=function(e){rt({type:e,sourceUpdater:this,action:tt.abort(e),name:"abort"})},r.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer()){I.log.error("removeSourceBuffer is not supported!");return}rt({type:"mediaSource",sourceUpdater:this,action:tt.removeSourceBuffer(e),name:"removeSourceBuffer"})},r.canRemoveSourceBuffer=function(){return!I.browser.IE_VERSION&&!I.browser.IS_FIREFOX&&A.MediaSource&&A.MediaSource.prototype&&typeof A.MediaSource.prototype.removeSourceBuffer=="function"},t.canChangeType=function(){return A.SourceBuffer&&A.SourceBuffer.prototype&&typeof A.SourceBuffer.prototype.changeType=="function"},r.canChangeType=function(){return this.constructor.canChangeType()},r.changeType=function(e,i){if(!this.canChangeType()){I.log.error("changeType is not supported!");return}rt({type:e,sourceUpdater:this,action:tt.changeType(i),name:"changeType"})},r.addOrChangeSourceBuffers=function(e){var i=this;if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(s){var o=e[s];if(!i.hasCreatedSourceBuffers())return i.addSourceBuffer(s,o);i.canChangeType()&&i.changeType(s,o)})},r.appendBuffer=function(e,i){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes;if(this.processedAppend_=!0,u==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_("delayed audio append of "+l.length+" until video append");return}var c=i;if(rt({type:u,sourceUpdater:this,action:tt.appendBuffer(l,o||{mediaIndex:-1},c),doneFn:i,name:"appendBuffer"}),u==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var p=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+p.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,p.forEach(function(m){s.appendBuffer.apply(s,m)})}},r.audioBuffered=function(){return _t(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:I.createTimeRange()},r.videoBuffered=function(){return _t(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:I.createTimeRange()},r.buffered=function(){var e=_t(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=_t(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():yy(this.audioBuffered(),this.videoBuffered())},r.setDuration=function(e,i){i===void 0&&(i=Ot),rt({type:"mediaSource",sourceUpdater:this,action:tt.duration(e),name:"duration",doneFn:i})},r.endOfStream=function(e,i){e===void 0&&(e=null),i===void 0&&(i=Ot),typeof e!="string"&&(e=void 0),rt({type:"mediaSource",sourceUpdater:this,action:tt.endOfStream(e),name:"endOfStream",doneFn:i})},r.removeAudio=function(e,i,s){if(s===void 0&&(s=Ot),!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}rt({type:"audio",sourceUpdater:this,action:tt.remove(e,i),doneFn:s,name:"remove"})},r.removeVideo=function(e,i,s){if(s===void 0&&(s=Ot),!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}rt({type:"video",sourceUpdater:this,action:tt.remove(e,i),doneFn:s,name:"remove"})},r.updating=function(){return!!(Ns("audio",this)||Ns("video",this))},r.audioTimestampOffset=function(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(rt({type:"audio",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},r.videoTimestampOffset=function(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(rt({type:"video",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},r.audioQueueCallback=function(e){this.audioBuffer&&rt({type:"audio",sourceUpdater:this,action:tt.callback(e),name:"callback"})},r.videoQueueCallback=function(e){this.videoBuffer&&rt({type:"video",sourceUpdater:this,action:tt.callback(e),name:"callback"})},r.dispose=function(){var e=this;this.trigger("dispose"),Y_.forEach(function(i){e.abort(i),e.canRemoveSourceBuffer()?e.removeSourceBuffer(i):e[i+"QueueCallback"](function(){return Zf(i,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(I.EventTarget),ed=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},td=new Uint8Array(`
|
|
64
|
+
`).replace(/^\n+|\n+$/g,"");d.length&&this.trigger("data",{startPts:this.startPts_,endPts:T,text:d,stream:this.name_})},Te.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=er(),this.nonDisplayed_=er(),this.lastControlCode_=null,this.column_=0,this.row_=rn,this.rollUpRows_=2,this.formatting_=[]},Te.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},Te.prototype.isSpecialCharacter=function(T,d){return T===this.EXT_&&d>=48&&d<=63},Te.prototype.isExtCharacter=function(T,d){return(T===this.EXT_+1||T===this.EXT_+2)&&d>=32&&d<=63},Te.prototype.isMidRowCode=function(T,d){return T===this.EXT_&&d>=32&&d<=47},Te.prototype.isOffsetControlCode=function(T,d){return T===this.OFFSET_&&d>=33&&d<=35},Te.prototype.isPAC=function(T,d){return T>=this.BASE_&&T<this.BASE_+8&&d>=64&&d<=127},Te.prototype.isColorPAC=function(T){return T>=64&&T<=79||T>=96&&T<=127},Te.prototype.isNormalChar=function(T){return T>=32&&T<=127},Te.prototype.setRollUp=function(T,d){if(this.mode_!=="rollUp"&&(this.row_=rn,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=er(),this.displayed_=er()),d!==void 0&&d!==this.row_)for(var h=0;h<this.rollUpRows_;h++)this.displayed_[d-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]="";d===void 0&&(d=this.row_),this.topRow_=d-this.rollUpRows_+1},Te.prototype.addFormatting=function(T,d){this.formatting_=this.formatting_.concat(d);var h=d.reduce(function(f,g){return f+"<"+g+">"},"");this[this.mode_](T,h)},Te.prototype.clearFormatting=function(T){if(this.formatting_.length){var d=this.formatting_.reverse().reduce(function(h,f){return h+"</"+f+">"},"");this.formatting_=[],this[this.mode_](T,d)}},Te.prototype.popOn=function(T,d){var h=this.nonDisplayed_[this.row_];h+=d,this.nonDisplayed_[this.row_]=h},Te.prototype.rollUp=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h},Te.prototype.shiftRowsUp_=function(){var T;for(T=0;T<this.topRow_;T++)this.displayed_[T]="";for(T=this.row_+1;T<rn+1;T++)this.displayed_[T]="";for(T=this.topRow_;T<this.row_;T++)this.displayed_[T]=this.displayed_[T+1];this.displayed_[this.row_]=""},Te.prototype.paintOn=function(T,d){var h=this.displayed_[this.row_];h+=d,this.displayed_[this.row_]=h};var nn={CaptionStream:et,Cea608Stream:Te,Cea708Stream:me},Le={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ph=8589934592,Ih=4294967296,Xo="shared",Oa=function(d,h){var f=1;for(d>h&&(f=-1);Math.abs(h-d)>Ih;)d+=f*Ph;return d},Yo=function T(d){var h,f;T.prototype.init.call(this),this.type_=d||Xo,this.push=function(g){this.type_!==Xo&&g.type!==this.type_||(f===void 0&&(f=g.dts),g.dts=Oa(g.dts,f),g.pts=Oa(g.pts,f),h=g.dts,this.trigger("data",g))},this.flush=function(){f=h,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,h=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Yo.prototype=new t;var Qo={TimestampRolloverStream:Yo,handleRollover:Oa},Jo=function(d,h,f){var g,v="";for(g=h;g<f;g++)v+="%"+("00"+d[g].toString(16)).slice(-2);return v},an=function(d,h,f){return decodeURIComponent(Jo(d,h,f))},Lh=function(d,h,f){return unescape(Jo(d,h,f))},sn=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Zo={TXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=an(d.data,1,h),d.value=an(d.data,h+1,d.data.length).replace(/\0*$/,"");break}d.data=d.value}},WXXX:function(d){var h;if(d.data[0]===3){for(h=1;h<d.data.length;h++)if(d.data[h]===0){d.description=an(d.data,1,h),d.url=an(d.data,h+1,d.data.length);break}}},PRIV:function(d){var h;for(h=0;h<d.data.length;h++)if(d.data[h]===0){d.owner=Lh(d.data,0,h);break}d.privateData=d.data.subarray(h+1),d.data=d.privateData}},on;on=function(d){var h={descriptor:d&&d.descriptor},f=0,g=[],v=0,y;if(on.prototype.init.call(this),this.dispatchType=Le.METADATA_STREAM_TYPE.toString(16),h.descriptor)for(y=0;y<h.descriptor.length;y++)this.dispatchType+=("00"+h.descriptor[y].toString(16)).slice(-2);this.push=function(E){var C,w,D,P,M,z;if(E.type==="timed-metadata"){if(E.dataAlignmentIndicator&&(v=0,g.length=0),g.length===0&&(E.data.length<10||E.data[0]!==73||E.data[1]!==68||E.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(g.push(E),v+=E.data.byteLength,g.length===1&&(f=sn(E.data.subarray(6,10)),f+=10),!(v<f)){for(C={data:new Uint8Array(f),frames:[],pts:g[0].pts,dts:g[0].dts},M=0;M<f;)C.data.set(g[0].data.subarray(0,f-M),M),M+=g[0].data.byteLength,v-=g[0].data.byteLength,g.shift();w=10,C.data[5]&64&&(w+=4,w+=sn(C.data.subarray(10,14)),f-=sn(C.data.subarray(16,20)));do{if(D=sn(C.data.subarray(w+4,w+8)),D<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(z=String.fromCharCode(C.data[w],C.data[w+1],C.data[w+2],C.data[w+3]),P={id:z,data:C.data.subarray(w+10,w+D+10)},P.key=P.id,Zo[P.id]&&(Zo[P.id](P),P.owner==="com.apple.streaming.transportStreamTimestamp")){var Y=P.data,j=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;j*=4,j+=Y[7]&3,P.timeStamp=j,C.pts===void 0&&C.dts===void 0&&(C.pts=P.timeStamp,C.dts=P.timeStamp),this.trigger("timestamp",P)}C.frames.push(P),w+=10,w+=D}while(w<f);this.trigger("data",C)}}}},on.prototype=new t;var Oh=on,Fh=Qo.TimestampRolloverStream,un,si,ln,br=188,Fa=71;un=function(){var d=new Uint8Array(br),h=0;un.prototype.init.call(this),this.push=function(f){var g=0,v=br,y;for(h?(y=new Uint8Array(f.byteLength+h),y.set(d.subarray(0,h)),y.set(f,h),h=0):y=f;v<y.byteLength;){if(y[g]===Fa&&y[v]===Fa){this.trigger("data",y.subarray(g,v)),g+=br,v+=br;continue}g++,v++}g<y.byteLength&&(d.set(y.subarray(g),0),h=y.byteLength-g)},this.flush=function(){h===br&&d[0]===Fa&&(this.trigger("data",d),h=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){h=0,this.trigger("reset")}},un.prototype=new t,si=function(){var d,h,f,g;si.prototype.init.call(this),g=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(y,E){var C=0;E.payloadUnitStartIndicator&&(C+=y[C]+1),E.type==="pat"?h(y.subarray(C),E):f(y.subarray(C),E)},h=function(y,E){E.section_number=y[7],E.last_section_number=y[8],g.pmtPid=(y[10]&31)<<8|y[11],E.pmtPid=g.pmtPid},f=function(y,E){var C,w,D,P;if(y[5]&1){for(g.programMapTable={video:null,audio:null,"timed-metadata":{}},C=(y[1]&15)<<8|y[2],w=3+C-4,D=(y[10]&15)<<8|y[11],P=12+D;P<w;){var M=y[P],z=(y[P+1]&31)<<8|y[P+2];M===Le.H264_STREAM_TYPE&&g.programMapTable.video===null?g.programMapTable.video=z:M===Le.ADTS_STREAM_TYPE&&g.programMapTable.audio===null?g.programMapTable.audio=z:M===Le.METADATA_STREAM_TYPE&&(g.programMapTable["timed-metadata"][z]=M),P+=((y[P+3]&15)<<8|y[P+4])+5}E.programMapTable=g.programMapTable}},this.push=function(v){var y={},E=4;if(y.payloadUnitStartIndicator=!!(v[1]&64),y.pid=v[1]&31,y.pid<<=8,y.pid|=v[2],(v[3]&48)>>>4>1&&(E+=v[E]+1),y.pid===0)y.type="pat",d(v.subarray(E),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",d(v.subarray(E),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,E,y]):this.processPes_(v,E,y)},this.processPes_=function(v,y,E){E.pid===this.programMapTable.video?E.streamType=Le.H264_STREAM_TYPE:E.pid===this.programMapTable.audio?E.streamType=Le.ADTS_STREAM_TYPE:E.streamType=this.programMapTable["timed-metadata"][E.pid],E.type="pes",E.data=v.subarray(y),this.trigger("data",E)}},si.prototype=new t,si.STREAM_TYPES={h264:27,adts:15},ln=function(){var d=this,h=!1,f={data:[],size:0},g={data:[],size:0},v={data:[],size:0},y,E=function(D,P){var M,z=D[0]<<16|D[1]<<8|D[2];P.data=new Uint8Array,z===1&&(P.packetLength=6+(D[4]<<8|D[5]),P.dataAlignmentIndicator=(D[6]&4)!==0,M=D[7],M&192&&(P.pts=(D[9]&14)<<27|(D[10]&255)<<20|(D[11]&254)<<12|(D[12]&255)<<5|(D[13]&254)>>>3,P.pts*=4,P.pts+=(D[13]&6)>>>1,P.dts=P.pts,M&64&&(P.dts=(D[14]&14)<<27|(D[15]&255)<<20|(D[16]&254)<<12|(D[17]&255)<<5|(D[18]&254)>>>3,P.dts*=4,P.dts+=(D[18]&6)>>>1)),P.data=D.subarray(9+D[8]))},C=function(D,P,M){var z=new Uint8Array(D.size),Y={type:P},j=0,Z=0,De=!1,He;if(!(!D.data.length||D.size<9)){for(Y.trackId=D.data[0].pid,j=0;j<D.data.length;j++)He=D.data[j],z.set(He.data,Z),Z+=He.data.byteLength;E(z,Y),De=P==="video"||Y.packetLength<=D.size,(M||De)&&(D.size=0,D.data.length=0),De&&d.trigger("data",Y)}};ln.prototype.init.call(this),this.push=function(w){({pat:function(){},pes:function(){var P,M;switch(w.streamType){case Le.H264_STREAM_TYPE:P=f,M="video";break;case Le.ADTS_STREAM_TYPE:P=g,M="audio";break;case Le.METADATA_STREAM_TYPE:P=v,M="timed-metadata";break;default:return}w.payloadUnitStartIndicator&&C(P,M,!0),P.data.push(w),P.size+=w.data.byteLength},pmt:function(){var P={type:"metadata",tracks:[]};y=w.programMapTable,y.video!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),y.audio!==null&&P.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),h=!0,d.trigger("data",P)}})[w.type]()},this.reset=function(){f.size=0,f.data.length=0,g.size=0,g.data.length=0,this.trigger("reset")},this.flushStreams_=function(){C(f,"video"),C(g,"audio"),C(v,"timed-metadata")},this.flush=function(){if(!h&&y){var w={type:"metadata",tracks:[]};y.video!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),y.audio!==null&&w.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),d.trigger("data",w)}h=!1,this.flushStreams_(),this.trigger("done")}},ln.prototype=new t;var eu={PAT_PID:0,MP2T_PACKET_LENGTH:br,TransportPacketStream:un,TransportParseStream:si,ElementaryStream:ln,TimestampRolloverStream:Fh,CaptionStream:nn.CaptionStream,Cea608Stream:nn.Cea608Stream,Cea708Stream:nn.Cea708Stream,MetadataStream:Oh};for(var Ra in Le)Le.hasOwnProperty(Ra)&&(eu[Ra]=Le[Ra]);var kt=eu,Rh=se.ONE_SECOND_IN_TS,dn,tu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];dn=function(d){var h,f=0;dn.prototype.init.call(this),this.skipWarn_=function(g,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+g+" to "+v+" in frame "+f+" outside syncword"})},this.push=function(g){var v=0,y,E,C,w,D;if(d||(f=0),g.type==="audio"){h&&h.length?(C=h,h=new Uint8Array(C.byteLength+g.data.byteLength),h.set(C),h.set(g.data,C.byteLength)):h=g.data;for(var P;v+7<h.length;){if(h[v]!==255||(h[v+1]&246)!==240){typeof P!="number"&&(P=v),v++;continue}if(typeof P=="number"&&(this.skipWarn_(P,v),P=null),E=(~h[v+1]&1)*2,y=(h[v+3]&3)<<11|h[v+4]<<3|(h[v+5]&224)>>5,w=((h[v+6]&3)+1)*1024,D=w*Rh/tu[(h[v+2]&60)>>>2],h.byteLength-v<y)break;this.trigger("data",{pts:g.pts+f*D,dts:g.dts+f*D,sampleCount:w,audioobjecttype:(h[v+2]>>>6&3)+1,channelcount:(h[v+2]&1)<<2|(h[v+3]&192)>>>6,samplerate:tu[(h[v+2]&60)>>>2],samplingfrequencyindex:(h[v+2]&60)>>>2,samplesize:16,data:h.subarray(v+7+E,v+y)}),f++,v+=y}typeof P=="number"&&(this.skipWarn_(P,v),P=null),h=h.subarray(v)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},dn.prototype=new t;var ru=dn,iu;iu=function(d){var h=d.byteLength,f=0,g=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+g},this.loadWord=function(){var v=d.byteLength-h,y=new Uint8Array(4),E=Math.min(4,h);if(E===0)throw new Error("no bytes available");y.set(d.subarray(v,v+E)),f=new DataView(y.buffer).getUint32(0),g=E*8,h-=E},this.skipBits=function(v){var y;g>v?(f<<=v,g-=v):(v-=g,y=Math.floor(v/8),v-=y*8,h-=y,this.loadWord(),f<<=v,g-=v)},this.readBits=function(v){var y=Math.min(g,v),E=f>>>32-y;return g-=y,g>0?f<<=y:h>0&&this.loadWord(),y=v-y,y>0?E<<y|this.readBits(y):E},this.skipLeadingZeros=function(){var v;for(v=0;v<g;++v)if(f&2147483648>>>v)return f<<=v,g-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Mh=iu,cn,fn,nu;fn=function(){var d=0,h,f;fn.prototype.init.call(this),this.push=function(g){var v;f?(v=new Uint8Array(f.byteLength+g.data.byteLength),v.set(f),v.set(g.data,f.byteLength),f=v):f=g.data;for(var y=f.byteLength;d<y-3;d++)if(f[d+2]===1){h=d+5;break}for(;h<y;)switch(f[h]){case 0:if(f[h-1]!==0){h+=2;break}else if(f[h-2]!==0){h++;break}d+3!==h-2&&this.trigger("data",f.subarray(d+3,h-2));do h++;while(f[h]!==1&&h<y);d=h-2,h+=3;break;case 1:if(f[h-1]!==0||f[h-2]!==0){h+=3;break}this.trigger("data",f.subarray(d+3,h-2)),d=h-2,h+=3;break;default:h+=3;break}f=f.subarray(d),h-=d,d=0},this.reset=function(){f=null,d=0,this.trigger("reset")},this.flush=function(){f&&f.byteLength>3&&this.trigger("data",f.subarray(d+3)),f=null,d=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},fn.prototype=new t,nu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},cn=function(){var d=new fn,h,f,g,v,y,E,C;cn.prototype.init.call(this),h=this,this.push=function(w){w.type==="video"&&(f=w.trackId,g=w.pts,v=w.dts,d.push(w))},d.on("data",function(w){var D={trackId:f,pts:g,dts:v,data:w,nalUnitTypeCode:w[0]&31};switch(D.nalUnitTypeCode){case 5:D.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:D.nalUnitType="sei_rbsp",D.escapedRBSP=y(w.subarray(1));break;case 7:D.nalUnitType="seq_parameter_set_rbsp",D.escapedRBSP=y(w.subarray(1)),D.config=E(D.escapedRBSP);break;case 8:D.nalUnitType="pic_parameter_set_rbsp";break;case 9:D.nalUnitType="access_unit_delimiter_rbsp";break}h.trigger("data",D)}),d.on("done",function(){h.trigger("done")}),d.on("partialdone",function(){h.trigger("partialdone")}),d.on("reset",function(){h.trigger("reset")}),d.on("endedtimeline",function(){h.trigger("endedtimeline")}),this.flush=function(){d.flush()},this.partialFlush=function(){d.partialFlush()},this.reset=function(){d.reset()},this.endTimeline=function(){d.endTimeline()},C=function(D,P){var M=8,z=8,Y,j;for(Y=0;Y<D;Y++)z!==0&&(j=P.readExpGolomb(),z=(M+j+256)%256),M=z===0?M:z},y=function(D){for(var P=D.byteLength,M=[],z=1,Y,j;z<P-2;)D[z]===0&&D[z+1]===0&&D[z+2]===3?(M.push(z+2),z+=2):z++;if(M.length===0)return D;Y=P-M.length,j=new Uint8Array(Y);var Z=0;for(z=0;z<Y;Z++,z++)Z===M[0]&&(Z++,M.shift()),j[z]=D[Z];return j},E=function(D){var P=0,M=0,z=0,Y=0,j,Z,De,He,nr,Ba,Au,Du,wu,Ua,ku,xe=[1,1],Pu,ar;if(j=new Mh(D),Z=j.readUnsignedByte(),He=j.readUnsignedByte(),De=j.readUnsignedByte(),j.skipUnsignedExpGolomb(),nu[Z]&&(nr=j.readUnsignedExpGolomb(),nr===3&&j.skipBits(1),j.skipUnsignedExpGolomb(),j.skipUnsignedExpGolomb(),j.skipBits(1),j.readBoolean()))for(ku=nr!==3?8:12,ar=0;ar<ku;ar++)j.readBoolean()&&(ar<6?C(16,j):C(64,j));if(j.skipUnsignedExpGolomb(),Ba=j.readUnsignedExpGolomb(),Ba===0)j.readUnsignedExpGolomb();else if(Ba===1)for(j.skipBits(1),j.skipExpGolomb(),j.skipExpGolomb(),Au=j.readUnsignedExpGolomb(),ar=0;ar<Au;ar++)j.skipExpGolomb();if(j.skipUnsignedExpGolomb(),j.skipBits(1),Du=j.readUnsignedExpGolomb(),wu=j.readUnsignedExpGolomb(),Ua=j.readBits(1),Ua===0&&j.skipBits(1),j.skipBits(1),j.readBoolean()&&(P=j.readUnsignedExpGolomb(),M=j.readUnsignedExpGolomb(),z=j.readUnsignedExpGolomb(),Y=j.readUnsignedExpGolomb()),j.readBoolean()&&j.readBoolean()){switch(Pu=j.readUnsignedByte(),Pu){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=[j.readUnsignedByte()<<8|j.readUnsignedByte(),j.readUnsignedByte()<<8|j.readUnsignedByte()];break}}xe&&xe[0]/xe[1]}return{profileIdc:Z,levelIdc:De,profileCompatibility:He,width:(Du+1)*16-P*2-M*2,height:(2-Ua)*(wu+1)*16-z*2-Y*2,sarRatio:xe}}},cn.prototype=new t;var Nh={H264Stream:cn},Bh=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],au=function(d,h){var f=d[h+6]<<21|d[h+7]<<14|d[h+8]<<7|d[h+9],g=d[h+5],v=(g&16)>>4;return f=f>=0?f:0,v?f+20:f+10},Uh=function T(d,h){return d.length-h<10||d[h]!==73||d[h+1]!==68||d[h+2]!==51?h:(h+=au(d,h),T(d,h))},Vh=function(d){var h=Uh(d,0);return d.length>=h+2&&(d[h]&255)===255&&(d[h+1]&240)===240&&(d[h+1]&22)===16},su=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Hh=function(d,h,f){var g,v="";for(g=h;g<f;g++)v+="%"+("00"+d[g].toString(16)).slice(-2);return v},qh=function(d,h,f){return unescape(Hh(d,h,f))},jh=function(d,h){var f=(d[h+5]&224)>>5,g=d[h+4]<<3,v=d[h+3]&6144;return v|g|f},Wh=function(d,h){return d[h]===73&&d[h+1]===68&&d[h+2]===51?"timed-metadata":d[h]&!0&&(d[h+1]&240)===240?"audio":null},Gh=function(d){for(var h=0;h+5<d.length;){if(d[h]!==255||(d[h+1]&246)!==240){h++;continue}return Bh[(d[h+2]&60)>>>2]}return null},zh=function(d){var h,f,g,v;h=10,d[5]&64&&(h+=4,h+=su(d.subarray(10,14)));do{if(f=su(d.subarray(h+4,h+8)),f<1)return null;if(v=String.fromCharCode(d[h],d[h+1],d[h+2],d[h+3]),v==="PRIV"){g=d.subarray(h+10,h+f+10);for(var y=0;y<g.byteLength;y++)if(g[y]===0){var E=qh(g,0,y);if(E==="com.apple.streaming.transportStreamTimestamp"){var C=g.subarray(y+1),w=(C[3]&1)<<30|C[4]<<22|C[5]<<14|C[6]<<6|C[7]>>>2;return w*=4,w+=C[7]&3,w}break}}h+=10,h+=f}while(h<d.byteLength);return null},hn={isLikelyAacData:Vh,parseId3TagSize:au,parseAdtsSize:jh,parseType:Wh,parseSampleRate:Gh,parseAacTimestamp:zh},pn;pn=function(){var d=new Uint8Array,h=0;pn.prototype.init.call(this),this.setTimestamp=function(f){h=f},this.push=function(f){var g=0,v=0,y,E,C,w;for(d.length?(w=d.length,d=new Uint8Array(f.byteLength+w),d.set(d.subarray(0,w)),d.set(f,w)):d=f;d.length-v>=3;){if(d[v]===73&&d[v+1]===68&&d[v+2]===51){if(d.length-v<10||(g=hn.parseId3TagSize(d,v),v+g>d.length))break;E={type:"timed-metadata",data:d.subarray(v,v+g)},this.trigger("data",E),v+=g;continue}else if((d[v]&255)===255&&(d[v+1]&240)===240){if(d.length-v<7||(g=hn.parseAdtsSize(d,v),v+g>d.length))break;C={type:"audio",data:d.subarray(v,v+g),pts:h,dts:h},this.trigger("data",C),v+=g;continue}v++}y=d.length-v,y>0?d=d.subarray(v):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},pn.prototype=new t;var $h=pn,Kh=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ou=Kh,Xh=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],uu=Xh,Yh=Nh.H264Stream,Qh=hn.isLikelyAacData,Jh=se.ONE_SECOND_IN_TS,mn,oi,gn,tr,Zh=function(d,h){h.stream=d,this.trigger("log",h)},lu=function(d,h){for(var f=Object.keys(h),g=0;g<f.length;g++){var v=f[g];v==="headOfPipeline"||!h[v].on||h[v].on("log",Zh.bind(d,v))}},du=function(d,h){var f;if(d.length!==h.length)return!1;for(f=0;f<d.length;f++)if(d[f]!==h[f])return!1;return!0},cu=function(d,h,f,g,v,y){var E=f-h,C=g-h,w=v-f;return{start:{dts:d,pts:d+E},end:{dts:d+C,pts:d+w},prependedContentDuration:y,baseMediaDecodeTime:d}};oi=function(d,h){var f=[],g,v=0,y=0,E=1/0;h=h||{},g=h.firstSequenceNumber||0,oi.prototype.init.call(this),this.push=function(C){ut.collectDtsInfo(d,C),d&&ou.forEach(function(w){d[w]=C[w]}),f.push(C)},this.setEarliestDts=function(C){v=C},this.setVideoBaseMediaDecodeTime=function(C){E=C},this.setAudioAppendStart=function(C){y=C},this.flush=function(){var C,w,D,P,M,z,Y;if(f.length===0){this.trigger("done","AudioSegmentStream");return}C=Ji.trimAdtsFramesByEarliestDts(f,d,v),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),Y=Ji.prefixWithSilence(d,C,y,E),d.samples=Ji.generateSampleTable(C),D=gt.mdat(Ji.concatenateFrameData(C)),f=[],w=gt.moof(g,[d]),P=new Uint8Array(w.byteLength+D.byteLength),g++,P.set(w),P.set(D,w.byteLength),ut.clearDtsInfo(d),M=Math.ceil(Jh*1024/d.samplerate),C.length&&(z=C.length*M,this.trigger("segmentTimingInfo",cu(se.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),C[0].dts,C[0].pts,C[0].dts+z,C[0].pts+z,Y||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+z})),this.trigger("data",{track:d,boxes:P}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ut.clearDtsInfo(d),f=[],this.trigger("reset")}},oi.prototype=new t,mn=function(d,h){var f,g=[],v=[],y,E;h=h||{},f=h.firstSequenceNumber||0,mn.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(C){ut.collectDtsInfo(d,C),C.nalUnitType==="seq_parameter_set_rbsp"&&!y&&(y=C.config,d.sps=[C.data],uu.forEach(function(w){d[w]=y[w]},this)),C.nalUnitType==="pic_parameter_set_rbsp"&&!E&&(E=C.data,d.pps=[C.data]),g.push(C)},this.flush=function(){for(var C,w,D,P,M,z,Y=0,j,Z;g.length&&g[0].nalUnitType!=="access_unit_delimiter_rbsp";)g.shift();if(g.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(C=ni.groupNalsIntoFrames(g),D=ni.groupFramesIntoGops(C),D[0][0].keyFrame||(w=this.getGopForFusion_(g[0],d),w?(Y=w.duration,D.unshift(w),D.byteLength+=w.byteLength,D.nalCount+=w.nalCount,D.pts=w.pts,D.dts=w.dts,D.duration+=w.duration):D=ni.extendFirstKeyFrame(D)),v.length){var De;if(h.alignGopsAtEnd?De=this.alignGopsAtEnd_(D):De=this.alignGopsAtStart_(D),!De){this.gopCache_.unshift({gop:D.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),g=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ut.clearDtsInfo(d),D=De}ut.collectDtsInfo(d,D),d.samples=ni.generateSampleTable(D),M=gt.mdat(ni.concatenateNalData(D)),d.baseMediaDecodeTime=ut.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),this.trigger("processedGopsInfo",D.map(function(He){return{pts:He.pts,dts:He.dts,byteLength:He.byteLength}})),j=D[0],Z=D[D.length-1],this.trigger("segmentTimingInfo",cu(d.baseMediaDecodeTime,j.dts,j.pts,Z.dts+Z.duration,Z.pts+Z.duration,Y)),this.trigger("timingInfo",{start:D[0].pts,end:D[D.length-1].pts+D[D.length-1].duration}),this.gopCache_.unshift({gop:D.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),g=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),P=gt.moof(f,[d]),z=new Uint8Array(P.byteLength+M.byteLength),f++,z.set(P),z.set(M,P.byteLength),this.trigger("data",{track:d,boxes:z}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),g=[],this.gopCache_.length=0,v.length=0,this.trigger("reset")},this.resetStream_=function(){ut.clearDtsInfo(d),y=void 0,E=void 0},this.getGopForFusion_=function(C){var w=45e3,D=1/0,P,M,z,Y,j;for(j=0;j<this.gopCache_.length;j++)Y=this.gopCache_[j],z=Y.gop,!(!(d.pps&&du(d.pps[0],Y.pps[0]))||!(d.sps&&du(d.sps[0],Y.sps[0])))&&(z.dts<d.timelineStartInfo.dts||(P=C.dts-z.dts-z.duration,P>=-1e4&&P<=w&&(!M||D>P)&&(M=Y,D=P)));return M?M.gop:null},this.alignGopsAtStart_=function(C){var w,D,P,M,z,Y,j,Z;for(z=C.byteLength,Y=C.nalCount,j=C.duration,w=D=0;w<v.length&&D<C.length&&(P=v[w],M=C[D],P.pts!==M.pts);){if(M.pts>P.pts){w++;continue}D++,z-=M.byteLength,Y-=M.nalCount,j-=M.duration}return D===0?C:D===C.length?null:(Z=C.slice(D),Z.byteLength=z,Z.duration=j,Z.nalCount=Y,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z)},this.alignGopsAtEnd_=function(C){var w,D,P,M,z,Y;for(w=v.length-1,D=C.length-1,z=null,Y=!1;w>=0&&D>=0;){if(P=v[w],M=C[D],P.pts===M.pts){Y=!0;break}if(P.pts>M.pts){w--;continue}w===v.length-1&&(z=D),D--}if(!Y&&z===null)return null;var j;if(Y?j=D:j=z,j===0)return C;var Z=C.slice(j),De=Z.reduce(function(He,nr){return He.byteLength+=nr.byteLength,He.duration+=nr.duration,He.nalCount+=nr.nalCount,He},{byteLength:0,duration:0,nalCount:0});return Z.byteLength=De.byteLength,Z.duration=De.duration,Z.nalCount=De.nalCount,Z.pts=Z[0].pts,Z.dts=Z[0].dts,Z},this.alignGopsWith=function(C){v=C}},mn.prototype=new t,tr=function(d,h){this.numberOfTracks=0,this.metadataStream=h,d=d||{},typeof d.remux<"u"?this.remuxTracks=!!d.remux:this.remuxTracks=!0,typeof d.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=d.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,tr.prototype.init.call(this),this.push=function(f){if(f.text)return this.pendingCaptions.push(f);if(f.frames)return this.pendingMetadata.push(f);this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))}},tr.prototype=new t,tr.prototype.flush=function(T){var d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},f,g,v,y=0,E;if(this.pendingTracks.length<this.numberOfTracks){if(T!=="VideoSegmentStream"&&T!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(y=this.videoTrack.timelineStartInfo.pts,uu.forEach(function(C){h.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,ou.forEach(function(C){h.info[C]=this.audioTrack[C]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,v=gt.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)h.data.set(this.pendingBoxes[E],d),d+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)f=this.pendingCaptions[E],f.startTime=se.metadataTsToSeconds(f.startPts,y,this.keepOriginalTimestamps),f.endTime=se.metadataTsToSeconds(f.endPts,y,this.keepOriginalTimestamps),h.captionStreams[f.stream]=!0,h.captions.push(f);for(E=0;E<this.pendingMetadata.length;E++)g=this.pendingMetadata[E],g.cueTime=se.metadataTsToSeconds(g.pts,y,this.keepOriginalTimestamps),h.metadata.push(g);for(h.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",h),E=0;E<h.captions.length;E++)f=h.captions[E],this.trigger("caption",f);for(E=0;E<h.metadata.length;E++)g=h.metadata[E],this.trigger("id3Frame",g)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},tr.prototype.setRemux=function(T){this.remuxTracks=T},gn=function(d){var h=this,f=!0,g,v;gn.prototype.init.call(this),d=d||{},this.baseMediaDecodeTime=d.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new kt.MetadataStream,y.aacStream=new $h,y.audioTimestampRolloverStream=new kt.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new kt.TimestampRolloverStream("timed-metadata"),y.adtsStream=new ru,y.coalesceStream=new tr(d,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(E){y.aacStream.setTimestamp(E.timeStamp)}),y.aacStream.on("data",function(E){E.type!=="timed-metadata"&&E.type!=="audio"||y.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new oi(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!g}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),lu(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new kt.MetadataStream,y.packetStream=new kt.TransportPacketStream,y.parseStream=new kt.TransportParseStream,y.elementaryStream=new kt.ElementaryStream,y.timestampRolloverStream=new kt.TimestampRolloverStream,y.adtsStream=new ru,y.h264Stream=new Yh,y.captionStream=new kt.CaptionStream(d),y.coalesceStream=new tr(d,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream).pipe(y.timestampRolloverStream),y.timestampRolloverStream.pipe(y.h264Stream),y.timestampRolloverStream.pipe(y.adtsStream),y.timestampRolloverStream.pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(E){var C;if(E.type==="metadata"){for(C=E.tracks.length;C--;)!g&&E.tracks[C].type==="video"?(g=E.tracks[C],g.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):!v&&E.tracks[C].type==="audio"&&(v=E.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime);g&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new mn(g,d),y.videoSegmentStream.on("log",h.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(w){v&&!d.keepOriginalTimestamps&&(v.timelineStartInfo=w,y.audioSegmentStream.setEarliestDts(w.dts-h.baseMediaDecodeTime))}),y.videoSegmentStream.on("processedGopsInfo",h.trigger.bind(h,"gopInfo")),y.videoSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"videoSegmentTimingInfo")),y.videoSegmentStream.on("baseMediaDecodeTime",function(w){v&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(w)}),y.videoSegmentStream.on("timingInfo",h.trigger.bind(h,"videoTimingInfo")),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),v&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new oi(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!g})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(E){E.dispatchType=y.metadataStream.dispatchType,h.trigger("id3Frame",E)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),lu(this,y)},this.setBaseMediaDecodeTime=function(y){var E=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,ut.clearDtsInfo(v),E.audioTimestampRolloverStream&&E.audioTimestampRolloverStream.discontinuity()),g&&(E.videoSegmentStream&&(E.videoSegmentStream.gopCache_=[]),g.timelineStartInfo.dts=void 0,g.timelineStartInfo.pts=void 0,ut.clearDtsInfo(g),E.captionStream.reset()),E.timestampRolloverStream&&E.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var E=this.transmuxPipeline_;d.remux=y,E&&E.coalesceStream&&E.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){g&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var E=this;return function(C){C.stream=y,E.trigger("log",C)}},this.push=function(y){if(f){var E=Qh(y);E&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!E&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),f=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){f=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},gn.prototype=new t;var ep={Transmuxer:gn},tp=function(d){return d>>>0},rp=function(d){return("00"+d.toString(16)).slice(-2)},vn={toUnsigned:tp,toHexString:rp},ip=function(d){var h="";return h+=String.fromCharCode(d[0]),h+=String.fromCharCode(d[1]),h+=String.fromCharCode(d[2]),h+=String.fromCharCode(d[3]),h},rr=ip,np=vn.toUnsigned,ap=function T(d,h){var f=[],g,v,y,E,C;if(!h.length)return null;for(g=0;g<d.byteLength;)v=np(d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3]),y=rr(d.subarray(g+4,g+8)),E=v>1?g+v:d.byteLength,y===h[0]&&(h.length===1?f.push(d.subarray(g+8,E)):(C=T(d.subarray(g+8,E),h.slice(1)),C.length&&(f=f.concat(C)))),g=E;return f},ge=ap,sp=vn.toUnsigned,op=e.getUint64,up=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=op(d.subarray(4)):h.baseMediaDecodeTime=sp(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),h},fu=up,lp=function(d){return{isLeading:(d[0]&12)>>>2,dependsOn:d[0]&3,isDependedOn:(d[1]&192)>>>6,hasRedundancy:(d[1]&48)>>>4,paddingValue:(d[1]&14)>>>1,isNonSyncSample:d[1]&1,degradationPriority:d[2]<<8|d[3]}},hu=lp,dp=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},f=new DataView(d.buffer,d.byteOffset,d.byteLength),g=h.flags[2]&1,v=h.flags[2]&4,y=h.flags[1]&1,E=h.flags[1]&2,C=h.flags[1]&4,w=h.flags[1]&8,D=f.getUint32(4),P=8,M;for(g&&(h.dataOffset=f.getInt32(P),P+=4),v&&D&&(M={flags:hu(d.subarray(P,P+4))},P+=4,y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),w&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M),D--);D--;)M={},y&&(M.duration=f.getUint32(P),P+=4),E&&(M.size=f.getUint32(P),P+=4),C&&(M.flags=hu(d.subarray(P,P+4)),P+=4),w&&(h.version===1?M.compositionTimeOffset=f.getInt32(P):M.compositionTimeOffset=f.getUint32(P),P+=4),h.samples.push(M);return h},pu=dp,cp=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:h.getUint32(4)},g=f.flags[2]&1,v=f.flags[2]&2,y=f.flags[2]&8,E=f.flags[2]&16,C=f.flags[2]&32,w=f.flags[0]&65536,D=f.flags[0]&131072,P;return P=8,g&&(P+=4,f.baseDataOffset=h.getUint32(12),P+=4),v&&(f.sampleDescriptionIndex=h.getUint32(P),P+=4),y&&(f.defaultSampleDuration=h.getUint32(P),P+=4),E&&(f.defaultSampleSize=h.getUint32(P),P+=4),C&&(f.defaultSampleFlags=h.getUint32(P)),w&&(f.durationIsEmpty=!0),!g&&D&&(f.baseDataOffsetIsMoof=!0),f},mu=cp,gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ui;typeof window<"u"?ui=window:typeof gu<"u"?ui=gu:typeof self<"u"?ui=self:ui={};var li=ui,fp=ai.discardEmulationPreventionBytes,hp=nn.CaptionStream,pp=function(d,h){for(var f=d,g=0;g<h.length;g++){var v=h[g];if(f<v.size)return v;f-=v.size}return null},mp=function(d,h,f){var g=new DataView(d.buffer,d.byteOffset,d.byteLength),v={logs:[],seiNals:[]},y,E,C,w;for(E=0;E+4<d.length;E+=C)if(C=g.getUint32(E),E+=4,!(C<=0))switch(d[E]&31){case 6:var D=d.subarray(E+1,E+1+C),P=pp(E,h);if(y={nalUnitType:"sei_rbsp",size:C,data:D,escapedRBSP:fp(D),trackId:f},P)y.pts=P.pts,y.dts=P.dts,w=P;else if(w)y.pts=w.pts,y.dts=w.dts;else{v.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+E+" for trackId "+f+". See mux.js#223."});break}v.seiNals.push(y);break}return v},gp=function(d,h,f){var g=h,v=f.defaultSampleDuration||0,y=f.defaultSampleSize||0,E=f.trackId,C=[];return d.forEach(function(w){var D=pu(w),P=D.samples;P.forEach(function(M){M.duration===void 0&&(M.duration=v),M.size===void 0&&(M.size=y),M.trackId=E,M.dts=g,M.compositionTimeOffset===void 0&&(M.compositionTimeOffset=0),typeof g=="bigint"?(M.pts=g+li.BigInt(M.compositionTimeOffset),g+=li.BigInt(M.duration)):(M.pts=g+M.compositionTimeOffset,g+=M.duration)}),C=C.concat(P)}),C},vp=function(d,h){var f=ge(d,["moof","traf"]),g=ge(d,["mdat"]),v={},y=[];return g.forEach(function(E,C){var w=f[C];y.push({mdat:E,traf:w})}),y.forEach(function(E){var C=E.mdat,w=E.traf,D=ge(w,["tfhd"]),P=mu(D[0]),M=P.trackId,z=ge(w,["tfdt"]),Y=z.length>0?fu(z[0]).baseMediaDecodeTime:0,j=ge(w,["trun"]),Z,De;h===M&&j.length>0&&(Z=gp(j,Y,P),De=mp(C,Z,M),v[M]||(v[M]={seiNals:[],logs:[]}),v[M].seiNals=v[M].seiNals.concat(De.seiNals),v[M].logs=v[M].logs.concat(De.logs))}),v},yp=function(d,h,f){var g;if(h===null)return null;g=vp(d,h);var v=g[h]||{};return{seiNals:v.seiNals,logs:v.logs,timescale:f}},_p=function(){var d=!1,h,f,g,v,y,E;this.isInitialized=function(){return d},this.init=function(C){h=new hp,d=!0,E=C?C.isPartial:!1,h.on("data",function(w){w.startTime=w.startPts/v,w.endTime=w.endPts/v,y.captions.push(w),y.captionStreams[w.stream]=!0}),h.on("log",function(w){y.logs.push(w)})},this.isNewInit=function(C,w){return C&&C.length===0||w&&typeof w=="object"&&Object.keys(w).length===0?!1:g!==C[0]||v!==w[g]},this.parse=function(C,w,D){var P;if(this.isInitialized()){if(!w||!D)return null;if(this.isNewInit(w,D))g=w[0],v=D[g];else if(g===null||!v)return f.push(C),null}else return null;for(;f.length>0;){var M=f.shift();this.parse(M,w,D)}return P=yp(C,g,v),P&&P.logs&&(y.logs=y.logs.concat(P.logs)),P===null||!P.seiNals?y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),y)},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(w){h.push(w)})},this.flushStream=function(){if(!this.isInitialized())return null;E?h.partialFlush():h.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;h.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],g=null,v=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Tp=_p,yn=vn.toUnsigned,di=vn.toHexString,bp=e.getUint64,vu,yu,_u,Tu,bu,Ma;vu=function(d){var h={},f=ge(d,["moov","trak"]);return f.reduce(function(g,v){var y,E,C,w,D;return y=ge(v,["tkhd"])[0],!y||(E=y[0],C=E===0?12:20,w=yn(y[C]<<24|y[C+1]<<16|y[C+2]<<8|y[C+3]),D=ge(v,["mdia","mdhd"])[0],!D)?null:(E=D[0],C=E===0?12:20,g[w]=yn(D[C]<<24|D[C+1]<<16|D[C+2]<<8|D[C+3]),g)},h)},yu=function(d,h){var f;f=ge(h,["moof","traf"]);var g=f.reduce(function(v,y){var E=ge(y,["tfhd"])[0],C=yn(E[4]<<24|E[5]<<16|E[6]<<8|E[7]),w=d[C]||9e4,D=ge(y,["tfdt"])[0],P=new DataView(D.buffer,D.byteOffset,D.byteLength),M;D[0]===1?M=bp(D.subarray(4,12)):M=P.getUint32(4);var z;return typeof M=="bigint"?z=M/li.BigInt(w):typeof M=="number"&&!isNaN(M)&&(z=M/w),z<Number.MAX_SAFE_INTEGER&&(z=Number(z)),z<v&&(v=z),v},1/0);return typeof g=="bigint"||isFinite(g)?g:0},_u=function(d,h){var f=ge(h,["moof","traf"]),g=0,v=0,y;if(f&&f.length){var E=ge(f[0],["tfhd"])[0],C=ge(f[0],["trun"])[0],w=ge(f[0],["tfdt"])[0];if(E){var D=mu(E);y=D.trackId}if(w){var P=fu(w);g=P.baseMediaDecodeTime}if(C){var M=pu(C);M.samples&&M.samples.length&&(v=M.samples[0].compositionTimeOffset||0)}}var z=d[y]||9e4;typeof g=="bigint"&&(v=li.BigInt(v),z=li.BigInt(z));var Y=(g+v)/z;return typeof Y=="bigint"&&Y<Number.MAX_SAFE_INTEGER&&(Y=Number(Y)),Y},Tu=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(g){var v=ge(g,["mdia","hdlr"]),y=ge(g,["tkhd"]);v.forEach(function(E,C){var w=rr(E.subarray(8,12)),D=y[C],P,M,z;w==="vide"&&(P=new DataView(D.buffer,D.byteOffset,D.byteLength),M=P.getUint8(0),z=M===0?P.getUint32(12):P.getUint32(20),f.push(z))})}),f},Ma=function(d){var h=d[0],f=h===0?12:20;return yn(d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])},bu=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(g){var v={},y=ge(g,["tkhd"])[0],E,C;y&&(E=new DataView(y.buffer,y.byteOffset,y.byteLength),C=E.getUint8(0),v.id=C===0?E.getUint32(12):E.getUint32(20));var w=ge(g,["mdia","hdlr"])[0];if(w){var D=rr(w.subarray(8,12));D==="vide"?v.type="video":D==="soun"?v.type="audio":v.type=D}var P=ge(g,["mdia","minf","stbl","stsd"])[0];if(P){var M=P.subarray(8);v.codec=rr(M.subarray(4,8));var z=ge(M,[v.codec])[0],Y,j;z&&(/^[asm]vc[1-9]$/i.test(v.codec)?(Y=z.subarray(78),j=rr(Y.subarray(4,8)),j==="avcC"&&Y.length>11?(v.codec+=".",v.codec+=di(Y[9]),v.codec+=di(Y[10]),v.codec+=di(Y[11])):v.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(v.codec)?(Y=z.subarray(28),j=rr(Y.subarray(4,8)),j==="esds"&&Y.length>20&&Y[19]!==0?(v.codec+="."+di(Y[19]),v.codec+="."+di(Y[20]>>>2&63).replace(/^0/,"")):v.codec="mp4a.40.2"):v.codec=v.codec.toLowerCase())}var Z=ge(g,["mdia","mdhd"])[0];Z&&(v.timescale=Ma(Z)),f.push(v)}),f};var xu={findBox:ge,parseType:rr,timescale:vu,startTime:yu,compositionStartTime:_u,videoTrackIds:Tu,tracks:bu,getTimescaleFromMediaHeader:Ma},Su=function(d){var h=d[1]&31;return h<<=8,h|=d[2],h},_n=function(d){return!!(d[1]&64)},Tn=function(d){var h=0;return(d[3]&48)>>>4>1&&(h+=d[4]+1),h},xp=function(d,h){var f=Su(d);return f===0?"pat":f===h?"pmt":h?"pes":null},Sp=function(d){var h=_n(d),f=4+Tn(d);return h&&(f+=d[f]+1),(d[f+10]&31)<<8|d[f+11]},Ep=function(d){var h={},f=_n(d),g=4+Tn(d);if(f&&(g+=d[g]+1),!!(d[g+5]&1)){var v,y,E;v=(d[g+1]&15)<<8|d[g+2],y=3+v-4,E=(d[g+10]&15)<<8|d[g+11];for(var C=12+E;C<y;){var w=g+C;h[(d[w+1]&31)<<8|d[w+2]]=d[w],C+=((d[w+3]&15)<<8|d[w+4])+5}return h}},Cp=function(d,h){var f=Su(d),g=h[f];switch(g){case Le.H264_STREAM_TYPE:return"video";case Le.ADTS_STREAM_TYPE:return"audio";case Le.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Ap=function(d){var h=_n(d);if(!h)return null;var f=4+Tn(d);if(f>=d.byteLength)return null;var g=null,v;return v=d[f+7],v&192&&(g={},g.pts=(d[f+9]&14)<<27|(d[f+10]&255)<<20|(d[f+11]&254)<<12|(d[f+12]&255)<<5|(d[f+13]&254)>>>3,g.pts*=4,g.pts+=(d[f+13]&6)>>>1,g.dts=g.pts,v&64&&(g.dts=(d[f+14]&14)<<27|(d[f+15]&255)<<20|(d[f+16]&254)<<12|(d[f+17]&255)<<5|(d[f+18]&254)>>>3,g.dts*=4,g.dts+=(d[f+18]&6)>>>1)),g},Na=function(d){switch(d){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Dp=function(d){for(var h=4+Tn(d),f=d.subarray(h),g=0,v=0,y=!1,E;v<f.byteLength-3;v++)if(f[v+2]===1){g=v+5;break}for(;g<f.byteLength;)switch(f[g]){case 0:if(f[g-1]!==0){g+=2;break}else if(f[g-2]!==0){g++;break}v+3!==g-2&&(E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0));do g++;while(f[g]!==1&&g<f.length);v=g-2,g+=3;break;case 1:if(f[g-1]!==0||f[g-2]!==0){g+=3;break}E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0),v=g-2,g+=3;break;default:g+=3;break}return f=f.subarray(v),g-=v,v=0,f&&f.byteLength>3&&(E=Na(f[v+3]&31),E==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0)),y},wp={parseType:xp,parsePat:Sp,parsePmt:Ep,parsePayloadUnitStartIndicator:_n,parsePesType:Cp,parsePesTime:Ap,videoPacketContainsKeyFrame:Dp},xr=Qo.handleRollover,de={};de.ts=wp,de.aac=hn;var ir=se.ONE_SECOND_IN_TS,Ve=188,vt=71,kp=function(d,h){for(var f=0,g=Ve,v,y;g<d.byteLength;){if(d[f]===vt&&d[g]===vt){switch(v=d.subarray(f,g),y=de.ts.parseType(v,h.pid),y){case"pat":h.pid=de.ts.parsePat(v);break;case"pmt":var E=de.ts.parsePmt(v);h.table=h.table||{},Object.keys(E).forEach(function(C){h.table[C]=E[C]});break}f+=Ve,g+=Ve;continue}f++,g++}},Eu=function(d,h,f){for(var g=0,v=Ve,y,E,C,w,D,P=!1;v<=d.byteLength;){if(d[g]===vt&&(d[v]===vt||v===d.byteLength)){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="audio",f.audio.push(D),P=!0));break}if(P)break;g+=Ve,v+=Ve;continue}g++,v++}for(v=d.byteLength,g=v-Ve,P=!1;g>=0;){if(d[g]===vt&&(d[v]===vt||v===d.byteLength)){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="audio",f.audio.push(D),P=!0));break}if(P)break;g-=Ve,v-=Ve;continue}g--,v--}},Pp=function(d,h,f){for(var g=0,v=Ve,y,E,C,w,D,P,M,z,Y=!1,j={data:[],size:0};v<d.byteLength;){if(d[g]===vt&&d[v]===vt){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":if(C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="video"&&(w&&!Y&&(D=de.ts.parsePesTime(y),D&&(D.type="video",f.video.push(D),Y=!0)),!f.firstKeyFrame)){if(w&&j.size!==0){for(P=new Uint8Array(j.size),M=0;j.data.length;)z=j.data.shift(),P.set(z,M),M+=z.byteLength;if(de.ts.videoPacketContainsKeyFrame(P)){var Z=de.ts.parsePesTime(P);Z?(f.firstKeyFrame=Z,f.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}j.size=0}j.data.push(y),j.size+=y.byteLength}break}if(Y&&f.firstKeyFrame)break;g+=Ve,v+=Ve;continue}g++,v++}for(v=d.byteLength,g=v-Ve,Y=!1;g>=0;){if(d[g]===vt&&d[v]===vt){switch(y=d.subarray(g,v),E=de.ts.parseType(y,h.pid),E){case"pes":C=de.ts.parsePesType(y,h.table),w=de.ts.parsePayloadUnitStartIndicator(y),C==="video"&&w&&(D=de.ts.parsePesTime(y),D&&(D.type="video",f.video.push(D),Y=!0));break}if(Y)break;g-=Ve,v-=Ve;continue}g--,v--}},Ip=function(d,h){if(d.audio&&d.audio.length){var f=h;(typeof f>"u"||isNaN(f))&&(f=d.audio[0].dts),d.audio.forEach(function(y){y.dts=xr(y.dts,f),y.pts=xr(y.pts,f),y.dtsTime=y.dts/ir,y.ptsTime=y.pts/ir})}if(d.video&&d.video.length){var g=h;if((typeof g>"u"||isNaN(g))&&(g=d.video[0].dts),d.video.forEach(function(y){y.dts=xr(y.dts,g),y.pts=xr(y.pts,g),y.dtsTime=y.dts/ir,y.ptsTime=y.pts/ir}),d.firstKeyFrame){var v=d.firstKeyFrame;v.dts=xr(v.dts,g),v.pts=xr(v.pts,g),v.dtsTime=v.dts/ir,v.ptsTime=v.pts/ir}}},Lp=function(d){for(var h=!1,f=0,g=null,v=null,y=0,E=0,C;d.length-E>=3;){var w=de.aac.parseType(d,E);switch(w){case"timed-metadata":if(d.length-E<10){h=!0;break}if(y=de.aac.parseId3TagSize(d,E),y>d.length){h=!0;break}v===null&&(C=d.subarray(E,E+y),v=de.aac.parseAacTimestamp(C)),E+=y;break;case"audio":if(d.length-E<7){h=!0;break}if(y=de.aac.parseAdtsSize(d,E),y>d.length){h=!0;break}g===null&&(C=d.subarray(E,E+y),g=de.aac.parseSampleRate(C)),f++,E+=y;break;default:E++;break}if(h)return null}if(g===null||v===null)return null;var D=ir/g,P={audio:[{type:"audio",dts:v,pts:v},{type:"audio",dts:v+f*1024*D,pts:v+f*1024*D}]};return P},Op=function(d){var h={pid:null,table:null},f={};kp(d,h);for(var g in h.table)if(h.table.hasOwnProperty(g)){var v=h.table[g];switch(v){case Le.H264_STREAM_TYPE:f.video=[],Pp(d,h,f),f.video.length===0&&delete f.video;break;case Le.ADTS_STREAM_TYPE:f.audio=[],Eu(d,h,f),f.audio.length===0&&delete f.audio;break}}return f},Fp=function(d,h){var f=de.aac.isLikelyAacData(d),g;return f?g=Lp(d):g=Op(d),!g||!g.audio&&!g.video?null:(Ip(g,h),g)},Rp={inspect:Fp,parseAudioPes_:Eu},Mp=function(d,h){h.on("data",function(f){var g=f.initSegment;f.initSegment={data:g.buffer,byteOffset:g.byteOffset,byteLength:g.byteLength};var v=f.data;f.data=v.buffer,d.postMessage({action:"data",segment:f,byteOffset:v.byteOffset,byteLength:v.byteLength},[f.data])}),h.on("done",function(f){d.postMessage({action:"done"})}),h.on("gopInfo",function(f){d.postMessage({action:"gopInfo",gopInfo:f})}),h.on("videoSegmentTimingInfo",function(f){var g={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(g.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:g})}),h.on("audioSegmentTimingInfo",function(f){var g={start:{decode:se.videoTsToSeconds(f.start.dts),presentation:se.videoTsToSeconds(f.start.pts)},end:{decode:se.videoTsToSeconds(f.end.dts),presentation:se.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:se.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(g.prependedContentDuration=se.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:g})}),h.on("id3Frame",function(f){d.postMessage({action:"id3Frame",id3Frame:f})}),h.on("caption",function(f){d.postMessage({action:"caption",caption:f})}),h.on("trackinfo",function(f){d.postMessage({action:"trackinfo",trackInfo:f})}),h.on("audioTimingInfo",function(f){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("videoTimingInfo",function(f){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:se.videoTsToSeconds(f.start),end:se.videoTsToSeconds(f.end)}})}),h.on("log",function(f){d.postMessage({action:"log",log:f})})},Cu=function(){function T(h,f){this.options=f||{},this.self=h,this.init()}var d=T.prototype;return d.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ep.Transmuxer(this.options),Mp(this.self,this.transmuxer)},d.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Tp,this.captionParser.init());var g=new Uint8Array(f.data,f.byteOffset,f.byteLength),v=this.captionParser.parse(g,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:g.buffer},[g.buffer])},d.probeMp4StartTime=function(f){var g=f.timescales,v=f.data,y=xu.startTime(g,v);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:v},[v.buffer])},d.probeMp4Tracks=function(f){var g=f.data,v=xu.tracks(g);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:g},[g.buffer])},d.probeTs=function(f){var g=f.data,v=f.baseStartTime,y=typeof v=="number"&&!isNaN(v)?v*se.ONE_SECOND_IN_TS:void 0,E=Rp.inspect(g,y),C=null;E&&(C={hasVideo:E.video&&E.video.length===2||!1,hasAudio:E.audio&&E.audio.length===2||!1},C.hasVideo&&(C.videoStart=E.video[0].ptsTime),C.hasAudio&&(C.audioStart=E.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:g},[g.buffer])},d.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},d.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},d.push=function(f){var g=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(g)},d.reset=function(){this.transmuxer.reset()},d.setTimestampOffset=function(f){var g=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(se.secondsToVideoTs(g)))},d.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(se.secondsToVideoTs(f.appendStart)))},d.setRemux=function(f){this.transmuxer.setRemux(f.remux)},d.flush=function(f){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},d.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},d.alignGopsWith=function(f){this.transmuxer.alignGopsWith(f.gopsToAlignWith.slice())},T}();self.onmessage=function(T){if(T.data.action==="init"&&T.data.options){this.messageHandlers=new Cu(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new Cu(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}})),u_=Uf(o_),l_=function(t,r,n){var e=t.data.segment,i=e.type,s=e.initSegment,o=e.captions,u=e.captionStreams,l=e.metadata,c=e.videoFrameDtsTime,p=e.videoFramePtsTime;r.buffer.push({captions:o,captionStreams:u,metadata:l});var m=t.data.segment.boxes||{data:t.data.segment.data},_={type:i,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof p<"u"&&(_.videoFramePtsTime=p),n(_)},d_=function(t){var r=t.transmuxedData,n=t.callback;r.buffer=[],n(r)},c_=function(t,r){r.gopInfo=t.data.gopInfo},qf=function(t){var r=t.transmuxer,n=t.bytes,e=t.audioAppendStart,i=t.gopsToAlignWith,s=t.remux,o=t.onData,u=t.onTrackInfo,l=t.onAudioTimingInfo,c=t.onVideoTimingInfo,p=t.onVideoSegmentTimingInfo,m=t.onAudioSegmentTimingInfo,_=t.onId3,b=t.onCaptions,S=t.onDone,x=t.onEndedTimeline,k=t.onTransmuxerLog,L=t.isEndOfTimeline,H={buffer:[]},O=L,F=function(U){r.currentTransmux===t&&(U.data.action==="data"&&l_(U,H,o),U.data.action==="trackinfo"&&u(U.data.trackInfo),U.data.action==="gopInfo"&&c_(U,H),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&c(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&p(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&m(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&_([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&b(U.data.caption),U.data.action==="endedtimeline"&&(O=!1,x()),U.data.action==="log"&&k(U.data.log),U.data.type==="transmuxed"&&(O||(r.onmessage=null,d_({transmuxedData:H,callback:S}),jf(r))))};if(r.onmessage=F,e&&r.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(i)&&r.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),typeof s<"u"&&r.postMessage({action:"setRemux",remux:s}),n.byteLength){var q=n instanceof ArrayBuffer?n:n.buffer,B=n instanceof ArrayBuffer?0:n.byteOffset;r.postMessage({action:"push",data:q,byteOffset:B,byteLength:n.byteLength},[q])}L&&r.postMessage({action:"endTimeline"}),r.postMessage({action:"flush"})},jf=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():qf(t.currentTransmux))},Wl=function(t,r){t.postMessage({action:r}),jf(t)},Wf=function(t,r){if(!r.currentTransmux){r.currentTransmux=t,Wl(r,t);return}r.transmuxQueue.push(Wl.bind(null,r,t))},f_=function(t){Wf("reset",t)},h_=function(t){Wf("endTimeline",t)},Gf=function(t){if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,qf(t);return}t.transmuxer.transmuxQueue.push(t)},p_=function(t){var r=new u_;r.currentTransmux=null,r.transmuxQueue=[];var n=r.terminate;return r.terminate=function(){return r.currentTransmux=null,r.transmuxQueue.length=0,n.call(r)},r.postMessage({action:"init",options:t}),r},us={reset:f_,endTimeline:h_,transmux:Gf,createTransmuxer:p_},ra=function(t){var r=t.transmuxer,n=t.endAction||t.action,e=t.callback,i=ht({},t,{endAction:null,transmuxer:null,callback:null}),s=function l(c){c.data.action===n&&(r.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,t.byteOffset||0,t.byteLength||c.data.data.byteLength),t.data&&(t.data=c.data.data)),e(c.data))};if(r.addEventListener("message",s),t.data){var o=t.data instanceof ArrayBuffer;i.byteOffset=o?0:t.data.byteOffset,i.byteLength=t.data.byteLength;var u=[o?t.data:t.data.buffer];r.postMessage(i,u)}else r.postMessage(i)},xt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Rs=function(t){t.forEach(function(r){r.abort()})},m_=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},g_=function(t){var r=t.target,n=Date.now()-r.requestTime,e={bandwidth:1/0,bytesReceived:0,roundTripTime:n||0};return e.bytesReceived=t.loaded,e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3),e},Vo=function(t,r){return r.timedout?{status:r.status,message:"HLS request timed-out at URL: "+r.uri,code:xt.TIMEOUT,xhr:r}:r.aborted?{status:r.status,message:"HLS request aborted at URL: "+r.uri,code:xt.ABORTED,xhr:r}:t?{status:r.status,message:"HLS request errored at URL: "+r.uri,code:xt.FAILURE,xhr:r}:r.responseType==="arraybuffer"&&r.response.byteLength===0?{status:r.status,message:"Empty HLS response at URL: "+r.uri,code:xt.FAILURE,xhr:r}:null},Gl=function(t,r,n){return function(e,i){var s=i.response,o=Vo(e,i);if(o)return n(o,t);if(s.byteLength!==16)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:xt.FAILURE,xhr:i},t);for(var u=new DataView(s),l=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]),c=0;c<r.length;c++)r[c].bytes=l;return n(null,t)}},zf=function(t,r){var n=no(t.map.bytes);if(n!=="mp4"){var e=t.map.resolvedUri||t.map.uri;return r({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+e,code:xt.FAILURE})}ra({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:function(s){var o=s.tracks,u=s.data;return t.map.bytes=u,o.forEach(function(l){t.map.tracks=t.map.tracks||{},!t.map.tracks[l.type]&&(t.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[l.id]=l.timescale))}),r(null)}})},v_=function(t){var r=t.segment,n=t.finishProcessingFn;return function(e,i){var s=Vo(e,i);if(s)return n(s,r);var o=new Uint8Array(i.response);if(r.map.key)return r.map.encryptedBytes=o,n(null,r);r.map.bytes=o,zf(r,function(u){if(u)return u.xhr=i,u.status=i.status,n(u,r);n(null,r)})}},y_=function(t){var r=t.segment,n=t.finishProcessingFn,e=t.responseType;return function(i,s){var o=Vo(i,s);if(o)return n(o,r);var u=e==="arraybuffer"||!s.responseText?s.response:a_(s.responseText.substring(r.lastReachedChar||0));return r.stats=m_(s),r.key?r.encryptedBytes=new Uint8Array(u):r.bytes=new Uint8Array(u),n(null,r)}},__=function(t){var r=t.segment,n=t.bytes,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=r.map&&r.map.tracks||{},x=!!(S.audio&&S.video),k=i.bind(null,r,"audio","start"),L=i.bind(null,r,"audio","end"),H=i.bind(null,r,"video","start"),O=i.bind(null,r,"video","end"),F=function(){return Gf({bytes:n,transmuxer:r.transmuxer,audioAppendStart:r.audioAppendStart,gopsToAlignWith:r.gopsToAlignWith,remux:x,onData:function(R){R.type=R.type==="combined"?"video":R.type,m(r,R)},onTrackInfo:function(R){e&&(x&&(R.isMuxed=!0),e(r,R))},onAudioTimingInfo:function(R){k&&typeof R.start<"u"&&(k(R.start),k=null),L&&typeof R.end<"u"&&L(R.end)},onVideoTimingInfo:function(R){H&&typeof R.start<"u"&&(H(R.start),H=null),O&&typeof R.end<"u"&&O(R.end)},onVideoSegmentTimingInfo:function(R){s(R)},onAudioSegmentTimingInfo:function(R){o(R)},onId3:function(R,U){u(r,R,U)},onCaptions:function(R){l(r,[R])},isEndOfTimeline:c,onEndedTimeline:function(){p()},onTransmuxerLog:b,onDone:function(R){_&&(R.type=R.type==="combined"?"video":R.type,_(null,r,R))}})};ra({action:"probeTs",transmuxer:r.transmuxer,data:n,baseStartTime:r.baseStartTime,callback:function(B){r.bytes=n=B.data;var R=B.result;R&&(e(r,{hasAudio:R.hasAudio,hasVideo:R.hasVideo,isMuxed:x}),e=null,R.hasAudio&&!x&&k(R.audioStart),R.hasVideo&&H(R.videoStart),k=null,H=null),F()}})},$f=function(t){var r=t.segment,n=t.bytes,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=new Uint8Array(n);if(Hv(S)){r.isFmp4=!0;var x=r.map.tracks,k={isFmp4:!0,hasVideo:!!x.video,hasAudio:!!x.audio};x.audio&&x.audio.codec&&x.audio.codec!=="enca"&&(k.audioCodec=x.audio.codec),x.video&&x.video.codec&&x.video.codec!=="encv"&&(k.videoCodec=x.video.codec),x.video&&x.audio&&(k.isMuxed=!0),e(r,k);var L=function(O){m(r,{data:S,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),O&&O.length&&l(r,O),_(null,r,{})};ra({action:"probeMp4StartTime",timescales:r.map.timescales,data:S,transmuxer:r.transmuxer,callback:function(O){var F=O.data,q=O.startTime;if(n=F.buffer,r.bytes=S=F,k.hasAudio&&!k.isMuxed&&i(r,"audio","start",q),k.hasVideo&&i(r,"video","start",q),!x.video||!F.byteLength||!r.transmuxer){L();return}ra({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:r.transmuxer,data:S,timescales:r.map.timescales,trackIds:[x.video.id],callback:function(R){n=R.data.buffer,r.bytes=S=R.data,R.logs.forEach(function(U){b(I.mergeOptions(U,{stream:"mp4CaptionParser"}))}),L(R.captions)}})}});return}if(!r.transmuxer){_(null,r,{});return}if(typeof r.container>"u"&&(r.container=no(S)),r.container!=="ts"&&r.container!=="aac"){e(r,{hasAudio:!1,hasVideo:!1}),_(null,r,{});return}__({segment:r,bytes:n,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})},Kf=function(t,r){var n=t.id,e=t.key,i=t.encryptedBytes,s=t.decryptionWorker,o=function l(c){if(c.data.source===n){s.removeEventListener("message",l);var p=c.data.decrypted;r(new Uint8Array(p.bytes,p.byteOffset,p.byteLength))}};s.addEventListener("message",o);var u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Of({source:n,encrypted:i,key:u,iv:e.iv}),[i.buffer,u.buffer])},T_=function(t){var r=t.decryptionWorker,n=t.segment,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog;Kf({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:r},function(S){n.bytes=S,$f({segment:n,bytes:n.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})})},b_=function(t){var r=t.activeXhrs,n=t.decryptionWorker,e=t.trackInfoFn,i=t.timingInfoFn,s=t.videoSegmentTimingInfoFn,o=t.audioSegmentTimingInfoFn,u=t.id3Fn,l=t.captionsFn,c=t.isEndOfTimeline,p=t.endedTimelineFn,m=t.dataFn,_=t.doneFn,b=t.onTransmuxerLog,S=0,x=!1;return function(k,L){if(!x){if(k)return x=!0,Rs(r),_(k,L);if(S+=1,S===r.length){var H=function(){if(L.encryptedBytes)return T_({decryptionWorker:n,segment:L,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b});$f({segment:L,bytes:L.bytes,trackInfoFn:e,timingInfoFn:i,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:_,onTransmuxerLog:b})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return Kf({decryptionWorker:n,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key},function(O){L.map.bytes=O,zf(L,function(F){if(F)return Rs(r),_(F,L);H()})});H()}}}},x_=function(t){var r=t.loadendState,n=t.abortFn;return function(e){var i=e.target;i.aborted&&n&&!r.calledAbortFn&&(n(),r.calledAbortFn=!0)}},S_=function(t){var r=t.segment,n=t.progressFn;return function(e){var i=e.target;if(!i.aborted)return r.stats=I.mergeOptions(r.stats,g_(e)),!r.stats.firstBytesReceivedAt&&r.stats.bytesReceived&&(r.stats.firstBytesReceivedAt=Date.now()),n(e,r)}},E_=function(t){var r=t.xhr,n=t.xhrOptions,e=t.decryptionWorker,i=t.segment,s=t.abortFn,o=t.progressFn,u=t.trackInfoFn,l=t.timingInfoFn,c=t.videoSegmentTimingInfoFn,p=t.audioSegmentTimingInfoFn,m=t.id3Fn,_=t.captionsFn,b=t.isEndOfTimeline,S=t.endedTimelineFn,x=t.dataFn,k=t.doneFn,L=t.onTransmuxerLog,H=[],O=b_({activeXhrs:H,decryptionWorker:e,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:p,id3Fn:m,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:S,dataFn:x,doneFn:k,onTransmuxerLog:L});if(i.key&&!i.key.bytes){var F=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&F.push(i.map.key);var q=I.mergeOptions(n,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),B=Gl(i,F,O),R=r(q,B);H.push(R)}if(i.map&&!i.map.bytes){var U=i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri);if(U){var N=I.mergeOptions(n,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),X=Gl(i,[i.map.key],O),$=r(N,X);H.push($)}var J=I.mergeOptions(n,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Os(i.map)}),oe=v_({segment:i,finishProcessingFn:O}),fe=r(J,oe);H.push(fe)}var re=I.mergeOptions(n,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Os(i)}),ae=y_({segment:i,finishProcessingFn:O,responseType:re.responseType}),pe=r(re,ae);pe.addEventListener("progress",S_({segment:i,progressFn:o})),H.push(pe);var Me={};return H.forEach(function(ue){ue.addEventListener("loadend",x_({loadendState:Me,abortFn:s}))}),function(){return Rs(H)}},C_=mt("CodecUtils"),A_=function(t){var r=t.attributes||{};if(r.CODECS)return yt(r.CODECS)},Xf=function(t,r){var n=r.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&n.AUDIO&&t.mediaGroups.AUDIO[n.AUDIO]},D_=function(t,r){if(!Xf(t,r))return!0;var n=r.attributes||{},e=t.mediaGroups.AUDIO[n.AUDIO];for(var i in e)if(!e[i].uri&&!e[i].playlists)return!0;return!1},ia=function(t){var r={};return t.forEach(function(n){var e=n.mediaType,i=n.type,s=n.details;r[e]=r[e]||[],r[e].push(yd(""+i+s))}),Object.keys(r).forEach(function(n){if(r[n].length>1){C_("multiple "+n+" codecs found as attributes: "+r[n].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),r[n]=null;return}r[n]=r[n][0]}),r},zl=function(t){var r=0;return t.audio&&r++,t.video&&r++,r},Di=function(t,r){var n=r.attributes||{},e=ia(A_(r)||[]);if(Xf(t,r)&&!e.audio&&!D_(t,r)){var i=ia(Wm(t,n.AUDIO)||[]);i.audio&&(e.audio=i.audio)}return e},Pn=mt("PlaylistSelector"),$l=function(t){if(!(!t||!t.playlist)){var r=t.playlist;return JSON.stringify({id:r.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:r.attributes&&r.attributes.CODECS||""})}},na=function(t,r){if(!t)return"";var n=A.getComputedStyle(t);return n?n[r]:""},Br=function(t,r){var n=t.slice();t.sort(function(e,i){var s=r(e,i);return s===0?n.indexOf(e)-n.indexOf(i):s})},Ho=function(t,r){var n,e;return t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||A.Number.MAX_VALUE,r.attributes.BANDWIDTH&&(e=r.attributes.BANDWIDTH),e=e||A.Number.MAX_VALUE,n-e},w_=function(t,r){var n,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||A.Number.MAX_VALUE,r.attributes.RESOLUTION&&r.attributes.RESOLUTION.width&&(e=r.attributes.RESOLUTION.width),e=e||A.Number.MAX_VALUE,n===e&&t.attributes.BANDWIDTH&&r.attributes.BANDWIDTH?t.attributes.BANDWIDTH-r.attributes.BANDWIDTH:n-e},Yf=function(t,r,n,e,i,s){if(t){var o={bandwidth:r,width:n,height:e,limitRenditionByPlayerDimensions:i},u=t.playlists;Qe.isAudioOnly(t)&&(u=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map(function(N){var X,$=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.width,J=N.attributes&&N.attributes.RESOLUTION&&N.attributes.RESOLUTION.height;return X=N.attributes&&N.attributes.BANDWIDTH,X=X||A.Number.MAX_VALUE,{bandwidth:X,width:$,height:J,playlist:N}});Br(l,function(N,X){return N.bandwidth-X.bandwidth}),l=l.filter(function(N){return!Qe.isIncompatible(N.playlist)});var c=l.filter(function(N){return Qe.isEnabled(N.playlist)});c.length||(c=l.filter(function(N){return!Qe.isDisabled(N.playlist)}));var p=c.filter(function(N){return N.bandwidth*we.BANDWIDTH_VARIANCE<r}),m=p[p.length-1],_=p.filter(function(N){return N.bandwidth===m.bandwidth})[0];if(i===!1){var b=_||c[0]||l[0];if(b&&b.playlist){var S="sortedPlaylistReps";return _&&(S="bandwidthBestRep"),c[0]&&(S="enabledPlaylistReps"),Pn("choosing "+$l(b)+" using "+S+" with options",o),b.playlist}return Pn("could not choose a playlist with options",o),null}var x=p.filter(function(N){return N.width&&N.height});Br(x,function(N,X){return N.width-X.width});var k=x.filter(function(N){return N.width===n&&N.height===e});m=k[k.length-1];var L=k.filter(function(N){return N.bandwidth===m.bandwidth})[0],H,O,F;L||(H=x.filter(function(N){return N.width>n||N.height>e}),O=H.filter(function(N){return N.width===H[0].width&&N.height===H[0].height}),m=O[O.length-1],F=O.filter(function(N){return N.bandwidth===m.bandwidth})[0]);var q;if(s.experimentalLeastPixelDiffSelector){var B=x.map(function(N){return N.pixelDiff=Math.abs(N.width-n)+Math.abs(N.height-e),N});Br(B,function(N,X){return N.pixelDiff===X.pixelDiff?X.bandwidth-N.bandwidth:N.pixelDiff-X.pixelDiff}),q=B[0]}var R=q||F||L||_||c[0]||l[0];if(R&&R.playlist){var U="sortedPlaylistReps";return q?U="leastPixelDiffRep":F?U="resolutionPlusOneRep":L?U="resolutionBestRep":_?U="bandwidthBestRep":c[0]&&(U="enabledPlaylistReps"),Pn("choosing "+$l(R)+" using "+U+" with options",o),R.playlist}return Pn("could not choose a playlist with options",o),null}},Kl=function(){var t=this.useDevicePixelRatio&&A.devicePixelRatio||1;return Yf(this.playlists.master,this.systemBandwidth,parseInt(na(this.tech_.el(),"width"),10)*t,parseInt(na(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},k_=function(t){var r=-1,n=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&A.devicePixelRatio||1;return r<0&&(r=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(r=t*this.systemBandwidth+(1-t)*r,n=this.systemBandwidth),Yf(this.playlists.master,r,parseInt(na(this.tech_.el(),"width"),10)*e,parseInt(na(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},P_=function(t){var r=t.master,n=t.currentTime,e=t.bandwidth,i=t.duration,s=t.segmentDuration,o=t.timeUntilRebuffer,u=t.currentTimeline,l=t.syncController,c=r.playlists.filter(function(S){return!Qe.isIncompatible(S)}),p=c.filter(Qe.isEnabled);p.length||(p=c.filter(function(S){return!Qe.isDisabled(S)}));var m=p.filter(Qe.hasAttribute.bind(null,"BANDWIDTH")),_=m.map(function(S){var x=l.getSyncPoint(S,i,u,n),k=x?1:2,L=Qe.estimateSegmentRequestTime(s,e,S),H=L*k-o;return{playlist:S,rebufferingImpact:H}}),b=_.filter(function(S){return S.rebufferingImpact<=0});return Br(b,function(S,x){return Ho(x.playlist,S.playlist)}),b.length?b[0]:(Br(_,function(S,x){return S.rebufferingImpact-x.rebufferingImpact}),_[0]||null)},I_=function(){var t=this,r=this.playlists.master.playlists.filter(Qe.isEnabled);Br(r,function(e,i){return Ho(e,i)});var n=r.filter(function(e){return!!Di(t.playlists.master,e).video});return n[0]||null},L_=function(t){var r=0,n;return t.bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(function(e){n.set(e,r),r+=e.byteLength})),n},O_=function(t,r,n){if(!t[n]){r.trigger({type:"usage",name:"vhs-608"}),r.trigger({type:"usage",name:"hls-608"});var e=n;/^cc708_/.test(n)&&(e="SERVICE"+n.split("_")[1]);var i=r.textTracks().getTrackById(e);if(i)t[n]=i;else{var s=r.options_.vhs&&r.options_.vhs.captionServices||{},o=n,u=n,l=!1,c=s[e];c&&(o=c.label,u=c.language,l=c.default),t[n]=r.addRemoteTextTrack({kind:"captions",id:e,default:l,label:o,language:u},!1).track}}},F_=function(t){var r=t.inbandTextTracks,n=t.captionArray,e=t.timestampOffset;if(n){var i=A.WebKitDataCue||A.VTTCue;n.forEach(function(s){var o=s.stream;r[o].addCue(new i(s.startTime+e,s.endTime+e,s.text))})}},R_=function(t){Object.defineProperties(t.frame,{id:{get:function(){return I.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return I.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return I.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},M_=function(t){var r=t.inbandTextTracks,n=t.metadataArray,e=t.timestampOffset,i=t.videoDuration;if(n){var s=A.WebKitDataCue||A.VTTCue,o=r.metadataTrack_;if(o&&(n.forEach(function(_){var b=_.cueTime+e;typeof b!="number"||A.isNaN(b)||b<0||!(b<1/0)||_.frames.forEach(function(S){var x=new s(b,b,S.value||S.url||S.data||"");x.frame=S,x.value=S,R_(x),o.addCue(x)})}),!(!o.cues||!o.cues.length))){for(var u=o.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var p=l.reduce(function(_,b){var S=_[b.startTime]||[];return S.push(b),_[b.startTime]=S,_},{}),m=Object.keys(p).sort(function(_,b){return Number(_)-Number(b)});m.forEach(function(_,b){var S=p[_],x=Number(m[b+1])||i;S.forEach(function(k){k.endTime=x})})}}},N_=function(t,r,n){t.metadataTrack_||(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=r)},Si=function(t,r,n){var e,i;if(n&&n.cues)for(e=n.cues.length;e--;)i=n.cues[e],i.startTime>=t&&i.endTime<=r&&n.removeCue(i)},B_=function(t){var r=t.cues;if(r)for(var n=0;n<r.length;n++){for(var e=[],i=0,s=0;s<r.length;s++)r[n].startTime===r[s].startTime&&r[n].endTime===r[s].endTime&&r[n].text===r[s].text&&(i++,i>1&&e.push(r[s]));e.length&&e.forEach(function(o){return t.removeCue(o)})}},U_=function(t,r,n){if(typeof r>"u"||r===null||!t.length)return[];var e=Math.ceil((r-n+3)*jn.ONE_SECOND_IN_TS),i;for(i=0;i<t.length&&!(t[i].pts>e);i++);return t.slice(i)},V_=function(t,r,n){if(!r.length)return t;if(n)return r.slice();var e=r[0].pts,i=0;for(i;i<t.length&&!(t[i].pts>=e);i++);return t.slice(0,i).concat(r)},H_=function(t,r,n,e){for(var i=Math.ceil((r-e)*jn.ONE_SECOND_IN_TS),s=Math.ceil((n-e)*jn.ONE_SECOND_IN_TS),o=t.slice(),u=t.length;u--&&!(t[u].pts<=s););if(u===-1)return o;for(var l=u+1;l--&&!(t[l].pts<=i););return l=Math.max(l,0),o.splice(l,u-l+1),o},q_=function(t,r){if(!t&&!r||!t&&r||t&&!r)return!1;if(t===r)return!0;var n=Object.keys(t).sort(),e=Object.keys(r).sort();if(n.length!==e.length)return!1;for(var i=0;i<n.length;i++){var s=n[i];if(s!==e[i]||t[s]!==r[s])return!1}return!0},Qf=22,j_=function(t,r,n){r=r||[];for(var e=[],i=0,s=0;s<r.length;s++){var o=r[s];if(t===o.timeline&&(e.push(s),i+=o.duration,i>n))return s}return e.length===0?0:e[e.length-1]},vi=1,W_=500,Xl=function(t){return typeof t=="number"&&isFinite(t)},In=1/60,G_=function(t,r,n){return t!=="main"||!r||!n?null:!n.hasAudio&&!n.hasVideo?"Neither audio nor video found in segment.":r.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!r.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null},z_=function(t,r,n){var e=r-we.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var i=r-n;return Math.min(i,e)},Pr=function(t){var r=t.startOfSegment,n=t.duration,e=t.segment,i=t.part,s=t.playlist,o=s.mediaSequence,u=s.id,l=s.segments,c=l===void 0?[]:l,p=t.mediaIndex,m=t.partIndex,_=t.timeline,b=c.length-1,S="mediaIndex/partIndex increment";t.getMediaInfoForTime?S="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(S="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(S+=" with independent "+t.independent);var x=typeof m=="number",k=t.segment.uri?"segment":"pre-segment",L=x?_f({preloadSegment:e})-1:0;return k+" ["+(o+p)+"/"+(o+b)+"]"+(x?" part ["+m+"/"+L+"]":"")+(" segment start/end ["+e.start+" => "+e.end+"]")+(x?" part start/end ["+i.start+" => "+i.end+"]":"")+(" startOfSegment ["+r+"]")+(" duration ["+n+"]")+(" timeline ["+_+"]")+(" selected by ["+S+"]")+(" playlist ["+u+"]")},Yl=function(t){return t+"TimingInfo"},$_=function(t){var r=t.segmentTimeline,n=t.currentTimeline,e=t.startOfSegment,i=t.buffered,s=t.overrideCheck;return!s&&r===n?null:r<n?e:i.length?i.end(i.length-1):e},Ql=function(t){var r=t.timelineChangeController,n=t.currentTimeline,e=t.segmentTimeline,i=t.loaderType,s=t.audioDisabled;if(n===e)return!1;if(i==="audio"){var o=r.lastTimelineChange({type:"main"});return!o||o.to!==e}if(i==="main"&&s){var u=r.pendingTimelineChange({type:"audio"});return!(u&&u.to===e)}return!1},K_=function(t){var r=0;return["video","audio"].forEach(function(n){var e=t[n+"TimingInfo"];if(e){var i=e.start,s=e.end,o;typeof i=="bigint"||typeof s=="bigint"?o=A.BigInt(s)-A.BigInt(i):typeof i=="number"&&typeof s=="number"&&(o=s-i),typeof o<"u"&&o>r&&(r=o)}}),typeof r=="bigint"&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r},Jl=function(t){var r=t.segmentDuration,n=t.maxDuration;return r?Math.round(r)>n+Qt:!1},X_=function(t,r){if(r!=="hls")return null;var n=K_({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!n)return null;var e=t.playlist.targetDuration,i=Jl({segmentDuration:n,maxDuration:e*2}),s=Jl({segmentDuration:n,maxDuration:e}),o="Segment with index "+t.mediaIndex+" "+("from playlist "+t.playlist.id+" ")+("has a duration of "+n+" ")+("when the reported duration is "+t.duration+" ")+("and the target duration is "+e+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return i||s?{severity:i?"warn":"info",message:o}:null},Ms=function(a){G._inheritsLoose(t,a);function t(n,e){var i;if(i=a.call(this)||this,!n)throw new TypeError("Initialization settings are required");if(typeof n.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!n.mediaSource)throw new TypeError("No MediaSource specified");return i.bandwidth=n.bandwidth,i.throughput={rate:0,count:0},i.roundTrip=NaN,i.resetStats_(),i.mediaIndex=null,i.partIndex=null,i.hasPlayed_=n.hasPlayed,i.currentTime_=n.currentTime,i.seekable_=n.seekable,i.seeking_=n.seeking,i.duration_=n.duration,i.mediaSource_=n.mediaSource,i.vhs_=n.vhs,i.loaderType_=n.loaderType,i.currentMediaInfo_=void 0,i.startingMediaInfo_=void 0,i.segmentMetadataTrack_=n.segmentMetadataTrack,i.goalBufferLength_=n.goalBufferLength,i.sourceType_=n.sourceType,i.sourceUpdater_=n.sourceUpdater,i.inbandTextTracks_=n.inbandTextTracks,i.state_="INIT",i.timelineChangeController_=n.timelineChangeController,i.shouldSaveSegmentTimingInfo_=!0,i.parse708captions_=n.parse708captions,i.useDtsForTimestampOffset_=n.useDtsForTimestampOffset,i.captionServices_=n.captionServices,i.experimentalExactManifestTimings=n.experimentalExactManifestTimings,i.checkBufferTimeout_=null,i.error_=void 0,i.currentTimeline_=-1,i.pendingSegment_=null,i.xhrOptions_=null,i.pendingSegments_=[],i.audioDisabled_=!1,i.isPendingTimestampOffset_=!1,i.gopBuffer_=[],i.timeMapping_=0,i.safeAppend_=I.browser.IE_VERSION>=11,i.appendInitSegment_={audio:!0,video:!0},i.playlistOfLastInitSegment_={audio:null,video:null},i.callQueue_=[],i.loadQueue_=[],i.metadataQueue_={id3:[],caption:[]},i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=null,i.activeInitSegmentId_=null,i.initSegments_={},i.cacheEncryptionKeys_=n.cacheEncryptionKeys,i.keyCache_={},i.decrypter_=n.decrypter,i.syncController_=n.syncController,i.syncPoint_={segmentIndex:0,time:0},i.transmuxer_=i.createTransmuxer_(),i.triggerSyncInfoUpdate_=function(){return i.trigger("syncinfoupdate")},i.syncController_.on("syncinfoupdate",i.triggerSyncInfoUpdate_),i.mediaSource_.addEventListener("sourceopen",function(){i.isEndOfStream_()||(i.ended_=!1)}),i.fetchAtBuffer_=!1,i.logger_=mt("SegmentLoader["+i.loaderType_+"]"),Object.defineProperty(ee(i),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),i.sourceUpdater_.on("ready",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="main"&&i.timelineChangeController_.on("pendingtimelinechange",function(){i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i.loaderType_==="audio"&&i.timelineChangeController_.on("timelinechange",function(){i.hasEnoughInfoToLoad_()&&i.processLoadQueue_(),i.hasEnoughInfoToAppend_()&&i.processCallQueue_()}),i}var r=t.prototype;return r.createTransmuxer_=function(){return us.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,A.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e},r.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&us.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return I.createTimeRanges();if(this.loaderType_==="main"){var i=e.hasAudio,s=e.hasVideo,o=e.isMuxed;if(s&&i&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=ta(e),o=this.initSegments_[s];return i&&!o&&e.bytes&&(this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},r.segmentKey=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=Ff(e),o=this.keyCache_[s];this.cacheEncryptionKeys_&&i&&!o&&e.bytes&&(this.keyCache_[s]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var u={resolvedUri:(o||e).resolvedUri};return o&&(u.bytes=o.bytes),u},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(e,i){if(i===void 0&&(i={}),!!e){var s=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var u=null;if(s&&(s.id?u=s.id:s.uri&&(u=s.uri)),this.logger_("playlist update ["+u+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var l=e.mediaSequence-s.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var p=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=p}}o&&(o.mediaIndex-=l,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}},r.pause=function(){this.checkBufferTimeout_&&(A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&us.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(e,i,s,o){if(s===void 0&&(s=function(){}),o===void 0&&(o=!1),i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var u=1,l=function(){u--,u===0&&s()};(o||!this.audioDisabled_)&&(u++,this.sourceUpdater_.removeAudio(e,i,l)),(o||this.loaderType_==="main")&&(this.gopBuffer_=H_(this.gopBuffer_,e,i,this.timeMapping_),u++,this.sourceUpdater_.removeVideo(e,i,l));for(var c in this.inbandTextTracks_)Si(e,i,this.inbandTextTracks_[c]);Si(e,i,this.segmentMetadataTrack_),l()},r.monitorBuffer_=function(){this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&A.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A.setTimeout(this.monitorBufferTick_.bind(this),W_)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},r.isEndOfStream_=function(e,i,s){if(e===void 0&&(e=this.mediaIndex),i===void 0&&(i=this.playlist_),s===void 0&&(s=this.partIndex),!i||!this.mediaSource_)return!1;var o=typeof e=="number"&&i.segments[e],u=e+1===i.segments.length,l=!o||!o.parts||s+1===o.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&u&&l},r.chooseNextRequest_=function(){var e=this.buffered_(),i=Ul(e)||0,s=Ro(e,this.currentTime_()),o=!this.hasPlayed_()&&s>=1,u=s>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||o||u)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=j_(this.currentTimeline_,l,i);else if(this.mediaIndex!==null){var p=l[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=p.end?p.end:i,p.parts&&p.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var _=Qe.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?i:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=_.segmentIndex,S=_.startTime,x=_.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+i:"currentTime "+this.currentTime_(),c.mediaIndex=b,c.startOfSegment=S,c.partIndex=x}var k=l[c.mediaIndex],L=k&&typeof c.partIndex=="number"&&k.parts&&k.parts[c.partIndex];if(!k||typeof c.partIndex=="number"&&!L)return null;if(typeof c.partIndex!="number"&&k.parts&&(c.partIndex=0,L=k.parts[0]),!s&&L&&!L.independent)if(c.partIndex===0){var H=l[c.mediaIndex-1],O=H.parts&&H.parts.length&&H.parts[H.parts.length-1];O&&O.independent&&(c.mediaIndex-=1,c.partIndex=H.parts.length-1,c.independent="previous segment")}else k.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var F=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=l.length-1&&F&&!this.seeking_()?null:this.generateSegmentInfo_(c)},r.generateSegmentInfo_=function(e){var i=e.independent,s=e.playlist,o=e.mediaIndex,u=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,p=e.forceTimestampOffset,m=e.getMediaInfoForTime,_=s.segments[o],b=typeof c=="number"&&_.parts[c],S={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||_.resolvedUri,mediaIndex:o,partIndex:b?c:null,isSyncRequest:l,startOfSegment:u,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:b&&b.duration||_.duration,segment:_,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:i},x=typeof p<"u"?p:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:u,buffered:this.buffered_(),overrideCheck:x});var k=Ul(this.sourceUpdater_.audioBuffered());return typeof k=="number"&&(S.audioAppendStart=k-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=U_(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S},r.timestampOffsetForSegment_=function(e){return $_(e)},r.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var i=this.currentTime_(),s=e.bandwidth,o=this.pendingSegment_.duration,u=Qe.estimateSegmentRequestTime(o,s,this.playlist_,e.bytesReceived),l=_y(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(!(u<=l)){var c=P_({master:this.vhs_.playlists.master,currentTime:i,bandwidth:s,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var p=u-l,m=p-c.rebufferingImpact,_=.5;l<=Qt&&(_=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||m<_)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*we.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},r.handleAbort_=function(e){this.logger_("Aborting "+Pr(e)),this.mediaRequestsAborted+=1},r.handleProgress_=function(e,i){this.earlyAbortWhenNeeded_(i.stats),!this.checkForAbort_(i.requestId)&&this.trigger("progress")},r.handleTrackInfo_=function(e,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(i)||(i=i||{},q_(this.currentMediaInfo_,i)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=i,this.currentMediaInfo_=i,this.logger_("trackinfo update",i),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=i,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},r.handleTimingInfo_=function(e,i,s,o){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var u=this.pendingSegment_,l=Yl(i);u[l]=u[l]||{},u[l][s]=o,this.logger_("timinginfo: "+i+" - "+s+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},r.handleCaptions_=function(e,i){var s=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(i.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,i));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),l={};i.forEach(function(c){l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};var p=l[c.stream];p.startTime=Math.min(p.startTime,c.startTime+u),p.endTime=Math.max(p.endTime,c.endTime+u),p.captions.push(c)}),Object.keys(l).forEach(function(c){var p=l[c],m=p.startTime,_=p.endTime,b=p.captions,S=s.inbandTextTracks_;s.logger_("adding cues from "+m+" -> "+_+" for "+c),O_(S,s.vhs_.tech_,c),Si(m,_,S[c]),F_({captionArray:b,inbandTextTracks:S,timestampOffset:u})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},r.handleId3_=function(e,i,s){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,s));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();N_(this.inbandTextTracks_,s,this.vhs_.tech_),M_({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:u,videoDuration:this.duration_()})}},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(i){return i()})},r.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(i){return i()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},r.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed;return!(o&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!u&&!e.audioTimingInfo||Ql({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.handleData_=function(e,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,i));return}var s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Yl(i.type)].start;else{var o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo,l;u&&(l=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:l,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,i.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==s.mediaIndex||c.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,i)}}},r.updateAppendInitSegmentStatus=function(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)},r.getInitSegmentAndUpdateState_=function(e){var i=e.type,s=e.initSegment,o=e.map,u=e.playlist;if(o){var l=ta(o);if(this.activeInitSegmentId_===l)return null;s=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=l}return s&&this.appendInitSegment_[i]?(this.playlistOfLastInitSegment_[i]=u,this.appendInitSegment_[i]=!1,this.activeInitSegmentId_=null,s):null},r.handleQuotaExceededError_=function(e,i){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes,c=this.sourceUpdater_.audioBuffered(),p=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+dr(c).join(", ")),p.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+dr(p).join(", "));var m=c.length?c.start(0):0,_=c.length?c.end(c.length-1):0,b=p.length?p.start(0):0,S=p.length?p.end(p.length-1):0;if(_-m<=vi&&S-b<=vi){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+l.byteLength+", ")+("audio buffer: "+dr(c).join(", ")+", ")+("video buffer: "+dr(p).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:u,bytes:l}));var x=this.currentTime_(),k=x-vi;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+k),this.remove(0,k,function(){s.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+vi+"s"),s.waitingOnRemove_=!1,s.quotaExceededErrorRetryTimeout_=A.setTimeout(function(){s.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),s.quotaExceededErrorRetryTimeout_=null,s.processCallQueue_()},vi*1e3)},!0)},r.handleAppendError_=function(e,i){var s=e.segmentInfo,o=e.type,u=e.bytes;if(i){if(i.code===Qf){this.handleQuotaExceededError_({segmentInfo:s,type:o,bytes:u});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",i),this.error(o+" append of "+u.length+"b failed for segment "+("#"+s.mediaIndex+" in playlist "+s.playlist.id)),this.trigger("appenderror")}},r.appendToSourceBuffer_=function(e){var i=e.segmentInfo,s=e.type,o=e.initSegment,u=e.data,l=e.bytes;if(!l){var c=[u],p=u.byteLength;o&&(c.unshift(o),p+=o.byteLength),l=L_({bytes:p,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:s,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:i,type:s,bytes:l}))},r.handleSegmentTimingInfo_=function(e,i,s){if(!(!this.pendingSegment_||i!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,u=e+"TimingInfo";o[u]||(o[u]={}),o[u].transmuxerPrependedSeconds=s.prependedContentDuration||0,o[u].transmuxedPresentationStart=s.start.presentation,o[u].transmuxedDecodeStart=s.start.decode,o[u].transmuxedPresentationEnd=s.end.presentation,o[u].transmuxedDecodeEnd=s.end.decode,o[u].baseMediaDecodeTime=s.baseMediaDecodeTime}},r.appendData_=function(e,i){var s=i.type,o=i.data;if(!(!o||!o.byteLength)&&!(s==="audio"&&this.audioDisabled_)){var u=this.getInitSegmentAndUpdateState_({type:s,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:u,data:o})}},r.loadSegment_=function(e){var i=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var s=ht({},e,{forceTimestampOffset:!0});ht(e,i.generateSegmentInfo_(s)),i.isPendingTimestampOffset_=!1,i.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},r.updateTransmuxerAndRequestSegment_=function(e){var i=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var s=this.createSimplifiedSegmentObj_(e),o=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),u=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,c=o||u&&l;this.logger_("Requesting "+Pr(e)),s.map&&!s.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=E_({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:s,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){i.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(m){var _=m.message,b=m.level,S=m.stream;i.logger_(Pr(e)+" logged from transmuxer stream "+S+" as a "+b+": "+_)}})},r.trimBackBuffer_=function(e){var i=z_(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)},r.createSimplifiedSegmentObj_=function(e){var i=e.segment,s=e.part,o={resolvedUri:s?s.resolvedUri:i.resolvedUri,byterange:s?s.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===i.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),i.key){var l=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=l}return i.map&&(o.map=this.initSegmentForMap(i.map)),o},r.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},r.saveBandwidthRelatedStats_=function(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e<In){this.logger_("Ignoring segment's bandwidth because its duration of "+e+(" is less than the min to record "+In));return}this.bandwidth=i.bandwidth,this.roundTrip=i.roundTripTime},r.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},r.segmentRequestFinished_=function(e,i,s){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,i,s));return}if(this.saveTransferStats_(i.stats),!!this.pendingSegment_&&i.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===xt.ABORTED)return;if(this.pause(),e.code===xt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,i.stats),o.endOfAllRequests=i.endOfAllRequests,s.gopInfo&&(this.gopBuffer_=V_(this.gopBuffer_,s.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},r.setTimeMapping_=function(e){var i=this.syncController_.mappingForTimeline(e);i!==null&&(this.timeMapping_=i)},r.updateMediaSecondsLoaded_=function(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},r.shouldUpdateTransmuxerTimestampOffset_=function(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()},r.trueSegmentStart_=function(e){var i=e.currentStart,s=e.playlist,o=e.mediaIndex,u=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,c=e.useVideoTimingInfo,p=e.videoTimingInfo,m=e.audioTimingInfo;if(typeof i<"u")return i;if(!c)return m.start;var _=s.segments[o-1];return o===0||!_||typeof _.start>"u"||_.end!==u+l?u:p.start},r.waitForAppendsToComplete_=function(e){var i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var s=i.hasAudio,o=i.hasVideo,u=i.isMuxed,l=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&s&&!u;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}l&&e.waitingOnAppends++,c&&e.waitingOnAppends++,l&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},r.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},r.checkForIllegalMediaSwitch=function(e){var i=G_(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,blacklistDuration:1/0}),this.trigger("error"),!0):!1},r.updateSourceBufferTimestampOffset_=function(e){if(!(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")){var i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}},r.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var i=e.videoTimingInfo,s=e.audioTimingInfo,o=e.timingInfo;return this.useDtsForTimestampOffset_?i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:s&&typeof s.transmuxedDecodeStart=="number"?s.transmuxedDecodeStart:o.start:o.start},r.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var i=this.getMediaInfo_(),s=this.loaderType_==="main"&&i&&i.hasVideo,o=s&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)},r.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});var i=X_(e,this.sourceType_);if(i&&(i.severity==="warn"?I.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+Pr(e));return}this.logger_("Appended "+Pr(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var s=e.segment,o=e.part,u=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,l=o&&o.end&&this.currentTime_()-o.end>e.playlist.partTargetDuration*3;if(u||l){this.logger_("bad "+(u?"segment":"part")+" "+Pr(e)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},r.recordThroughput_=function(e){if(e.duration<In){this.logger_("Ignoring segment's throughput because its duration of "+e.duration+(" is less than the min to record "+In));return}var i=this.throughput.rate,s=Date.now()-e.endOfAllRequests+1,o=Math.floor(e.byteLength/s*8*1e3);this.throughput.rate+=(o-i)/++this.throughput.count},r.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var i=e.segment,s=i.start,o=i.end;if(!(!Xl(s)||!Xl(o))){Si(s,o,this.segmentMetadataTrack_);var u=A.WebKitDataCue||A.VTTCue,l={custom:i.custom,dateTimeObject:i.dateTimeObject,dateTimeString:i.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:s,end:o},c=JSON.stringify(l),p=new u(s,o,c);p.value=l,this.segmentMetadataTrack_.addCue(p)}}},t}(I.EventTarget);function Ot(){}var Jf=function(t){return typeof t!="string"?t:t.replace(/./,function(r){return r.toUpperCase()})},Y_=["video","audio"],Ns=function(t,r){var n=r[t+"Buffer"];return n&&n.updating||r.queuePending[t]},Q_=function(t,r){for(var n=0;n<r.length;n++){var e=r[n];if(e.type==="mediaSource")return null;if(e.type===t)return n}return null},qo=function a(t,r){if(r.queue.length!==0){var n=0,e=r.queue[n];if(e.type==="mediaSource"){!r.updating()&&r.mediaSource.readyState!=="closed"&&(r.queue.shift(),e.action(r),e.doneFn&&e.doneFn(),a("audio",r),a("video",r));return}if(t!=="mediaSource"&&!(!r.ready()||r.mediaSource.readyState==="closed"||Ns(t,r))){if(e.type!==t){if(n=Q_(t,r.queue),n===null)return;e=r.queue[n]}if(r.queue.splice(n,1),r.queuePending[t]=e,e.action(t,r),!e.doneFn){r.queuePending[t]=null,a(t,r);return}}}},Zf=function(t,r){var n=r[t+"Buffer"],e=Jf(t);n&&(n.removeEventListener("updateend",r["on"+e+"UpdateEnd_"]),n.removeEventListener("error",r["on"+e+"Error_"]),r.codecs[t]=null,r[t+"Buffer"]=null)},_t=function(t,r){return t&&r&&Array.prototype.indexOf.call(t.sourceBuffers,r)!==-1},tt={appendBuffer:function(t,r,n){return function(e,i){var s=i[e+"Buffer"];if(_t(i.mediaSource,s)){i.logger_("Appending segment "+r.mediaIndex+"'s "+t.length+" bytes to "+e+"Buffer");try{s.appendBuffer(t)}catch(o){i.logger_("Error with code "+o.code+" "+(o.code===Qf?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+r.mediaIndex+" to "+e+"Buffer")),i.queuePending[e]=null,n(o)}}}},remove:function(t,r){return function(n,e){var i=e[n+"Buffer"];if(_t(e.mediaSource,i)){e.logger_("Removing "+t+" to "+r+" from "+n+"Buffer");try{i.remove(t,r)}catch{e.logger_("Remove "+t+" to "+r+" from "+n+"Buffer failed")}}}},timestampOffset:function(t){return function(r,n){var e=n[r+"Buffer"];_t(n.mediaSource,e)&&(n.logger_("Setting "+r+"timestampOffset to "+t),e.timestampOffset=t)}},callback:function(t){return function(r,n){t()}},endOfStream:function(t){return function(r){if(r.mediaSource.readyState==="open"){r.logger_("Calling mediaSource endOfStream("+(t||"")+")");try{r.mediaSource.endOfStream(t)}catch(n){I.log.warn("Failed to call media source endOfStream",n)}}}},duration:function(t){return function(r){r.logger_("Setting mediaSource duration to "+t);try{r.mediaSource.duration=t}catch(n){I.log.warn("Failed to set media source duration",n)}}},abort:function(){return function(t,r){if(r.mediaSource.readyState==="open"){var n=r[t+"Buffer"];if(_t(r.mediaSource,n)){r.logger_("calling abort on "+t+"Buffer");try{n.abort()}catch(e){I.log.warn("Failed to abort on "+t+"Buffer",e)}}}}},addSourceBuffer:function(t,r){return function(n){var e=Jf(t),i=wi(r);n.logger_("Adding "+t+"Buffer with codec "+r+" to mediaSource");var s=n.mediaSource.addSourceBuffer(i);s.addEventListener("updateend",n["on"+e+"UpdateEnd_"]),s.addEventListener("error",n["on"+e+"Error_"]),n.codecs[t]=r,n[t+"Buffer"]=s}},removeSourceBuffer:function(t){return function(r){var n=r[t+"Buffer"];if(Zf(t,r),!!_t(r.mediaSource,n)){r.logger_("Removing "+t+"Buffer with codec "+r.codecs[t]+" from mediaSource");try{r.mediaSource.removeSourceBuffer(n)}catch(e){I.log.warn("Failed to removeSourceBuffer "+t+"Buffer",e)}}}},changeType:function(t){return function(r,n){var e=n[r+"Buffer"],i=wi(t);_t(n.mediaSource,e)&&n.codecs[r]!==t&&(n.logger_("changing "+r+"Buffer codec from "+n.codecs[r]+" to "+t),e.changeType(i),n.codecs[r]=t)}}},rt=function(t){var r=t.type,n=t.sourceUpdater,e=t.action,i=t.doneFn,s=t.name;n.queue.push({type:r,action:e,doneFn:i,name:s}),qo(r,n)},Zl=function(t,r){return function(n){if(r.queuePending[t]){var e=r.queuePending[t].doneFn;r.queuePending[t]=null,e&&e(r[t+"Error_"])}qo(t,r)}},eh=function(a){G._inheritsLoose(t,a);function t(n){var e;return e=a.call(this)||this,e.mediaSource=n,e.sourceopenListener_=function(){return qo("mediaSource",ee(e))},e.mediaSource.addEventListener("sourceopen",e.sourceopenListener_),e.logger_=mt("SourceUpdater"),e.audioTimestampOffset_=0,e.videoTimestampOffset_=0,e.queue=[],e.queuePending={audio:null,video:null},e.delayedAudioAppendQueue_=[],e.videoAppendQueued_=!1,e.codecs={},e.onVideoUpdateEnd_=Zl("video",ee(e)),e.onAudioUpdateEnd_=Zl("audio",ee(e)),e.onVideoError_=function(i){e.videoError_=i},e.onAudioError_=function(i){e.audioError_=i},e.createdSourceBuffers_=!1,e.initializedEme_=!1,e.triggeredReady_=!1,e}var r=t.prototype;return r.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},r.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},r.hasInitializedAnyEme=function(){return this.initializedEme_},r.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},r.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},r.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},r.addSourceBuffer=function(e,i){rt({type:"mediaSource",sourceUpdater:this,action:tt.addSourceBuffer(e,i),name:"addSourceBuffer"})},r.abort=function(e){rt({type:e,sourceUpdater:this,action:tt.abort(e),name:"abort"})},r.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer()){I.log.error("removeSourceBuffer is not supported!");return}rt({type:"mediaSource",sourceUpdater:this,action:tt.removeSourceBuffer(e),name:"removeSourceBuffer"})},r.canRemoveSourceBuffer=function(){return!I.browser.IE_VERSION&&!I.browser.IS_FIREFOX&&A.MediaSource&&A.MediaSource.prototype&&typeof A.MediaSource.prototype.removeSourceBuffer=="function"},t.canChangeType=function(){return A.SourceBuffer&&A.SourceBuffer.prototype&&typeof A.SourceBuffer.prototype.changeType=="function"},r.canChangeType=function(){return this.constructor.canChangeType()},r.changeType=function(e,i){if(!this.canChangeType()){I.log.error("changeType is not supported!");return}rt({type:e,sourceUpdater:this,action:tt.changeType(i),name:"changeType"})},r.addOrChangeSourceBuffers=function(e){var i=this;if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(s){var o=e[s];if(!i.hasCreatedSourceBuffers())return i.addSourceBuffer(s,o);i.canChangeType()&&i.changeType(s,o)})},r.appendBuffer=function(e,i){var s=this,o=e.segmentInfo,u=e.type,l=e.bytes;if(this.processedAppend_=!0,u==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_("delayed audio append of "+l.length+" until video append");return}var c=i;if(rt({type:u,sourceUpdater:this,action:tt.appendBuffer(l,o||{mediaIndex:-1},c),doneFn:i,name:"appendBuffer"}),u==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var p=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+p.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,p.forEach(function(m){s.appendBuffer.apply(s,m)})}},r.audioBuffered=function(){return _t(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:I.createTimeRange()},r.videoBuffered=function(){return _t(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:I.createTimeRange()},r.buffered=function(){var e=_t(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=_t(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():yy(this.audioBuffered(),this.videoBuffered())},r.setDuration=function(e,i){i===void 0&&(i=Ot),rt({type:"mediaSource",sourceUpdater:this,action:tt.duration(e),name:"duration",doneFn:i})},r.endOfStream=function(e,i){e===void 0&&(e=null),i===void 0&&(i=Ot),typeof e!="string"&&(e=void 0),rt({type:"mediaSource",sourceUpdater:this,action:tt.endOfStream(e),name:"endOfStream",doneFn:i})},r.removeAudio=function(e,i,s){if(s===void 0&&(s=Ot),!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}rt({type:"audio",sourceUpdater:this,action:tt.remove(e,i),doneFn:s,name:"remove"})},r.removeVideo=function(e,i,s){if(s===void 0&&(s=Ot),!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}rt({type:"video",sourceUpdater:this,action:tt.remove(e,i),doneFn:s,name:"remove"})},r.updating=function(){return!!(Ns("audio",this)||Ns("video",this))},r.audioTimestampOffset=function(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(rt({type:"audio",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},r.videoTimestampOffset=function(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(rt({type:"video",sourceUpdater:this,action:tt.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},r.audioQueueCallback=function(e){this.audioBuffer&&rt({type:"audio",sourceUpdater:this,action:tt.callback(e),name:"callback"})},r.videoQueueCallback=function(e){this.videoBuffer&&rt({type:"video",sourceUpdater:this,action:tt.callback(e),name:"callback"})},r.dispose=function(){var e=this;this.trigger("dispose"),Y_.forEach(function(i){e.abort(i),e.canRemoveSourceBuffer()?e.removeSourceBuffer(i):e[i+"QueueCallback"](function(){return Zf(i,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(I.EventTarget),ed=function(t){return decodeURIComponent(escape(String.fromCharCode.apply(null,t)))},td=new Uint8Array(`
|
|
65
65
|
|
|
66
|
-
`.split("").map(function(a){return a.charCodeAt(0)})),J_=function(a){G._inheritsLoose(t,a);function t(){return a.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return t}(ys(Error)),Z_=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,i.mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=n.featuresNativeTextTracks,i.loadVttJs=n.loadVttJs,i.shouldSaveSegmentTimingInfo_=!1,i}var r=t.prototype;return r.createTransmuxer_=function(){return null},r.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return I.createTimeRanges();var e=this.subtitlesTrack_.cues,i=e[0].startTime,s=e[e.length-1].startTime;return I.createTimeRanges([[i,s]])},r.initSegmentForMap=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=ta(e),o=this.initSegments_[s];if(i&&!o&&e.bytes){var u=td.byteLength+e.bytes.byteLength,l=new Uint8Array(u);l.set(e.bytes),l.set(td,e.bytes.byteLength),this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:l}}return o||e},r.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.track=function(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},r.remove=function(e,i){Si(e,i,this.subtitlesTrack_)},r.fillBuffer_=function(){var e=this,i=this.chooseNextRequest_();if(i){if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null){var s=function(){e.state="READY",e.paused()||e.monitorBuffer_()};this.syncController_.one("timestampoffset",s),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(i)}},r.timestampOffsetForSegment_=function(){return null},r.chooseNextRequest_=function(){return this.skipEmptySegments_(a.prototype.chooseNextRequest_.call(this))},r.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},r.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(e,i,s){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===xt.TIMEOUT&&this.handleTimeout_(),e.code===xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var u=this.pendingSegment_;this.saveBandwidthRelatedStats_(u.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");var l=u.segment;if(l.map&&(l.map.bytes=i.map.bytes),u.bytes=i.bytes,typeof A.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(e,i,s)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}l.requested=!0;try{this.parseVTTCues_(u)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(u,this.syncController_.timelines[u.timeline],this.playlist_),u.cues.length?u.timingInfo={start:u.cues[0].startTime,end:u.cues[u.cues.length-1].endTime}:u.timingInfo={start:u.startOfSegment,end:u.startOfSegment+u.duration},u.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}u.byteLength=u.bytes.byteLength,this.mediaSecondsLoaded+=l.duration,u.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new A.VTTCue(c.startTime,c.endTime,c.text):c)}),B_(this.subtitlesTrack_),this.handleAppendsDone_()},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(e){var i,s=!1;if(typeof A.WebVTT!="function")throw new J_;typeof A.TextDecoder=="function"?i=new A.TextDecoder("utf8"):(i=A.WebVTT.StringDecoder(),s=!0);var o=new A.WebVTT.Parser(A,A.vttjs,i);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(c){e.timestampmap=c},o.onparsingerror=function(c){I.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){var u=e.segment.map.bytes;s&&(u=ed(u)),o.parse(u)}var l=e.bytes;s&&(l=ed(l)),o.parse(l),o.flush()},r.updateTimeMapping_=function(e,i,s){var o=e.segment;if(i){if(!e.cues.length){o.empty=!0;return}var u=e.timestampmap,l=u.MPEGTS/jn.ONE_SECOND_IN_TS-u.LOCAL+i.mapping;if(e.cues.forEach(function(m){m.startTime+=l,m.endTime+=l}),!s.syncInfo){var c=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(c,p-o.duration)}}}},t}(Ms),eT=function(t,r){for(var n=t.cues,e=0;e<n.length;e++){var i=n[e];if(r>=i.adStartTime&&r<=i.adEndTime)return i}return null},tT=function(t,r,n){if(n===void 0&&(n=0),!!t.segments)for(var e=n,i,s=0;s<t.segments.length;s++){var o=t.segments[s];if(i||(i=eT(r,e+o.duration/2)),i){if("cueIn"in o){i.endTime=e,i.adEndTime=e,e+=o.duration,i=null;continue}if(e<i.endTime){e+=o.duration;continue}i.endTime+=o.duration}else if("cueOut"in o&&(i=new A.VTTCue(e,e+o.duration,o.cueOut),i.adStartTime=e,i.adEndTime=e+parseFloat(o.cueOut),r.addCue(i)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];i=new A.VTTCue(e,e+o.duration,""),i.adStartTime=e-l,i.adEndTime=i.adStartTime+c,r.addCue(i)}e+=o.duration}},rT=86400,rd=[{name:"VOD",run:function(t,r,n,e,i){if(n!==1/0){var s={time:0,segmentIndex:0,partIndex:null};return s}return null}},{name:"ProgramDateTime",run:function(t,r,n,e,i){if(!Object.keys(t.timelineToDatetimeMappings).length)return null;var s=null,o=null,u=ws(r);i=i||0;for(var l=0;l<u.length;l++){var c=r.endList||i===0?l:u.length-(l+1),p=u[c],m=p.segment,_=t.timelineToDatetimeMappings[m.timeline];if(!(!_||!m.dateTimeObject)){var b=m.dateTimeObject.getTime()/1e3,S=b+_;if(m.parts&&typeof p.partIndex=="number")for(var x=0;x<p.partIndex;x++)S+=m.parts[x].duration;var k=Math.abs(i-S);if(o!==null&&(k===0||o<k))break;o=k,s={time:S,segmentIndex:p.segmentIndex,partIndex:p.partIndex}}}return s}},{name:"Segment",run:function(t,r,n,e,i){var s=null,o=null;i=i||0;for(var u=ws(r),l=0;l<u.length;l++){var c=r.endList||i===0?l:u.length-(l+1),p=u[c],m=p.segment,_=p.part&&p.part.start||m&&m.start;if(m.timeline===e&&typeof _<"u"){var b=Math.abs(i-_);if(o!==null&&o<b)break;(!s||o===null||o>=b)&&(o=b,s={time:_,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return s}},{name:"Discontinuity",run:function(t,r,n,e,i){var s=null;if(i=i||0,r.discontinuityStarts&&r.discontinuityStarts.length)for(var o=null,u=0;u<r.discontinuityStarts.length;u++){var l=r.discontinuityStarts[u],c=r.discontinuitySequence+u+1,p=t.discontinuities[c];if(p){var m=Math.abs(i-p.time);if(o!==null&&o<m)break;(!s||o===null||o>=m)&&(o=m,s={time:p.time,segmentIndex:l,partIndex:null})}}return s}},{name:"Playlist",run:function(t,r,n,e,i){if(r.syncInfo){var s={time:r.syncInfo.time,segmentIndex:r.syncInfo.mediaSequence-r.mediaSequence,partIndex:null};return s}return null}}],iT=function(a){G._inheritsLoose(t,a);function t(n){var e;return e=a.call(this)||this,e.timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mt("SyncController"),e}var r=t.prototype;return r.getSyncPoint=function(e,i,s,o){var u=this.runStrategies_(e,i,s,o);return u.length?this.selectSyncPoint_(u,{key:"time",value:o}):null},r.getExpiredTime=function(e,i){if(!e||!e.segments)return null;var s=this.runStrategies_(e,i,e.discontinuitySequence,0);if(!s.length)return null;var o=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Ai({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},r.runStrategies_=function(e,i,s,o){for(var u=[],l=0;l<rd.length;l++){var c=rd[l],p=c.run(this,e,i,s,o);p&&(p.strategy=c.name,u.push({strategy:c.name,syncPoint:p}))}return u},r.selectSyncPoint_=function(e,i){for(var s=e[0].syncPoint,o=Math.abs(e[0].syncPoint[i.key]-i.value),u=e[0].strategy,l=1;l<e.length;l++){var c=Math.abs(e[l].syncPoint[i.key]-i.value);c<o&&(o=c,s=e[l].syncPoint,u=e[l].strategy)}return this.logger_("syncPoint for ["+i.key+": "+i.value+"] chosen with strategy"+(" ["+u+"]: [time:"+s.time+",")+(" segmentIndex:"+s.segmentIndex)+(typeof s.partIndex=="number"?",partIndex:"+s.partIndex:"")+"]"),s},r.saveExpiredSegmentInfo=function(e,i){var s=i.mediaSequence-e.mediaSequence;if(s>rT){I.log.warn("Not saving expired segment info. Media sequence gap "+s+" is too large.");return}for(var o=s-1;o>=0;o--){var u=e.segments[o];if(u&&typeof u.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+o,time:u.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+","+(" mediaSequence: "+i.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var i=e.segments[0],s=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-s}},r.saveSegmentTimingInfo=function(e){var i=e.segmentInfo,s=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(i,i.timingInfo,s),u=i.segment;o&&(this.saveDiscontinuitySyncInfo_(i),i.playlist.syncInfo||(i.playlist.syncInfo={mediaSequence:i.playlist.mediaSequence+i.mediaIndex,time:u.start}));var l=u.dateTimeObject;u.discontinuity&&s&&l&&(this.timelineToDatetimeMappings[u.timeline]=-(l.getTime()/1e3))},r.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},r.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,i,s){var o=e.segment,u=e.part,l=this.timelines[e.timeline],c,p;if(typeof e.timestampOffset=="number")l={time:e.startOfSegment,mapping:e.startOfSegment-i.start},s&&(this.timelines[e.timeline]=l,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+l.time+"] [mapping: "+l.mapping+"]"))),c=e.startOfSegment,p=i.end+l.mapping;else if(l)c=i.start+l.mapping,p=i.end+l.mapping;else return!1;return u&&(u.start=c,u.end=p),(!o.start||c<o.start)&&(o.start=c),o.end=p,!0},r.saveDiscontinuitySyncInfo_=function(e){var i=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(i.discontinuityStarts&&i.discontinuityStarts.length)for(var o=0;o<i.discontinuityStarts.length;o++){var u=i.discontinuityStarts[o],l=i.discontinuitySequence+o+1,c=u-e.mediaIndex,p=Math.abs(c);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>p){var m=void 0;c<0?m=s.start-Ai({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:u}):m=s.end+Ai({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:u}),this.discontinuities[l]={time:m,accuracy:p}}}},r.dispose=function(){this.trigger("dispose"),this.off()},t}(I.EventTarget),nT=function(a){G._inheritsLoose(t,a);function t(){var n;return n=a.call(this)||this,n.pendingTimelineChanges_={},n.lastTimelineChanges_={},n}var r=t.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[i]={type:i,from:s,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[i]},r.lastTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[i]={type:i,from:s,to:o},delete this.pendingTimelineChanges_[i],this.trigger("timelinechange")),this.lastTimelineChanges_[i]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(I.EventTarget),aT=Vf(Hf(function(){var a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(O,F,q){return q={path:F,exports:{},require:function(R,U){return r(R,U??q.path)}},O(q,q.exports),q.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var n=t(function(O){function F(B,R){for(var U=0;U<R.length;U++){var N=R[U];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(B,N.key,N)}}function q(B,R,U){return R&&F(B.prototype,R),U&&F(B,U),B}O.exports=q,O.exports.default=O.exports,O.exports.__esModule=!0}),e=t(function(O){function F(q,B){return O.exports=F=Object.setPrototypeOf||function(U,N){return U.__proto__=N,U},O.exports.default=O.exports,O.exports.__esModule=!0,F(q,B)}O.exports=F,O.exports.default=O.exports,O.exports.__esModule=!0}),i=t(function(O){function F(q,B){q.prototype=Object.create(B.prototype),q.prototype.constructor=q,e(q,B)}O.exports=F,O.exports.default=O.exports,O.exports.__esModule=!0}),s=function(){function O(){this.listeners={}}var F=O.prototype;return F.on=function(B,R){this.listeners[B]||(this.listeners[B]=[]),this.listeners[B].push(R)},F.off=function(B,R){if(!this.listeners[B])return!1;var U=this.listeners[B].indexOf(R);return this.listeners[B]=this.listeners[B].slice(0),this.listeners[B].splice(U,1),U>-1},F.trigger=function(B){var R=this.listeners[B];if(R)if(arguments.length===2)for(var U=R.length,N=0;N<U;++N)R[N].call(this,arguments[1]);else for(var X=Array.prototype.slice.call(arguments,1),$=R.length,J=0;J<$;++J)R[J].apply(this,X)},F.dispose=function(){this.listeners={}},F.pipe=function(B){this.on("data",function(R){B.push(R)})},O}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(O){return O.subarray(0,O.byteLength-O[O.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var u=function(){var F=[[[],[],[],[],[]],[[],[],[],[],[]]],q=F[0],B=F[1],R=q[4],U=B[4],N,X,$,J=[],oe=[],fe,re,ae,pe,Me,ue;for(N=0;N<256;N++)oe[(J[N]=N<<1^(N>>7)*283)^N]=N;for(X=$=0;!R[X];X^=fe||1,$=oe[$]||1)for(pe=$^$<<1^$<<2^$<<3^$<<4,pe=pe>>8^pe&255^99,R[X]=pe,U[pe]=X,ae=J[re=J[fe=J[X]]],ue=ae*16843009^re*65537^fe*257^X*16843008,Me=J[pe]*257^pe*16843008,N=0;N<4;N++)q[N][X]=Me=Me<<24^Me>>>8,B[N][pe]=ue=ue<<24^ue>>>8;for(N=0;N<5;N++)q[N]=q[N].slice(0),B[N]=B[N].slice(0);return F},l=null,c=function(){function O(q){l||(l=u()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var B,R,U,N=this._tables[0][4],X=this._tables[1],$=q.length,J=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");var oe=q.slice(0),fe=[];for(this._key=[oe,fe],B=$;B<4*$+28;B++)U=oe[B-1],(B%$===0||$===8&&B%$===4)&&(U=N[U>>>24]<<24^N[U>>16&255]<<16^N[U>>8&255]<<8^N[U&255],B%$===0&&(U=U<<8^U>>>24^J<<24,J=J<<1^(J>>7)*283)),oe[B]=oe[B-$]^U;for(R=0;B;R++,B--)U=oe[R&3?B:B-4],B<=4||R<4?fe[R]=U:fe[R]=X[0][N[U>>>24]]^X[1][N[U>>16&255]]^X[2][N[U>>8&255]]^X[3][N[U&255]]}var F=O.prototype;return F.decrypt=function(B,R,U,N,X,$){var J=this._key[1],oe=B^J[0],fe=N^J[1],re=U^J[2],ae=R^J[3],pe,Me,ue,Yi=J.length/4-2,at,Dt=4,zt=this._tables[1],Zt=zt[0],gt=zt[1],vr=zt[2],yr=zt[3],_r=zt[4];for(at=0;at<Yi;at++)pe=Zt[oe>>>24]^gt[fe>>16&255]^vr[re>>8&255]^yr[ae&255]^J[Dt],Me=Zt[fe>>>24]^gt[re>>16&255]^vr[ae>>8&255]^yr[oe&255]^J[Dt+1],ue=Zt[re>>>24]^gt[ae>>16&255]^vr[oe>>8&255]^yr[fe&255]^J[Dt+2],ae=Zt[ae>>>24]^gt[oe>>16&255]^vr[fe>>8&255]^yr[re&255]^J[Dt+3],Dt+=4,oe=pe,fe=Me,re=ue;for(at=0;at<4;at++)X[(3&-at)+$]=_r[oe>>>24]<<24^_r[fe>>16&255]<<16^_r[re>>8&255]<<8^_r[ae&255]^J[Dt++],pe=oe,oe=fe,fe=re,re=ae,ae=pe},O}(),p=function(O){i(F,O);function F(){var B;return B=O.call(this,s)||this,B.jobs=[],B.delay=1,B.timeout_=null,B}var q=F.prototype;return q.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},q.push=function(R){this.jobs.push(R),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},F}(s),m=function(F){return F<<24|(F&65280)<<8|(F&16711680)>>8|F>>>24},_=function(F,q,B){var R=new Int32Array(F.buffer,F.byteOffset,F.byteLength>>2),U=new c(Array.prototype.slice.call(q)),N=new Uint8Array(F.byteLength),X=new Int32Array(N.buffer),$,J,oe,fe,re,ae,pe,Me,ue;for($=B[0],J=B[1],oe=B[2],fe=B[3],ue=0;ue<R.length;ue+=4)re=m(R[ue]),ae=m(R[ue+1]),pe=m(R[ue+2]),Me=m(R[ue+3]),U.decrypt(re,ae,pe,Me,X,ue),X[ue]=m(X[ue]^$),X[ue+1]=m(X[ue+1]^J),X[ue+2]=m(X[ue+2]^oe),X[ue+3]=m(X[ue+3]^fe),$=re,J=ae,oe=pe,fe=Me;return N},b=function(){function O(q,B,R,U){var N=O.STEP,X=new Int32Array(q.buffer),$=new Uint8Array(q.byteLength),J=0;for(this.asyncStream_=new p,this.asyncStream_.push(this.decryptChunk_(X.subarray(J,J+N),B,R,$)),J=N;J<X.length;J+=N)R=new Uint32Array([m(X[J-4]),m(X[J-3]),m(X[J-2]),m(X[J-1])]),this.asyncStream_.push(this.decryptChunk_(X.subarray(J,J+N),B,R,$));this.asyncStream_.push(function(){U(null,o($))})}var F=O.prototype;return F.decryptChunk_=function(B,R,U,N){return function(){var X=_(B,R,U);N.set(X,B.byteOffset)}},n(O,null,[{key:"STEP",get:function(){return 32e3}}]),O}(),S;typeof window<"u"?S=window:typeof a<"u"?S=a:typeof self<"u"?S=self:S={};var x=S,k=function(F){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(F):F&&F.buffer instanceof ArrayBuffer},L=x.BigInt||Number;L("0x1"),L("0x100"),L("0x10000"),L("0x1000000"),L("0x100000000"),L("0x10000000000"),L("0x1000000000000"),L("0x100000000000000"),L("0x10000000000000000");var H=function(F){var q={};return Object.keys(F).forEach(function(B){var R=F[B];k(R)?q[B]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:q[B]=R}),q};self.onmessage=function(O){var F=O.data,q=new Uint8Array(F.encrypted.bytes,F.encrypted.byteOffset,F.encrypted.byteLength),B=new Uint32Array(F.key.bytes,F.key.byteOffset,F.key.byteLength/4),R=new Uint32Array(F.iv.bytes,F.iv.byteOffset,F.iv.byteLength/4);new b(q,B,R,function(U,N){self.postMessage(H({source:F.source,decrypted:N}),[N.buffer])})}})),sT=Uf(aT),oT=function(t){var r=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(r="main-desc"),r},aa=function(t,r){t.abort(),t.pause(),r&&r.activePlaylistLoader&&(r.activePlaylistLoader.pause(),r.activePlaylistLoader=null)},Bs=function(t,r){r.activePlaylistLoader=t,t.load()},uT=function(t,r){return function(){var n=r.segmentLoaders,e=n[t],i=n.main,s=r.mediaTypes[t],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastGroup_;if(!(u&&c&&u.id===c.id)&&(s.lastGroup_=u,s.lastTrack_=o,aa(e,s),!(!u||u.isMasterPlaylist))){if(!u.playlistLoader){l&&i.resetEverything();return}e.resyncLoader(),Bs(u.playlistLoader,s)}}},lT=function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];e.lastGroup_=null,n.abort(),n.pause()}},dT=function(t,r){return function(){var n=r.masterPlaylistLoader,e=r.segmentLoaders,i=e[t],s=e.main,o=r.mediaTypes[t],u=o.activeTrack(),l=o.getActiveGroup(),c=o.activePlaylistLoader,p=o.lastTrack_;if(!(p&&u&&p.id===u.id)&&(o.lastGroup_=l,o.lastTrack_=u,aa(i,o),!!l)){if(l.isMasterPlaylist){if(!u||!p||u.id===p.id)return;var m=r.vhs.masterPlaylistController_,_=m.selectPlaylist();if(m.media()===_)return;o.logger_("track change. Switching master audio from "+p.id+" to "+u.id),n.pause(),s.resetEverything(),m.fastQualityChange_(_);return}if(t==="AUDIO"){if(!l.playlistLoader){s.setAudio(!0),s.resetEverything();return}i.setAudio(!0),s.setAudio(!1)}if(c===l.playlistLoader){Bs(l.playlistLoader,o);return}i.track&&i.track(u),i.resetEverything(),Bs(l.playlistLoader,o)}}},sa={AUDIO:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t],i=r.blacklistCurrentPlaylist;aa(n,e);var s=e.activeTrack(),o=e.activeGroup(),u=(o.filter(function(p){return p.default})[0]||o[0]).id,l=e.tracks[u];if(s===l){i({message:"Problem encountered loading the default audio track."});return}I.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in e.tracks)e.tracks[c].enabled=e.tracks[c]===l;e.onTrackChanged()}},SUBTITLES:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];I.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),aa(n,e);var i=e.activeTrack();i&&(i.mode="disabled"),e.onTrackChanged()}}},id={AUDIO:function(t,r,n){if(r){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t];r.on("loadedmetadata",function(){var o=r.media();s.playlist(o,i),(!e.paused()||o.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},SUBTITLES:function(t,r,n){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t],o=n.mediaTypes[t];r.on("loadedmetadata",function(){var u=r.media();s.playlist(u,i),s.track(o.activeTrack()),(!e.paused()||u.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},cT={AUDIO:function(t,r){var n=r.vhs,e=r.sourceType,i=r.segmentLoaders[t],s=r.requestOptions,o=r.master.mediaGroups,u=r.mediaTypes[t],l=u.groups,c=u.tracks,p=u.logger_,m=r.masterPlaylistLoader,_=Ki(m.master);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},_&&(o[t].main.default.playlists=m.master.playlists));for(var b in o[t]){l[b]||(l[b]=[]);for(var S in o[t][b]){var x=o[t][b][S],k=void 0;if(_?(p("AUDIO group '"+b+"' label '"+S+"' is a master playlist"),x.isMasterPlaylist=!0,k=null):e==="vhs-json"&&x.playlists?k=new Rr(x.playlists[0],n,s):x.resolvedUri?k=new Rr(x.resolvedUri,n,s):x.playlists&&e==="dash"?k=new Fs(x.playlists[0],n,s,m):k=null,x=I.mergeOptions({id:S,playlistLoader:k},x),id[t](t,x.playlistLoader,r),l[b].push(x),typeof c[S]>"u"){var L=new I.AudioTrack({id:S,kind:oT(x),enabled:!1,language:x.language,default:x.default,label:S});c[S]=L}}}i.on("error",sa[t](t,r))},SUBTITLES:function(t,r){var n=r.tech,e=r.vhs,i=r.sourceType,s=r.segmentLoaders[t],o=r.requestOptions,u=r.master.mediaGroups,l=r.mediaTypes[t],c=l.groups,p=l.tracks,m=r.masterPlaylistLoader;for(var _ in u[t]){c[_]||(c[_]=[]);for(var b in u[t][_])if(!u[t][_][b].forced){var S=u[t][_][b],x=void 0;if(i==="hls")x=new Rr(S.resolvedUri,e,o);else if(i==="dash"){var k=S.playlists.filter(function(H){return H.excludeUntil!==1/0});if(!k.length)return;x=new Fs(S.playlists[0],e,o,m)}else i==="vhs-json"&&(x=new Rr(S.playlists?S.playlists[0]:S.resolvedUri,e,o));if(S=I.mergeOptions({id:b,playlistLoader:x},S),id[t](t,S.playlistLoader,r),c[_].push(S),typeof p[b]>"u"){var L=n.addRemoteTextTrack({id:b,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:b},!1).track;p[b]=L}}}s.on("error",sa[t](t,r))},"CLOSED-CAPTIONS":function(t,r){var n=r.tech,e=r.master.mediaGroups,i=r.mediaTypes[t],s=i.groups,o=i.tracks;for(var u in e[t]){s[u]||(s[u]=[]);for(var l in e[t][u]){var c=e[t][u][l];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var p=n.options_.vhs&&n.options_.vhs.captionServices||{},m={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(p[m.instreamId]&&(m=I.mergeOptions(m,p[m.instreamId])),m.default===void 0&&delete m.default,s[u].push(I.mergeOptions({id:l},c)),typeof o[l]>"u"){var _=n.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;o[l]=_}}}}}},fT=function a(t,r){for(var n=0;n<t.length;n++)if(Bo(r,t[n])||t[n].playlists&&a(t[n].playlists,r))return!0;return!1},hT=function(t,r){return function(n){var e=r.masterPlaylistLoader,i=r.mediaTypes[t].groups,s=e.media();if(!s)return null;var o=null;s.attributes[t]&&(o=i[s.attributes[t]]);var u=Object.keys(i);if(!o)if(t==="AUDIO"&&u.length>1&&Ki(r.master))for(var l=0;l<u.length;l++){var c=i[u[l]];if(fT(c,s)){o=c;break}}else i.main?o=i.main:u.length===1&&(o=i[u[0]]);return typeof n>"u"?o:n===null||!o?null:o.filter(function(p){return p.id===n.id})[0]||null}},pT={AUDIO:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].enabled)return n[e];return null}},SUBTITLES:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].mode==="showing"||n[e].mode==="hidden")return n[e];return null}}},mT=function(t,r){var n=r.mediaTypes;return function(){var e=n[t].activeTrack();return e?n[t].activeGroup(e):null}},gT=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){cT[b](b,t)});var r=t.mediaTypes,n=t.masterPlaylistLoader,e=t.tech,i=t.vhs,s=t.segmentLoaders,o=s.AUDIO,u=s.main;["AUDIO","SUBTITLES"].forEach(function(b){r[b].activeGroup=hT(b,t),r[b].activeTrack=pT[b](b,t),r[b].onGroupChanged=uT(b,t),r[b].onGroupChanging=lT(b,t),r[b].onTrackChanged=dT(b,t),r[b].getActiveGroup=mT(b,t)});var l=r.AUDIO.activeGroup();if(l){var c=(l.filter(function(b){return b.default})[0]||l[0]).id;r.AUDIO.tracks[c].enabled=!0,r.AUDIO.onGroupChanged(),r.AUDIO.onTrackChanged();var p=r.AUDIO.getActiveGroup();p.playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanging()})});var m=function(){r.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};e.audioTracks().addEventListener("change",m),e.remoteTextTracks().addEventListener("change",r.SUBTITLES.onTrackChanged),i.on("dispose",function(){e.audioTracks().removeEventListener("change",m),e.remoteTextTracks().removeEventListener("change",r.SUBTITLES.onTrackChanged)}),e.clearTracks("audio");for(var _ in r.AUDIO.tracks)e.audioTracks().addTrack(r.AUDIO.tracks[_])},vT=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(r){t[r]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ot,activeTrack:Ot,getActiveGroup:Ot,onGroupChanged:Ot,onTrackChanged:Ot,lastTrack_:null,logger_:mt("MediaGroups["+r+"]")}}),t},yT=60*2,Pt,_T=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],TT=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},bT=function(t){var r=t.currentPlaylist,n=t.buffered,e=t.currentTime,i=t.nextPlaylist,s=t.bufferLowWaterLine,o=t.bufferHighWaterLine,u=t.duration,l=t.experimentalBufferBasedABR,c=t.log;if(!i)return I.log.warn("We received no playlist to switch to. Please check your stream."),!1;var p="allowing switch "+(r&&r.id||"null")+" -> "+i.id;if(!r)return c(p+" as current playlist is not set"),!0;if(i.id===r.id)return!1;var m=!!Fr(n,e).length;if(!r.endList)return!m&&typeof r.partTargetDuration=="number"?(c("not "+p+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(p+" as current playlist is live"),!0);var _=Ro(n,e),b=l?we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:we.MAX_BUFFER_LOW_WATER_LINE;if(u<b)return c(p+" as duration < max low water line ("+u+" < "+b+")"),!0;var S=i.attributes.BANDWIDTH,x=r.attributes.BANDWIDTH;if(S<x&&(!l||_<o)){var k=p+" as next bandwidth < current bandwidth ("+S+" < "+x+")";return l&&(k+=" and forwardBuffer < bufferHighWaterLine ("+_+" < "+o+")"),c(k),!0}if((!l||S>x)&&_>=s){var L=p+" as forwardBuffer >= bufferLowWaterLine ("+_+" >= "+s+")";return l&&(L+=" and next bandwidth > current bandwidth ("+S+" > "+x+")"),c(L),!0}return c("not "+p+" as no switching criteria met"),!1},xT=function(a){G._inheritsLoose(t,a);function t(n){var e;e=a.call(this)||this;var i=n.src,s=n.handleManifestRedirects,o=n.withCredentials,u=n.tech,l=n.bandwidth,c=n.externVhs,p=n.useCueTags,m=n.blacklistDuration,_=n.enableLowInitialPlaylist,b=n.sourceType,S=n.cacheEncryptionKeys,x=n.experimentalBufferBasedABR,k=n.experimentalLeastPixelDiffSelector,L=n.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var H=n.maxPlaylistRetries;(H===null||typeof H>"u")&&(H=1/0),Pt=c,e.experimentalBufferBasedABR=!!x,e.experimentalLeastPixelDiffSelector=!!k,e.withCredentials=o,e.tech_=u,e.vhs_=u.vhs,e.sourceType_=b,e.useCueTags_=p,e.blacklistDuration=m,e.maxPlaylistRetries=H,e.enableLowInitialPlaylist=_,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:H,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=vT(),e.mediaSource=new A.MediaSource,e.handleDurationChange_=e.handleDurationChange_.bind(ee(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(ee(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(ee(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=I.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new iT(n),e.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new sT,e.sourceUpdater_=new eh(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new nT;var O={vhs:e.vhs_,parse708captions:n.parse708captions,useDtsForTimestampOffset:n.useDtsForTimestampOffset,captionServices:L,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.duration()},hasPlayed:function(){return e.hasPlayed_},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:l,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_,cacheEncryptionKeys:S,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:n.experimentalExactManifestTimings};e.masterPlaylistLoader_=e.sourceType_==="dash"?new Fs(i,e.vhs_,e.requestOptions_):new Rr(i,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Ms(I.mergeOptions(O,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),n),e.audioSegmentLoader_=new Ms(I.mergeOptions(O,{loaderType:"audio"}),n),e.subtitleSegmentLoader_=new Z_(I.mergeOptions(O,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(B,R){function U(){u.off("vttjserror",N),B()}function N(){u.off("vttjsloaded",U),R()}u.one("vttjsloaded",U),u.one("vttjserror",N),u.addWebVttScript_()})}}),n),e.setupSegmentLoaderListeners_(),e.experimentalBufferBasedABR&&(e.masterPlaylistLoader_.one("loadedplaylist",function(){return e.startABRTimer_()}),e.tech_.on("pause",function(){return e.stopABRTimer_()}),e.tech_.on("play",function(){return e.startABRTimer_()})),_T.forEach(function(q){e[q+"_"]=TT.bind(ee(e),q)}),e.logger_=mt("MPC"),e.triggeredFmp4Usage=!1,e.tech_.preload()==="none"?(e.loadOnPlay_=function(){e.loadOnPlay_=null,e.masterPlaylistLoader_.load()},e.tech_.one("play",e.loadOnPlay_)):e.masterPlaylistLoader_.load(),e.timeToLoadedData__=-1,e.mainAppendsToLoadedData__=-1,e.audioAppendsToLoadedData__=-1;var F=e.tech_.preload()==="none"?"play":"loadstart";return e.tech_.one(F,function(){var q=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-q,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}var r=t.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(e){e===void 0&&(e="abr");var i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)},r.switchMedia_=function(e,i,s){var o=this.media(),u=o&&(o.id||o.uri),l=e.id||e.uri;u&&u!==l&&(this.logger_("switch media "+u+" -> "+l+" from "+i),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+i})),this.masterPlaylistLoader_.media(e,s)},r.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.setInterval(function(){return e.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var e=this.master(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;var s=e.mediaGroups.AUDIO,o=Object.keys(s),u;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)u=this.mediaTypes_.AUDIO.activeTrack();else{var l=s.main||o.length&&s[o[0]];for(var c in l)if(l[c].default){u={label:c};break}}if(!u)return i;var p=[];for(var m in s)if(s[m][u.label]){var _=s[m][u.label];if(_.playlists&&_.playlists.length)p.push.apply(p,_.playlists);else if(_.uri)p.push(_);else if(e.playlists.length)for(var b=0;b<e.playlists.length;b++){var S=e.playlists[b];S.attributes&&S.attributes.AUDIO&&S.attributes.AUDIO===m&&p.push(S)}}return p.length?p:i},r.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var i=e.masterPlaylistLoader_.media(),s=i.targetDuration*1.5*1e3;ks(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,i.endList&&e.tech_.preload()!=="none"&&(e.mainSegmentLoader_.playlist(i,e.requestOptions_),e.mainSegmentLoader_.load()),gT({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),i),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var i=e.masterPlaylistLoader_.media();if(!i){e.excludeUnsupportedVariants_();var s;if(e.enableLowInitialPlaylist&&(s=e.selectInitialPlaylist()),s||(s=e.selectPlaylist()),!s||!e.shouldSwitchToMedia_(s))return;e.initialMedia_=s,e.switchMedia_(e.initialMedia_,"initial");var o=e.sourceType_==="vhs-json"&&e.initialMedia_.segments;if(!o)return;i=e.initialMedia_}e.handleUpdatedMediaPlaylist(i)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var i=e.masterPlaylistLoader_.media(),s=i.targetDuration*1.5*1e3;ks(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(i,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var i=e.masterPlaylistLoader_.media();if(i.lastExcludeReason_!=="playlist-unchanged"){var s=e.stuckAtPlaylistEnd_(i);s&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},r.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},r.triggerPresenceUsage_=function(e,i){var s=e.mediaGroups||{},o=!0,u=Object.keys(s.AUDIO);for(var l in s.AUDIO)for(var c in s.AUDIO[l]){var p=s.AUDIO[l][c];p.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(s.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Pt.Playlist.isAes(i)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),u.length&&Object.keys(s.AUDIO[u[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(e){var i=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),o=this.bufferLowWaterLine(),u=this.bufferHighWaterLine(),l=this.tech_.buffered();return bT({buffered:l,currentTime:s,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:u,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(s){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},yT))});var i=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();o&&e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",i),this.audioSegmentLoader_.on("trackinfo",i),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},r.fastQualityChange_=function(e){var i=this;if(e===void 0&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){I.browser.IE_VERSION||I.browser.IS_EDGE?i.tech_.setCurrentTime(i.tech_.currentTime()+.04):i.tech_.setCurrentTime(i.tech_.currentTime())})},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},r.setupFirstPlay=function(){var e=this,i=this.masterPlaylistLoader_.media();if(!i||this.tech_.paused()||this.hasPlayed_)return!1;if(!i.endList){var s=this.seekable();if(!s.length)return!1;if(I.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(s.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(s.end(0))}return this.hasPlayed_=!0,this.load(),!0},r.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,function(i){})}this.trigger("sourceopen")},r.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(!(!e||!e.length)){var i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}}},r.handleDurationChange_=function(){this.tech_.trigger("durationchange")},r.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},r.stuckAtPlaylistEnd_=function(e){var i=this.seekable();if(!i.length)return!1;var s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;var o=Pt.Playlist.playlistEnd(e,s),u=this.tech_.currentTime(),l=this.tech_.buffered();if(!l.length)return o-u<=bt;var c=l.end(l.length-1);return c-u<=bt&&o-c<=bt},r.blacklistCurrentPlaylist=function(e,i){e===void 0&&(e={});var s=e.playlist||this.masterPlaylistLoader_.media();if(i=i||e.blacklistDuration||this.blacklistDuration,!s){this.error=e,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}s.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,u=o.filter(Aa),l=u.length===1&&u[0]===s;if(o.length===1&&i!==1/0)return I.log.warn("Problem encountered with playlist "+s.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(l);if(l){var c=!1;o.forEach(function(k){if(k!==s){var L=k.excludeUntil;typeof L<"u"&&L!==1/0&&(c=!0,delete k.excludeUntil)}}),c&&(I.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var p;s.playlistErrors_>this.maxPlaylistRetries?p=1/0:p=Date.now()+i*1e3,s.excludeUntil=p,e.reason&&(s.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var m=this.selectPlaylist();if(!m){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var _=e.internal?this.logger_:I.log.warn,b=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+s.id+"."+(b+" Switching to playlist "+m.id+".")),m.attributes.AUDIO!==s.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==s.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var S=m.targetDuration/2*1e3||5*1e3,x=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=S;return this.switchMedia_(m,"exclude",l||x)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(e,i){var s=this,o=[],u=e==="all";(u||e==="main")&&o.push(this.masterPlaylistLoader_);var l=[];(u||e==="audio")&&l.push("AUDIO"),(u||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(c){var p=s.mediaTypes_[c]&&s.mediaTypes_[c].activePlaylistLoader;p&&o.push(p)}),["main","audio","subtitle"].forEach(function(c){var p=s[c+"SegmentLoader_"];p&&(e===c||e==="all")&&o.push(p)}),o.forEach(function(c){return i.forEach(function(p){typeof c[p]=="function"&&c[p]()})})},r.setCurrentTime=function(e){var i=Fr(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Pt.Playlist.duration(e):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var s=this.syncController_.getExpiredTime(i,this.duration());if(s!==null){var o=this.masterPlaylistLoader_.master,u=Pt.Playlist.seekable(i,s,Pt.Playlist.liveEdgeDelay(o,i));if(u.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(i,this.duration()),s===null||(e=Pt.Playlist.seekable(i,s,Pt.Playlist.liveEdgeDelay(o,i)),e.length===0)))){var l,c;this.seekable_&&this.seekable_.length&&(l=this.seekable_.end(0),c=this.seekable_.start(0)),e?e.start(0)>u.end(0)||u.start(0)>e.end(0)?this.seekable_=u:this.seekable_=I.createTimeRanges([[e.start(0)>u.start(0)?e.start(0):u.start(0),e.end(0)<u.end(0)?e.end(0):u.end(0)]]):this.seekable_=u,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===l&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+vf(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},r.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){var i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}var s=this.tech_.buffered(),o=Pt.Playlist.duration(this.masterPlaylistLoader_.media());s.length>0&&(o=Math.max(o,s.end(s.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},r.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(i){var s=e.mediaTypes_[i].groups;for(var o in s)s[o].forEach(function(u){u.playlistLoader&&u.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!s)},r.getCodecsOrExclude_=function(){var e=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var s=Di(this.master(),this.media()),o={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(o.video=s.video||i.main.videoCodec||zm),i.main.isMuxed&&(o.video+=","+(s.audio||i.main.audioCodec||Vu)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||u)&&(o.audio=s.audio||i.main.audioCodec||i.audio.audioCodec||Vu,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),!o.audio&&!o.video){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var l=function(x,k){return x?Ln(k):Wa(k)},c={},p;if(["video","audio"].forEach(function(S){if(o.hasOwnProperty(S)&&!l(i[S].isFmp4,o[S])){var x=i[S].isFmp4?"browser":"muxer";c[x]=c[x]||[],c[x].push(o[S]),S==="audio"&&(p=x)}}),u&&p&&this.media().attributes.AUDIO){var m=this.media().attributes.AUDIO;this.master().playlists.forEach(function(S){var x=S.attributes&&S.attributes.AUDIO;x===m&&S!==e.media()&&(S.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+p+' does not support codec(s): "'+o.audio+'"')}if(Object.keys(c).length){var _=Object.keys(c).reduce(function(S,x){return S&&(S+=", "),S+=x+' does not support codec(s): "'+c[x].join(",")+'"',S},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:_,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var b=[];if(["video","audio"].forEach(function(S){var x=(yt(e.sourceUpdater_.codecs[S]||"")[0]||{}).type,k=(yt(o[S]||"")[0]||{}).type;x&&k&&x.toLowerCase()!==k.toLowerCase()&&b.push('"'+e.sourceUpdater_.codecs[S]+'" -> "'+o[S]+'"')}),b.length){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+b.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return o},r.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}}},r.excludeUnsupportedVariants_=function(){var e=this,i=this.master().playlists,s=[];Object.keys(i).forEach(function(o){var u=i[o];if(s.indexOf(u.id)===-1){s.push(u.id);var l=Di(e.master,u),c=[];l.audio&&!Wa(l.audio)&&!Ln(l.audio)&&c.push("audio codec "+l.audio),l.video&&!Wa(l.video)&&!Ln(l.video)&&c.push("video codec "+l.video),l.text&&l.text==="stpp.ttml.im1t"&&c.push("text codec "+l.text),c.length&&(u.excludeUntil=1/0,e.logger_("excluding "+u.id+" for unsupported: "+c.join(", ")))}})},r.excludeIncompatibleVariants_=function(e){var i=this,s=[],o=this.master().playlists,u=ia(yt(e)),l=zl(u),c=u.video&&yt(u.video)[0]||null,p=u.audio&&yt(u.audio)[0]||null;Object.keys(o).forEach(function(m){var _=o[m];if(!(s.indexOf(_.id)!==-1||_.excludeUntil===1/0)){s.push(_.id);var b=[],S=Di(i.masterPlaylistLoader_.master,_),x=zl(S);if(!(!S.audio&&!S.video)){if(x!==l&&b.push('codec count "'+x+'" !== "'+l+'"'),!i.sourceUpdater_.canChangeType()){var k=S.video&&yt(S.video)[0]||null,L=S.audio&&yt(S.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&b.push('video codec "'+k.type+'" !== "'+c.type+'"'),L&&p&&L.type.toLowerCase()!==p.type.toLowerCase()&&b.push('audio codec "'+L.type+'" !== "'+p.type+'"')}b.length&&(_.excludeUntil=1/0,i.logger_("blacklisting "+_.id+": "+b.join(" && ")))}}})},r.updateAdCues_=function(e){var i=0,s=this.seekable();s.length&&(i=s.start(0)),tT(e,this.cueTagsTrack_,i)},r.goalBufferLength=function(){var e=this.tech_.currentTime(),i=we.GOAL_BUFFER_LENGTH,s=we.GOAL_BUFFER_LENGTH_RATE,o=Math.max(i,we.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*s,o)},r.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),i=we.BUFFER_LOW_WATER_LINE,s=we.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(i,we.MAX_BUFFER_LOW_WATER_LINE),u=Math.max(i,we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*s,this.experimentalBufferBasedABR?u:o)},r.bufferHighWaterLine=function(){return we.BUFFER_HIGH_WATER_LINE},t}(I.EventTarget),ST=function(t,r,n){return function(e){var i=t.master.playlists[r],s=No(i),o=Aa(i);return typeof e>"u"?o:(e?delete i.disabled:i.disabled=!0,e!==o&&!s&&(n(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},ET=function(t,r,n){var e=t.masterPlaylistController_,i=t.options_.smoothQualityChange,s=i?"smooth":"fast",o=e[s+"QualityChange_"].bind(e);if(r.attributes){var u=r.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=r.attributes.BANDWIDTH,this.frameRate=r.attributes["FRAME-RATE"]}this.codecs=Di(e.master(),r),this.playlist=r,this.id=n,this.enabled=ST(t.playlists,r.id,o)},CT=function(t){t.representations=function(){var r=t.masterPlaylistController_.master(),n=Ki(r)?t.masterPlaylistController_.getAudioTrackPlaylists_():r.playlists;return n?n.filter(function(e){return!No(e)}).map(function(e,i){return new ET(t,e,e.id)}):[]}},nd=["seeking","seeked","pause","playing","error"],AT=function(){function a(r){var n=this;this.masterPlaylistController_=r.masterPlaylistController,this.tech_=r.tech,this.seekable=r.seekable,this.allowSeeksWithinUnsafeLiveWindow=r.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=r.liveRangeSafeTimeDelta,this.media=r.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=mt("PlaybackWatcher"),this.logger_("initialize");var e=function(){return n.monitorCurrentTime_()},i=function(){return n.monitorCurrentTime_()},s=function(){return n.techWaiting_()},o=function(){return n.cancelTimer_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach(function(m){c[m]={reset:function(){return n.resetSegmentDownloads_(m)},updateend:function(){return n.checkSegmentDownloads_(m)}},u[m+"SegmentLoader_"].on("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].on("playlistupdate",c[m].reset),n.tech_.on(["seeked","seeking"],c[m].reset)});var p=function(_){["main","audio"].forEach(function(b){u[b+"SegmentLoader_"][_]("appended",n.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){n.fixesBadSeeks_()&&(n.consecutiveUpdates=0,n.lastRecordedTime=n.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=function(){return p("off")},this.watchForBadSeeking_=function(){n.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(nd,o),this.tech_.on("canplay",i),this.tech_.one("play",e),this.dispose=function(){n.clearSeekingAppendCheck_(),n.logger_("dispose"),n.tech_.off("waiting",s),n.tech_.off(nd,o),n.tech_.off("canplay",i),n.tech_.off("play",e),n.tech_.off("seeking",n.watchForBadSeeking_),n.tech_.off("seeked",n.clearSeekingAppendCheck_),l.forEach(function(m){u[m+"SegmentLoader_"].off("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].off("playlistupdate",c[m].reset),n.tech_.off(["seeked","seeking"],c[m].reset)}),n.checkCurrentTimeTimeout_&&A.clearTimeout(n.checkCurrentTimeTimeout_),n.cancelTimer_()}}var t=a.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=A.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(n){var e=this.masterPlaylistController_[n+"SegmentLoader_"];this[n+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+n+" loader"),this[n+"StalledDownloads_"]=0,this[n+"Buffered_"]=e.buffered_()},t.checkSegmentDownloads_=function(n){var e=this.masterPlaylistController_,i=e[n+"SegmentLoader_"],s=i.buffered_(),o=Ty(this[n+"Buffered_"],s);if(this[n+"Buffered_"]=s,o){this.resetSegmentDownloads_(n);return}this[n+"StalledDownloads_"]++,this.logger_("found #"+this[n+"StalledDownloads_"]+" "+n+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:lr(s)}),!(this[n+"StalledDownloads_"]<10)&&(this.logger_(n+" loader stalled download exclusion"),this.resetSegmentDownloads_(n),this.tech_.trigger({type:"usage",name:"vhs-"+n+"-download-exclusion"}),n!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+n+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var n=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===n&&(!e.length||n+bt>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&n===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):n===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=n)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var n=this.tech_.seeking();if(!n)return!1;var e=this.seekable(),i=this.tech_.currentTime(),s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(s){var u=e.end(e.length-1);o=u}if(this.beforeSeekableWindow_(e,i)){var l=e.start(0);o=l+(l===e.end(0)?0:bt)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+i+" with "+("seekable range "+vf(e)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,p=this.tech_.buffered(),m=c.audioBuffer?c.audioBuffered():null,_=c.videoBuffer?c.videoBuffered():null,b=this.media(),S=b.partTargetDuration?b.partTargetDuration:(b.targetDuration-Qt)*2,x=[m,_],k=0;k<x.length;k++)if(x[k]){var L=Ro(x[k],i);if(L<S)return!1}var H=kn(p,i);return H.length===0?!1:(o=H.start(0)+bt,this.logger_("Buffered region starts ("+H.start(0)+") "+(" just beyond seek point ("+i+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},t.waiting_=function(){if(!this.techWaiting_()){var n=this.tech_.currentTime(),e=this.tech_.buffered(),i=Fr(e,n);if(i.length&&n+3<=i.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(n),this.logger_("Stopped at "+n+" while inside a buffered region "+("["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var n=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(n,e)){var i=n.end(n.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to "+("live point (seekable end) "+i)),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var s=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:e});if(u)return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var l=kn(o,e);if(l.length>0){var c=l.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+c+", seeking "+("to "+l.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,e),!0}return!1},t.afterSeekableWindow_=function(n,e,i,s){if(s===void 0&&(s=!1),!n.length)return!1;var o=n.end(n.length-1)+bt,u=!i.endList;return u&&s&&(o=n.end(n.length-1)+i.targetDuration*3),e>o},t.beforeSeekableWindow_=function(n,e){return!!(n.length&&n.start(0)>0&&e<n.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(n){var e=n.videoBuffered,i=n.audioBuffered,s=n.currentTime;if(e){var o;if(e.length&&i.length){var u=Fr(e,s-3),l=Fr(e,s),c=Fr(i,s);c.length&&!l.length&&u.length&&(o={start:u.end(0),end:c.end(0)})}else{var p=kn(e,s);p.length||(o=this.gapFromVideoUnderflow_(e,s))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+s)),!0):!1}},t.skipTheGap_=function(n){var e=this.tech_.buffered(),i=this.tech_.currentTime(),s=kn(e,i);this.cancelTimer_(),!(s.length===0||i!==n)&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",n,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Qt),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(n,e){for(var i=vy(n),s=0;s<i.length;s++){var o=i.start(s),u=i.end(s);if(e-o<4&&e-o>2)return{start:o,end:u}}return null},a}(),DT={errorInterval:30,getSource:function(t){var r=this.tech({IWillNotUseThisInPlugins:!0}),n=r.currentSource_||this.currentSource();return t(n)}},wT=function a(t,r){var n=0,e=0,i=I.mergeOptions(DT,r);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){e&&t.currentTime(e)},o=function(m){m!=null&&(e=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(m),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<i.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){I.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),i.getSource.call(t,o)},l=function p(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",p)},c=function(m){l(),a(t,m)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},kT=function(t){wT(this,t)},th="2.16.0",PT="6.0.1",IT="0.22.1",LT="4.8.0",OT="3.1.3",Fe={PlaylistLoader:Rr,Playlist:Qe,utils:Wy,STANDARD_PLAYLIST_SELECTOR:Kl,INITIAL_PLAYLIST_SELECTOR:I_,lastBandwidthSelector:Kl,movingAverageBandwidthSelector:k_,comparePlaylistBandwidth:Ho,comparePlaylistResolution:w_,xhr:Lf()};Object.keys(we).forEach(function(a){Object.defineProperty(Fe,a,{get:function(){return I.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),we[a]},set:function(r){if(I.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),typeof r!="number"||r<0){I.log.warn("value of Vhs."+a+" must be greater than or equal to 0");return}we[a]=r}})});var rh="videojs-vhs",ih=function(t,r){for(var n=r.media(),e=-1,i=0;i<t.length;i++)if(t[i].id===n.id){e=i;break}t.selectedIndex_=e,t.trigger({selectedIndex:e,type:"change"})},FT=function(t,r){r.representations().forEach(function(n){t.addQualityLevel(n)}),ih(t,r.playlists)};Fe.canPlaySource=function(){return I.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var RT=function(t,r,n){if(!t)return t;var e={};r&&r.attributes&&r.attributes.CODECS&&(e=ia(yt(r.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(e.audio=n.attributes.CODECS);var i=wi(e.video),s=wi(e.audio),o={};for(var u in t)o[u]={},s&&(o[u].audioContentType=s),i&&(o[u].videoContentType=i),r.contentProtection&&r.contentProtection[u]&&r.contentProtection[u].pssh&&(o[u].pssh=r.contentProtection[u].pssh),typeof t[u]=="string"&&(o[u].url=t[u]);return I.mergeOptions(t,o)},MT=function(t,r){return t.reduce(function(n,e){if(!e.contentProtection)return n;var i=r.reduce(function(s,o){var u=e.contentProtection[o];return u&&u.pssh&&(s[o]={pssh:u.pssh}),s},{});return Object.keys(i).length&&n.push(i),n},[])},NT=function(t){var r=t.player,n=t.sourceKeySystems,e=t.audioMedia,i=t.mainPlaylists;if(!r.eme.initializeMediaKeys)return Promise.resolve();var s=e?i.concat([e]):i,o=MT(s,Object.keys(n)),u=[],l=[];return o.forEach(function(c){l.push(new Promise(function(p,m){r.tech_.one("keysessioncreated",p)})),u.push(new Promise(function(p,m){r.eme.initializeMediaKeys({keySystems:c},function(_){if(_){m(_);return}p()})}))}),Promise.race([Promise.all(u),Promise.race(l)])},BT=function(t){var r=t.player,n=t.sourceKeySystems,e=t.media,i=t.audioMedia,s=RT(n,e,i);return s?(r.currentSource().keySystems=s,s&&!r.eme?(I.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},nh=function(){if(!A.localStorage)return null;var t=A.localStorage.getItem(rh);if(!t)return null;try{return JSON.parse(t)}catch{return null}},UT=function(t){if(!A.localStorage)return!1;var r=nh();r=r?I.mergeOptions(r,t):t;try{A.localStorage.setItem(rh,JSON.stringify(r))}catch{return!1}return r},VT=function(t){return t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t};Fe.supportsNativeHls=function(){if(!W||!W.createElement)return!1;var a=W.createElement("video");if(!I.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(r){return/maybe|probably/i.test(a.canPlayType(r))})}();Fe.supportsNativeDash=function(){return!W||!W.createElement||!I.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(W.createElement("video").canPlayType("application/dash+xml"))}();Fe.supportsTypeNatively=function(a){return a==="hls"?Fe.supportsNativeHls:a==="dash"?Fe.supportsNativeDash:!1};Fe.isSupported=function(){return I.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var HT=I.getComponent("Component"),jo=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(s=a.call(this,e,I.mergeOptions(i.hls,i.vhs))||this,i.hls&&Object.keys(i.hls).length&&I.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof i.initialBandwidth=="number"&&(s.options_.bandwidth=i.initialBandwidth),s.logger_=mt("VhsHandler"),e.options_&&e.options_.playerId){var o=I(e.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return I.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"hls-player-access"}),ee(s)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return I.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"vhs-player-access"}),ee(s)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return I.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),ee(s)},configurable:!0}),s.player_=o}if(s.tech_=e,s.source_=n,s.stats={},s.ignoreNextSeekingEvent_=!1,s.setOptions_(),s.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);else if(s.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return s.on(W,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(u){var l=W.fullscreenElement||W.webkitFullscreenElement||W.mozFullScreenElement||W.msFullscreenElement;l&&l.contains(s.tech_.el())?s.masterPlaylistController_.fastQualityChange_():s.masterPlaylistController_.checkABR_()}),s.on(s.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),s.on(s.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),s.on(s.tech_,"play",s.play),s}var r=t.prototype;return r.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var i=nh();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=we.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===we.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(s){typeof e.source_[s]<"u"&&(e.options_[s]=e.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},r.src=function(e,i){var s=this;if(e){this.setOptions_(),this.options_.src=VT(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Fe,this.options_.sourceType=Td(i),this.options_.seekTo=function(l){s.tech_.setCurrentTime(l)},this.options_.smoothQualityChange&&I.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new xT(this.options_);var o=I.mergeOptions({liveRangeSafeTimeDelta:bt},this.options_,{seekable:function(){return s.seekable()},media:function(){return s.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new AT(o),this.masterPlaylistController_.on("error",function(){var l=I.players[s.tech_.options_.playerId],c=s.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),l.error(c)});var u=this.options_.experimentalBufferBasedABR?Fe.movingAverageBandwidthSelector(.55):Fe.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):u.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Fe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,p=A.navigator.connection||A.navigator.mozConnection||A.navigator.webkitConnection,m=1e7;if(this.options_.useNetworkInformationApi&&p){var _=p.downlink*1e3*1e3;_>=m&&c>=m?c=Math.max(c,_):c=_}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),p;this.throughput>0?p=1/this.throughput:p=0;var m=Math.floor(1/(c+p));return m},set:function(){I.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return s.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return s.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return s.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return s.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return s.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return s.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return s.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return s.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return s.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return s.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return s.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return lr(s.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return s.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return s.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return s.tech_.name_},enumerable:!0},duration:{get:function(){return s.tech_.duration()},enumerable:!0},master:{get:function(){return s.playlists.master},enumerable:!0},playerDimensions:{get:function(){return s.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return lr(s.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return s.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){s.options_.useBandwidthFromLocalStorage&&UT({bandwidth:s.bandwidth,throughput:Math.round(s.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){CT(s)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){s.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),NT({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(s){e.logger_("error while creating EME key session",s),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,s=BT({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var u=e.masterPlaylistController_.master();if(!(!u||!u.playlists)){var l=[];if(u.playlists.forEach(function(p){p&&p.attributes&&p.attributes.RESOLUTION&&p.attributes.RESOLUTION.height>=720&&(!p.excludeUntil||p.excludeUntil<1/0)&&(p.excludeUntil=1/0,l.push(p))}),l.length){var c;(c=I.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(l)),e.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),I.browser.IE_VERSION===11||!s){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},r.setupQualityLevels_=function(){var e=this,i=I.players[this.tech_.options_.playerId];!i||!i.qualityLevels||this.qualityLevels_||(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){FT(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){ih(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":th,"mux.js":PT,"mpd-parser":IT,"m3u8-parser":LT,"aes-decrypter":OT}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return eh.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.URL.revokeObjectURL&&(A.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),a.prototype.dispose.call(this)},r.convertToProgramTime=function(e,i){return Qy({playlist:this.masterPlaylistController_.media(),time:e,callback:i})},r.seekToProgramTime=function(e,i,s,o){return s===void 0&&(s=!0),o===void 0&&(o=2),Jy({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})},t}(HT),Ni={name:"videojs-http-streaming",VERSION:th,canHandleSource:function(t,r){r===void 0&&(r={});var n=I.mergeOptions(I.options,r);return Ni.canPlayType(t.type,n)},handleSource:function(t,r,n){n===void 0&&(n={});var e=I.mergeOptions(I.options,n);return r.vhs=new jo(t,r,e),I.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return I.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),r.vhs},configurable:!0}),r.vhs.xhr=Lf(),r.vhs.src(t.src,t.type),r.vhs},canPlayType:function(t,r){var n=Td(t);if(!n)return"";var e=Ni.getOverrideNative(r),i=Fe.supportsTypeNatively(n),s=!i||e;return s?"maybe":""},getOverrideNative:function(t){t===void 0&&(t={});var r=t,n=r.vhs,e=n===void 0?{}:n,i=r.hls,s=i===void 0?{}:i,o=!(I.browser.IS_ANY_SAFARI||I.browser.IS_IOS),u=e.overrideNative,l=u===void 0?o:u,c=s.overrideNative,p=c===void 0?!1:c;return p||l}},qT=function(){return Ln("avc1.4d400d,mp4a.40.2")};qT()&&I.getTech("Html5").registerSourceHandler(Ni,0);I.VhsHandler=jo;Object.defineProperty(I,"HlsHandler",{get:function(){return I.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),jo},configurable:!0});I.VhsSourceHandler=Ni;Object.defineProperty(I,"HlsSourceHandler",{get:function(){return I.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ni},configurable:!0});I.Vhs=Fe;Object.defineProperty(I,"Hls",{get:function(){return I.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Fe},configurable:!0});I.use||(I.registerComponent("Hls",Fe),I.registerComponent("Vhs",Fe));I.options.vhs=I.options.vhs||{};I.options.hls=I.options.hls||{};if(!I.getPlugin||!I.getPlugin("reloadSourceOnError")){var jT=I.registerPlugin||I.plugin;jT("reloadSourceOnError",kT)}const WT=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"})),GT=Re.getAugmentedNamespace(WT);(function(a,t){(function(r,n){{var e=GT;a.exports=n(e.default||e)}})(Re.commonjsGlobal,function(r){var n=r.browser.IS_IOS||r.browser.IS_NATIVE_ANDROID,e=r.getTech("Tech");class i extends e{constructor(c,p){super(c,p),this.setPoster(c.poster),this.setSrc(this.options_.source,!0),this.setTimeout((function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",n&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),i.isApiReady?this.initYTPlayer():i.apiReadyQueue.push(this))}).bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var c=i.apiReadyQueue.indexOf(this);c!==-1&&i.apiReadyQueue.splice(c,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.parentNode.removeChild(this.el_),e.prototype.dispose.call(this)}createEl(){var c=document.createElement("div");c.setAttribute("id",this.options_.techId),c.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),c.setAttribute("class","vjs-tech");var p=document.createElement("div");if(p.appendChild(c),!n&&!this.options_.ytControls){var m=document.createElement("div");m.setAttribute("class","vjs-iframe-blocker"),m.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),m.onclick=(function(){this.pause()}).bind(this),p.appendChild(m)}return p}initYTPlayer(){var c={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(typeof this.options_.autohide<"u"&&(c.autohide=this.options_.autohide),typeof this.options_.cc_load_policy<"u"&&(c.cc_load_policy=this.options_.cc_load_policy),typeof this.options_.ytControls<"u"&&(c.controls=this.options_.ytControls),typeof this.options_.disablekb<"u"&&(c.disablekb=this.options_.disablekb),typeof this.options_.color<"u"&&(c.color=this.options_.color),c.controls?typeof this.options_.fs<"u"&&(c.fs=this.options_.fs):c.fs=0,this.options_.source.src.indexOf("end=")!==-1){var p=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(p[1])}if(typeof this.options_.end<"u"&&(c.end=this.options_.end),typeof this.options_.hl<"u"?c.hl=this.options_.hl:typeof this.options_.language<"u"&&(c.hl=this.options_.language.substr(0,2)),typeof this.options_.iv_load_policy<"u"&&(c.iv_load_policy=this.options_.iv_load_policy),typeof this.options_.list<"u"?c.list=this.options_.list:this.url&&typeof this.url.listId<"u"&&(c.list=this.url.listId),typeof this.options_.listType<"u"&&(c.listType=this.options_.listType),typeof this.options_.modestbranding<"u"&&(c.modestbranding=this.options_.modestbranding),typeof this.options_.playlist<"u"&&(c.playlist=this.options_.playlist),typeof this.options_.playsinline<"u"&&(c.playsinline=this.options_.playsinline),typeof this.options_.rel<"u"&&(c.rel=this.options_.rel),typeof this.options_.showinfo<"u"&&(c.showinfo=this.options_.showinfo),this.options_.source.src.indexOf("start=")!==-1){var m=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(m[1])}if(typeof this.options_.start<"u"&&(c.start=this.options_.start),typeof this.options_.theme<"u"&&(c.theme=this.options_.theme),typeof this.options_.customVars<"u"){var _=this.options_.customVars;Object.keys(_).forEach(function(S){c[S]=_[S]})}this.activeVideoId=this.url?this.url.videoId:null,this.activeList=c.list;var b={videoId:this.activeVideoId,playerVars:c,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};typeof this.options_.enablePrivacyEnhancedMode<"u"&&this.options_.enablePrivacyEnhancedMode&&(b.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,b)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute();var c=this.ytPlayer.getAvailablePlaybackRates();c.length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(c){var p=c.data;if(!(p===this.lastState||this.errorNumber))switch(this.lastState=p,p){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting");break}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(c){this.errorNumber=c.data,this.trigger("pause"),this.trigger("error")}error(){var c=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:c,message:"Error while trying to play the video"};case 2:case 100:return{code:c,message:"Unable to find the video"};case 101:case 150:return{code:c,message:"Playback on other Websites has been disabled by the video owner."}}return{code:c,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(c){var p={videoId:c};this.options_.start&&(p.startSeconds=this.options_.start),this.options_.end&&(p.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(p)}cueVideoById_(c){var p={videoId:c};this.options_.start&&(p.startSeconds=this.options_.start),this.options_.end&&(p.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(p)}src(c){return c&&this.setSrc({src:c}),this.source}poster(){return n?null:this.poster_}setPoster(c){this.poster_=c}setSrc(c){!c||!c.src||(delete this.errorNumber,this.source=c,this.url=i.parseUrl(c.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!n?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(c){this.options_.autoplay=c}loop(){return this.options_.loop}setLoop(c){this.options_.loop=c}play(){!this.url||!this.url.videoId||(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:!0}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(c){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(c,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==c&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval((function(){this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking?clearInterval(this.checkSeekedInPauseInterval):this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked())}).bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?r.createTimeRange(0,this.ytPlayer.getDuration()):r.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(c){this.ytPlayer&&this.ytPlayer.setPlaybackRate(c)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:!1}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(c){this.ytPlayer&&this.ytPlayer.setVolume(c*100)}muted(){return this.ytPlayer?this.ytPlayer.isMuted():!1}setMuted(c){if(this.ytPlayer)this.muted(!0);else return;c?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50)}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return r.createTimeRange();var c=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return r.createTimeRange(0,c)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var c="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var p=new Image;p.onload=(function(){if("naturalHeight"in p){if(p.naturalHeight<=90||p.naturalWidth<=120)return}else if(p.height<=90||p.width<=120)return;this.poster_=c,this.trigger("posterchange")}).bind(this),p.onerror=function(){},p.src=c}catch{}}}i.isSupported=function(){return!0},i.canPlaySource=function(l){return i.canPlayType(l.type)},i.canPlayType=function(l){return l==="video/youtube"},i.parseUrl=function(l){var c={videoId:null},p=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,m=l.match(p);m&&m[2].length===11&&(c.videoId=m[2]);var _=/[?&]list=([^#\&\?]+)/;return m=l.match(_),m&&m[1]&&(c.listId=m[1]),c};function s(){YT.ready(function(){i.isApiReady=!0;for(var l=0;l<i.apiReadyQueue.length;++l)i.apiReadyQueue[l].initYTPlayer()})}function o(l,c){var p=!1,m=document.createElement("script"),_=document.getElementsByTagName("script")[0];_&&(_.parentNode.insertBefore(m,_),m.onload=function(){p||(p=!0,c())},m.onreadystatechange=function(){!p&&(this.readyState==="complete"||this.readyState==="loaded")&&(p=!0,c())},m.src=l)}function u(){var l=".vjs-youtube .vjs-iframe-blocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }.vjs-youtube .vjs-poster { background-size: cover; }.vjs-youtube-mobile .vjs-big-play-button { display: none; }",c=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css",p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l)),c.appendChild(p)}i.apiReadyQueue=[],typeof document<"u"&&(o("https://www.youtube.com/iframe_api",s),u()),typeof r.registerTech<"u"?r.registerTech("Youtube",i):r.registerComponent("Youtube",i)})})(Bp);const zT=I,$T=Pr.forwardRef(({src:a,poster:t,youtube:r},n)=>{const e=Pr.useRef(null),i=Pr.useRef();return Pr.useImperativeHandle(n,()=>({get player(){return i.current}}),[i]),Pr.useEffect(()=>(e.current&&(i.current=zT(e.current,{autoplay:!1,controls:!0,preload:"auto",bigPlayButton:!1,poster:t==null?void 0:t.src,controlBar:{descriptionsButton:!1,playbackRateMenuButton:!1,chaptersButton:!1,audioTrackButton:!1,pictureInPictureToggle:!1,subsCapsButton:!1,seekToLive:!1,liveDisplay:!1},errorDisplay:!1,textTrackSettings:!1,resizeManager:!1,sources:[{type:r?"video/youtube":void 0,src:a}],dataSetup:{techOrder:["youtube"]},liveTracker:!1})),()=>{i.current&&i.current.dispose()}),[t==null?void 0:t.src,a,r]),Ir.jsx("div",{className:"ilo--videoplayer",children:Ir.jsx("video",{ref:e,className:"ilo--video--element"})})}),KT=Pr.forwardRef(({className:a,caption:t,...r},n)=>{const{prefix:e}=Np.useGlobalSettings(),i=`${e}--video`,s=Re.classNames(a,{[i]:!0}),o=Re.classNames("",{[`${i}--caption`]:!0});return Ir.jsxs("figure",{className:s,children:[Ir.jsx("div",{className:`${s}--wrapper`,children:r&&Ir.jsx($T,{...r,ref:n})}),t&&Ir.jsx("figcaption",{className:o,children:t})]})});exports.Video=KT;
|
|
66
|
+
`.split("").map(function(a){return a.charCodeAt(0)})),J_=function(a){G._inheritsLoose(t,a);function t(){return a.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return t}(ys(Error)),Z_=function(a){G._inheritsLoose(t,a);function t(n,e){var i;return e===void 0&&(e={}),i=a.call(this,n,e)||this,i.mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=n.featuresNativeTextTracks,i.loadVttJs=n.loadVttJs,i.shouldSaveSegmentTimingInfo_=!1,i}var r=t.prototype;return r.createTransmuxer_=function(){return null},r.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return I.createTimeRanges();var e=this.subtitlesTrack_.cues,i=e[0].startTime,s=e[e.length-1].startTime;return I.createTimeRanges([[i,s]])},r.initSegmentForMap=function(e,i){if(i===void 0&&(i=!1),!e)return null;var s=ta(e),o=this.initSegments_[s];if(i&&!o&&e.bytes){var u=td.byteLength+e.bytes.byteLength,l=new Uint8Array(u);l.set(e.bytes),l.set(td,e.bytes.byteLength),this.initSegments_[s]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:l}}return o||e},r.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.track=function(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},r.remove=function(e,i){Si(e,i,this.subtitlesTrack_)},r.fillBuffer_=function(){var e=this,i=this.chooseNextRequest_();if(i){if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null){var s=function(){e.state="READY",e.paused()||e.monitorBuffer_()};this.syncController_.one("timestampoffset",s),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(i)}},r.timestampOffsetForSegment_=function(){return null},r.chooseNextRequest_=function(){return this.skipEmptySegments_(a.prototype.chooseNextRequest_.call(this))},r.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},r.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(e,i,s){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===xt.TIMEOUT&&this.handleTimeout_(),e.code===xt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var u=this.pendingSegment_;this.saveBandwidthRelatedStats_(u.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");var l=u.segment;if(l.map&&(l.map.bytes=i.map.bytes),u.bytes=i.bytes,typeof A.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(e,i,s)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}l.requested=!0;try{this.parseVTTCues_(u)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(u,this.syncController_.timelines[u.timeline],this.playlist_),u.cues.length?u.timingInfo={start:u.cues[0].startTime,end:u.cues[u.cues.length-1].endTime}:u.timingInfo={start:u.startOfSegment,end:u.startOfSegment+u.duration},u.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}u.byteLength=u.bytes.byteLength,this.mediaSecondsLoaded+=l.duration,u.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new A.VTTCue(c.startTime,c.endTime,c.text):c)}),B_(this.subtitlesTrack_),this.handleAppendsDone_()},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(e){var i,s=!1;if(typeof A.WebVTT!="function")throw new J_;typeof A.TextDecoder=="function"?i=new A.TextDecoder("utf8"):(i=A.WebVTT.StringDecoder(),s=!0);var o=new A.WebVTT.Parser(A,A.vttjs,i);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=e.cues.push.bind(e.cues),o.ontimestampmap=function(c){e.timestampmap=c},o.onparsingerror=function(c){I.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){var u=e.segment.map.bytes;s&&(u=ed(u)),o.parse(u)}var l=e.bytes;s&&(l=ed(l)),o.parse(l),o.flush()},r.updateTimeMapping_=function(e,i,s){var o=e.segment;if(i){if(!e.cues.length){o.empty=!0;return}var u=e.timestampmap,l=u.MPEGTS/jn.ONE_SECOND_IN_TS-u.LOCAL+i.mapping;if(e.cues.forEach(function(m){m.startTime+=l,m.endTime+=l}),!s.syncInfo){var c=e.cues[0].startTime,p=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(c,p-o.duration)}}}},t}(Ms),eT=function(t,r){for(var n=t.cues,e=0;e<n.length;e++){var i=n[e];if(r>=i.adStartTime&&r<=i.adEndTime)return i}return null},tT=function(t,r,n){if(n===void 0&&(n=0),!!t.segments)for(var e=n,i,s=0;s<t.segments.length;s++){var o=t.segments[s];if(i||(i=eT(r,e+o.duration/2)),i){if("cueIn"in o){i.endTime=e,i.adEndTime=e,e+=o.duration,i=null;continue}if(e<i.endTime){e+=o.duration;continue}i.endTime+=o.duration}else if("cueOut"in o&&(i=new A.VTTCue(e,e+o.duration,o.cueOut),i.adStartTime=e,i.adEndTime=e+parseFloat(o.cueOut),r.addCue(i)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];i=new A.VTTCue(e,e+o.duration,""),i.adStartTime=e-l,i.adEndTime=i.adStartTime+c,r.addCue(i)}e+=o.duration}},rT=86400,rd=[{name:"VOD",run:function(t,r,n,e,i){if(n!==1/0){var s={time:0,segmentIndex:0,partIndex:null};return s}return null}},{name:"ProgramDateTime",run:function(t,r,n,e,i){if(!Object.keys(t.timelineToDatetimeMappings).length)return null;var s=null,o=null,u=ws(r);i=i||0;for(var l=0;l<u.length;l++){var c=r.endList||i===0?l:u.length-(l+1),p=u[c],m=p.segment,_=t.timelineToDatetimeMappings[m.timeline];if(!(!_||!m.dateTimeObject)){var b=m.dateTimeObject.getTime()/1e3,S=b+_;if(m.parts&&typeof p.partIndex=="number")for(var x=0;x<p.partIndex;x++)S+=m.parts[x].duration;var k=Math.abs(i-S);if(o!==null&&(k===0||o<k))break;o=k,s={time:S,segmentIndex:p.segmentIndex,partIndex:p.partIndex}}}return s}},{name:"Segment",run:function(t,r,n,e,i){var s=null,o=null;i=i||0;for(var u=ws(r),l=0;l<u.length;l++){var c=r.endList||i===0?l:u.length-(l+1),p=u[c],m=p.segment,_=p.part&&p.part.start||m&&m.start;if(m.timeline===e&&typeof _<"u"){var b=Math.abs(i-_);if(o!==null&&o<b)break;(!s||o===null||o>=b)&&(o=b,s={time:_,segmentIndex:p.segmentIndex,partIndex:p.partIndex})}}return s}},{name:"Discontinuity",run:function(t,r,n,e,i){var s=null;if(i=i||0,r.discontinuityStarts&&r.discontinuityStarts.length)for(var o=null,u=0;u<r.discontinuityStarts.length;u++){var l=r.discontinuityStarts[u],c=r.discontinuitySequence+u+1,p=t.discontinuities[c];if(p){var m=Math.abs(i-p.time);if(o!==null&&o<m)break;(!s||o===null||o>=m)&&(o=m,s={time:p.time,segmentIndex:l,partIndex:null})}}return s}},{name:"Playlist",run:function(t,r,n,e,i){if(r.syncInfo){var s={time:r.syncInfo.time,segmentIndex:r.syncInfo.mediaSequence-r.mediaSequence,partIndex:null};return s}return null}}],iT=function(a){G._inheritsLoose(t,a);function t(n){var e;return e=a.call(this)||this,e.timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=mt("SyncController"),e}var r=t.prototype;return r.getSyncPoint=function(e,i,s,o){var u=this.runStrategies_(e,i,s,o);return u.length?this.selectSyncPoint_(u,{key:"time",value:o}):null},r.getExpiredTime=function(e,i){if(!e||!e.segments)return null;var s=this.runStrategies_(e,i,e.discontinuitySequence,0);if(!s.length)return null;var o=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Ai({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},r.runStrategies_=function(e,i,s,o){for(var u=[],l=0;l<rd.length;l++){var c=rd[l],p=c.run(this,e,i,s,o);p&&(p.strategy=c.name,u.push({strategy:c.name,syncPoint:p}))}return u},r.selectSyncPoint_=function(e,i){for(var s=e[0].syncPoint,o=Math.abs(e[0].syncPoint[i.key]-i.value),u=e[0].strategy,l=1;l<e.length;l++){var c=Math.abs(e[l].syncPoint[i.key]-i.value);c<o&&(o=c,s=e[l].syncPoint,u=e[l].strategy)}return this.logger_("syncPoint for ["+i.key+": "+i.value+"] chosen with strategy"+(" ["+u+"]: [time:"+s.time+",")+(" segmentIndex:"+s.segmentIndex)+(typeof s.partIndex=="number"?",partIndex:"+s.partIndex:"")+"]"),s},r.saveExpiredSegmentInfo=function(e,i){var s=i.mediaSequence-e.mediaSequence;if(s>rT){I.log.warn("Not saving expired segment info. Media sequence gap "+s+" is too large.");return}for(var o=s-1;o>=0;o--){var u=e.segments[o];if(u&&typeof u.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+o,time:u.start},this.logger_("playlist refresh sync: [time:"+i.syncInfo.time+","+(" mediaSequence: "+i.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var i=e.segments[0],s=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-s}},r.saveSegmentTimingInfo=function(e){var i=e.segmentInfo,s=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(i,i.timingInfo,s),u=i.segment;o&&(this.saveDiscontinuitySyncInfo_(i),i.playlist.syncInfo||(i.playlist.syncInfo={mediaSequence:i.playlist.mediaSequence+i.mediaIndex,time:u.start}));var l=u.dateTimeObject;u.discontinuity&&s&&l&&(this.timelineToDatetimeMappings[u.timeline]=-(l.getTime()/1e3))},r.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},r.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,i,s){var o=e.segment,u=e.part,l=this.timelines[e.timeline],c,p;if(typeof e.timestampOffset=="number")l={time:e.startOfSegment,mapping:e.startOfSegment-i.start},s&&(this.timelines[e.timeline]=l,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+l.time+"] [mapping: "+l.mapping+"]"))),c=e.startOfSegment,p=i.end+l.mapping;else if(l)c=i.start+l.mapping,p=i.end+l.mapping;else return!1;return u&&(u.start=c,u.end=p),(!o.start||c<o.start)&&(o.start=c),o.end=p,!0},r.saveDiscontinuitySyncInfo_=function(e){var i=e.playlist,s=e.segment;if(s.discontinuity)this.discontinuities[s.timeline]={time:s.start,accuracy:0};else if(i.discontinuityStarts&&i.discontinuityStarts.length)for(var o=0;o<i.discontinuityStarts.length;o++){var u=i.discontinuityStarts[o],l=i.discontinuitySequence+o+1,c=u-e.mediaIndex,p=Math.abs(c);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>p){var m=void 0;c<0?m=s.start-Ai({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:u}):m=s.end+Ai({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:u}),this.discontinuities[l]={time:m,accuracy:p}}}},r.dispose=function(){this.trigger("dispose"),this.off()},t}(I.EventTarget),nT=function(a){G._inheritsLoose(t,a);function t(){var n;return n=a.call(this)||this,n.pendingTimelineChanges_={},n.lastTimelineChanges_={},n}var r=t.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[i]={type:i,from:s,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[i]},r.lastTimelineChange=function(e){var i=e.type,s=e.from,o=e.to;return typeof s=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[i]={type:i,from:s,to:o},delete this.pendingTimelineChanges_[i],this.trigger("timelinechange")),this.lastTimelineChanges_[i]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(I.EventTarget),aT=Vf(Hf(function(){var a=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t(O,F,q){return q={path:F,exports:{},require:function(R,U){return r(R,U??q.path)}},O(q,q.exports),q.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var n=t(function(O){function F(B,R){for(var U=0;U<R.length;U++){var N=R[U];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(B,N.key,N)}}function q(B,R,U){return R&&F(B.prototype,R),U&&F(B,U),B}O.exports=q,O.exports.default=O.exports,O.exports.__esModule=!0}),e=t(function(O){function F(q,B){return O.exports=F=Object.setPrototypeOf||function(U,N){return U.__proto__=N,U},O.exports.default=O.exports,O.exports.__esModule=!0,F(q,B)}O.exports=F,O.exports.default=O.exports,O.exports.__esModule=!0}),i=t(function(O){function F(q,B){q.prototype=Object.create(B.prototype),q.prototype.constructor=q,e(q,B)}O.exports=F,O.exports.default=O.exports,O.exports.__esModule=!0}),s=function(){function O(){this.listeners={}}var F=O.prototype;return F.on=function(B,R){this.listeners[B]||(this.listeners[B]=[]),this.listeners[B].push(R)},F.off=function(B,R){if(!this.listeners[B])return!1;var U=this.listeners[B].indexOf(R);return this.listeners[B]=this.listeners[B].slice(0),this.listeners[B].splice(U,1),U>-1},F.trigger=function(B){var R=this.listeners[B];if(R)if(arguments.length===2)for(var U=R.length,N=0;N<U;++N)R[N].call(this,arguments[1]);else for(var X=Array.prototype.slice.call(arguments,1),$=R.length,J=0;J<$;++J)R[J].apply(this,X)},F.dispose=function(){this.listeners={}},F.pipe=function(B){this.on("data",function(R){B.push(R)})},O}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o(O){return O.subarray(0,O.byteLength-O[O.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var u=function(){var F=[[[],[],[],[],[]],[[],[],[],[],[]]],q=F[0],B=F[1],R=q[4],U=B[4],N,X,$,J=[],oe=[],fe,re,ae,pe,Me,ue;for(N=0;N<256;N++)oe[(J[N]=N<<1^(N>>7)*283)^N]=N;for(X=$=0;!R[X];X^=fe||1,$=oe[$]||1)for(pe=$^$<<1^$<<2^$<<3^$<<4,pe=pe>>8^pe&255^99,R[X]=pe,U[pe]=X,ae=J[re=J[fe=J[X]]],ue=ae*16843009^re*65537^fe*257^X*16843008,Me=J[pe]*257^pe*16843008,N=0;N<4;N++)q[N][X]=Me=Me<<24^Me>>>8,B[N][pe]=ue=ue<<24^ue>>>8;for(N=0;N<5;N++)q[N]=q[N].slice(0),B[N]=B[N].slice(0);return F},l=null,c=function(){function O(q){l||(l=u()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var B,R,U,N=this._tables[0][4],X=this._tables[1],$=q.length,J=1;if($!==4&&$!==6&&$!==8)throw new Error("Invalid aes key size");var oe=q.slice(0),fe=[];for(this._key=[oe,fe],B=$;B<4*$+28;B++)U=oe[B-1],(B%$===0||$===8&&B%$===4)&&(U=N[U>>>24]<<24^N[U>>16&255]<<16^N[U>>8&255]<<8^N[U&255],B%$===0&&(U=U<<8^U>>>24^J<<24,J=J<<1^(J>>7)*283)),oe[B]=oe[B-$]^U;for(R=0;B;R++,B--)U=oe[R&3?B:B-4],B<=4||R<4?fe[R]=U:fe[R]=X[0][N[U>>>24]]^X[1][N[U>>16&255]]^X[2][N[U>>8&255]]^X[3][N[U&255]]}var F=O.prototype;return F.decrypt=function(B,R,U,N,X,$){var J=this._key[1],oe=B^J[0],fe=N^J[1],re=U^J[2],ae=R^J[3],pe,Me,ue,Yi=J.length/4-2,at,Dt=4,zt=this._tables[1],Zt=zt[0],gt=zt[1],yr=zt[2],_r=zt[3],Tr=zt[4];for(at=0;at<Yi;at++)pe=Zt[oe>>>24]^gt[fe>>16&255]^yr[re>>8&255]^_r[ae&255]^J[Dt],Me=Zt[fe>>>24]^gt[re>>16&255]^yr[ae>>8&255]^_r[oe&255]^J[Dt+1],ue=Zt[re>>>24]^gt[ae>>16&255]^yr[oe>>8&255]^_r[fe&255]^J[Dt+2],ae=Zt[ae>>>24]^gt[oe>>16&255]^yr[fe>>8&255]^_r[re&255]^J[Dt+3],Dt+=4,oe=pe,fe=Me,re=ue;for(at=0;at<4;at++)X[(3&-at)+$]=Tr[oe>>>24]<<24^Tr[fe>>16&255]<<16^Tr[re>>8&255]<<8^Tr[ae&255]^J[Dt++],pe=oe,oe=fe,fe=re,re=ae,ae=pe},O}(),p=function(O){i(F,O);function F(){var B;return B=O.call(this,s)||this,B.jobs=[],B.delay=1,B.timeout_=null,B}var q=F.prototype;return q.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},q.push=function(R){this.jobs.push(R),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},F}(s),m=function(F){return F<<24|(F&65280)<<8|(F&16711680)>>8|F>>>24},_=function(F,q,B){var R=new Int32Array(F.buffer,F.byteOffset,F.byteLength>>2),U=new c(Array.prototype.slice.call(q)),N=new Uint8Array(F.byteLength),X=new Int32Array(N.buffer),$,J,oe,fe,re,ae,pe,Me,ue;for($=B[0],J=B[1],oe=B[2],fe=B[3],ue=0;ue<R.length;ue+=4)re=m(R[ue]),ae=m(R[ue+1]),pe=m(R[ue+2]),Me=m(R[ue+3]),U.decrypt(re,ae,pe,Me,X,ue),X[ue]=m(X[ue]^$),X[ue+1]=m(X[ue+1]^J),X[ue+2]=m(X[ue+2]^oe),X[ue+3]=m(X[ue+3]^fe),$=re,J=ae,oe=pe,fe=Me;return N},b=function(){function O(q,B,R,U){var N=O.STEP,X=new Int32Array(q.buffer),$=new Uint8Array(q.byteLength),J=0;for(this.asyncStream_=new p,this.asyncStream_.push(this.decryptChunk_(X.subarray(J,J+N),B,R,$)),J=N;J<X.length;J+=N)R=new Uint32Array([m(X[J-4]),m(X[J-3]),m(X[J-2]),m(X[J-1])]),this.asyncStream_.push(this.decryptChunk_(X.subarray(J,J+N),B,R,$));this.asyncStream_.push(function(){U(null,o($))})}var F=O.prototype;return F.decryptChunk_=function(B,R,U,N){return function(){var X=_(B,R,U);N.set(X,B.byteOffset)}},n(O,null,[{key:"STEP",get:function(){return 32e3}}]),O}(),S;typeof window<"u"?S=window:typeof a<"u"?S=a:typeof self<"u"?S=self:S={};var x=S,k=function(F){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(F):F&&F.buffer instanceof ArrayBuffer},L=x.BigInt||Number;L("0x1"),L("0x100"),L("0x10000"),L("0x1000000"),L("0x100000000"),L("0x10000000000"),L("0x1000000000000"),L("0x100000000000000"),L("0x10000000000000000");var H=function(F){var q={};return Object.keys(F).forEach(function(B){var R=F[B];k(R)?q[B]={bytes:R.buffer,byteOffset:R.byteOffset,byteLength:R.byteLength}:q[B]=R}),q};self.onmessage=function(O){var F=O.data,q=new Uint8Array(F.encrypted.bytes,F.encrypted.byteOffset,F.encrypted.byteLength),B=new Uint32Array(F.key.bytes,F.key.byteOffset,F.key.byteLength/4),R=new Uint32Array(F.iv.bytes,F.iv.byteOffset,F.iv.byteLength/4);new b(q,B,R,function(U,N){self.postMessage(H({source:F.source,decrypted:N}),[N.buffer])})}})),sT=Uf(aT),oT=function(t){var r=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(r="main-desc"),r},aa=function(t,r){t.abort(),t.pause(),r&&r.activePlaylistLoader&&(r.activePlaylistLoader.pause(),r.activePlaylistLoader=null)},Bs=function(t,r){r.activePlaylistLoader=t,t.load()},uT=function(t,r){return function(){var n=r.segmentLoaders,e=n[t],i=n.main,s=r.mediaTypes[t],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastGroup_;if(!(u&&c&&u.id===c.id)&&(s.lastGroup_=u,s.lastTrack_=o,aa(e,s),!(!u||u.isMasterPlaylist))){if(!u.playlistLoader){l&&i.resetEverything();return}e.resyncLoader(),Bs(u.playlistLoader,s)}}},lT=function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];e.lastGroup_=null,n.abort(),n.pause()}},dT=function(t,r){return function(){var n=r.masterPlaylistLoader,e=r.segmentLoaders,i=e[t],s=e.main,o=r.mediaTypes[t],u=o.activeTrack(),l=o.getActiveGroup(),c=o.activePlaylistLoader,p=o.lastTrack_;if(!(p&&u&&p.id===u.id)&&(o.lastGroup_=l,o.lastTrack_=u,aa(i,o),!!l)){if(l.isMasterPlaylist){if(!u||!p||u.id===p.id)return;var m=r.vhs.masterPlaylistController_,_=m.selectPlaylist();if(m.media()===_)return;o.logger_("track change. Switching master audio from "+p.id+" to "+u.id),n.pause(),s.resetEverything(),m.fastQualityChange_(_);return}if(t==="AUDIO"){if(!l.playlistLoader){s.setAudio(!0),s.resetEverything();return}i.setAudio(!0),s.setAudio(!1)}if(c===l.playlistLoader){Bs(l.playlistLoader,o);return}i.track&&i.track(u),i.resetEverything(),Bs(l.playlistLoader,o)}}},sa={AUDIO:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t],i=r.blacklistCurrentPlaylist;aa(n,e);var s=e.activeTrack(),o=e.activeGroup(),u=(o.filter(function(p){return p.default})[0]||o[0]).id,l=e.tracks[u];if(s===l){i({message:"Problem encountered loading the default audio track."});return}I.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in e.tracks)e.tracks[c].enabled=e.tracks[c]===l;e.onTrackChanged()}},SUBTITLES:function(t,r){return function(){var n=r.segmentLoaders[t],e=r.mediaTypes[t];I.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),aa(n,e);var i=e.activeTrack();i&&(i.mode="disabled"),e.onTrackChanged()}}},id={AUDIO:function(t,r,n){if(r){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t];r.on("loadedmetadata",function(){var o=r.media();s.playlist(o,i),(!e.paused()||o.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},SUBTITLES:function(t,r,n){var e=n.tech,i=n.requestOptions,s=n.segmentLoaders[t],o=n.mediaTypes[t];r.on("loadedmetadata",function(){var u=r.media();s.playlist(u,i),s.track(o.activeTrack()),(!e.paused()||u.endList&&e.preload()!=="none")&&s.load()}),r.on("loadedplaylist",function(){s.playlist(r.media(),i),e.paused()||s.load()}),r.on("error",sa[t](t,n))}},cT={AUDIO:function(t,r){var n=r.vhs,e=r.sourceType,i=r.segmentLoaders[t],s=r.requestOptions,o=r.master.mediaGroups,u=r.mediaTypes[t],l=u.groups,c=u.tracks,p=u.logger_,m=r.masterPlaylistLoader,_=Ki(m.master);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},_&&(o[t].main.default.playlists=m.master.playlists));for(var b in o[t]){l[b]||(l[b]=[]);for(var S in o[t][b]){var x=o[t][b][S],k=void 0;if(_?(p("AUDIO group '"+b+"' label '"+S+"' is a master playlist"),x.isMasterPlaylist=!0,k=null):e==="vhs-json"&&x.playlists?k=new Rr(x.playlists[0],n,s):x.resolvedUri?k=new Rr(x.resolvedUri,n,s):x.playlists&&e==="dash"?k=new Fs(x.playlists[0],n,s,m):k=null,x=I.mergeOptions({id:S,playlistLoader:k},x),id[t](t,x.playlistLoader,r),l[b].push(x),typeof c[S]>"u"){var L=new I.AudioTrack({id:S,kind:oT(x),enabled:!1,language:x.language,default:x.default,label:S});c[S]=L}}}i.on("error",sa[t](t,r))},SUBTITLES:function(t,r){var n=r.tech,e=r.vhs,i=r.sourceType,s=r.segmentLoaders[t],o=r.requestOptions,u=r.master.mediaGroups,l=r.mediaTypes[t],c=l.groups,p=l.tracks,m=r.masterPlaylistLoader;for(var _ in u[t]){c[_]||(c[_]=[]);for(var b in u[t][_])if(!u[t][_][b].forced){var S=u[t][_][b],x=void 0;if(i==="hls")x=new Rr(S.resolvedUri,e,o);else if(i==="dash"){var k=S.playlists.filter(function(H){return H.excludeUntil!==1/0});if(!k.length)return;x=new Fs(S.playlists[0],e,o,m)}else i==="vhs-json"&&(x=new Rr(S.playlists?S.playlists[0]:S.resolvedUri,e,o));if(S=I.mergeOptions({id:b,playlistLoader:x},S),id[t](t,S.playlistLoader,r),c[_].push(S),typeof p[b]>"u"){var L=n.addRemoteTextTrack({id:b,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:b},!1).track;p[b]=L}}}s.on("error",sa[t](t,r))},"CLOSED-CAPTIONS":function(t,r){var n=r.tech,e=r.master.mediaGroups,i=r.mediaTypes[t],s=i.groups,o=i.tracks;for(var u in e[t]){s[u]||(s[u]=[]);for(var l in e[t][u]){var c=e[t][u][l];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var p=n.options_.vhs&&n.options_.vhs.captionServices||{},m={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(p[m.instreamId]&&(m=I.mergeOptions(m,p[m.instreamId])),m.default===void 0&&delete m.default,s[u].push(I.mergeOptions({id:l},c)),typeof o[l]>"u"){var _=n.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;o[l]=_}}}}}},fT=function a(t,r){for(var n=0;n<t.length;n++)if(Bo(r,t[n])||t[n].playlists&&a(t[n].playlists,r))return!0;return!1},hT=function(t,r){return function(n){var e=r.masterPlaylistLoader,i=r.mediaTypes[t].groups,s=e.media();if(!s)return null;var o=null;s.attributes[t]&&(o=i[s.attributes[t]]);var u=Object.keys(i);if(!o)if(t==="AUDIO"&&u.length>1&&Ki(r.master))for(var l=0;l<u.length;l++){var c=i[u[l]];if(fT(c,s)){o=c;break}}else i.main?o=i.main:u.length===1&&(o=i[u[0]]);return typeof n>"u"?o:n===null||!o?null:o.filter(function(p){return p.id===n.id})[0]||null}},pT={AUDIO:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].enabled)return n[e];return null}},SUBTITLES:function(t,r){return function(){var n=r.mediaTypes[t].tracks;for(var e in n)if(n[e].mode==="showing"||n[e].mode==="hidden")return n[e];return null}}},mT=function(t,r){var n=r.mediaTypes;return function(){var e=n[t].activeTrack();return e?n[t].activeGroup(e):null}},gT=function(t){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){cT[b](b,t)});var r=t.mediaTypes,n=t.masterPlaylistLoader,e=t.tech,i=t.vhs,s=t.segmentLoaders,o=s.AUDIO,u=s.main;["AUDIO","SUBTITLES"].forEach(function(b){r[b].activeGroup=hT(b,t),r[b].activeTrack=pT[b](b,t),r[b].onGroupChanged=uT(b,t),r[b].onGroupChanging=lT(b,t),r[b].onTrackChanged=dT(b,t),r[b].getActiveGroup=mT(b,t)});var l=r.AUDIO.activeGroup();if(l){var c=(l.filter(function(b){return b.default})[0]||l[0]).id;r.AUDIO.tracks[c].enabled=!0,r.AUDIO.onGroupChanged(),r.AUDIO.onTrackChanged();var p=r.AUDIO.getActiveGroup();p.playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)}n.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanged()})}),n.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(b){return r[b].onGroupChanging()})});var m=function(){r.AUDIO.onTrackChanged(),e.trigger({type:"usage",name:"vhs-audio-change"}),e.trigger({type:"usage",name:"hls-audio-change"})};e.audioTracks().addEventListener("change",m),e.remoteTextTracks().addEventListener("change",r.SUBTITLES.onTrackChanged),i.on("dispose",function(){e.audioTracks().removeEventListener("change",m),e.remoteTextTracks().removeEventListener("change",r.SUBTITLES.onTrackChanged)}),e.clearTracks("audio");for(var _ in r.AUDIO.tracks)e.audioTracks().addTrack(r.AUDIO.tracks[_])},vT=function(){var t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(r){t[r]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ot,activeTrack:Ot,getActiveGroup:Ot,onGroupChanged:Ot,onTrackChanged:Ot,lastTrack_:null,logger_:mt("MediaGroups["+r+"]")}}),t},yT=60*2,Pt,_T=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],TT=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},bT=function(t){var r=t.currentPlaylist,n=t.buffered,e=t.currentTime,i=t.nextPlaylist,s=t.bufferLowWaterLine,o=t.bufferHighWaterLine,u=t.duration,l=t.experimentalBufferBasedABR,c=t.log;if(!i)return I.log.warn("We received no playlist to switch to. Please check your stream."),!1;var p="allowing switch "+(r&&r.id||"null")+" -> "+i.id;if(!r)return c(p+" as current playlist is not set"),!0;if(i.id===r.id)return!1;var m=!!Fr(n,e).length;if(!r.endList)return!m&&typeof r.partTargetDuration=="number"?(c("not "+p+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(p+" as current playlist is live"),!0);var _=Ro(n,e),b=l?we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:we.MAX_BUFFER_LOW_WATER_LINE;if(u<b)return c(p+" as duration < max low water line ("+u+" < "+b+")"),!0;var S=i.attributes.BANDWIDTH,x=r.attributes.BANDWIDTH;if(S<x&&(!l||_<o)){var k=p+" as next bandwidth < current bandwidth ("+S+" < "+x+")";return l&&(k+=" and forwardBuffer < bufferHighWaterLine ("+_+" < "+o+")"),c(k),!0}if((!l||S>x)&&_>=s){var L=p+" as forwardBuffer >= bufferLowWaterLine ("+_+" >= "+s+")";return l&&(L+=" and next bandwidth > current bandwidth ("+S+" > "+x+")"),c(L),!0}return c("not "+p+" as no switching criteria met"),!1},xT=function(a){G._inheritsLoose(t,a);function t(n){var e;e=a.call(this)||this;var i=n.src,s=n.handleManifestRedirects,o=n.withCredentials,u=n.tech,l=n.bandwidth,c=n.externVhs,p=n.useCueTags,m=n.blacklistDuration,_=n.enableLowInitialPlaylist,b=n.sourceType,S=n.cacheEncryptionKeys,x=n.experimentalBufferBasedABR,k=n.experimentalLeastPixelDiffSelector,L=n.captionServices;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");var H=n.maxPlaylistRetries;(H===null||typeof H>"u")&&(H=1/0),Pt=c,e.experimentalBufferBasedABR=!!x,e.experimentalLeastPixelDiffSelector=!!k,e.withCredentials=o,e.tech_=u,e.vhs_=u.vhs,e.sourceType_=b,e.useCueTags_=p,e.blacklistDuration=m,e.maxPlaylistRetries=H,e.enableLowInitialPlaylist=_,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:H,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=vT(),e.mediaSource=new A.MediaSource,e.handleDurationChange_=e.handleDurationChange_.bind(ee(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(ee(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(ee(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=I.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new iT(n),e.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new sT,e.sourceUpdater_=new eh(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new nT;var O={vhs:e.vhs_,parse708captions:n.parse708captions,useDtsForTimestampOffset:n.useDtsForTimestampOffset,captionServices:L,mediaSource:e.mediaSource,currentTime:e.tech_.currentTime.bind(e.tech_),seekable:function(){return e.seekable()},seeking:function(){return e.tech_.seeking()},duration:function(){return e.duration()},hasPlayed:function(){return e.hasPlayed_},goalBufferLength:function(){return e.goalBufferLength()},bandwidth:l,syncController:e.syncController_,decrypter:e.decrypter_,sourceType:e.sourceType_,inbandTextTracks:e.inbandTextTracks_,cacheEncryptionKeys:S,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:n.experimentalExactManifestTimings};e.masterPlaylistLoader_=e.sourceType_==="dash"?new Fs(i,e.vhs_,e.requestOptions_):new Rr(i,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new Ms(I.mergeOptions(O,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),n),e.audioSegmentLoader_=new Ms(I.mergeOptions(O,{loaderType:"audio"}),n),e.subtitleSegmentLoader_=new Z_(I.mergeOptions(O,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(B,R){function U(){u.off("vttjserror",N),B()}function N(){u.off("vttjsloaded",U),R()}u.one("vttjsloaded",U),u.one("vttjserror",N),u.addWebVttScript_()})}}),n),e.setupSegmentLoaderListeners_(),e.experimentalBufferBasedABR&&(e.masterPlaylistLoader_.one("loadedplaylist",function(){return e.startABRTimer_()}),e.tech_.on("pause",function(){return e.stopABRTimer_()}),e.tech_.on("play",function(){return e.startABRTimer_()})),_T.forEach(function(q){e[q+"_"]=TT.bind(ee(e),q)}),e.logger_=mt("MPC"),e.triggeredFmp4Usage=!1,e.tech_.preload()==="none"?(e.loadOnPlay_=function(){e.loadOnPlay_=null,e.masterPlaylistLoader_.load()},e.tech_.one("play",e.loadOnPlay_)):e.masterPlaylistLoader_.load(),e.timeToLoadedData__=-1,e.mainAppendsToLoadedData__=-1,e.audioAppendsToLoadedData__=-1;var F=e.tech_.preload()==="none"?"play":"loadstart";return e.tech_.one(F,function(){var q=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-q,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}var r=t.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(e){e===void 0&&(e="abr");var i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)},r.switchMedia_=function(e,i,s){var o=this.media(),u=o&&(o.id||o.uri),l=e.id||e.uri;u&&u!==l&&(this.logger_("switch media "+u+" -> "+l+" from "+i),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+i})),this.masterPlaylistLoader_.media(e,s)},r.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.setInterval(function(){return e.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var e=this.master(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;var s=e.mediaGroups.AUDIO,o=Object.keys(s),u;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)u=this.mediaTypes_.AUDIO.activeTrack();else{var l=s.main||o.length&&s[o[0]];for(var c in l)if(l[c].default){u={label:c};break}}if(!u)return i;var p=[];for(var m in s)if(s[m][u.label]){var _=s[m][u.label];if(_.playlists&&_.playlists.length)p.push.apply(p,_.playlists);else if(_.uri)p.push(_);else if(e.playlists.length)for(var b=0;b<e.playlists.length;b++){var S=e.playlists[b];S.attributes&&S.attributes.AUDIO&&S.attributes.AUDIO===m&&p.push(S)}}return p.length?p:i},r.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var i=e.masterPlaylistLoader_.media(),s=i.targetDuration*1.5*1e3;ks(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,i.endList&&e.tech_.preload()!=="none"&&(e.mainSegmentLoader_.playlist(i,e.requestOptions_),e.mainSegmentLoader_.load()),gT({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),i),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var i=e.masterPlaylistLoader_.media();if(!i){e.excludeUnsupportedVariants_();var s;if(e.enableLowInitialPlaylist&&(s=e.selectInitialPlaylist()),s||(s=e.selectPlaylist()),!s||!e.shouldSwitchToMedia_(s))return;e.initialMedia_=s,e.switchMedia_(e.initialMedia_,"initial");var o=e.sourceType_==="vhs-json"&&e.initialMedia_.segments;if(!o)return;i=e.initialMedia_}e.handleUpdatedMediaPlaylist(i)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var i=e.masterPlaylistLoader_.media(),s=i.targetDuration*1.5*1e3;ks(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=s,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(i,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var i=e.masterPlaylistLoader_.media();if(i.lastExcludeReason_!=="playlist-unchanged"){var s=e.stuckAtPlaylistEnd_(i);s&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},r.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},r.triggerPresenceUsage_=function(e,i){var s=e.mediaGroups||{},o=!0,u=Object.keys(s.AUDIO);for(var l in s.AUDIO)for(var c in s.AUDIO[l]){var p=s.AUDIO[l][c];p.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(s.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Pt.Playlist.isAes(i)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),u.length&&Object.keys(s.AUDIO[u[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(e){var i=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),o=this.bufferLowWaterLine(),u=this.bufferHighWaterLine(),l=this.tech_.buffered();return bT({buffered:l,currentTime:s,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:u,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(s){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},yT))});var i=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();o&&e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",i),this.audioSegmentLoader_.on("trackinfo",i),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},r.fastQualityChange_=function(e){var i=this;if(e===void 0&&(e=this.selectPlaylist()),e===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){I.browser.IE_VERSION||I.browser.IS_EDGE?i.tech_.setCurrentTime(i.tech_.currentTime()+.04):i.tech_.setCurrentTime(i.tech_.currentTime())})},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}},r.setupFirstPlay=function(){var e=this,i=this.masterPlaylistLoader_.media();if(!i||this.tech_.paused()||this.hasPlayed_)return!1;if(!i.endList){var s=this.seekable();if(!s.length)return!1;if(I.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(s.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(s.end(0))}return this.hasPlayed_=!0,this.load(),!0},r.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,function(i){})}this.trigger("sourceopen")},r.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(!(!e||!e.length)){var i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}}},r.handleDurationChange_=function(){this.tech_.trigger("durationchange")},r.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},r.stuckAtPlaylistEnd_=function(e){var i=this.seekable();if(!i.length)return!1;var s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;var o=Pt.Playlist.playlistEnd(e,s),u=this.tech_.currentTime(),l=this.tech_.buffered();if(!l.length)return o-u<=bt;var c=l.end(l.length-1);return c-u<=bt&&o-c<=bt},r.blacklistCurrentPlaylist=function(e,i){e===void 0&&(e={});var s=e.playlist||this.masterPlaylistLoader_.media();if(i=i||e.blacklistDuration||this.blacklistDuration,!s){this.error=e,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}s.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,u=o.filter(Aa),l=u.length===1&&u[0]===s;if(o.length===1&&i!==1/0)return I.log.warn("Problem encountered with playlist "+s.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(l);if(l){var c=!1;o.forEach(function(k){if(k!==s){var L=k.excludeUntil;typeof L<"u"&&L!==1/0&&(c=!0,delete k.excludeUntil)}}),c&&(I.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var p;s.playlistErrors_>this.maxPlaylistRetries?p=1/0:p=Date.now()+i*1e3,s.excludeUntil=p,e.reason&&(s.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var m=this.selectPlaylist();if(!m){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var _=e.internal?this.logger_:I.log.warn,b=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+s.id+"."+(b+" Switching to playlist "+m.id+".")),m.attributes.AUDIO!==s.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==s.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var S=m.targetDuration/2*1e3||5*1e3,x=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=S;return this.switchMedia_(m,"exclude",l||x)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(e,i){var s=this,o=[],u=e==="all";(u||e==="main")&&o.push(this.masterPlaylistLoader_);var l=[];(u||e==="audio")&&l.push("AUDIO"),(u||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(c){var p=s.mediaTypes_[c]&&s.mediaTypes_[c].activePlaylistLoader;p&&o.push(p)}),["main","audio","subtitle"].forEach(function(c){var p=s[c+"SegmentLoader_"];p&&(e===c||e==="all")&&o.push(p)}),o.forEach(function(c){return i.forEach(function(p){typeof c[p]=="function"&&c[p]()})})},r.setCurrentTime=function(e){var i=Fr(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Pt.Playlist.duration(e):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var s=this.syncController_.getExpiredTime(i,this.duration());if(s!==null){var o=this.masterPlaylistLoader_.master,u=Pt.Playlist.seekable(i,s,Pt.Playlist.liveEdgeDelay(o,i));if(u.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(i,this.duration()),s===null||(e=Pt.Playlist.seekable(i,s,Pt.Playlist.liveEdgeDelay(o,i)),e.length===0)))){var l,c;this.seekable_&&this.seekable_.length&&(l=this.seekable_.end(0),c=this.seekable_.start(0)),e?e.start(0)>u.end(0)||u.start(0)>e.end(0)?this.seekable_=u:this.seekable_=I.createTimeRanges([[e.start(0)>u.start(0)?e.start(0):u.start(0),e.end(0)<u.end(0)?e.end(0):u.end(0)]]):this.seekable_=u,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===l&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+vf(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},r.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){var i=this.seekable();if(!i.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<i.end(i.length-1))&&this.sourceUpdater_.setDuration(i.end(i.length-1));return}var s=this.tech_.buffered(),o=Pt.Playlist.duration(this.masterPlaylistLoader_.media());s.length>0&&(o=Math.max(o,s.end(s.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},r.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(i){var s=e.mediaTypes_[i].groups;for(var o in s)s[o].forEach(function(u){u.playlistLoader&&u.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!s)},r.getCodecsOrExclude_=function(){var e=this,i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};i.video=i.main;var s=Di(this.master(),this.media()),o={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo&&(o.video=s.video||i.main.videoCodec||zm),i.main.isMuxed&&(o.video+=","+(s.audio||i.main.audioCodec||Vu)),(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||u)&&(o.audio=s.audio||i.main.audioCodec||i.audio.audioCodec||Vu,i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4),!o.audio&&!o.video){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var l=function(x,k){return x?Ln(k):Wa(k)},c={},p;if(["video","audio"].forEach(function(S){if(o.hasOwnProperty(S)&&!l(i[S].isFmp4,o[S])){var x=i[S].isFmp4?"browser":"muxer";c[x]=c[x]||[],c[x].push(o[S]),S==="audio"&&(p=x)}}),u&&p&&this.media().attributes.AUDIO){var m=this.media().attributes.AUDIO;this.master().playlists.forEach(function(S){var x=S.attributes&&S.attributes.AUDIO;x===m&&S!==e.media()&&(S.excludeUntil=1/0)}),this.logger_("excluding audio group "+m+" as "+p+' does not support codec(s): "'+o.audio+'"')}if(Object.keys(c).length){var _=Object.keys(c).reduce(function(S,x){return S&&(S+=", "),S+=x+' does not support codec(s): "'+c[x].join(",")+'"',S},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:_,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var b=[];if(["video","audio"].forEach(function(S){var x=(yt(e.sourceUpdater_.codecs[S]||"")[0]||{}).type,k=(yt(o[S]||"")[0]||{}).type;x&&k&&x.toLowerCase()!==k.toLowerCase()&&b.push('"'+e.sourceUpdater_.codecs[S]+'" -> "'+o[S]+'"')}),b.length){this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+b.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return o},r.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}}},r.excludeUnsupportedVariants_=function(){var e=this,i=this.master().playlists,s=[];Object.keys(i).forEach(function(o){var u=i[o];if(s.indexOf(u.id)===-1){s.push(u.id);var l=Di(e.master,u),c=[];l.audio&&!Wa(l.audio)&&!Ln(l.audio)&&c.push("audio codec "+l.audio),l.video&&!Wa(l.video)&&!Ln(l.video)&&c.push("video codec "+l.video),l.text&&l.text==="stpp.ttml.im1t"&&c.push("text codec "+l.text),c.length&&(u.excludeUntil=1/0,e.logger_("excluding "+u.id+" for unsupported: "+c.join(", ")))}})},r.excludeIncompatibleVariants_=function(e){var i=this,s=[],o=this.master().playlists,u=ia(yt(e)),l=zl(u),c=u.video&&yt(u.video)[0]||null,p=u.audio&&yt(u.audio)[0]||null;Object.keys(o).forEach(function(m){var _=o[m];if(!(s.indexOf(_.id)!==-1||_.excludeUntil===1/0)){s.push(_.id);var b=[],S=Di(i.masterPlaylistLoader_.master,_),x=zl(S);if(!(!S.audio&&!S.video)){if(x!==l&&b.push('codec count "'+x+'" !== "'+l+'"'),!i.sourceUpdater_.canChangeType()){var k=S.video&&yt(S.video)[0]||null,L=S.audio&&yt(S.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&b.push('video codec "'+k.type+'" !== "'+c.type+'"'),L&&p&&L.type.toLowerCase()!==p.type.toLowerCase()&&b.push('audio codec "'+L.type+'" !== "'+p.type+'"')}b.length&&(_.excludeUntil=1/0,i.logger_("blacklisting "+_.id+": "+b.join(" && ")))}}})},r.updateAdCues_=function(e){var i=0,s=this.seekable();s.length&&(i=s.start(0)),tT(e,this.cueTagsTrack_,i)},r.goalBufferLength=function(){var e=this.tech_.currentTime(),i=we.GOAL_BUFFER_LENGTH,s=we.GOAL_BUFFER_LENGTH_RATE,o=Math.max(i,we.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*s,o)},r.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),i=we.BUFFER_LOW_WATER_LINE,s=we.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(i,we.MAX_BUFFER_LOW_WATER_LINE),u=Math.max(i,we.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*s,this.experimentalBufferBasedABR?u:o)},r.bufferHighWaterLine=function(){return we.BUFFER_HIGH_WATER_LINE},t}(I.EventTarget),ST=function(t,r,n){return function(e){var i=t.master.playlists[r],s=No(i),o=Aa(i);return typeof e>"u"?o:(e?delete i.disabled:i.disabled=!0,e!==o&&!s&&(n(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},ET=function(t,r,n){var e=t.masterPlaylistController_,i=t.options_.smoothQualityChange,s=i?"smooth":"fast",o=e[s+"QualityChange_"].bind(e);if(r.attributes){var u=r.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=r.attributes.BANDWIDTH,this.frameRate=r.attributes["FRAME-RATE"]}this.codecs=Di(e.master(),r),this.playlist=r,this.id=n,this.enabled=ST(t.playlists,r.id,o)},CT=function(t){t.representations=function(){var r=t.masterPlaylistController_.master(),n=Ki(r)?t.masterPlaylistController_.getAudioTrackPlaylists_():r.playlists;return n?n.filter(function(e){return!No(e)}).map(function(e,i){return new ET(t,e,e.id)}):[]}},nd=["seeking","seeked","pause","playing","error"],AT=function(){function a(r){var n=this;this.masterPlaylistController_=r.masterPlaylistController,this.tech_=r.tech,this.seekable=r.seekable,this.allowSeeksWithinUnsafeLiveWindow=r.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=r.liveRangeSafeTimeDelta,this.media=r.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=mt("PlaybackWatcher"),this.logger_("initialize");var e=function(){return n.monitorCurrentTime_()},i=function(){return n.monitorCurrentTime_()},s=function(){return n.techWaiting_()},o=function(){return n.cancelTimer_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach(function(m){c[m]={reset:function(){return n.resetSegmentDownloads_(m)},updateend:function(){return n.checkSegmentDownloads_(m)}},u[m+"SegmentLoader_"].on("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].on("playlistupdate",c[m].reset),n.tech_.on(["seeked","seeking"],c[m].reset)});var p=function(_){["main","audio"].forEach(function(b){u[b+"SegmentLoader_"][_]("appended",n.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){n.fixesBadSeeks_()&&(n.consecutiveUpdates=0,n.lastRecordedTime=n.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=function(){return p("off")},this.watchForBadSeeking_=function(){n.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(nd,o),this.tech_.on("canplay",i),this.tech_.one("play",e),this.dispose=function(){n.clearSeekingAppendCheck_(),n.logger_("dispose"),n.tech_.off("waiting",s),n.tech_.off(nd,o),n.tech_.off("canplay",i),n.tech_.off("play",e),n.tech_.off("seeking",n.watchForBadSeeking_),n.tech_.off("seeked",n.clearSeekingAppendCheck_),l.forEach(function(m){u[m+"SegmentLoader_"].off("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].off("playlistupdate",c[m].reset),n.tech_.off(["seeked","seeking"],c[m].reset)}),n.checkCurrentTimeTimeout_&&A.clearTimeout(n.checkCurrentTimeTimeout_),n.cancelTimer_()}}var t=a.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&A.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=A.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(n){var e=this.masterPlaylistController_[n+"SegmentLoader_"];this[n+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+n+" loader"),this[n+"StalledDownloads_"]=0,this[n+"Buffered_"]=e.buffered_()},t.checkSegmentDownloads_=function(n){var e=this.masterPlaylistController_,i=e[n+"SegmentLoader_"],s=i.buffered_(),o=Ty(this[n+"Buffered_"],s);if(this[n+"Buffered_"]=s,o){this.resetSegmentDownloads_(n);return}this[n+"StalledDownloads_"]++,this.logger_("found #"+this[n+"StalledDownloads_"]+" "+n+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:dr(s)}),!(this[n+"StalledDownloads_"]<10)&&(this.logger_(n+" loader stalled download exclusion"),this.resetSegmentDownloads_(n),this.tech_.trigger({type:"usage",name:"vhs-"+n+"-download-exclusion"}),n!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+n+" segment downloading detected."},1/0))},t.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var n=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===n&&(!e.length||n+bt>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&n===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):n===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=n)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var n=this.tech_.seeking();if(!n)return!1;var e=this.seekable(),i=this.tech_.currentTime(),s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(s){var u=e.end(e.length-1);o=u}if(this.beforeSeekableWindow_(e,i)){var l=e.start(0);o=l+(l===e.end(0)?0:bt)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+i+" with "+("seekable range "+vf(e)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,p=this.tech_.buffered(),m=c.audioBuffer?c.audioBuffered():null,_=c.videoBuffer?c.videoBuffered():null,b=this.media(),S=b.partTargetDuration?b.partTargetDuration:(b.targetDuration-Qt)*2,x=[m,_],k=0;k<x.length;k++)if(x[k]){var L=Ro(x[k],i);if(L<S)return!1}var H=kn(p,i);return H.length===0?!1:(o=H.start(0)+bt,this.logger_("Buffered region starts ("+H.start(0)+") "+(" just beyond seek point ("+i+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},t.waiting_=function(){if(!this.techWaiting_()){var n=this.tech_.currentTime(),e=this.tech_.buffered(),i=Fr(e,n);if(i.length&&n+3<=i.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(n),this.logger_("Stopped at "+n+" while inside a buffered region "+("["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},t.techWaiting_=function(){var n=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(n,e)){var i=n.end(n.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to "+("live point (seekable end) "+i)),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var s=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:e});if(u)return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var l=kn(o,e);if(l.length>0){var c=l.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+c+", seeking "+("to "+l.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,e),!0}return!1},t.afterSeekableWindow_=function(n,e,i,s){if(s===void 0&&(s=!1),!n.length)return!1;var o=n.end(n.length-1)+bt,u=!i.endList;return u&&s&&(o=n.end(n.length-1)+i.targetDuration*3),e>o},t.beforeSeekableWindow_=function(n,e){return!!(n.length&&n.start(0)>0&&e<n.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(n){var e=n.videoBuffered,i=n.audioBuffered,s=n.currentTime;if(e){var o;if(e.length&&i.length){var u=Fr(e,s-3),l=Fr(e,s),c=Fr(i,s);c.length&&!l.length&&u.length&&(o={start:u.end(0),end:c.end(0)})}else{var p=kn(e,s);p.length||(o=this.gapFromVideoUnderflow_(e,s))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+s)),!0):!1}},t.skipTheGap_=function(n){var e=this.tech_.buffered(),i=this.tech_.currentTime(),s=kn(e,i);this.cancelTimer_(),!(s.length===0||i!==n)&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",n,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Qt),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(n,e){for(var i=vy(n),s=0;s<i.length;s++){var o=i.start(s),u=i.end(s);if(e-o<4&&e-o>2)return{start:o,end:u}}return null},a}(),DT={errorInterval:30,getSource:function(t){var r=this.tech({IWillNotUseThisInPlugins:!0}),n=r.currentSource_||this.currentSource();return t(n)}},wT=function a(t,r){var n=0,e=0,i=I.mergeOptions(DT,r);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){e&&t.currentTime(e)},o=function(m){m!=null&&(e=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(m),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){if(Date.now()-n<i.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),t.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!i.getSource||typeof i.getSource!="function"){I.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return n=Date.now(),i.getSource.call(t,o)},l=function p(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",p)},c=function(m){l(),a(t,m)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},kT=function(t){wT(this,t)},th="2.16.0",PT="6.0.1",IT="0.22.1",LT="4.8.0",OT="3.1.3",Fe={PlaylistLoader:Rr,Playlist:Qe,utils:Wy,STANDARD_PLAYLIST_SELECTOR:Kl,INITIAL_PLAYLIST_SELECTOR:I_,lastBandwidthSelector:Kl,movingAverageBandwidthSelector:k_,comparePlaylistBandwidth:Ho,comparePlaylistResolution:w_,xhr:Lf()};Object.keys(we).forEach(function(a){Object.defineProperty(Fe,a,{get:function(){return I.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),we[a]},set:function(r){if(I.log.warn("using Vhs."+a+" is UNSAFE be sure you know what you are doing"),typeof r!="number"||r<0){I.log.warn("value of Vhs."+a+" must be greater than or equal to 0");return}we[a]=r}})});var rh="videojs-vhs",ih=function(t,r){for(var n=r.media(),e=-1,i=0;i<t.length;i++)if(t[i].id===n.id){e=i;break}t.selectedIndex_=e,t.trigger({selectedIndex:e,type:"change"})},FT=function(t,r){r.representations().forEach(function(n){t.addQualityLevel(n)}),ih(t,r.playlists)};Fe.canPlaySource=function(){return I.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var RT=function(t,r,n){if(!t)return t;var e={};r&&r.attributes&&r.attributes.CODECS&&(e=ia(yt(r.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(e.audio=n.attributes.CODECS);var i=wi(e.video),s=wi(e.audio),o={};for(var u in t)o[u]={},s&&(o[u].audioContentType=s),i&&(o[u].videoContentType=i),r.contentProtection&&r.contentProtection[u]&&r.contentProtection[u].pssh&&(o[u].pssh=r.contentProtection[u].pssh),typeof t[u]=="string"&&(o[u].url=t[u]);return I.mergeOptions(t,o)},MT=function(t,r){return t.reduce(function(n,e){if(!e.contentProtection)return n;var i=r.reduce(function(s,o){var u=e.contentProtection[o];return u&&u.pssh&&(s[o]={pssh:u.pssh}),s},{});return Object.keys(i).length&&n.push(i),n},[])},NT=function(t){var r=t.player,n=t.sourceKeySystems,e=t.audioMedia,i=t.mainPlaylists;if(!r.eme.initializeMediaKeys)return Promise.resolve();var s=e?i.concat([e]):i,o=MT(s,Object.keys(n)),u=[],l=[];return o.forEach(function(c){l.push(new Promise(function(p,m){r.tech_.one("keysessioncreated",p)})),u.push(new Promise(function(p,m){r.eme.initializeMediaKeys({keySystems:c},function(_){if(_){m(_);return}p()})}))}),Promise.race([Promise.all(u),Promise.race(l)])},BT=function(t){var r=t.player,n=t.sourceKeySystems,e=t.media,i=t.audioMedia,s=RT(n,e,i);return s?(r.currentSource().keySystems=s,s&&!r.eme?(I.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},nh=function(){if(!A.localStorage)return null;var t=A.localStorage.getItem(rh);if(!t)return null;try{return JSON.parse(t)}catch{return null}},UT=function(t){if(!A.localStorage)return!1;var r=nh();r=r?I.mergeOptions(r,t):t;try{A.localStorage.setItem(rh,JSON.stringify(r))}catch{return!1}return r},VT=function(t){return t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t};Fe.supportsNativeHls=function(){if(!W||!W.createElement)return!1;var a=W.createElement("video");if(!I.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some(function(r){return/maybe|probably/i.test(a.canPlayType(r))})}();Fe.supportsNativeDash=function(){return!W||!W.createElement||!I.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(W.createElement("video").canPlayType("application/dash+xml"))}();Fe.supportsTypeNatively=function(a){return a==="hls"?Fe.supportsNativeHls:a==="dash"?Fe.supportsNativeDash:!1};Fe.isSupported=function(){return I.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var HT=I.getComponent("Component"),jo=function(a){G._inheritsLoose(t,a);function t(n,e,i){var s;if(s=a.call(this,e,I.mergeOptions(i.hls,i.vhs))||this,i.hls&&Object.keys(i.hls).length&&I.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof i.initialBandwidth=="number"&&(s.options_.bandwidth=i.initialBandwidth),s.logger_=mt("VhsHandler"),e.options_&&e.options_.playerId){var o=I(e.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return I.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"hls-player-access"}),ee(s)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return I.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"vhs-player-access"}),ee(s)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return I.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),ee(s)},configurable:!0}),s.player_=o}if(s.tech_=e,s.source_=n,s.stats={},s.ignoreNextSeekingEvent_=!1,s.setOptions_(),s.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);else if(s.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return s.on(W,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(u){var l=W.fullscreenElement||W.webkitFullscreenElement||W.mozFullScreenElement||W.msFullscreenElement;l&&l.contains(s.tech_.el())?s.masterPlaylistController_.fastQualityChange_():s.masterPlaylistController_.checkABR_()}),s.on(s.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),s.on(s.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),s.on(s.tech_,"play",s.play),s}var r=t.prototype;return r.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var i=nh();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=we.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===we.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(s){typeof e.source_[s]<"u"&&(e.options_[s]=e.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},r.src=function(e,i){var s=this;if(e){this.setOptions_(),this.options_.src=VT(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Fe,this.options_.sourceType=Td(i),this.options_.seekTo=function(l){s.tech_.setCurrentTime(l)},this.options_.smoothQualityChange&&I.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new xT(this.options_);var o=I.mergeOptions({liveRangeSafeTimeDelta:bt},this.options_,{seekable:function(){return s.seekable()},media:function(){return s.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new AT(o),this.masterPlaylistController_.on("error",function(){var l=I.players[s.tech_.options_.playerId],c=s.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),l.error(c)});var u=this.options_.experimentalBufferBasedABR?Fe.movingAverageBandwidthSelector(.55):Fe.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):u.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Fe.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,p=A.navigator.connection||A.navigator.mozConnection||A.navigator.webkitConnection,m=1e7;if(this.options_.useNetworkInformationApi&&p){var _=p.downlink*1e3*1e3;_>=m&&c>=m?c=Math.max(c,_):c=_}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),p;this.throughput>0?p=1/this.throughput:p=0;var m=Math.floor(1/(c+p));return m},set:function(){I.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return s.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return s.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return s.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return s.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return s.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return s.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return s.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return s.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return s.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return s.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return s.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return s.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return dr(s.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return s.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return s.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return s.tech_.name_},enumerable:!0},duration:{get:function(){return s.tech_.duration()},enumerable:!0},master:{get:function(){return s.playlists.master},enumerable:!0},playerDimensions:{get:function(){return s.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return dr(s.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return s.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){s.options_.useBandwidthFromLocalStorage&&UT({bandwidth:s.bandwidth,throughput:Math.round(s.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){CT(s)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){s.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),NT({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:i&&i.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(s){e.logger_("error while creating EME key session",s),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var e=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,s=BT({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var u=e.masterPlaylistController_.master();if(!(!u||!u.playlists)){var l=[];if(u.playlists.forEach(function(p){p&&p.attributes&&p.attributes.RESOLUTION&&p.attributes.RESOLUTION.height>=720&&(!p.excludeUntil||p.excludeUntil<1/0)&&(p.excludeUntil=1/0,l.push(p))}),l.length){var c;(c=I.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(l)),e.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),I.browser.IE_VERSION===11||!s){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},r.setupQualityLevels_=function(){var e=this,i=I.players[this.tech_.options_.playerId];!i||!i.qualityLevels||this.qualityLevels_||(this.qualityLevels_=i.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){FT(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){ih(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":th,"mux.js":PT,"mpd-parser":IT,"m3u8-parser":LT,"aes-decrypter":OT}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return eh.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.URL.revokeObjectURL&&(A.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),a.prototype.dispose.call(this)},r.convertToProgramTime=function(e,i){return Qy({playlist:this.masterPlaylistController_.media(),time:e,callback:i})},r.seekToProgramTime=function(e,i,s,o){return s===void 0&&(s=!0),o===void 0&&(o=2),Jy({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})},t}(HT),Ni={name:"videojs-http-streaming",VERSION:th,canHandleSource:function(t,r){r===void 0&&(r={});var n=I.mergeOptions(I.options,r);return Ni.canPlayType(t.type,n)},handleSource:function(t,r,n){n===void 0&&(n={});var e=I.mergeOptions(I.options,n);return r.vhs=new jo(t,r,e),I.hasOwnProperty("hls")||Object.defineProperty(r,"hls",{get:function(){return I.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),r.vhs},configurable:!0}),r.vhs.xhr=Lf(),r.vhs.src(t.src,t.type),r.vhs},canPlayType:function(t,r){var n=Td(t);if(!n)return"";var e=Ni.getOverrideNative(r),i=Fe.supportsTypeNatively(n),s=!i||e;return s?"maybe":""},getOverrideNative:function(t){t===void 0&&(t={});var r=t,n=r.vhs,e=n===void 0?{}:n,i=r.hls,s=i===void 0?{}:i,o=!(I.browser.IS_ANY_SAFARI||I.browser.IS_IOS),u=e.overrideNative,l=u===void 0?o:u,c=s.overrideNative,p=c===void 0?!1:c;return p||l}},qT=function(){return Ln("avc1.4d400d,mp4a.40.2")};qT()&&I.getTech("Html5").registerSourceHandler(Ni,0);I.VhsHandler=jo;Object.defineProperty(I,"HlsHandler",{get:function(){return I.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),jo},configurable:!0});I.VhsSourceHandler=Ni;Object.defineProperty(I,"HlsSourceHandler",{get:function(){return I.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ni},configurable:!0});I.Vhs=Fe;Object.defineProperty(I,"Hls",{get:function(){return I.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Fe},configurable:!0});I.use||(I.registerComponent("Hls",Fe),I.registerComponent("Vhs",Fe));I.options.vhs=I.options.vhs||{};I.options.hls=I.options.hls||{};if(!I.getPlugin||!I.getPlugin("reloadSourceOnError")){var jT=I.registerPlugin||I.plugin;jT("reloadSourceOnError",kT)}const WT=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"})),GT=Re.getAugmentedNamespace(WT);(function(a,t){(function(r,n){{var e=GT;a.exports=n(e.default||e)}})(Re.commonjsGlobal,function(r){var n=r.browser.IS_IOS||r.browser.IS_NATIVE_ANDROID,e=r.getTech("Tech");class i extends e{constructor(c,p){super(c,p),this.setPoster(c.poster),this.setSrc(this.options_.source,!0),this.setTimeout((function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",n&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),i.isApiReady?this.initYTPlayer():i.apiReadyQueue.push(this))}).bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var c=i.apiReadyQueue.indexOf(this);c!==-1&&i.apiReadyQueue.splice(c,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.parentNode.removeChild(this.el_),e.prototype.dispose.call(this)}createEl(){var c=document.createElement("div");c.setAttribute("id",this.options_.techId),c.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),c.setAttribute("class","vjs-tech");var p=document.createElement("div");if(p.appendChild(c),!n&&!this.options_.ytControls){var m=document.createElement("div");m.setAttribute("class","vjs-iframe-blocker"),m.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),m.onclick=(function(){this.pause()}).bind(this),p.appendChild(m)}return p}initYTPlayer(){var c={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(typeof this.options_.autohide<"u"&&(c.autohide=this.options_.autohide),typeof this.options_.cc_load_policy<"u"&&(c.cc_load_policy=this.options_.cc_load_policy),typeof this.options_.ytControls<"u"&&(c.controls=this.options_.ytControls),typeof this.options_.disablekb<"u"&&(c.disablekb=this.options_.disablekb),typeof this.options_.color<"u"&&(c.color=this.options_.color),c.controls?typeof this.options_.fs<"u"&&(c.fs=this.options_.fs):c.fs=0,this.options_.source.src.indexOf("end=")!==-1){var p=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(p[1])}if(typeof this.options_.end<"u"&&(c.end=this.options_.end),typeof this.options_.hl<"u"?c.hl=this.options_.hl:typeof this.options_.language<"u"&&(c.hl=this.options_.language.substr(0,2)),typeof this.options_.iv_load_policy<"u"&&(c.iv_load_policy=this.options_.iv_load_policy),typeof this.options_.list<"u"?c.list=this.options_.list:this.url&&typeof this.url.listId<"u"&&(c.list=this.url.listId),typeof this.options_.listType<"u"&&(c.listType=this.options_.listType),typeof this.options_.modestbranding<"u"&&(c.modestbranding=this.options_.modestbranding),typeof this.options_.playlist<"u"&&(c.playlist=this.options_.playlist),typeof this.options_.playsinline<"u"&&(c.playsinline=this.options_.playsinline),typeof this.options_.rel<"u"&&(c.rel=this.options_.rel),typeof this.options_.showinfo<"u"&&(c.showinfo=this.options_.showinfo),this.options_.source.src.indexOf("start=")!==-1){var m=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(m[1])}if(typeof this.options_.start<"u"&&(c.start=this.options_.start),typeof this.options_.theme<"u"&&(c.theme=this.options_.theme),typeof this.options_.customVars<"u"){var _=this.options_.customVars;Object.keys(_).forEach(function(S){c[S]=_[S]})}this.activeVideoId=this.url?this.url.videoId:null,this.activeList=c.list;var b={videoId:this.activeVideoId,playerVars:c,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};typeof this.options_.enablePrivacyEnhancedMode<"u"&&this.options_.enablePrivacyEnhancedMode&&(b.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,b)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute();var c=this.ytPlayer.getAvailablePlaybackRates();c.length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(c){var p=c.data;if(!(p===this.lastState||this.errorNumber))switch(this.lastState=p,p){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting");break}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(c){this.errorNumber=c.data,this.trigger("pause"),this.trigger("error")}error(){var c=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:c,message:"Error while trying to play the video"};case 2:case 100:return{code:c,message:"Unable to find the video"};case 101:case 150:return{code:c,message:"Playback on other Websites has been disabled by the video owner."}}return{code:c,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(c){var p={videoId:c};this.options_.start&&(p.startSeconds=this.options_.start),this.options_.end&&(p.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(p)}cueVideoById_(c){var p={videoId:c};this.options_.start&&(p.startSeconds=this.options_.start),this.options_.end&&(p.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(p)}src(c){return c&&this.setSrc({src:c}),this.source}poster(){return n?null:this.poster_}setPoster(c){this.poster_=c}setSrc(c){!c||!c.src||(delete this.errorNumber,this.source=c,this.url=i.parseUrl(c.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!n?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(c){this.options_.autoplay=c}loop(){return this.options_.loop}setLoop(c){this.options_.loop=c}play(){!this.url||!this.url.videoId||(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:!0}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(c){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(c,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==c&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval((function(){this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking?clearInterval(this.checkSeekedInPauseInterval):this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked())}).bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?r.createTimeRange(0,this.ytPlayer.getDuration()):r.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(c){this.ytPlayer&&this.ytPlayer.setPlaybackRate(c)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:!1}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(c){this.ytPlayer&&this.ytPlayer.setVolume(c*100)}muted(){return this.ytPlayer?this.ytPlayer.isMuted():!1}setMuted(c){if(this.ytPlayer)this.muted(!0);else return;c?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout(function(){this.trigger("volumechange")},50)}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return r.createTimeRange();var c=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return r.createTimeRange(0,c)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var c="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var p=new Image;p.onload=(function(){if("naturalHeight"in p){if(p.naturalHeight<=90||p.naturalWidth<=120)return}else if(p.height<=90||p.width<=120)return;this.poster_=c,this.trigger("posterchange")}).bind(this),p.onerror=function(){},p.src=c}catch{}}}i.isSupported=function(){return!0},i.canPlaySource=function(l){return i.canPlayType(l.type)},i.canPlayType=function(l){return l==="video/youtube"},i.parseUrl=function(l){var c={videoId:null},p=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/,m=l.match(p);m&&m[2].length===11&&(c.videoId=m[2]);var _=/[?&]list=([^#\&\?]+)/;return m=l.match(_),m&&m[1]&&(c.listId=m[1]),c};function s(){YT.ready(function(){i.isApiReady=!0;for(var l=0;l<i.apiReadyQueue.length;++l)i.apiReadyQueue[l].initYTPlayer()})}function o(l,c){var p=!1,m=document.createElement("script"),_=document.getElementsByTagName("script")[0];_&&(_.parentNode.insertBefore(m,_),m.onload=function(){p||(p=!0,c())},m.onreadystatechange=function(){!p&&(this.readyState==="complete"||this.readyState==="loaded")&&(p=!0,c())},m.src=l)}function u(){var l=".vjs-youtube .vjs-iframe-blocker { display: none; }.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }.vjs-youtube .vjs-poster { background-size: cover; }.vjs-youtube-mobile .vjs-big-play-button { display: none; }",c=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css",p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l)),c.appendChild(p)}i.apiReadyQueue=[],typeof document<"u"&&(o("https://www.youtube.com/iframe_api",s),u()),typeof r.registerTech<"u"?r.registerTech("Youtube",i):r.registerComponent("Youtube",i)})})(Bp);const zT=I,$T=or.forwardRef(({src:a,poster:t,youtube:r},n)=>{const e=or.useRef(null),i=or.useRef(void 0);return or.useImperativeHandle(n,()=>({get player(){return i.current}}),[i]),or.useEffect(()=>{if(e.current)if(i.current)i.current.poster((t==null?void 0:t.src)||""),i.current.src([{type:r?"video/youtube":void 0,src:a}]);else{const s=document.createElement("video");s.className="ilo--video--element",e.current.appendChild(s),i.current=zT(s,{autoplay:!1,controls:!0,preload:"auto",bigPlayButton:!1,poster:t==null?void 0:t.src,controlBar:{descriptionsButton:!1,playbackRateMenuButton:!1,chaptersButton:!1,audioTrackButton:!1,pictureInPictureToggle:!1,subsCapsButton:!1,seekToLive:!1,liveDisplay:!1},errorDisplay:!1,textTrackSettings:!1,resizeManager:!1,sources:[{type:r?"video/youtube":void 0,src:a}],dataSetup:{techOrder:["youtube"]},liveTracker:!1})}},[t==null?void 0:t.src,a,r]),or.useEffect(()=>()=>{i.current&&(i.current.dispose(),i.current=void 0),e.current&&(e.current.innerHTML="")},[]),Ir.jsx("div",{className:"ilo--videoplayer",children:Ir.jsx("div",{ref:e})})}),KT=or.forwardRef(({className:a,caption:t,...r},n)=>{const{prefix:e}=Np.useGlobalSettings(),i=`${e}--video`,s=Re.classNames(a,{[i]:!0}),o=Re.classNames("",{[`${i}--caption`]:!0});return Ir.jsxs("figure",{className:s,children:[Ir.jsx("div",{className:`${s}--wrapper`,children:r&&Ir.jsx($T,{...r,ref:n})}),t&&Ir.jsx("figcaption",{className:o,children:t})]})});exports.Video=KT;
|