PageSourceSearch

https://siberianhealth.com/_nuxt/-urvh8Go.js

js siberianhealth.com collected 2026-09-24 09:20:42 UTC 584,436 bytes, 62 lines download raw bytes

1import{w as k,U as Oo,_ as wt,l as Jf,d as K,k as se,X as $u,v as Do,s as Zf}from"./D-reCCFH.js";import{a5 as eh}from"./DihDAdJ2.js";import"./BQHDSsQe.js";function ne(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Ti(s,i){return Ti=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ti(s,i)}function $(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,Ti(s,i)}function Xu(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xu=function(){return!!s})()}function Qu(s,i,n){if(Xu())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,i);var e=new(s.bind.apply(s,r));return n&&Ti(e,n.prototype),e}function th(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),i&&Ti(s,i)}var Lo="http://example.com",En=function(i,n){if(/^[a-z]+:/i.test(n))return n;/^data:/.test(i)&&(i=k.location&&k.location.href||"");var r=typeof k.URL=="function",e=/^\/\//.test(i),t=!k.location&&!/\/\//i.test(i);if(r?i=new k.URL(i,k.location||Lo):/\/\//i.test(i)||(i=Oo.buildAbsoluteURL(k.location&&k.location.href||"",i)),r){var a=new URL(n,i);return t?a.href.slice(Lo.length):e?a.href.slice(a.protocol.length):a.href}return Oo.buildAbsoluteURL(i,n)},Qa=function(){function s(){this.listeners={}}var i=s.prototype;return i.on=function(r,e){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(e)},i.off=function(r,e){if(!this.listeners[r])return!1;var t=this.listeners[r].indexOf(e);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(t,1),t>-1},i.trigger=function(r){var e=this.listeners[r];if(e)if(arguments.length===2)for(var t=e.length,a=0;a<t;++a)e[a].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)},i.dispose=function(){this.listeners={}},i.pipe=function(r){this.on("data",function(e){r.push(e)})},s}(),ih=function(i){return k.atob?k.atob(i):Buffer.from(i,"base64").toString("binary")};function Yu(s){for(var i=ih(s),n=new Uint8Array(i.length),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var rh=function(s){$(i,s);function i(){var r;return r=s.call(this)||this,r.buffer="",r}var n=i.prototype;return n.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf(`
2`);t>-1;t=this.buffer.indexOf(`
3`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},i}(Qa),nh="	",Zn=function(i){var n=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),r={};return n[1]&&(r.length=parseInt(n[1],10)),n[2]&&(r.offset=parseInt(n[2],10)),r},ah=function(){var i="[^=]*",n='"[^"]*"|[^,]*',r="(?:"+i+")=(?:"+n+")";return new RegExp("(?:^|,)("+r+")")},at=function(i){for(var n=i.split(ah()),r={},e=n.length,t;e--;)n[e]!==""&&(t=/([^=]*)=(.*)/.exec(n[e]).slice(1),t[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),r[t[0]]=t[1]);return r},sh=function(s){$(i,s);function i(){var r;return r=s.call(this)||this,r.customParsers=[],r.tagMappers=[],r}var n=i.prototype;return n.push=function(e){var t=this,a,o;if(e=e.trim(),e.length!==0){if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}var u=this.tagMappers.reduce(function(l,c){var g=c(e);return g===e?l:l.concat([g])},[e]);u.forEach(function(l){for(var c=0;c<t.customParsers.length;c++)if(t.customParsers[c].call(t,l))return;if(l.indexOf("#EXT")!==0){t.trigger("data",{type:"comment",text:l.slice(1)});return}if(l=l.replace("\r",""),a=/^#EXTM3U/.exec(l),a){t.trigger("data",{type:"tag",tagType:"m3u"});return}if(a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(l),a){o={type:"tag",tagType:"inf"},a[1]&&(o.duration=parseFloat(a[1])),a[2]&&(o.title=a[2]),t.trigger("data",o);return}if(a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(l),a){o={type:"tag",tagType:"targetduration"},a[1]&&(o.duration=parseInt(a[1],10)),t.trigger("data",o);return}if(a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(l),a){o={type:"tag",tagType:"version"},a[1]&&(o.version=parseInt(a[1],10)),t.trigger("data",o);return}if(a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),a){o={type:"tag",tagType:"media-sequence"},a[1]&&(o.number=parseInt(a[1],10)),t.trigger("data",o);return}if(a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(l),a){o={type:"tag",tagType:"discontinuity-sequence"},a[1]&&(o.number=parseInt(a[1],10)),t.trigger("data",o);return}if(a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(l),a){o={type:"tag",tagType:"playlist-type"},a[1]&&(o.playlistType=a[1]),t.trigger("data",o);return}if(a=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(l),a){o=wt(Zn(a[1]),{type:"tag",tagType:"byterange"}),t.trigger("data",o);return}if(a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(l),a){o={type:"tag",tagType:"allow-cache"},a[1]&&(o.allowed=!/NO/.test(a[1])),t.trigger("data",o);return}if(a=/^#EXT-X-MAP:?(.*)$/.exec(l),a){if(o={type:"tag",tagType:"map"},a[1]){var g=at(a[1]);g.URI&&(o.uri=g.URI),g.BYTERANGE&&(o.byterange=Zn(g.BYTERANGE))}t.trigger("data",o);return}if(a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(l),a){if(o={type:"tag",tagType:"stream-inf"},a[1]){if(o.attributes=at(a[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))}t.trigger("data",o);return}if(a=/^#EXT-X-MEDIA:?(.*)$/.exec(l),a){o={type:"tag",tagType:"media"},a[1]&&(o.attributes=at(a[1])),t.trigger("data",o);return}if(a=/^#EXT-X-ENDLIST/.exec(l),a){t.trigger("data",{type:"tag",tagType:"endlist"});return}if(a=/^#EXT-X-DISCONTINUITY/.exec(l),a){t.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(l),a){o={type:"tag",tagType:"program-date-time"}
3,a[1]&&(o.dateTimeString=a[1],o.dateTimeObject=new Date(a[1])),t.trigger("data",o);return}if(a=/^#EXT-X-KEY:?(.*)$/.exec(l),a){o={type:"tag",tagType:"key"},a[1]&&(o.attributes=at(a[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))),t.trigger("data",o);return}if(a=/^#EXT-X-START:?(.*)$/.exec(l),a){o={type:"tag",tagType:"start"},a[1]&&(o.attributes=at(a[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),t.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(l),a){o={type:"tag",tagType:"cue-out-cont"},a[1]?o.data=a[1]:o.data="",t.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(l),a){o={type:"tag",tagType:"cue-out"},a[1]?o.data=a[1]:o.data="",t.trigger("data",o);return}if(a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(l),a){o={type:"tag",tagType:"cue-in"},a[1]?o.data=a[1]:o.data="",t.trigger("data",o);return}if(a=/^#EXT-X-SKIP:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"skip"},o.attributes=at(a[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(nh)),t.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=at(a[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=Zn(o.attributes.BYTERANGE)),t.trigger("data",o);return}if(a=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"server-control"},o.attributes=at(a[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]))}),t.trigger("data",o);return}if(a=/^#EXT-X-PART-INF:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"part-inf"},o.attributes=at(a[1]),["PART-TARGET"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseFloat(o.attributes[b]))}),t.trigger("data",o);return}if(a=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=at(a[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(b){if(o.attributes.hasOwnProperty(b)){o.attributes[b]=parseInt(o.attributes[b],10);var E=b==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[E]=o.attributes[b],delete o.attributes[b]}}),t.trigger("data",o);return}if(a=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(l),a&&a[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=at(a[1]),["LAST-MSN","LAST-PART"].forEach(function(b){o.attributes.hasOwnProperty(b)&&(o.attributes[b]=parseInt(o.attributes[b],10))}),t.trigger("data",o);return}t.trigger("data",{type:"tag",data:l.slice(4)})})}},n.addParser=function(e){var t=this,a=e.expression,o=e.customType,u=e.dataParser,l=e.segment;typeof u!="function"&&(u=function(g){return g}),this.customParsers.push(function(c){var g=a.exec(c);if(g)return t.trigger("data",{type:"custom",data:u(c),customType:o,segment:l}),!0})},n.addTagMapper=function(e){var t=e.expression,a=e.map,o=function(l){return t.test(l)?a(l):l};this.tagMappers.push(o)},i}(Qa),oh=function(i){return i.toLowerCase().replace(/-(\w)/g,function(n){return n[1].toUpperCase()})},ui=function(i){var n={};
3return Object.keys(i).forEach(function(r){n[oh(r)]=i[r]}),n},ea=function(i){var n=i.serverControl,r=i.targetDuration,e=i.partTargetDuration;if(n){var t="#EXT-X-SERVER-CONTROL",a="holdBack",o="partHoldBack",u=r&&r*3,l=e&&e*2;r&&!n.hasOwnProperty(a)&&(n[a]=u,this.trigger("info",{message:t+" defaulting HOLD-BACK to targetDuration * 3 ("+u+")."})),u&&n[a]<u&&(this.trigger("warn",{message:t+" clamping HOLD-BACK ("+n[a]+") to targetDuration * 3 ("+u+")"}),n[a]=u),e&&!n.hasOwnProperty(o)&&(n[o]=e*3,this.trigger("info",{message:t+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+n[o]+")."})),e&&n[o]<l&&(this.trigger("warn",{message:t+" clamping PART-HOLD-BACK ("+n[o]+") to partTargetDuration * 2 ("+l+")."}),n[o]=l)}},uh=function(s){$(i,s);function i(){var r;r=s.call(this)||this,r.lineStream=new rh,r.parseStream=new sh,r.lineStream.pipe(r.parseStream);var e=ne(r),t=[],a={},o,u,l=!1,c=function(){},g={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},m="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",_=0;r.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var b=0,E=0;return r.on("end",function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&o&&(a.map=o),!a.key&&u&&(a.key=u),!a.timeline&&typeof _=="number"&&(a.timeline=_),r.manifest.preloadSegment=a)}),r.parseStream.on("data",function(S){var R,F;({tag:function(){({version:function(){S.version&&(this.manifest.version=S.version)},"allow-cache":function(){this.manifest.allowCache=S.allowed,"allowed"in S||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var L={};"length"in S&&(a.byterange=L,L.length=S.length,"offset"in S||(S.offset=b)),"offset"in S&&(a.byterange=L,L.offset=S.offset),b=L.offset+L.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"})),S.duration>0&&(a.duration=S.duration),S.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key:function(){if(!S.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(S.attributes.METHOD==="NONE"){u=null;return}if(!S.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(S.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:S.attributes};return}if(S.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:S.attributes.URI};return}if(S.attributes.KEYFORMAT===m){var L=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(L.indexOf(S.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(S.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),S.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(S.attributes.KEYID&&S.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:S.attributes.KEYFORMAT,keyId:S.attributes.KEYID.substring(2)},pssh:Yu(S.attributes.URI.split(",")[1])};return}S.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:S.attributes.METHOD||"AES-128",uri:S.attributes.URI},typeof S.attributes.IV<"u"&&(u.iv=S.attributes.IV)},"media-sequence":function(){if(!isFinite(S.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+S.number});return}this.manifest.mediaSequence=S.number},"discontinuity-sequence":function(){if(!isFinite(S.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+S.number});return}this.manifest.discontinuitySequence=S.number,_=S.number},"playlist-type":function(){if(!/VOD|EVENT/.test(S.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+S.playlist});return}this.manifest.playlistType=S.playlistType},map:function(){o={},S.uri&&(o.uri=S.uri),S.byterange&&(o.byterange=S.byterange),u&&(o.key=u)},"stream-inf":function(){if(this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||g,!S.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),wt(a.attributes,S.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||g,!(S.attributes&&S.attributes.TYPE&&S.attributes["GROUP-ID"]&&S.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var L=this.manifest.mediaGroups[S.attributes.TYPE];L[S.attributes["GROUP-ID"]]=L[S.attributes["GROUP-ID"]]||{},R=L[S.attributes["GROUP-ID"]],F={default:/yes/i.test(S.attributes.DEFAULT)},F.default?F.autoselect=!0:F.autoselect=/yes/i.test(S.attributes.AUTOSELECT),S.attributes.LANGUAGE&&(F.language=S.attributes.LANGUAGE),S.attributes.URI&&(F.uri=S.attributes.URI),S.attributes["INSTREAM-ID"]&&(F.instreamId=S.attributes["INSTREAM-ID"]),S.attributes.CHARACTERISTICS&&(F.characteristics=S.attributes.CHARACTERISTICS),S.attributes.FORCED&&(F.forced=/yes/i.test(S.attributes.FORCED)),R[S.attributes.NAME]=F},discontinuity:function(){_+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=S.dateTimeString,this.manifest.dateTimeObject=S.dateTimeObject),a.dateTimeString=S.dateTimeString,a.dateTimeObject=S.dateTimeObject},targetduration:function(){if(!isFinite(S.duration)||S.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+S.duration});return}this.manifest.targetDuration=S.duration,ea.call(this,this.manifest)},start:function(){if(!S.attributes||isNaN(S.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:S.attributes["TIME-OFFSET"],precise:S.attributes.PRECISE}},"cue-out":function(){a.cueOut=S.data},"cue-out-cont":function(){a.cueOutCont=S.data},"cue-in":function(){a.cueIn=S.data},skip:function(){this.manifest.skip=ui(S.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",S.attributes,["SKIPPED-SEGMENTS"])},part:function(){var L=this;l=!0;var j=this.manifest.segments.length,U=ui(S.attributes);a.parts=a.parts||[],a.parts.push(U),U.byterange&&(U.byterange.hasOwnProperty("offset")||(U.byterange.offset=E),E=U.byterange.offset+U.byterange.length);var D=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+D+" for segment #"+j,S.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEac
3h(function(W,V){W.hasOwnProperty("lastPart")||L.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+V+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var L=this.manifest.serverControl=ui(S.attributes);L.hasOwnProperty("canBlockReload")||(L.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ea.call(this,this.manifest),L.canSkipDateranges&&!L.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 L=this.manifest.segments.length,j=ui(S.attributes),U=j.type&&j.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(j),j.byterange&&(j.byterange.hasOwnProperty("offset")||(j.byterange.offset=U?E:0,U&&(E=j.byterange.offset+j.byterange.length)));var D=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+D+" for segment #"+L,S.attributes,["TYPE","URI"]),!!j.type)for(var W=0;W<a.preloadHints.length-1;W++){var V=a.preloadHints[W];V.type&&V.type===j.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+D+" for segment #"+L+" has the same TYPE "+j.type+" as preload hint #"+W})}},"rendition-report":function(){var L=ui(S.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(L);var j=this.manifest.renditionReports.length-1,U=["LAST-MSN","URI"];l&&U.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+j,S.attributes,U)},"part-inf":function(){this.manifest.partInf=ui(S.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",S.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),ea.call(this,this.manifest)}}[S.tagType]||c).call(e)},uri:function(){a.uri=S.uri,t.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),u&&(a.key=u),a.timeline=_,o&&(a.map=o),E=0,a={}},comment:function(){},custom:function(){S.segment?(a.custom=a.custom||{},a.custom[S.customType]=S.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[S.customType]=S.data)}})[S.type].call(e)}),r}var n=i.prototype;return n.warnOnMissingAttributes_=function(e,t,a){var o=[];a.forEach(function(u){t.hasOwnProperty(u)||o.push(u)}),o.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+o.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push(`
4`),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},i}(Qa),Yt={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^/},lh=["video","audio","text"],Mo=["Video","Audio","Text"],Ju=function(i){return i&&i.replace(/avc1\.(\d+)\.(\d+)/i,function(n,r,e){var t=("00"+Number(r).toString(16)).slice(-2),a=("00"+Number(e).toString(16)).slice(-2);return"avc1."+t+"00"+a})},ft=function(i){i===void 0&&(i="");var n=i.split(","),r=[];return n.forEach(function(e){e=e.trim();var t;lh.forEach(function(a){var o=Yt[a].exec(e.toLowerCase());if(!(!o||o.length<=1)){t=a;var u=e.substring(0,o[1].length),l=e.replace(u,"");r.push({type:u,details:l,mediaType:a})}}),t||r.push({type:e,details:"",mediaType:"unknown"})}),r},dh=function(i,n){if(!i.mediaGroups.AUDIO||!n)return null;var r=i.mediaGroups.AUDIO[n];if(!r)return null;for(var e in r){var t=r[e];if(t.default&&t.playlists)return ft(t.playlists[0].attributes.CODECS)}return null},Zu=function(i){return i===void 0&&(i=""),Yt.audio.test(i.trim().toLowerCase())},ch=function(i){return i===void 0&&(i=""),Yt.text.test(i.trim().toLowerCase())}
4,er=function(i){if(!(!i||typeof i!="string")){var n=i.toLowerCase().split(",").map(function(t){return Ju(t.trim())}),r="video";n.length===1&&Zu(n[0])?r="audio":n.length===1&&ch(n[0])&&(r="application");var e="mp4";return n.every(function(t){return Yt.mp4.test(t)})?e="mp4":n.every(function(t){return Yt.webm.test(t)})?e="webm":n.every(function(t){return Yt.ogg.test(t)})&&(e="ogg"),r+"/"+e+';codecs="'+i+'"'}},$r=function(i){return i===void 0&&(i=""),k.MediaSource&&k.MediaSource.isTypeSupported&&k.MediaSource.isTypeSupported(er(i))||!1},ta=function(i){return i===void 0&&(i=""),i.toLowerCase().split(",").every(function(n){n=n.trim();for(var r=0;r<Mo.length;r++){var e=Mo[r];if(Yt["muxer"+e].test(n))return!0}return!1})},Fo="mp4a.40.2",fh="avc1.4d400d",hh=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,ph=/^application\/dash\+xml/i,el=function(i){return hh.test(i)?"hls":ph.test(i)?"dash":i==="application/vnd.videojs.vhs+json"?"vhs-json":null},mh=function(i){return i.toString(2).length},gh=function(i){return Math.ceil(mh(i)/8)},tl=function(i){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer},vh=function(i){return tl(i)},te=function(i){return i instanceof Uint8Array?i:(!Array.isArray(i)&&!vh(i)&&!(i instanceof ArrayBuffer)&&(typeof i!="number"||typeof i=="number"&&i!==i?i=0:i=[i]),new Uint8Array(i&&i.buffer||i,i&&i.byteOffset||0,i&&i.byteLength||0))},Le=k.BigInt||Number,xa=[Le("0x1"),Le("0x100"),Le("0x10000"),Le("0x1000000"),Le("0x100000000"),Le("0x10000000000"),Le("0x1000000000000"),Le("0x100000000000000"),Le("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),i=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return i[0]===255?"big":i[0]===204?"little":"unknown"})();var yh=function(i,n){var r=n===void 0?{}:n,e=r.signed,t=e===void 0?!1:e,a=r.le,o=a===void 0?!1:a;i=te(i);var u=o?"reduce":"reduceRight",l=i[u]?i[u]:Array.prototype[u],c=l.call(i,function(m,_,b){var E=o?b:Math.abs(b+1-i.length);return m+Le(_)*xa[E]},Le(0));if(t){var g=xa[i.length]/Le(2)-Le(1);c=Le(c),c>g&&(c-=g,c-=g,c-=Le(2))}return Number(c)},_h=function(i,n){var r={},e=r.le,t=e===void 0?!1:e;(typeof i!="bigint"&&typeof i!="number"||typeof i=="number"&&i!==i)&&(i=0),i=Le(i);for(var a=gh(i),o=new Uint8Array(new ArrayBuffer(a)),u=0;u<a;u++){var l=t?u:Math.abs(u+1-o.length);o[l]=Number(i/xa[u]&Le(255)),i<0&&(o[l]=Math.abs(~o[l]),o[l]-=u===0?1:2)}return o},il=function(i,n){if(typeof i!="string"&&i&&typeof i.toString=="function"&&(i=i.toString()),typeof i!="string")return new Uint8Array;n||(i=unescape(encodeURIComponent(i)));for(var r=new Uint8Array(i.length),e=0;e<i.length;e++)r[e]=i.charCodeAt(e);return r},Th=function(){for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];if(n=n.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),n.length<=1)return te(n[0]);var e=n.reduce(function(o,u,l){return o+(u.byteLength||u.length)},0),t=new Uint8Array(e),a=0;return n.forEach(function(o){o=te(o),t.set(o,a),a+=o.byteLength}),t},_e=function(i,n,r){var e=r===void 0?{}:r,t=e.offset,a=t===void 0?0:t,o=e.mask,u=o===void 0?[]:o;i=te(i),n=te(n);var l=n.every?n.every:Array.prototype.every;return n.length&&i.length-a>=n.length&&l.call(n,function(c,g){var m=u[g]?u[g]&i[a+g]:i[a+g];return c===m})},bh=function(i,n,r){n.forEach(function(e){for(var t in i.mediaGroups[e])for(var a in i.mediaGroups[e][t]){var o=i.mediaGroups[e][t][a];r(o,e,t,a)}})};/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var Ro=function(i){return!!i&&typeof i=="object"},He=function s(){for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return n.reduce(function(e,t){return typeof t!="object"||Object.keys(t).forEach(function(a){Array.isArray(e[a])&&Array.isArray(t[a])?e[a]=e[a].concat(t[a]):Ro(e[a])&&Ro(t[a])?e[a]=s(e[a],t[a]):e[a]=t[a]}),e},{})},rl=function(i){return Object.keys(i).map(function(n){return i[n]})},Sh=function(i,n){for(var r=[],e=i;e<n;e++)r.push(e);return r},Cn=function(i){return i.reduce(function(n,r){return n.concat(r)},[])},nl=function(i){if(!i.length)return[];for(var n=[],r=0;r<i.length;r++)n.push(i[r]);return n},xh=function(i,n){return i.reduce(function(r,e,t){return e[n]&&r.push(t),r},[])},Ea=function(i,n){for(var r=0;r<i.length;r++)if(n(i[r]))return r;return-1},Eh=function(i,n){return rl(i.reduce(function(r,e){return e.forEach(function(t){r[n(t)]=t}),r},{}))}
4,bi={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},tr=function(i){var n=i.baseUrl,r=n===void 0?"":n,e=i.source,t=e===void 0?"":e,a=i.range,o=a===void 0?"":a,u=i.indexRange,l=u===void 0?"":u,c={uri:t,resolvedUri:En(r||"",t)};if(o||l){var g=o||l,m=g.split("-"),_=k.BigInt?k.BigInt(m[0]):parseInt(m[0],10),b=k.BigInt?k.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 E;typeof b=="bigint"||typeof _=="bigint"?E=k.BigInt(b)-k.BigInt(_)+k.BigInt(1):E=b-_+1,typeof E=="bigint"&&E<Number.MAX_SAFE_INTEGER&&(E=Number(E)),c.byterange={length:E,offset:_}}return c},Ch=function(i){var n;return typeof i.offset=="bigint"||typeof i.length=="bigint"?n=k.BigInt(i.offset)+k.BigInt(i.length)-k.BigInt(1):n=i.offset+i.length-1,i.offset+"-"+n},No=function(i){return i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i},kh={static:function(i){var n=i.duration,r=i.timescale,e=r===void 0?1:r,t=i.sourceDuration,a=i.periodDuration,o=No(i.endNumber),u=n/e;return typeof o=="number"?{start:0,end:o}:typeof a=="number"?{start:0,end:a/u}:{start:0,end:t/u}},dynamic:function(i){var n=i.NOW,r=i.clientOffset,e=i.availabilityStartTime,t=i.timescale,a=t===void 0?1:t,o=i.duration,u=i.periodStart,l=u===void 0?0:u,c=i.minimumUpdatePeriod,g=c===void 0?0:c,m=i.timeShiftBufferDepth,_=m===void 0?1/0:m,b=No(i.endNumber),E=(n+r)/1e3,S=e+l,R=E+g,F=R-S,B=Math.ceil(F*a/o),O=Math.floor((E-S-_)*a/o),L=Math.floor((E-S)*a/o);return{start:Math.max(0,O),end:typeof b=="number"?b:Math.min(B,L)}}},wh=function(i){return function(n){var r=i.duration,e=i.timescale,t=e===void 0?1:e,a=i.periodStart,o=i.startNumber,u=o===void 0?1:o;return{number:u+n,duration:r/t,timeline:a,time:n*r}}},Ya=function(i){var n=i.type,r=i.duration,e=i.timescale,t=e===void 0?1:e,a=i.periodDuration,o=i.sourceDuration,u=kh[n](i),l=u.start,c=u.end,g=Sh(l,c).map(wh(i));if(n==="static"){var m=g.length-1,_=typeof a=="number"?a:o;g[m].duration=_-r/t*m}return g},al=function(i){var n=i.baseUrl,r=i.initialization,e=r===void 0?{}:r,t=i.sourceDuration,a=i.indexRange,o=a===void 0?"":a,u=i.periodStart,l=i.presentationTime,c=i.number,g=c===void 0?0:c,m=i.duration;if(!n)throw new Error(bi.NO_BASE_URL);var _=tr({baseUrl:n,source:e.sourceURL,range:e.range}),b=tr({baseUrl:n,source:n,indexRange:o});if(b.map=_,m){var E=Ya(i);E.length&&(b.duration=E[0].duration,b.timeline=E[0].timeline)}else t&&(b.duration=t,b.timeline=u);return b.presentationTime=l||u,b.number=g,[b]},Ja=function(i,n,r){var e=i.sidx.map?i.sidx.map:null,t=i.sidx.duration,a=i.timeline||0,o=i.sidx.byterange,u=o.offset+o.length,l=n.timescale,c=n.references.filter(function(W){return W.referenceType!==1}),g=[],m=i.endList?"static":"dynamic",_=i.sidx.timeline,b=_,E=i.mediaSequence||0,S;typeof n.firstOffset=="bigint"?S=k.BigInt(u)+n.firstOffset:S=u+n.firstOffset;for(var R=0;R<c.length;R++){var F=n.references[R],B=F.referencedSize,O=F.subsegmentDuration,L=void 0;typeof S=="bigint"?L=S+k.BigInt(B)-k.BigInt(1):L=S+B-1;var j=S+"-"+L,U={baseUrl:r,timescale:l,timeline:a,periodStart:_,presentationTime:b,number:E,duration:O,sourceDuration:t,indexRange:j,type:m},D=al(U)[0];e&&(D.map=e),g.push(D),typeof S=="bigint"?S+=k.BigInt(B):S+=B,b+=O/l,E++}return i.segments=g,i},Ph=["AUDIO","SUBTITLES"],Ih=1/60,sl=function(i){return Eh(i,function(n){var r=n.timeline;return r}).sort(function(n,r){return n.timeline>r.timeline?1:-1})},Ah=function(i,n){for(var r=0;r<i.length;r++)if(i[r].attributes.NAME===n)return i[r];return null},Uo=function(i){var n=[];return bh(i,Ph,function(r,e,t,a){n=n.concat(r.playlists||[])}),n},Bo=function(i){var n=i.playlist,r=i.mediaSequence;n.mediaSequence=r,n.segments.forEach(function(e,t){e.number=n.mediaSequence+t})},Oh=function(i){var n=i.oldPlaylists,r=i.newPlaylists,e=i.timelineStarts;r.forEach(function(t){t.discontinuitySequence=Ea(e,function(c){var g=c.timeline;return g===t.timeline});var a=Ah(n,t.attributes.NAME);if(a&&!t.sidx){var o=t.segments[0],u=Ea(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<Ih});if(u===-1){Bo({playlist:t,mediaSequence:a.mediaSequence+a.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!a.segments.length&&t.timeline>a.timeline||a.segments.length&&t.timeline>a.segments[a.segments.length-1].timeline)&&t.discontinuitySequence--;return}var l=a.segments[u];l.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),Bo({playlist:t,mediaSequence:a.segments[u].number})}})},Dh=function(i){var n=i.oldManifest,r=i.newManifest,e=n.playlists.concat(Uo(n)),t=r.playlists.concat(Uo(r));return r.timelineStarts=sl([n.timelineStarts,r.timelineStarts]),Oh({oldPlaylists:e,newPlaylists:t,timelineStarts:r.timelineStarts}),r},kn=function(i){return i&&i.uri+"-"+Ch(i.byterange)},ia=function(i){var n=rl(i.reduce(function(r,e){var t=e.attributes.id+(e.attributes.lang||"");if(!r[t])r[t]=e,r[t].attributes.timelineStarts=[];else{if(e.segments){var a;
4e.segments[0]&&(e.segments[0].discontinuity=!0),(a=r[t].segments).push.apply(a,e.segments)}e.attributes.contentProtection&&(r[t].attributes.contentProtection=e.attributes.contentProtection)}return r[t].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),r},{}));return n.map(function(r){return r.discontinuityStarts=xh(r.segments||[],"discontinuity"),r})},Za=function(i,n){var r=kn(i.sidx),e=r&&n[r]&&n[r].sidx;return e&&Ja(i,e,i.sidx.resolvedUri),i},Lh=function(i,n){if(n===void 0&&(n={}),!Object.keys(n).length)return i;for(var r in i)i[r]=Za(i[r],n);return i},Mh=function(i,n){var r,e=i.attributes,t=i.segments,a=i.sidx,o=i.mediaSequence,u=i.discontinuitySequence,l=i.discontinuityStarts,c={attributes:(r={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:u,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:o,segments:t};return e.contentProtection&&(c.contentProtection=e.contentProtection),a&&(c.sidx=a),n&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},Fh=function(i){var n,r=i.attributes,e=i.segments,t=i.mediaSequence,a=i.discontinuityStarts,o=i.discontinuitySequence;typeof e>"u"&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var u=(n={NAME:r.id,BANDWIDTH:r.bandwidth},n["PROGRAM-ID"]=1,n);return r.codecs&&(u.CODECS=r.codecs),{attributes:u,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:t,segments:e}},Rh=function(i,n,r){n===void 0&&(n={}),r===void 0&&(r=!1);var e,t=i.reduce(function(o,u){var l=u.attributes.role&&u.attributes.role.value||"",c=u.attributes.lang||"",g=u.attributes.label||"main";if(c&&!u.attributes.label){var m=l?" ("+l+")":"";g=""+u.attributes.lang+m}o[g]||(o[g]={language:c,autoselect:!0,default:l==="main",playlists:[],uri:""});var _=Za(Mh(u,r),n);return o[g].playlists.push(_),typeof e>"u"&&l==="main"&&(e=u,e.default=!0),o},{});if(!e){var a=Object.keys(t)[0];t[a].default=!0}return t},Nh=function(i,n){return n===void 0&&(n={}),i.reduce(function(r,e){var t=e.attributes.lang||"text";return r[t]||(r[t]={language:t,default:!1,autoselect:!1,playlists:[],uri:""}),r[t].playlists.push(Za(Fh(e),n)),r},{})},Uh=function(i){return i.reduce(function(n,r){return r&&r.forEach(function(e){var t=e.channel,a=e.language;n[a]={autoselect:!1,default:!1,instreamId:t,language:a},e.hasOwnProperty("aspectRatio")&&(n[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(n[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(n[a]["3D"]=e["3D"])}),n},{})},Bh=function(i){var n,r=i.attributes,e=i.segments,t=i.sidx,a=i.discontinuityStarts,o={attributes:(n={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},n["PROGRAM-ID"]=1,n),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:e};return r.frameRate&&(o.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(o.contentProtection=r.contentProtection),t&&(o.sidx=t),o},jh=function(i){var n=i.attributes;return n.mimeType==="video/mp4"||n.mimeType==="video/webm"||n.contentType==="video"},Vh=function(i){var n=i.attributes;return n.mimeType==="audio/mp4"||n.mimeType==="audio/webm"||n.contentType==="audio"},Hh=function(i){var n=i.attributes;return n.mimeType==="text/vtt"||n.contentType==="text"},Wh=function(i,n){i.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=Ea(n,function(e){var t=e.timeline;return t===r.timeline}),r.segments&&r.segments.forEach(function(e,t){e.number=t})})},jo=function(i){return i?Object.keys(i).reduce(function(n,r){var e=i[r];return n.concat(e.playlists)},[]):[]},qh=function(i){var n,r=i.dashPlaylists,e=i.locations,t=i.sidxMapping,a=t===void 0?{}:t,o=i.previousManifest;if(!r.length)return{};var u=r[0].attributes,l=u.sourceDuration,c=u.type,g=u.suggestedPresentationDelay,m=u.minimumUpdatePeriod,_=ia(r.filter(jh)).map(Bh),b=ia(r.filter(Vh)),E=ia(r.filter(Hh)),S=r.map(function(U){return U.attributes.captionServices}
4).filter(Boolean),R={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:l,playlists:Lh(_,a)};m>=0&&(R.minimumUpdatePeriod=m*1e3),e&&(R.locations=e),c==="dynamic"&&(R.suggestedPresentationDelay=g);var F=R.playlists.length===0,B=b.length?Rh(b,a,F):null,O=E.length?Nh(E,a):null,L=_.concat(jo(B),jo(O)),j=L.map(function(U){var D=U.timelineStarts;return D});return R.timelineStarts=sl(j),Wh(L,R.timelineStarts),B&&(R.mediaGroups.AUDIO.audio=B),O&&(R.mediaGroups.SUBTITLES.subs=O),S.length&&(R.mediaGroups["CLOSED-CAPTIONS"].cc=Uh(S)),o?Dh({oldManifest:o,newManifest:R}):R},Gh=function(i,n,r){var e=i.NOW,t=i.clientOffset,a=i.availabilityStartTime,o=i.timescale,u=o===void 0?1:o,l=i.periodStart,c=l===void 0?0:l,g=i.minimumUpdatePeriod,m=g===void 0?0:g,_=(e+t)/1e3,b=a+c,E=_+m,S=E-b;return Math.ceil((S*u-n)/r)},ol=function(i,n){for(var r=i.type,e=i.minimumUpdatePeriod,t=e===void 0?0:e,a=i.media,o=a===void 0?"":a,u=i.sourceDuration,l=i.timescale,c=l===void 0?1:l,g=i.startNumber,m=g===void 0?1:g,_=i.periodStart,b=[],E=-1,S=0;S<n.length;S++){var R=n[S],F=R.d,B=R.r||0,O=R.t||0;E<0&&(E=O),O&&O>E&&(E=O);var L=void 0;if(B<0){var j=S+1;j===n.length?r==="dynamic"&&t>0&&o.indexOf("$Number$")>0?L=Gh(i,E,F):L=(u*c-E)/F:L=(n[j].t-E)/F}else L=B+1;for(var U=m+b.length+L,D=m+b.length;D<U;)b.push({number:D,duration:F/c,time:E,timeline:_}),E+=F,D++}return b},zh=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Kh=function(i){return function(n,r,e,t){if(n==="$$")return"$";if(typeof i[r]>"u")return n;var a=""+i[r];return r==="RepresentationID"||(e?t=parseInt(t,10):t=1,a.length>=t)?a:""+new Array(t-a.length+1).join("0")+a}},Vo=function(i,n){return i.replace(zh,Kh(n))},$h=function(i,n){return!i.duration&&!n?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Ya(i):ol(i,n)},Xh=function(i,n){var r={RepresentationID:i.id,Bandwidth:i.bandwidth||0},e=i.initialization,t=e===void 0?{sourceURL:"",range:""}:e,a=tr({baseUrl:i.baseUrl,source:Vo(t.sourceURL,r),range:t.range}),o=$h(i,n);return o.map(function(u){r.Number=u.number,r.Time=u.time;var l=Vo(i.media||"",r),c=i.timescale||1,g=i.presentationTimeOffset||0,m=i.peri
4odStart+(u.time-g)/c,_={uri:l,timeline:u.timeline,duration:u.duration,resolvedUri:En(i.baseUrl||"",l),map:a,number:u.number,presentationTime:m};return _})},Qh=function(i,n){var r=i.baseUrl,e=i.initialization,t=e===void 0?{}:e,a=tr({baseUrl:r,source:t.sourceURL,range:t.range}),o=tr({baseUrl:r,source:n.media,range:n.mediaRange});return o.map=a,o},Yh=function(i,n){var r=i.duration,e=i.segmentUrls,t=e===void 0?[]:e,a=i.periodStart;if(!r&&!n||r&&n)throw new Error(bi.SEGMENT_TIME_UNSPECIFIED);var o=t.map(function(c){return Qh(i,c)}),u;r&&(u=Ya(i)),n&&(u=ol(i,n));var l=u.map(function(c,g){if(o[g]){var m=o[g],_=i.timescale||1,b=i.presentationTimeOffset||0;return m.timeline=c.timeline,m.duration=c.duration,m.number=c.number,m.presentationTime=a+(c.time-b)/_,m}}).filter(function(c){return c});return l},Jh=function(i){var n=i.attributes,r=i.segmentInfo,e,t;r.template?(t=Xh,e=He(n,r.template)):r.base?(t=al,e=He(n,r.base)):r.list&&(t=Yh,e=He(n,r.list));var a={attributes:n};if(!t)return a;var o=t(e,r.segmentTimeline);if(e.duration){var u=e,l=u.duration,c=u.timescale,g=c===void 0?1:c;e.duration=l/g}else o.length?e.duration=o.reduce(function(m,_){return Math.max(m,Math.ceil(_.duration))},0):e.duration=0;return a.attributes=e,a.segments=o,r.base&&e.indexRange&&(a.sidx=o[0],a.segments=[]),a},Zh=function(i){return i.map(Jh)},xe=function(i,n){return nl(i.childNodes).filter(function(r){var e=r.tagName;return e===n})},es=function(i){return i.textContent.trim()},ep=function(i){return parseFloat(i.split("/").reduce(function(n,r){return n/r}))},li=function(i){var n=31536e3,r=30*24*60*60,e=24*60*60,t=60*60,a=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,u=o.exec(i);if(!u)return 0;var l=u.slice(1),c=l[0],g=l[1],m=l[2],_=l[3],b=l[4],E=l[5];return parseFloat(c||0)*n+parseFloat(g||0)*r+parseFloat(m||0)*e+parseFloat(_||0)*t+parseFloat(b||0)*a+parseFloat(E||0)},tp=function(i){var n=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return n.test(i)&&(i+="Z"),Date.parse(i)},Ho={mediaPresentationDuration:function(i){return li(i)},availabilityStartTime:function(i){return tp(i)/1e3},minimumUpdatePeriod:function(i){return li(i)},suggestedPresentationDelay:function(i){return li(i)},type:function(i){return i},timeShiftBufferDepth:function(i){return li(i)},start:function(i){return li(i)},width:function(i){return parseInt(i,10)},height:function(i){return parseInt(i,10)},bandwidth:function(i){return parseInt(i,10)},frameRate:function(i){return ep(i)},startNumber:function(i){return parseInt(i,10)},timescale:function(i){return parseInt(i,10)},presentationTimeOffset:function(i){return parseInt(i,10)},duration:function(i){var n=parseInt(i,10);return isNaN(n)?li(i):n},d:function(i){return parseInt(i,10)},t:function(i){return parseInt(i,10)},r:function(i){return parseInt(i,10)},DEFAULT:function(i){return i}},Fe=function(i){return i&&i.attributes?nl(i.attributes).reduce(function(n,r){var e=Ho[r.name]||Ho.DEFAULT;return n[r.name]=e(r.value),n},{}):{}},ip={"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"},wn=function(i,n){return n.length?Cn(i.map(function(r){return n.map(function(e){return En(r,es(e))})})):i},ts=function(i){var n=xe(i,"SegmentTemplate")[0],r=xe(i,"SegmentList")[0],e=r&&xe(r,"SegmentURL").map(function(m){return He({tag:"SegmentURL"},Fe(m))}),t=xe(i,"SegmentBase")[0],a=r||n,o=a&&xe(a,"SegmentTimeline")[0],u=r||t||n,l=u&&xe(u,"Initialization")[0],c=n&&Fe(n);c&&l?c.initialization=l&&Fe(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var g={template:c,segmentTimeline:o&&xe(o,"S").map(function(m){return Fe(m)}
4),list:r&&He(Fe(r),{segmentUrls:e,initialization:Fe(l)}),base:t&&He(Fe(t),{initialization:Fe(l)})};return Object.keys(g).forEach(function(m){g[m]||delete g[m]}),g},rp=function(i,n,r){return function(e){var t=xe(e,"BaseURL"),a=wn(n,t),o=He(i,Fe(e)),u=ts(e);return a.map(function(l){return{segmentInfo:He(r,u),attributes:He(o,{baseUrl:l})}})}},np=function(i){return i.reduce(function(n,r){var e=Fe(r);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var t=ip[e.schemeIdUri];if(t){n[t]={attributes:e};var a=xe(r,"cenc:pssh")[0];if(a){var o=es(a);n[t].pssh=o&&Yu(o)}}return n},{})},ap=function(i){if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var n=typeof i.value!="string"?[]:i.value.split(";");return n.map(function(e){var t,a;if(a=e,/^CC\d=/.test(e)){var o=e.split("=");t=o[0],a=o[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:a}})}else if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var r=typeof i.value!="string"?[]:i.value.split(";");return r.map(function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var a=e.split("="),o=a[0],u=a[1],l=u===void 0?"":u;t.channel=o,t.language=e,l.split(",").forEach(function(c){var g=c.split(":"),m=g[0],_=g[1];m==="lang"?t.language=_:m==="er"?t.easyReader=Number(_):m==="war"?t.aspectRatio=Number(_):m==="3D"&&(t["3D"]=Number(_))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})}},sp=function(i,n,r){return function(e){var t=Fe(e),a=wn(n,xe(e,"BaseURL")),o=xe(e,"Role")[0],u={role:Fe(o)},l=He(i,t,u),c=xe(e,"Accessibility")[0],g=ap(Fe(c));g&&(l=He(l,{captionServices:g}));var m=xe(e,"Label")[0];if(m&&m.childNodes.length){var _=m.childNodes[0].nodeValue.trim();l=He(l,{label:_})}var b=np(xe(e,"ContentProtection"));Object.keys(b).length&&(l=He(l,{contentProtection:b}));var E=ts(e),S=xe(e,"Representation"),R=He(r,E);return Cn(S.map(rp(l,a,R)))}},op=function(i,n){return function(r,e){var t=wn(n,xe(r.node,"BaseURL")),a=He(i,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var o=xe(r.node,"AdaptationSet"),u=ts(r.node);return Cn(o.map(sp(a,t,u)))}},up=function(i){var n=i.attributes,r=i.priorPeriodAttributes,e=i.mpdType;return typeof n.start=="number"?n.start:r&&typeof r.start=="number"&&typeof r.duration=="number"?r.start+r.duration:!r&&e==="static"?0:null},lp=function(i,n){n===void 0&&(n={});var r=n,e=r.manifestUri,t=e===void 0?"":e,a=r.NOW,o=a===void 0?Date.now():a,u=r.clientOffset,l=u===void 0?0:u,c=xe(i,"Period");if(!c.length)throw new Error(bi.INVALID_NUMBER_OF_PERIOD);var g=xe(i,"Location"),m=Fe(i),_=wn([t],xe(i,"BaseURL"));m.type=m.type||"static",m.sourceDuration=m.mediaPresentationDuration||0,m.NOW=o,m.clientOffset=l,g.length&&(m.locations=g.map(es));var b=[];return c.forEach(function(E,S){var R=Fe(E),F=b[S-1];R.start=up({attributes:R,priorPeriodAttributes:F?F.attributes:null,mpdType:m.type}),b.push({node:E,attributes:R})}),{locations:m.locations,representationInfo:Cn(b.map(op(m,_)))}},ul=function(i){if(i==="")throw new Error(bi.DASH_EMPTY_MANIFEST);var n=new Jf.DOMParser,r,e;try{r=n.parseFromString(i,"application/xml"),e=r&&r.documentElement.tagName==="MPD"?r.documentElement:null}catch{}if(!e||e&&e.getElementsByTagName("parsererror").length>0)throw new Error(bi.DASH_INVALID_XML);return e},dp=function(i){var n=xe(i,"UTCTiming")[0];if(!n)return null;var r=Fe(n);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(bi.UNSUPPORTED_UTC_TIMING_SCHEME)}return r},cp=function(i,n){n===void 0&&(n={});var r=lp(ul(i),n),e=Zh(r.representationInfo);return qh({dashPlaylists:e,locations:r.locations,sidxMapping:n.sidxMapping,previousManifest:n.previousManifest})},fp=function(i){return dp(ul(i))},ra,Wo;function hp(){if(Wo)return ra;Wo=1;var s=Math.pow(2,32),i=function(n){var r=new DataView(n.buffer,n.byteOffset,n.byteLength),e;return r.getBigUint64?(e=r.getBigUint64(0),e<Number.MAX_SAFE_INTEGER?
4Number(e):e):r.getUint32(0)*s+r.getUint32(4)};return ra={getUint64:i,MAX_UINT32:s},ra}var na,qo;function pp(){if(qo)return na;qo=1;var s=hp().getUint64,i=function(n){var r=new DataView(n.buffer,n.byteOffset,n.byteLength),e={version:n[0],flags:new Uint8Array(n.subarray(1,4)),references:[],referenceId:r.getUint32(4),timescale:r.getUint32(8)},t=12;e.version===0?(e.earliestPresentationTime=r.getUint32(t),e.firstOffset=r.getUint32(t+4),t+=8):(e.earliestPresentationTime=s(n.subarray(t)),e.firstOffset=s(n.subarray(t+8)),t+=16),t+=2;var a=r.getUint16(t);for(t+=2;a>0;t+=12,a--)e.references.push({referenceType:(n[t]&128)>>>7,referencedSize:r.getUint32(t)&2147483647,subsegmentDuration:r.getUint32(t+4),startsWithSap:!!(n[t+8]&128),sapType:(n[t+8]&112)>>>4,sapDeltaTime:r.getUint32(t+8)&268435455});return e};return na=i,na}var mp=pp();const gp=eh(mp);var vp=te([73,68,51]),yp=function(i,n){n===void 0&&(n=0),i=te(i);var r=i[n+5],e=i[n+6]<<21|i[n+7]<<14|i[n+8]<<7|i[n+9],t=(r&16)>>4;return t?e+20:e+10},$i=function s(i,n){return n===void 0&&(n=0),i=te(i),i.length-n<10||!_e(i,vp,{offset:n})?n:(n+=yp(i,n),s(i,n))},Go=function(i){return typeof i=="string"?il(i):i},_p=function(i){return Array.isArray(i)?i.map(function(n){return Go(n)}):[Go(i)]},Tp=function s(i,n,r){r===void 0&&(r=!1),n=_p(n),i=te(i);var e=[];if(!n.length)return e;for(var t=0;t<i.length;){var a=(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3])>>>0,o=i.subarray(t+4,t+8);if(a===0)break;var u=t+a;if(u>i.length){if(r)break;u=i.length}var l=i.subarray(t+8,u);_e(o,n[0])&&(n.length===1?e.push(l):e.push.apply(e,s(l,n.slice(1),r))),t=u}return e},Br={EBML:te([26,69,223,163]),DocType:te([66,130]),Segment:te([24,83,128,103]),SegmentInfo:te([21,73,169,102]),Tracks:te([22,84,174,107]),Track:te([174]),TrackNumber:te([215]),DefaultDuration:te([35,227,131]),TrackEntry:te([174]),TrackType:te([131]),FlagDefault:te([136]),CodecID:te([134]),CodecPrivate:te([99,162]),VideoTrack:te([224]),AudioTrack:te([225]),Cluster:te([31,67,182,117]),Timestamp:te([231]),TimestampScale:te([42,215,177]),BlockGroup:te([160]),BlockDuration:te([155]),Block:te([161]),SimpleBlock:te([163])},Ca=[128,64,32,16,8,4,2,1],bp=function(i){for(var n=1,r=0;r<Ca.length&&!(i&Ca[r]);r++)n++;return n},rn=function(i,n,r,e){r===void 0&&(r=!0),e===void 0&&(e=!1);var t=bp(i[n]),a=i.subarray(n,n+t);return r&&(a=Array.prototype.slice.call(i,n,n+t),a[0]^=Ca[t-1]),{length:t,value:yh(a,{signed:e}),bytes:a}},zo=function s(i){return typeof i=="string"?i.match(/.{1,2}/g).map(function(n){return s(n)}):typeof i=="number"?_h(i):i},Sp=function(i){return Array.isArray(i)?i.map(function(n){return zo(n)}):[zo(i)]},xp=function s(i,n,r){if(r>=n.length)return n.length;var e=rn(n,r,!1);if(_e(i.bytes,e.bytes))return r;var t=rn(n,r+e.length);return s(i,n,r+t.length+t.value+e.length)},Ko=function s(i,n){n=Sp(n),i=te(i);var r=[];if(!n.length)return r;for(var e=0;e<i.length;){var t=rn(i,e,!1),a=rn(i,e+t.length),o=e+t.length+a.length;a.value===127&&(a.value=xp(t,i,o),a.value!==i.length&&(a.value-=o));var u=o+a.value>i.length?i.length:o+a.value,l=i.subarray(o,u);_e(n[0],t.bytes)&&(n.length===1?r.push(l):r=r.concat(s(l,n.slice(1))));var c=t.length+a.length+l.length;e+=c}return r},Ep=te([0,0,0,1]),Cp=te([0,0,1]),kp=te([0,0,3]),wp=function(i){for(var n=[],r=1;r<i.length-2;)_e(i.subarray(r,r+3),kp)&&(n.push(r+2),r++),r++;if(n.length===0)return i;var e=i.length-n.length,t=new Uint8Array(e),a=0;for(r=0;r<e;a++,r++)a===n[0]&&(a++,n.shift()),t[r]=i[a];return t},ll=function(i,n,r,e){i=te(i),r=[].concat(r);for(var t=0,a,o=0;t<i.length&&(o<e||a);){var u=void 0;if(_e(i.subarray(t),Ep)?u=4:_e(i.subarray(t),Cp)&&(u=3),!u){t++;continue}if(o++,a)return wp(i.subarray(a,t));var l=void 0;n==="h264"?l=i[t+u]&31:n==="h265"&&(l=i[t+u]>>1&63),r.indexOf(l)!==-1&&(a=t+u),t+=u+(n==="h264"?1:2)}return i.subarray(0,0)},Pp=function(i,n,r){return ll(i,"h264",n,r)},Ip=function(i,n,r){return ll(i,"h265",n,r)},Be={webm:te([119,101,98,109]),matroska:te([109,97,116,114,111,115,107,97]),flac:te([102,76,97,67]),ogg:te([79,103,103,83]),ac3:te([11,119]),riff:te([82,73,70,70]),avi:te([65,86,73]),wav:te([87,65,86,69]),"3gp":te([102,116,121,112,51,103]),mp4:te([102,116,121,112]),fmp4:te([115,116,121,112]),mov:te([102,116,121,112,113,116]),moov:te([109,111,111,118]),moof:te([109,111,111,102])},Si={aac:function(i){var n=$i(i);return _e(i,[255,16],{offset:n,mask:[255,22]})},mp3:function(i){var n=$i(i);return _e(i,[255,2],{offset:n,mask:[255,6]})},webm:function(i){var n=Ko(i,[Br.EBML,Br.DocType])[0];return _e(n,Be.webm)},mkv:function(i){var n=Ko(i,[Br.EBML,Br.DocType])[0];return _e(n,Be.matroska)},mp4:function(i){if(Si["3gp"](i)||Si.mov(i))return!1;if(_e(i,Be.mp4,{offset:4})||_e(i,Be.fmp4,{offset:4})||_e(i,Be.moof,{offset:4})||_e(i,Be.moov,{offset:4}))return!0},mov:function(i){return _e(i,Be.mov,{offset:4})},"3gp":function(i){return _e(i,Be["3gp"],{offset:4})},ac3:function(i){var n=$i(i);return _e(i,Be.ac3,{offset:n})},ts:function(i){if(i.length<189&&i.length>=1)return i[0]===71;for(var n=0;n+188<i.length&&n<188;){if(i[n]===71&&i[n+188]===71)return!0;n+=1}return!1},flac:function(i){var n=$i(i);return _e(i,Be.flac,{offset:n})},ogg:function(i){return _e(i,Be.ogg)},avi:function(i){return _e(i,Be.riff)&&_e(i,Be.avi,{offset:8})},wav:function(i){return _e(i,Be.riff)&&_e(i,Be.wav,{offset:8})},h264:function(i){return Pp(i,7,3).length},h265:function(i){return Ip(i,[32,33],3).length}},ka=Object.keys(Si).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);
4ka.forEach(function(s){var i=Si[s];Si[s]=function(n){return i(te(n))}});var Ap=Si,is=function(i){i=te(i);for(var n=0;n<ka.length;n++){var r=ka[n];if(Ap[r](i))return r}return""},Op=function(i){return Tp(i,["moof"]).length>0},aa,$o;function Dp(){if($o)return aa;$o=1;var s=9e4,i,n,r,e,t,a,o;return i=function(u){return u*s},n=function(u,l){return u*l},r=function(u){return u/s},e=function(u,l){return u/l},t=function(u,l){return i(e(u,l))},a=function(u,l){return n(r(u),l)},o=function(u,l,c){return r(c?u:u-l)},aa={ONE_SECOND_IN_TS:s,secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:e,audioTsToVideoTs:t,videoTsToAudioTs:a,metadataTsToSeconds:o},aa}var nn=Dp();function wa(s){return wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},wa(s)}function Lp(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function Pa(s){var i=typeof Map=="function"?new Map:void 0;return Pa=function(r){if(r===null||!Lp(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(i!==void 0){if(i.has(r))return i.get(r);i.set(r,e)}function e(){return Qu(r,arguments,wa(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Ti(e,r)},Pa(s)}/**
5 * @license
6 * Video.js 7.21.7 <http://videojs.com/>
7 * Copyright Brightcove, Inc. <https://www.brightcove.com/>
8 * Available under Apache License Version 2.0
9 * <https://github.com/videojs/video.js/blob/main/LICENSE>
10 *
11 * Includes vtt.js <https://github.com/mozilla/vtt.js>
12 * Available under Apache License Version 2.0
13 * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
14 */var dl="7.21.7",St={},Ft=function(i,n){return St[i]=St[i]||[],n&&(St[i]=St[i].concat(n)),St[i]},Mp=function(i,n){Ft(i,n)},cl=function(i,n){var r=Ft(i).indexOf(n);return r<=-1?!1:(St[i]=St[i].slice(),St[i].splice(r,1),!0)},Fp=function(i,n){Ft(i,[].concat(n).map(function(r){var e=function t(){return cl(i,t),r.apply(void 0,arguments)};return e}))},an={prefixed:!0},Xr=[["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"]],Xo=Xr[0],Xi;for(var jr=0;jr<Xr.length;jr++)if(Xr[jr][1]in K){Xi=Xr[jr];break}if(Xi){for(var Vr=0;Vr<Xi.length;Vr++)an[Xo[Vr]]=Xi[Vr];an.prefixed=Xi[0]!==Xo[0]}var $e=[],Rp=function(i,n){return function(r,e,t){var a=n.levels[e],o=new RegExp("^("+a+")$");if(r!=="log"&&t.unshift(r.toUpperCase()+":"),t.unshift(i+":"),$e){$e.push([].concat(t));var u=$e.length-1e3;$e.splice(0,u>0?u:0)}if(k.console){var l=k.console[r];!l&&r==="debug"&&(l=k.console.info||k.console.log),!(!l||!a||!o.test(r))&&l[Array.isArray(t)?"apply":"call"](k.console,t)}}};function fl(s){var i="info",n,r=function(){for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];n("log",i,a)};return n=Rp(s,r),r.createLogger=function(e){return fl(s+": "+e)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},r.level=function(e){if(typeof e=="string"){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');i=e}return i},r.history=function(){return $e?[].concat($e):[]},r.history.filter=function(e){return($e||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},r.history.clear=function(){$e&&($e.length=0)},r.history.disable=function(){$e!==null&&($e.length=0,$e=null)},r.history.enable=function(){$e===null&&($e=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return n("error",i,t)},r.warn=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return n("warn",i,t)},r.debug=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return n("debug",i,t)},r}var ue=fl("VIDEOJS"),hl=ue.createLogger,Np=Object.prototype.toString,pl=function(i){return Pt(i)?Object.keys(i):[]};
14function gi(s,i){pl(s).forEach(function(n){return i(s[n],n)})}function Up(s,i,n){return n===void 0&&(n=0),pl(s).reduce(function(r,e){return i(r,s[e],e)},n)}function be(s){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return Object.assign?wt.apply(void 0,[s].concat(n)):(n.forEach(function(e){e&&gi(e,function(t,a){s[a]=t})}),s)}function Pt(s){return!!s&&typeof s=="object"}function ir(s){return Pt(s)&&Np.call(s)==="[object Object]"&&s.constructor===Object}function rr(s,i){if(!s||!i)return"";if(typeof k.getComputedStyle=="function"){var n;try{n=k.getComputedStyle(s)}catch{return""}return n?n.getPropertyValue(i)||n[i]:""}return""}var Ie=k.navigator&&k.navigator.userAgent||"",Qo=/AppleWebKit\/([\d.]+)/i.exec(Ie),Bp=Qo?parseFloat(Qo.pop()):null,ml=/iPod/i.test(Ie),jp=function(){var s=Ie.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null}(),At=/Android/i.test(Ie),rs=function(){var s=Ie.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!s)return null;var i=s[1]&&parseFloat(s[1]),n=s[2]&&parseFloat(s[2]);return i&&n?parseFloat(s[1]+"."+s[2]):i||null}(),gl=At&&rs<5&&Bp<537,vl=/Firefox/i.test(Ie),lr=/Edg/i.test(Ie),Ot=!lr&&(/Chrome/i.test(Ie)||/CriOS/i.test(Ie)),yl=function(){var s=Ie.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null}(),dr=function(){var s=/MSIE\s(\d+)\.\d/.exec(Ie),i=s&&parseFloat(s[1]);return!i&&/Trident\/7.0/i.test(Ie)&&/rv:11.0/.test(Ie)&&(i=11),i}(),ns=/Safari/i.test(Ie)&&!Ot&&!At&&!lr,_l=/Windows/i.test(Ie),xi=!!(Ii()&&("ontouchstart"in k||k.navigator.maxTouchPoints||k.DocumentTouch&&k.document instanceof k.DocumentTouch)),as=/iPad/i.test(Ie)||ns&&xi&&!/iPhone/i.test(Ie),ss=/iPhone/i.test(Ie)&&!as,Ge=ss||as||ml,Pn=(ns||Ge)&&!Ot,Vp=Object.freeze({__proto__:null,IS_IPOD:ml,IOS_VERSION:jp,IS_ANDROID:At,ANDROID_VERSION:rs,IS_NATIVE_ANDROID:gl,IS_FIREFOX:vl,IS_EDGE:lr,IS_CHROME:Ot,CHROME_VERSION:yl,IE_VERSION:dr,IS_SAFARI:ns,IS_WINDOWS:_l,TOUCH_ENABLED:xi,IS_IPAD:as,IS_IPHONE:ss,IS_IOS:Ge,IS_ANY_SAFARI:Pn});function Yo(s){return typeof s=="string"&&!!s.trim()}function Tl(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Hp(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function Ii(){return K===k.document}function Ai(s){return Pt(s)&&s.nodeType===1}function bl(){try{return k.parent!==k.self}catch{return!0}}function Sl(s){return function(i,n){if(!Yo(i))return K[s](null);Yo(n)&&(n=K.querySelector(n));var r=Ai(n)?n:K;return r[s]&&r[s](i)}}function le(s,i,n,r){s===void 0&&(s="div"),i===void 0&&(i={}),n===void 0&&(n={});var e=K.createElement(s);return Object.getOwnPropertyNames(i).forEach(function(t){var a=i[t];t.indexOf("aria-")!==-1||t==="role"||t==="type"?(ue.warn(`Setting attributes in the second argument of createEl()
15has been deprecated. Use the third argument instead.
16`+("createEl(type, properties, attributes). Attempting to set "+t+" to "+a+".")),e.setAttribute(t,a)):t==="textContent"?ii(e,a):(e[t]!==a||t==="tabIndex")&&(e[t]=a)}),Object.getOwnPropertyNames(n).forEach(function(t){e.setAttribute(t,n[t])}),r&&us(e,r),e}function ii(s,i){return typeof s.textContent>"u"?s.innerText=i:s.textContent=i,s}function Ia(s,i){i.firstChild?i.insertBefore(s,i.firstChild):i.appendChild(s)}function Jt(s,i){return Tl(i),s.classList?s.classList.contains(i):Hp(i).test(s.className)}function Et(s,i){return s.classList?s.classList.add(i):Jt(s,i)||(s.className=(s.className+" "+i).trim()),s}function cr(s,i){return s?(s.classList?s.classList.remove(i):(Tl(i),s.className=s.className.split(/\s+/).filter(function(n){return n!==i}).join(" ")),s):(ue.warn("removeClass was called with an element that doesn't exist"),null)}function xl(s,i,n){var r=Jt(s,i);if(typeof n=="function"&&(n=n(s,i)),typeof n!="boolean"&&(n=!r),n!==r)return n?Et(s,i):cr(s,i),s}function El(s,i){Object.getOwnPropertyNames(i).forEach(function(n){var r=i[n];r===null||typeof r>"u"||r===!1?s.removeAttribute(n):s.setAttribute(n,r===!0?"":r)})}function bt(s){var i={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(s&&s.attributes&&s.attributes.length>0)for(var r=s.attributes,e=r.length-1;e>=0;e--){var t=r[e].name,a=r[e].value;(typeof s[t]=="boolean"||n.indexOf(","+t+",")!==-1)&&(a=a!==null),i[t]=a}return i}function Cl(s,i){return s.getAttribute(i)}function Ei(s,i,n){s.setAttribute(i,n)}function In(s,i){s.removeAttribute(i)}function kl(){K.body.focus(),K.onselectstart=function(){return!1}}function wl(){K.onselectstart=function(){return!0}}function Ci(s){if(s&&s.getBoundingClientRect&&s.parentNode){var i=s.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(r){i[r]!==void 0&&(n[r]=i[r])}),n.height||(n.height=parseFloat(rr(s,"height"))),n.width||(n.width=parseFloat(rr(s,"width"))),n}}function nr(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var i=s.offsetWidth,n=s.offsetHeight,r=0,e=0;s.offsetParent&&s!==K[an.fullscreenElement];)r+=s.offsetLeft,e+=s.offsetTop,s=s.offsetParent;return{left:r,top:e,width:i,height:n}}function An(s,i){var n={x:0,y:0};if(Ge)for(var r=s;r&&r.nodeName.toLowerCase()!=="html";){var e=rr(r,"transform");
16if(/^matrix/.test(e)){var t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){var a=e.slice(9,-1).split(/,\s/).map(Number);n.x+=a[12],n.y+=a[13]}r=r.parentNode}var o={},u=nr(i.target),l=nr(s),c=l.width,g=l.height,m=i.offsetY-(l.top-u.top),_=i.offsetX-(l.left-u.left);return i.changedTouches&&(_=i.changedTouches[0].pageX-l.left,m=i.changedTouches[0].pageY+l.top,Ge&&(_-=n.x,m-=n.y)),o.y=1-Math.max(0,Math.min(1,m/g)),o.x=Math.max(0,Math.min(1,_/c)),o}function Pl(s){return Pt(s)&&s.nodeType===3}function os(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function Il(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(i){if(typeof i=="function"&&(i=i()),Ai(i)||Pl(i))return i;if(typeof i=="string"&&/\S/.test(i))return K.createTextNode(i)}).filter(function(i){return i})}function us(s,i){return Il(i).forEach(function(n){return s.appendChild(n)}),s}function Al(s,i){return us(os(s),i)}function ar(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}var Rt=Sl("querySelector"),Ol=Sl("querySelectorAll"),Dl=Object.freeze({__proto__:null,isReal:Ii,isEl:Ai,isInFrame:bl,createEl:le,textContent:ii,prependTo:Ia,hasClass:Jt,addClass:Et,removeClass:cr,toggleClass:xl,setAttributes:El,getAttributes:bt,getAttribute:Cl,setAttribute:Ei,removeAttribute:In,blockTextSelection:kl,unblockTextSelection:wl,getBoundingClientRect:Ci,findPosition:nr,getPointerPosition:An,isTextNode:Pl,emptyEl:os,normalizeContent:Il,appendContent:us,insertContent:Al,isSingleLeftClick:ar,$:Rt,$$:Ol}),Ll=!1,Aa,Wp=function(){if(Aa.options.autoSetup!==!1){var i=Array.prototype.slice.call(K.getElementsByTagName("video")),n=Array.prototype.slice.call(K.getElementsByTagName("audio")),r=Array.prototype.slice.call(K.getElementsByTagName("video-js")),e=i.concat(n,r);if(e&&e.length>0)for(var t=0,a=e.length;t<a;t++){var o=e[t];if(o&&o.getAttribute){if(o.player===void 0){var u=o.getAttribute("data-setup");u!==null&&Aa(o)}}else{Oa(1);break}}else Ll||Oa(1)}};function Oa(s,i){Ii()&&(i&&(Aa=i),k.setTimeout(Wp,s))}function Da(){Ll=!0,k.removeEventListener("load",Da)}Ii()&&(K.readyState==="complete"?Da():k.addEventListener("load",Da));var Ml=function(i){var n=K.createElement("style");return n.className=i,n},Fl=function(i,n){i.styleSheet?i.styleSheet.cssText=n:i.textContent=n},qp=3,Gp=qp;function Dt(){return Gp++}var Rl;k.WeakMap||(Rl=function(){function s(){this.vdata="vdata"+Math.floor(k.performance&&k.performance.now()||Date.now()),this.data={}}var i=s.prototype;return i.set=function(r,e){var t=r[this.vdata]||Dt();return r[this.vdata]||(r[this.vdata]=t),this.data[t]=e,this},i.get=function(r){var e=r[this.vdata];if(e)return this.data[e];ue("We have no data for this element",r)},i.has=function(r){var e=r[this.vdata];return e in this.data},i.delete=function(r){var e=r[this.vdata];e&&(delete this.data[e],delete r[this.vdata])},s}());var We=k.WeakMap?new WeakMap:new Rl;function Jo(s,i){if(We.has(s)){var n=We.get(s);n.handlers[i].length===0&&(delete n.handlers[i],s.removeEventListener?s.removeEventListener(i,n.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+i,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),Object.getOwnPropertyNames(n).length===0&&We.delete(s)}}function ls(s,i,n,r){n.forEach(function(e){s(i,e,r)})}function On(s){if(s.fixed_)return s;function i(){return!0}function n(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var r=s||k.event;s={};for(var e in r)e!=="layerX"&&e!=="layerY"&&e!=="keyLocation"&&e!=="webkitMovementX"&&e!=="webkitMovementY"&&e!=="path"&&(e==="returnValue"&&r.preventDefault||(s[e]=r[e]));if(s.target||(s.target=s.srcElement||K),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){r.preventDefault&&r.preventDefault(),s.returnValue=!1,r.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),s.cancelBubble=!0,r.cancelBubble=!0,s.isPropagationStopped=i},s.isPropagationStopped=n,s.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),s.isImmediatePropagationStopped=i,s.stopPropagation()},s.isImmediatePropagationStopped=n,s.clientX!==null&&s.clientX!==void 0){var t=K.documentElement,a=K.body;s.pageX=s.clientX+(t&&t.scrollLeft||a&&a.scrollLeft||0)-(t&&t.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(t&&t.scrollTop||a&&a.scrollTop||0)-(t&&t.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}var Hr,zp=function(){if(typeof Hr!="boolean"){Hr=!1;try{var i=Object.defineProperty({},"passive",{get:function(){Hr=!0}});k.addEventListener("test",null,i),k.removeEventListener("test",null,i)}catch{}}return Hr},Kp=["touchstart","touchmove"];function Ze(s,i,n){if(Array.isArray(i))return ls(Ze,s,i,n);We.has(s)||We.set(s,{});var r=We.get(s);if(r.handlers||(r.handlers={}),r.handlers[i]||(r.handlers[i]=[]),n.guid||(n.guid=Dt()),r.handlers[i].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,a){if(!r.disabled){t=On(t);var o=r.handlers[t.type];if(o)for(var u=o.slice(0),l=0,c=u.length;l<c&&!t.isImmediatePropagationStopped();
16l++)try{u[l].call(s,t,a)}catch(g){ue.error(g)}}}),r.handlers[i].length===1)if(s.addEventListener){var e=!1;zp()&&Kp.indexOf(i)>-1&&(e={passive:!0}),s.addEventListener(i,r.dispatcher,e)}else s.attachEvent&&s.attachEvent("on"+i,r.dispatcher)}function Re(s,i,n){if(We.has(s)){var r=We.get(s);if(r.handlers){if(Array.isArray(i))return ls(Re,s,i,n);var e=function(l,c){r.handlers[c]=[],Jo(l,c)};if(i===void 0){for(var t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&e(s,t);return}var a=r.handlers[i];if(a){if(!n){e(s,i);return}if(n.guid)for(var o=0;o<a.length;o++)a[o].guid===n.guid&&a.splice(o--,1);Jo(s,i)}}}}function Oi(s,i,n){var r=We.has(s)?We.get(s):{},e=s.parentNode||s.ownerDocument;if(typeof i=="string"?i={type:i,target:s}:i.target||(i.target=s),i=On(i),r.dispatcher&&r.dispatcher.call(s,i,n),e&&!i.isPropagationStopped()&&i.bubbles===!0)Oi.call(null,e,i,n);else if(!e&&!i.defaultPrevented&&i.target&&i.target[i.type]){We.has(i.target)||We.set(i.target,{});var t=We.get(i.target);i.target[i.type]&&(t.disabled=!0,typeof i.target[i.type]=="function"&&i.target[i.type](),t.disabled=!1)}return!i.defaultPrevented}function Dn(s,i,n){if(Array.isArray(i))return ls(Dn,s,i,n);var r=function e(){Re(s,i,e),n.apply(this,arguments)};r.guid=n.guid=n.guid||Dt(),Ze(s,i,r)}function Nl(s,i,n){var r=function e(){Re(s,i,e),n.apply(this,arguments)};r.guid=n.guid=n.guid||Dt(),Ze(s,i,r)}var $p=Object.freeze({__proto__:null,fixEvent:On,on:Ze,off:Re,trigger:Oi,one:Dn,any:Nl}),ut=30,ye=function(i,n,r){n.guid||(n.guid=Dt());var e=n.bind(i);return e.guid=r?r+"_"+n.guid:n.guid,e},It=function(i,n){var r=k.performance.now(),e=function(){var a=k.performance.now();a-r>=n&&(i.apply(void 0,arguments),r=a)};return e},Xp=function(i,n,r,e){e===void 0&&(e=k);var t,a=function(){e.clearTimeout(t),t=null},o=function(){var l=this,c=arguments,g=function(){t=null,g=null,i.apply(l,c)};e.clearTimeout(t),t=e.setTimeout(g,n)};return o.cancel=a,o},Ae=function(){};Ae.prototype.allowedEvents_={};Ae.prototype.on=function(s,i){var n=this.addEventListener;this.addEventListener=function(){},Ze(this,s,i),this.addEventListener=n};Ae.prototype.addEventListener=Ae.prototype.on;Ae.prototype.off=function(s,i){Re(this,s,i)};Ae.prototype.removeEventListener=Ae.prototype.off;Ae.prototype.one=function(s,i){var n=this.addEventListener;this.addEventListener=function(){},Dn(this,s,i),this.addEventListener=n};Ae.prototype.any=function(s,i){var n=this.addEventListener;this.addEventListener=function(){},Nl(this,s,i),this.addEventListener=n};Ae.prototype.trigger=function(s){var i=s.type||s;typeof s=="string"&&(s={type:i}),s=On(s),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](s),Oi(this,s)};Ae.prototype.dispatchEvent=Ae.prototype.trigger;var qi;Ae.prototype.queueTrigger=function(s){var i=this;qi||(qi=new Map);var n=s.type||s,r=qi.get(this);r||(r=new Map,qi.set(this,r));var e=r.get(n);r.delete(n),k.clearTimeout(e);var t=k.setTimeout(function(){r.delete(n),r.size===0&&(r=null,qi.delete(i)),i.trigger(s)},0);r.set(n,t)};var Ln=function(i){return typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i},Ct=function(i){return i instanceof Ae||!!i.eventBusEl_&&["on","one","off","trigger"].every(function(n){return typeof i[n]=="function"})},Qp=function(i,n){Ct(i)?n():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(n))},La=function(i){return typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length},sn=function(i,n,r){if(!i||!i.nodeName&&!Ct(i))throw new Error("Invalid target for "+Ln(n)+"#"+r+"; must be a DOM node or evented object.")},Ul=function(i,n,r){if(!La(i))throw new Error("Invalid event type for "+Ln(n)+"#"+r+"; must be a non-empty string or array.")},Bl=function(i,n,r){if(typeof i!="function")throw new Error("Invalid listener for "+Ln(n)+"#"+r+"; must be a function.")},sa=function(i,n,r){var e=n.length<3||n[0]===i||n[0]===i.eventBusEl_,t,a,o;return e?(t=i.eventBusEl_,n.length>=3&&n.shift(),a=n[0],o=n[1]):(t=n[0],a=n[1],o=n[2]),sn(t,i,r),Ul(a,i,r),Bl(o,i,r),o=ye(i,o),{isTargetingSelf:e,target:t,type:a,listener:o}},Gt=function(i,n,r,e){sn(i,i,n),i.nodeName?$p[n](i,r,e):i[n](r,e)},Yp={on:function(){for(var i=this,n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];var t=sa(this,r,"on"),a=t.isTargetingSelf,o=t.target,u=t.type,l=t.listener;if(Gt(o,"on",u,l),!a){var c=function(){return i.off(o,u,l)};c.guid=l.guid;var g=function(){return i.off("dispose",c)};g.guid=l.guid,Gt(this,"on","dispose",c),Gt(o,"on","dispose",g)}},one:function(){for(var i=this,n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];var t=sa(this,r,"one"),a=t.isTargetingSelf,o=t.target,u=t.type,l=t.listener;if(a)Gt(o,"one",u,l);else{var c=function g(){i.off(o,u,g);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,Gt(o,"one",u,c)}},any:function(){for(var i=this,n=arguments.length,r=new Array(n),e=0;e<n;e++)r[e]=arguments[e];var t=sa(this,r,"any"),a=t.isTargetingSelf,o=t.target,u=t.type,l=t.listener;if(a)Gt(o,"any",u,l);else{var c=function g(){i.off(o,u,g);for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];l.apply(null,_)};c.guid=l.guid,Gt(o,"any",u,c)}},off:function(i,n,r){if(!i||La(i))Re(this.eventBusEl_,i,n);else{var e=i,t=n;sn(e,this,"off"),Ul(t,this,"off"),Bl(r,this,"off"),r=ye(this,r),this.off("dispose",r),e.nodeName?(Re(e,t,r),Re(e,"dispose",r)):Ct(e)&&(e.off(t,r),e.off("dispose",r))}},trigger:function(i,n){sn(this.eventBusEl_,this,"trigger");
16var r=i&&typeof i!="string"?i.type:i;if(!La(r)){var e="Invalid event type for "+Ln(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(i)(this.log||ue).error(e);else throw new Error(e)}return Oi(this.eventBusEl_,i,n)}};function ds(s,i){i===void 0&&(i={});var n=i,r=n.eventBusKey;if(r){if(!s[r].nodeName)throw new Error('The eventBusKey "'+r+'" does not refer to an element.');s.eventBusEl_=s[r]}else s.eventBusEl_=le("span",{className:"vjs-event-bus"});return be(s,Yp),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(e){e()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(e){e&&We.has(e)&&We.delete(e)}),k.setTimeout(function(){s.eventBusEl_=null},0)}),s}var Jp={state:{},setState:function(i){var n=this;typeof i=="function"&&(i=i());var r;return gi(i,function(e,t){n.state[t]!==e&&(r=r||{},r[t]={from:n.state[t],to:e}),n.state[t]=e}),r&&Ct(this)&&this.trigger({changes:r,type:"statechanged"}),r}};function jl(s,i){return be(s,Jp),s.state=be({},s.state,i),typeof s.handleStateChanged=="function"&&Ct(s)&&s.on("statechanged",s.handleStateChanged),s}var Qr=function(i){return typeof i!="string"?i:i.replace(/./,function(n){return n.toLowerCase()})},Ee=function(i){return typeof i!="string"?i:i.replace(/./,function(n){return n.toUpperCase()})},Zp=function(i,n){return Ee(i)===Ee(n)};function ve(){for(var s={},i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];return n.forEach(function(e){e&&gi(e,function(t,a){if(!ir(t)){s[a]=t;return}ir(s[a])||(s[a]={}),s[a]=ve(s[a],t)})}),s}var em=function(){function s(){this.map_={}}var i=s.prototype;return i.has=function(r){return r in this.map_},i.delete=function(r){var e=this.has(r);return delete this.map_[r],e},i.set=function(r,e){return this.map_[r]=e,this}
16,i.forEach=function(r,e){for(var t in this.map_)r.call(e,this.map_[t],t,this)},s}(),tm=k.Map?k.Map:em,im=function(){function s(){this.set_={}}var i=s.prototype;return i.has=function(r){return r in this.set_},i.delete=function(r){var e=this.has(r);return delete this.set_[r],e},i.add=function(r){return this.set_[r]=1,this},i.forEach=function(r,e){for(var t in this.set_)r.call(e,t,t,this)},s}(),oa=k.Set?k.Set:im,q=function(){function s(n,r,e){var t=this;if(!n&&this.play?this.player_=n=this:this.player_=n,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ve({},this.options_),r=this.options_=ve(this.options_,r),this.id_=r.id||r.el&&r.el.id,!this.id_){var a=n&&n.id&&n.id()||"no_player";this.id_=a+"_component_"+Dt()}this.name_=r.name||null,r.el?this.el_=r.el:r.createEl!==!1&&(this.el_=this.createEl()),r.className&&this.el_&&r.className.split(" ").forEach(function(o){return t.addClass(o)}),r.evented!==!1&&(ds(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),jl(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new oa,this.setIntervalIds_=new oa,this.rafIds_=new oa,this.namedRafs_=new tm,this.clearingTimersOnDispose_=!1,r.initChildren!==!1&&this.initChildren(),this.ready(e),r.reportTouchActivity!==!1&&this.enableTouchActivity()}var i=s.prototype;return i.dispose=function(r){if(r===void 0&&(r={}),!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&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},i.isDisposed=function(){return!!this.isDisposed_},i.player=function(){return this.player_},i.options=function(r){return r?(this.options_=ve(this.options_,r),this.options_):this.options_},i.el=function(){return this.el_},i.createEl=function(r,e,t){return le(r,e,t)},i.localize=function(r,e,t){t===void 0&&(t=r);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),u=o&&o[a],l=a&&a.split("-")[0],c=o&&o[l],g=t;return u&&u[r]?g=u[r]:c&&c[r]&&(g=c[r]),e&&(g=g.replace(/\{(\d+)\}/g,function(m,_){var b=e[_-1],E=b;return typeof b>"u"&&(E=m),E})),g},i.handleLanguagechange=function(){},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(r){return this.childIndex_[r]},i.getChild=function(r){if(r)return this.childNameIndex_[r]},i.getDescendant=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e=e.reduce(function(u,l){return u.concat(l)},[]);for(var a=this,o=0;o<e.length;o++)if(a=a.getChild(e[o]),!a||!a.getChild)return;return a},i.addChild=function(r,e,t){e===void 0&&(e={}),t===void 0&&(t=this.children_.length);var a,o;if(typeof r=="string"){o=Ee(r);var u=e.componentClass||o;e.name=o;var l=s.getComponent(u);if(!l)throw new Error("Component "+u+" does not exist");if(typeof l!="function")return null;a=new l(this.player_||this,e)}else a=r;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(t,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),o=o||a.name&&Ee(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[Qr(o)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[t+1]&&(this.children_[t+1].el_?c=this.children_[t+1].el_:Ai(this.children_[t+1])&&(c=this.children_[t+1])),this.contentEl().insertBefore(a.el(),c)}return a},i.removeChild=function(r){if(typeof r=="string"&&(r=this.getChild(r)),!(!r||!this.children_)){for(var e=!1,t=this.children_.length-1;t>=0;t--)if(this.children_[t]===r){e=!0,this.children_.splice(t,1);break}if(e){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[Ee(r.name())]=null,this.childNameIndex_[Qr(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},i.initChildren=function(){var r=this,e=this.options_.children;if(e){var t=this.options_,a=function(c){var g=c.name,m=c.opts;if(t[g]!==void 0&&(m=t[g]),m!==!1){m===!0&&(m={}),m.playerOptions=r.options_.playerOptions;var _=r.addChild(g,m);_&&(r[g]=_)}},o,u=s.getComponent("Tech");
16Array.isArray(e)?o=e:o=Object.keys(e),o.concat(Object.keys(this.options_).filter(function(l){return!o.some(function(c){return typeof c=="string"?l===c:l===c.name})})).map(function(l){var c,g;return typeof l=="string"?(c=l,g=e[c]||r.options_[c]||{}):(c=l.name,g=l),{name:c,opts:g}}).filter(function(l){var c=s.getComponent(l.opts.componentClass||Ee(l.name));return c&&!u.isTech(c)}).forEach(a)}},i.buildCSSClass=function(){return""},i.ready=function(r,e){if(e===void 0&&(e=!1),!!r){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(r);return}e?r.call(this):this.setTimeout(r,1)}},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},i.$=function(r,e){return Rt(r,e||this.contentEl())},i.$$=function(r,e){return Ol(r,e||this.contentEl())},i.hasClass=function(r){return Jt(this.el_,r)},i.addClass=function(r){Et(this.el_,r)},i.removeClass=function(r){cr(this.el_,r)},i.toggleClass=function(r,e){xl(this.el_,r,e)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(r){return Cl(this.el_,r)},i.setAttribute=function(r,e){Ei(this.el_,r,e)},i.removeAttribute=function(r){In(this.el_,r)},i.width=function(r,e){return this.dimension("width",r,e)},i.height=function(r,e){return this.dimension("height",r,e)},i.dimensions=function(r,e){this.width(r,!0),this.height(e)},i.dimension=function(r,e,t){if(e!==void 0){(e===null||e!==e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[r]=e:e==="auto"?this.el_.style[r]="":this.el_.style[r]=e+"px",t||this.trigger("componentresize");return}if(!this.el_)return 0;var a=this.el_.style[r],o=a.indexOf("px");return parseInt(o!==-1?a.slice(0,o):this.el_["offset"+Ee(r)],10)},i.currentDimension=function(r){var e=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(e=rr(this.el_,r),e=parseFloat(e),e===0||isNaN(e)){var t="offset"+Ee(r);e=this.el_[t]}return e},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(r){this.player_&&(se.isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},i.handleKeyPress=function(r){this.handleKeyDown(r)},i.emitTapEvents=function(){var r=0,e=null,t=10,a=200,o;this.on("touchstart",function(l){l.touches.length===1&&(e={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},r=k.performance.now(),o=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)o=!1;else if(e){var c=l.touches[0].pageX-e.pageX,g=l.touches[0].pageY-e.pageY,m=Math.sqrt(c*c+g*g);m>t&&(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=k.performance.now()-r;c<a&&(l.preventDefault(),this.trigger("tap"))}})},i.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var r=ye(this.player(),this.player().reportUserActivity),e;this.on("touchstart",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)});var t=function(o){r(),this.clearInterval(e)};this.on("touchmove",r),this.on("touchend",t),this.on("touchcancel",t)}},i.setTimeout=function(r,e){var t=this,a;return r=ye(this,r),this.clearTimersOnDispose_(),a=k.setTimeout(function(){t.setTimeoutIds_.has(a)&&t.setTimeoutIds_.delete(a),r()},e),this.setTimeoutIds_.add(a),a},i.clearTimeout=function(r){return this.setTimeoutIds_.has(r)&&(this.setTimeoutIds_.delete(r),k.clearTimeout(r)),r},i.setInterval=function(r,e){r=ye(this,r),this.clearTimersOnDispose_();var t=k.setInterval(r,e);return this.setIntervalIds_.add(t),t},i.clearInterval=function(r){return this.setIntervalIds_.has(r)&&(this.setIntervalIds_.delete(r),k.clearInterval(r)),r},i.requestAnimationFrame=function(r){var e=this;if(!this.supportsRaf_)return this.setTimeout(r,1e3/60);this.clearTimersOnDispose_();var t;return r=ye(this,r),t=k.requestAnimationFrame(function(){e.rafIds_.has(t)&&e.rafIds_.delete(t),r()}),this.rafIds_.add(t),t},i.requestNamedAnimationFrame=function(r,e){var t=this;if(!this.namedRafs_.has(r)){this.clearTimersOnDispose_(),e=ye(this,e);var a=this.requestAnimationFrame(function(){e(),t.namedRafs_.has(r)&&t.namedRafs_.delete(r)});return this.namedRafs_.set(r,a),r}},i.cancelNamedAnimationFrame=function(r){this.namedRafs_.has(r)&&(this.cancelAnimationFrame(this.namedRafs_.get(r)),this.namedRafs_.delete(r))},i.cancelAnimationFrame=function(r){return this.supportsRaf_?(this.rafIds_.has(r)&&(this.rafIds_.delete(r),k.cancelAnimationFrame(r)),r):this.clearTimeout(r)},i.clearTimersOnDispose_=function(){var r=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
16h(function(e){var t=e[0],a=e[1];r[t].forEach(function(o,u){return r[a](u)})}),r.clearingTimersOnDispose_=!1}))},s.registerComponent=function(r,e){if(typeof r!="string"||!r)throw new Error('Illegal component name, "'+r+'"; must be a non-empty string.');var t=s.getComponent("Tech"),a=t&&t.isTech(e),o=s===e||s.prototype.isPrototypeOf(e.prototype);if(a||!o){var u;throw a?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error('Illegal component, "'+r+'"; '+u+".")}r=Ee(r),s.components_||(s.components_={});var l=s.getComponent("Player");if(r==="Player"&&l&&l.players){var c=l.players,g=Object.keys(c);if(c&&g.length>0&&g.map(function(m){return c[m]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[r]=e,s.components_[Qr(r)]=e,e},s.getComponent=function(r){if(!(!r||!s.components_))return s.components_[r]},s}();q.prototype.supportsRaf_=typeof k.requestAnimationFrame=="function"&&typeof k.cancelAnimationFrame=="function";q.registerComponent("Component",q);function rm(s,i,n){if(typeof i!="number"||i<0||i>n)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+i+") is non-numeric or out of bounds (0-"+n+").")}function Zo(s,i,n,r){return rm(s,r,n.length-1),n[r][i]}function ua(s){var i;return s===void 0||s.length===0?i={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:i={length:s.length,start:Zo.bind(null,"start",0,s),end:Zo.bind(null,"end",1,s)},k.Symbol&&k.Symbol.iterator&&(i[k.Symbol.iterator]=function(){return(s||[]).values()}),i}function Zt(s,i){return Array.isArray(s)?ua(s):s===void 0||i===void 0?ua():ua([[s,i]])}function Vl(s,i){var n=0,r,e;if(!i)return 0;(!s||!s.length)&&(s=Zt(0,0));for(var t=0;t<s.length;t++)r=s.start(t),e=s.end(t),e>i&&(e=i),n+=e-r;return n/i}function qe(s){if(s instanceof qe)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Pt(s)&&(typeof s.code=="number"&&(this.code=s.code),be(this,s)),this.message||(this.message=qe.defaultMessages[this.code]||"")}qe.prototype.code=0;qe.prototype.message="";qe.prototype.status=null;qe.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];qe.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 di=0;di<qe.errorTypes.length;di++)qe[qe.errorTypes[di]]=di,qe.prototype[qe.errorTypes[di]]=di;function Yi(s){return s!=null&&typeof s.then=="function"}function pt(s){Yi(s)&&s.then(null,function(i){})}var Ma=function(i){var n=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(r,e,t){return i[e]&&(r[e]=i[e]),r},{cues:i.cues&&Array.prototype.map.call(i.cues,function(r){return{startTime:r.startTime,endTime:r.endTime,text:r.text,id:r.id}})});return n},nm=function(i){var n=i.$$("track"),r=Array.prototype.map.call(n,function(t){return t.track}),e=Array.prototype.map.call(n,function(t){var a=Ma(t.track);return t.src&&(a.src=t.src),a});return e.concat(Array.prototype.filter.call(i.textTracks(),function(t){return r.indexOf(t)===-1}).map(Ma))},am=function(i,n){return i.forEach(function(r){var e=n.addRemoteTextTrack(r).track;!r.src&&r.cues&&r.cues.forEach(function(t){return e.addCue(t)})}),n.textTracks()},eu={textTracksToJson:nm,jsonToTextTracks:am,trackToJson_:Ma},la="vjs-modal-dialog",Di=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.handleKeyDown_=function(a){return t.handleKeyDown(a)},t.close_=function(a){return t.close(a)},t.opened_=t.hasBeenOpened_=t.hasBeenFilled_=!1,t.closeable(!t.options_.uncloseable),t.content(t.options_.content),t.contentEl_=le("div",{className:la+"-content"},{role:"document"}),t.descEl_=le("p",{className:la+"-description vjs-control-text",id:t.el().getAttribute("aria-describedby")}),ii(t.descEl_,t.description()),t.el_.appendChild(t.descEl_),t.el_.appendChild(t.contentEl_),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,s.prototype.dispose.call(this)},n.buildCSSClass=function(){return la+" vjs-hidden "+s.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.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},n.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_.pauseOnOpe
16n&&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}},n.opened=function(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_},n.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()}},n.closeable=function(e){if(typeof e=="boolean"){var t=this.closeable_=!!e,a=this.getChild("closeButton");if(t&&!a){var o=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(a,"close",this.close_)}!t&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),a=t.parentNode,o=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(t),this.empty(),Al(t,e),this.trigger("modalfill"),o?a.insertBefore(t,o):a.appendChild(t);var u=this.getChild("closeButton");u&&a.appendChild(u.el_)},n.empty=function(){this.trigger("beforemodalempty"),os(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return typeof e<"u"&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=K.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),se.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(se.isEventKey(e,"Tab")){for(var t=this.focusableEls_(),a=this.el_.querySelector(":focus"),o,u=0;u<t.length;u++)if(a===t[u]){o=u;break}K.activeElement===this.el_&&(o=0),e.shiftKey&&o===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&o===t.length-1&&(t[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(t){return(t instanceof k.HTMLAnchorElement||t instanceof k.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof k.HTMLInputElement||t instanceof k.HTMLSelectElement||t instanceof k.HTMLTextAreaElement||t instanceof k.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof k.HTMLIFrameElement||t instanceof k.HTMLObjectElement||t instanceof k.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable")})},i}(q);Di.prototype.options_={pauseOnOpen:!0,temporary:!0};q.registerComponent("ModalDialog",Di);var ki=function(s){$(i,s);function i(r){var e;r===void 0&&(r=[]),e=s.call(this)||this,e.tracks_=[],Object.defineProperty(ne(e),"length",{get:function(){return this.tracks_.length}});for(var t=0;t<r.length;t++)e.addTrack(r[t]);return e}var n=i.prototype;return n.addTrack=function(e){var t=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},Ct(e)&&e.addEventListener("labelchange",e.labelchange_)},n.removeTrack=function(e){for(var t,a=0,o=this.length;a<o;a++)if(this[a]===e){t=this[a],t.off&&t.off(),this.tracks_.splice(a,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,a=0,o=this.length;a<o;a++){var u=this[a];if(u.id===e){t=u;break}}return t},i}(Ae);ki.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var sm in ki.prototype.allowedEvents_)ki.prototype["on"+sm]=null;var da=function(i,n){for(var r=0;r<i.length;r++)!Object.keys(i[r]).length||n.id===i[r].id||(i[r].enabled=!1)},om=function(s){$(i,s);function i(r){var e;r===void 0&&(r=[]);for(var t=r.length-1;t>=0;t--)if(r[t].enabled){da(r,r[t]);break}return e=s.call(this,r)||this,e.changing_=!1,e}var n=i.prototype;return n.addTrack=function(e){var t=this;e.enabled&&da(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,da(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},n.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},i}(ki),ca=function(i,n){for(var r=0;r<i.length;r++)!Object.keys(i[r]).length||n.id===i[r].id||(i[r].selected=!1)},um=function(s){$(i,s);function i(r){var e;r===void 0&&(r=[]);for(var t=r.length-1;t>=0;t--)if(r[t].selected){ca(r,r[t]);break}return e=s.call(this,r)||this,e.changing_=!1,Object.defineProperty(ne(e),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),e}var n=i.prototype;return n.addTrack=function(e){var t=this;e.selected&&ca(this,e),s.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){t.changing_||(t.changing_=!0,ca(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},n.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},i}(ki),Hl=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.addTrack=function(e){var t=this;s.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return t.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return t.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);var a=["metadata","chapters"];a.indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(e){s.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},i}(ki),lm=function(){function s(n){n===void 0&&(n=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var r=0,e=n.length;r<e;r++)this.addTrackElement_(n[r])}var i=s.prototype;return i.addTrackElement_=function(r){var e=this.trackElements_.length;""+e in this||Object.defineProperty(this,e,{get:function(){return this.trackElements_[e]}}
16),this.trackElements_.indexOf(r)===-1&&this.trackElements_.push(r)},i.getTrackElementByTrack_=function(r){for(var e,t=0,a=this.trackElements_.length;t<a;t++)if(r===this.trackElements_[t].track){e=this.trackElements_[t];break}return e},i.removeTrackElement_=function(r){for(var e=0,t=this.trackElements_.length;e<t;e++)if(r===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}},s}(),tu=function(){function s(n){s.prototype.setCues_.call(this,n),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var i=s.prototype;return i.setCues_=function(r){var e=this.length||0,t=0,a=r.length;this.cues_=r,this.length_=r.length;var o=function(l){""+l in this||Object.defineProperty(this,""+l,{get:function(){return this.cues_[l]}})};if(e<a)for(t=e;t<a;t++)o.call(this,t)},i.getCueById=function(r){for(var e=null,t=0,a=this.length;t<a;t++){var o=this[t];if(o.id===r){e=o;break}}return e},s}(),dm={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},cm={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},fm={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},iu={disabled:"disabled",hidden:"hidden",showing:"showing"},cs=function(s){$(i,s);function i(n){var r;n===void 0&&(n={}),r=s.call(this)||this;var e={id:n.id||"vjs_track_"+Dt(),kind:n.kind||"",language:n.language||""},t=n.label||"",a=function(l){Object.defineProperty(ne(r),l,{get:function(){return e[l]},set:function(){}})};for(var o in e)a(o);return Object.defineProperty(ne(r),"label",{get:function(){return t},set:function(l){l!==t&&(t=l,this.trigger("labelchange"))}}),r}return i}(Ae),fs=function(i){var n=["protocol","hostname","port","pathname","search","hash","host"],r=K.createElement("a");r.href=i;for(var e={},t=0;t<n.length;t++)e[n[t]]=r[n[t]];return e.protocol==="http:"&&(e.host=e.host.replace(/:80$/,"")),e.protocol==="https:"&&(e.host=e.host.replace(/:443$/,"")),e.protocol||(e.protocol=k.location.protocol),e.host||(e.host=k.location.host),e},Wl=function(i){if(!i.match(/^https?:\/\//)){var n=K.createElement("a");n.href=i,i=n.href}return i},hs=function(i){if(typeof i=="string"){var n=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,r=n.exec(i);if(r)return r.pop().toLowerCase()}return""},Mn=function(i,n){n===void 0&&(n=k.location);var r=fs(i),e=r.protocol===":"?n.protocol:r.protocol,t=e+r.host!==n.protocol+n.host;return t},hm=Object.freeze({__proto__:null,parseUrl:fs,getAbsoluteURL:Wl,getFileExtension:hs,isCrossOrigin:Mn}),ru=function(i,n){var r=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),e=[];r.oncue=function(t){n.addCue(t)},r.onparsingerror=function(t){e.push(t)},r.onflush=function(){n.trigger({type:"loadeddata",target:n})},r.parse(i),e.length>0&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed("Text Track parsing errors for "+n.src),e.forEach(function(t){return ue.error(t)}),k.console&&k.console.groupEnd&&k.console.groupEnd()),r.flush()},nu=function(i,n){var r={uri:i},e=Mn(i);e&&(r.cors=e);var t=n.tech_.crossOrigin()==="use-credentials";t&&(r.withCredentials=t),$u(r,ye(this,function(a,o,u){if(a)return ue.error(a,o);n.loaded_=!0,typeof k.WebVTT!="function"?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type==="vttjserror"){ue.error("vttjs failed to load, stopping trying to process "+n.src);return}return ru(u,n)}):ru(u,n)}))},fr=function(s){$(i,s);function i(r){var e;if(r===void 0&&(r={}),!r.tech)throw new Error("A tech was not provided.");var t=ve(r,{kind:fm[r.kind]||"subtitles",language:r.language||r.srclang||""}),a=iu[t.mode]||"disabled",o=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(a="hidden"),e=s.call(this,t)||this,e.tech_=t.tech,e.cues_=[],e.activeCues_=[],e.preload_=e.tech_.preloadTextTracks!==!1;var u=new tu(e.cues_),l=new tu(e.activeCues_),c=!1;e.timeupdateHandler=ye(ne(e),function(m){if(m===void 0&&(m={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),m.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var g=function(){e.stopTracking()};return e.tech_.one("dispose",g),a!=="disabled"&&e.startTracking(),Object.defineProperties(ne(e),{default:{get:function(){return o}
16,set:function(){}},mode:{get:function(){return a},set:function(_){iu[_]&&a!==_&&(a=_,!this.preload_&&a!=="disabled"&&this.cues.length===0&&nu(this.src,this),this.stopTracking(),a!=="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=[],E=0,S=this.cues.length;E<S;E++){var R=this.cues[E];(R.startTime<=_&&R.endTime>=_||R.startTime===R.endTime&&R.startTime<=_&&R.startTime+.5>=_)&&b.push(R)}if(c=!1,b.length!==this.activeCues_.length)c=!0;else for(var F=0;F<b.length;F++)this.activeCues_.indexOf(b[F])===-1&&(c=!0);return this.activeCues_=b,l.setCues_(this.activeCues_),l},set:function(){}}}),t.src?(e.src=t.src,e.preload_||(e.loaded_=!0),(e.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&nu(e.src,ne(e))):e.loaded_=!0,e}var n=i.prototype;return n.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},n.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},n.addCue=function(e){var t=e;if(!("getCueAsHTML"in t)){t=new k.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(var a in e)a in t||(t[a]=e[a]);t.id=e.id,t.originalCue_=e}for(var o=this.tech_.textTracks(),u=0;u<o.length;u++)o[u]!==this&&o[u].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var t=this.cues_.length;t--;){var a=this.cues_[t];if(a===e||a.originalCue_&&a.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},i}(cs);fr.prototype.allowedEvents_={cuechange:"cuechange"};var ql=function(s){$(i,s);function i(n){var r;n===void 0&&(n={});var e=ve(n,{kind:cm[n.kind]||""});r=s.call(this,e)||this;var t=!1;return Object.defineProperty(ne(r),"enabled",{get:function(){return t},set:function(o){typeof o!="boolean"||o===t||(t=o,this.trigger("enabledchange"))}}),e.enabled&&(r.enabled=e.enabled),r.loaded_=!0,r}return i}(cs),Gl=function(s){$(i,s);function i(n){var r;n===void 0&&(n={});var e=ve(n,{kind:dm[n.kind]||""});r=s.call(this,e)||this;var t=!1;return Object.defineProperty(ne(r),"selected",{get:function(){return t},set:function(o){typeof o!="boolean"||o===t||(t=o,this.trigger("selectedchange"))}}),e.selected&&(r.selected=e.selected),r}return i}(cs),zl=0,pm=1,Kl=2,mm=3,Li=function(s){$(i,s);function i(n){var r;n===void 0&&(n={}),r=s.call(this)||this;var e,t=new fr(n);return r.kind=t.kind,r.src=t.src,r.srclang=t.language,r.label=t.label,r.default=t.default,Object.defineProperties(ne(r),{readyState:{get:function(){return e}},track:{get:function(){return t}}}),e=zl,t.addEventListener("loadeddata",function(){e=Kl,r.trigger({type:"load",target:ne(r)})}),r}return i}(Ae);Li.prototype.allowedEvents_={load:"load"};Li.NONE=zl;Li.LOADING=pm;Li.LOADED=Kl;Li.ERROR=mm;var it={audio:{ListClass:om,TrackClass:ql,capitalName:"Audio"},video:{ListClass:um,TrackClass:Gl,capitalName:"Video"},text:{ListClass:Hl,TrackClass:fr,capitalName:"Text"}};Object.keys(it).forEach(function(s){it[s].getterName=s+"Tracks",it[s].privateName=s+"Tracks_"});var wi={remoteText:{ListClass:Hl,TrackClass:fr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:lm,TrackClass:Li,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ve=wt({},it,wi);wi.names=Object.keys(wi);it.names=Object.keys(it);Ve.names=[].concat(wi.names).concat(it.names);function gm(s,i,n,r,e){e===void 0&&(e={});var t=s.textTracks();e.kind=i,n&&(e.label=n),r&&(e.language=r),e.tech=s;var a=new Ve.text.TrackClass(e);return t.addTrack(a),a}var pe=function(s){$(i,s);function i(r,e){var t;return r===void 0&&(r={}),e===void 0&&(e=function(){}),r.reportTouchActivity=!1,t=s.call(this,null,r,e)||this,t.onDurationChange_=function(a){return t.onDurationChange(a)},t.trackProgress_=function(a){return t.trackProgress(a)},t.trackCurrentTime_=function(a){return t.trackCurrentTime(a)},t.stopTrackingCurrentTime_=function(a){return t.stopTrackingCurrentTime(a)},t.disposeSourceHandler_=function(a){return t.disposeSourceHandler(a)}
16,t.queuedHanders_=new Set,t.hasStarted_=!1,t.on("playing",function(){this.hasStarted_=!0}),t.on("loadstart",function(){this.hasStarted_=!1}),Ve.names.forEach(function(a){var o=Ve[a];r&&r[o.getterName]&&(t[o.privateName]=r[o.getterName])}),t.featuresProgressEvents||t.manualProgressOn(),t.featuresTimeupdateEvents||t.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){r["native"+a+"Tracks"]===!1&&(t["featuresNative"+a+"Tracks"]=!1)}),r.nativeCaptions===!1||r.nativeTextTracks===!1?t.featuresNativeTextTracks=!1:(r.nativeCaptions===!0||r.nativeTextTracks===!0)&&(t.featuresNativeTextTracks=!0),t.featuresNativeTextTracks||t.emulateTextTracks(),t.preloadTextTracks=r.preloadTextTracks!==!1,t.autoRemoteTextTracks_=new Ve.text.ListClass,t.initTrackListeners(),r.nativeControlsForTouch||t.emitTapEvents(),t.constructor&&(t.name_=t.constructor.name||"Unknown Tech"),t}var n=i.prototype;return n.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},n.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ye(this,function(){var t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)},n.onDurationChange=function(e){this.duration_=this.duration()},n.buffered=function(){return Zt(0,0)},n.bufferedPercent=function(){return Vl(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks(it.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),s.prototype.dispose.call(this)},n.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach(function(a){for(var o=t[a+"Tracks"]()||[],u=o.length;u--;){var l=o[u];a==="text"&&t.removeRemoteTextTrack(l),o.removeTrack(l)}})},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var a=e[t];this.removeRemoteTextTrack(a)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(e){return e!==void 0&&(this.error_=new qe(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?Zt(0,0):Zt()},n.play=function(){},n.setScrubbing=function(){},n.scrubbing=function(){},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var e=this;it.names.forEach(function(t){var a=it[t],o=function(){e.trigger(t+"trackchange")},u=e[a.getterName]();u.addEventListener("removetrack",o),u.addEventListener("addtrack",o),e.on("dispose",function(){u.removeEventListener("removetrack",o),u.removeEventListener("addtrack",o)})})},n.addWebVttScript_=function(){var e=this;if(!k.WebVTT)if(K.body.contains(this.el())){if(!this.options_["vtt.js"]&&ir(Do)&&Object.keys(Do).length>0){this.trigger("vttjsloaded");return}var t=K.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),k.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),a=this.remoteTextTracks(),o=function(m){return t.addTrack(m.track)},u=function(m){return t.removeTrack(m.track)};a.on("addtrack",o),a.on("removetrack",u),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},c=function(){l();for(var m=0;m<t.length;m++){var _=t[m];_.removeEventListener("cuechange",l),_.mode==="showing"&&_.addEventListener("cuechange",l)}};c(),t.addEventListener("change",c),t.addEventListener("addtrack",c),t.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",o),a.off("removetrack",u),t.removeEventListener("change",c),t.removeEventListener("addtrack",c),t.removeEventListener("removetrack",c);for(var g=0;g<t.length;g++){var m=t[g];m.removeEventListener("cuechange",l)}})},n.addTextTrack=function(e,t,a){if(!e)throw new Error("TextTrack kind is required but was not provided");return gm(this,e,t,a)},n.createRemoteTextTrack=function(e){var t=ve(e,{tech:this});return new wi.remoteTextEl.TrackClass(t)},n.addRemoteTextTrack=function(e,t){var a=this;e===void 0&&(e={});var o=this.createRemoteTextTrack(e);return t!==!0&&t!==!1&&(ue.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),t!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(o.track)}),o},n.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var e=this.options_.Promise||k.Promise;if(e)return e.reject()},n.disablePictureInPicture=function(){return!0},n.setDisablePictureInPicture=function(){},n.requestVideoFrameCallback=function(e){var t=this,a=Dt();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){t.queuedH
16anders_.has(a)&&(t.queuedHanders_.delete(a),e())})):this.requestNamedAnimationFrame(a,e),a},n.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},i.canPlayType=function(){return""},i.canPlaySource=function(e,t){return i.canPlayType(e.type)},i.isTech=function(e){return e.prototype instanceof i||e instanceof i||e===i},i.registerTech=function(e,t){if(i.techs_||(i.techs_={}),!i.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!i.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!i.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Ee(e),i.techs_[e]=t,i.techs_[Qr(e)]=t,e!=="Tech"&&i.defaultTechOrder_.push(e),t},i.getTech=function(e){if(e){if(i.techs_&&i.techs_[e])return i.techs_[e];if(e=Ee(e),k&&k.videojs&&k.videojs[e])return ue.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),k.videojs[e]}},i}(q);Ve.names.forEach(function(s){var i=Ve[s];pe.prototype[i.getterName]=function(){return this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName]}});pe.prototype.featuresVolumeControl=!0;pe.prototype.featuresMuteControl=!0;pe.prototype.featuresFullscreenResize=!1;pe.prototype.featuresPlaybackRate=!1;pe.prototype.featuresProgressEvents=!1;pe.prototype.featuresSourceset=!1;pe.prototype.featuresTimeupdateEvents=!1;pe.prototype.featuresNativeTextTracks=!1;pe.prototype.featuresVideoFrameCallback=!1;pe.withSourceHandlers=function(s){s.registerSourceHandler=function(n,r){var e=s.sourceHandlers;e||(e=s.sourceHandlers=[]),r===void 0&&(r=e.length),e.splice(r,0,n)},s.canPlayType=function(n){for(var r=s.sourceHandlers||[],e,t=0;t<r.length;t++)if(e=r[t].canPlayType(n),e)return e;return""},s.selectSourceHandler=function(n,r){for(var e=s.sourceHandlers||[],t,a=0;a<e.length;a++)if(t=e[a].canHandleSource(n,r),t)return e[a];return null},s.canPlaySource=function(n,r){var e=s.selectSourceHandler(n,r);return e?e.canHandleSource(n,r):""};var i=["seekable","seeking","duration"];i.forEach(function(n){var r=this[n];typeof r=="function"&&(this[n]=function(){return this.sourceHandler_&&this.sourceHandler_[n]?this.sourceHandler_[n].apply(this.sourceHandler_,arguments):r.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(n){var r=s.selectSourceHandler(n,this.options_);r||(s.nativeSourceHandler?r=s.nativeSourceHandler:ue.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),r!==s.nativeSourceHandler&&(this.currentSource_=n),this.sourceHandler_=r.handleSource(n,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.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)}};q.registerComponent("Tech",pe);pe.registerTech("Tech",pe);pe.defaultTechOrder_=[];var ei={},Fa={},on={};function vm(s,i){ei[s]=ei[s]||[],ei[s].push(i)}function ym(s,i,n){s.setTimeout(function(){return Kt(i,ei[i.type],n,s)},1)}function _m(s,i){s.forEach(function(n){return n.setTech&&n.setTech(i)})}function Tm(s,i,n){return s.reduceRight(ps(n),i[n]())}function bm(s,i,n,r){return i[n](s.reduce(ps(n),r))}function au(s,i,n,r){r===void 0&&(r=null);var e="call"+Ee(n),t=s.reduce(ps(e),r),a=t===on,o=a?null:i[n](t);return Em(s,n,o,a),o}var Sm={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},xm={setCurrentTime:1,setMuted:1,setVolume:1},su={play:1,pause:1};function ps(s){return function(i,n){return i===on?on:n[s]?n[s](i):i}}function Em(s,i,n,r){for(var e=s.length-1;e>=0;e--){var t=s[e];t[i]&&t[i](r,n)}}function Cm(s){Fa[s.id()]=null}function km(s,i){var n=Fa[s.id()],r=null;if(n==null)return r=i(s),Fa[s.id()]=[[i,r]],r;for(var e=0;e<n.length;e++){var t=n[e],a=t[0],o=t[1];
16a===i&&(r=o)}return r===null&&(r=i(s),n.push([i,r])),r}function Kt(s,i,n,r,e,t){s===void 0&&(s={}),i===void 0&&(i=[]),e===void 0&&(e=[]),t===void 0&&(t=!1);var a=i,o=a[0],u=a.slice(1);if(typeof o=="string")Kt(s,ei[o],n,r,e,t);else if(o){var l=km(r,o);if(!l.setSource)return e.push(l),Kt(s,u,n,r,e,t);l.setSource(be({},s),function(c,g){if(c)return Kt(s,u,n,r,e,t);e.push(l),Kt(g,s.type===g.type?u:ei[g.type],n,r,e,t)})}else u.length?Kt(s,u,n,r,e,t):t?n(s,e):Kt(s,ei["*"],n,r,e,!0)}var wm={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"},un=function(i){i===void 0&&(i="");var n=hs(i),r=wm[n.toLowerCase()];return r||""},Pm=function(i,n){if(!n)return"";if(i.cache_.source.src===n&&i.cache_.source.type)return i.cache_.source.type;var r=i.cache_.sources.filter(function(o){return o.src===n});if(r.length)return r[0].type;for(var e=i.$$("source"),t=0;t<e.length;t++){var a=e[t];if(a.type&&a.src&&a.src===n)return a.type}return un(n)},Im=function s(i){if(Array.isArray(i)){var n=[];i.forEach(function(r){r=s(r),Array.isArray(r)?n=n.concat(r):Pt(r)&&n.push(r)}),i=n}else typeof i=="string"&&i.trim()?i=[ou({src:i})]:Pt(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[ou(i)]:i=[];return i};function ou(s){if(!s.type){var i=un(s.src);i&&(s.type=i)}return s}var Am=function(s){$(i,s);function i(n,r,e){var t,a=ve({createEl:!1},r);if(t=s.call(this,n,a,e)||this,!r.playerOptions.sources||r.playerOptions.sources.length===0)for(var o=0,u=r.playerOptions.techOrder;o<u.length;o++){var l=Ee(u[o]),c=pe.getTech(l);if(l||(c=q.getComponent(l)),c&&c.isSupported()){n.loadTech_(l);break}}else n.src(r.playerOptions.sources);return t}return i}(q);q.registerComponent("MediaLoader",Am);var Fn=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.options_.controlText&&t.controlText(t.options_.controlText),t.handleMouseOver_=function(a){return t.handleMouseOver(a)},t.handleMouseOut_=function(a){return t.handleMouseOut(a)},t.handleClick_=function(a){return t.handleClick(a)},t.handleKeyDown_=function(a){return t.handleKeyDown(a)},t.emitTapEvents(),t.enable(),t}var n=i.prototype;return n.createEl=function(e,t,a){e===void 0&&(e="div"),t===void 0&&(t={}),a===void 0&&(a={}),t=be({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&ue.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),a=be({role:"button"},a),this.tabIndex_=t.tabIndex;var o=le(e,t,a);return o.appendChild(le("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},n.dispose=function(){this.controlTextEl_=null,s.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=le("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(t===void 0&&(t=this.el()),e===void 0)return this.controlText_||"Need Text";var a=this.localize(e);this.controlText_=e,ii(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",a)},n.buildCSSClass=function(){return"vjs-control vjs-button "+s.prototype.buildCSSClass.call(this)},n.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_))},n.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_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(e){se.isEventKey(e,"Space")||se.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},i}(q);q.registerComponent("ClickableComponent",Fn);var Om=function(s){$(i,s);function i(r,e){var t;
16return t=s.call(this,r,e)||this,t.update(),t.update_=function(a){return t.update(a)},r.on("posterchange",t.update_),t}var n=i.prototype;return n.dispose=function(){this.player().off("posterchange",this.update_),s.prototype.dispose.call(this)},n.createEl=function(){var e=le("div",{className:"vjs-poster",tabIndex:-1});return e},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},n.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((dr||lr)&&t)&&this.player_.tech(!0).focus(),this.player_.paused()?pt(this.player_.play()):this.player_.pause()}},i}(Fn);q.registerComponent("PosterImage",Om);var et="#222",uu="#ccc",Dm={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 fa(s,i){var n;if(s.length===4)n=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)n=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+i+")"}function ha(s,i,n){try{s.style[i]=n}catch{return}}var Lm=function(s){$(i,s);function i(r,e,t){var a;a=s.call(this,r,e,t)||this;var o=function(l){return a.updateDisplay(l)};return r.on("loadstart",function(u){return a.toggleDisplay(u)}),r.on("texttrackchange",o),r.on("loadedmetadata",function(u){return a.preselectTrack(u)}),r.ready(ye(ne(a),function(){if(r.tech_&&r.tech_.featuresNativeTextTracks){this.hide();return}r.on("fullscreenchange",o),r.on("playerresize",o),k.addEventListener("orientationchange",o),r.on("dispose",function(){return k.removeEventListener("orientationchange",o)});for(var u=this.options_.playerOptions.tracks||[],l=0;l<u.length;l++)this.player_.addRemoteTextTrack(u[l],!0);this.preselectTrack()})),a}var n=i.prototype;return n.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o,u,l,c=0;c<t.length;c++){var g=t[c];a&&a.enabled&&a.language&&a.language===g.language&&g.kind in e?g.kind===a.kind?l=g:l||(l=g):a&&!a.enabled?(l=null,o=null,u=null):g.default&&(g.kind==="descriptions"&&!o?o=g:g.kind in e&&!u&&(u=g))}l?l.mode="showing":u?u.mode="showing":o&&(o.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){typeof k.WebVTT=="function"&&k.WebVTT.processCues(k,[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var a=[],o=0;o<e.length;++o){var u=e[o];u.mode==="showing"&&a.push(u)}this.updateForTrack(a);return}for(var l=null,c=null,g=e.length;g--;){var m=e[g];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))},n.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),a=e.activeCues,o=a.length;o--;){var u=a[o];if(u){var l=u.displayState;if(t.color&&(l.firstChild.style.color=t.color),t.textOpacity&&ha(l.firstChild,"color",fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(l.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ha(l.firstChild,"backgroundColor",fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ha(l,"backgroundColor",fa(t.windowColor,t.windowOpacity)):l.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?l.firstChild.style.textShadow="2px 2px 3px "+et+", 2px 2px 4px "+et+", 2px 2px 5px "+et:t.edgeStyle==="raised"?l.firstChild.style.textShadow="1px 1px "+et+", 2px 2px "+et+", 3px 3px "+et:t.edgeStyle==="depressed"?l.firstChild.style.textShadow="1px 1px "+uu+", 0 1px "+uu+", -1px -1px "+et+", 0 -1px "+et:t.edgeStyle==="uniform"&&(l.firstChild.style.textShadow="0 0 4px "+et+", 0 0 4px "+et+", 0 0 4px "+et+", 0 0 4px "+et)),t.fontPercent&&t.fontPercent!==1){var c=k.parseFloat(l.style.fontSize);
16l.style.fontSize=c*t.fontPercent+"px",l.style.height="auto",l.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?l.firstChild.style.fontVariant="small-caps":l.firstChild.style.fontFamily=Dm[t.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),!(typeof k.WebVTT!="function"||e.every(function(_){return!_.activeCues}))){for(var t=[],a=0;a<e.length;++a)for(var o=e[a],u=0;u<o.activeCues.length;++u)t.push(o.activeCues[u]);k.WebVTT.processCues(k,t,this.el_);for(var l=0;l<e.length;++l){for(var c=e[l],g=0;g<c.activeCues.length;++g){var m=c.activeCues[g].displayState;Et(m,"vjs-text-track-cue"),Et(m,"vjs-text-track-cue-"+(c.language?c.language:l)),c.language&&Ei(m,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},i}(q);q.registerComponent("TextTrackDisplay",Lm);var Mm=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(){var e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),a=le("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),o=s.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(a),o},i}(q);q.registerComponent("LoadingSpinner",Mm);var ot=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(e,t,a){t===void 0&&(t={}),a===void 0&&(a={}),e="button",t=be({className:this.buildCSSClass()},t),a=be({type:"button"},a);var o=le(e,t,a);return o.appendChild(le("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},n.addChild=function(e,t){t===void 0&&(t={});var a=this.constructor.name;return ue.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),q.prototype.addChild.call(this,e,t)},n.enable=function(){s.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){s.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(e){if(se.isEventKey(e,"Space")||se.isEventKey(e,"Enter")){e.stopPropagation();return}s.prototype.handleKeyDown.call(this,e)},i}(Fn);q.registerComponent("Button",ot);var $l=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.mouseused_=!1,t.on("mousedown",function(a){return t.handleMouseDown(a)}),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;pt(t),this.player_.tech(!0)&&!((dr||lr)&&a)&&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()};Yi(t)?t.then(l,function(){}):this.setTimeout(l,1)},n.handleKeyDown=function(e){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,e)},n.handleMouseDown=function(e){this.mouseused_=!0},i}(ot);$l.prototype.controlText_="Play Video";q.registerComponent("BigPlayButton",$l);var Fm=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.controlText(e&&e.controlText||t.localize("Close")),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(e){se.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,e)},i}(ot);q.registerComponent("CloseButton",Fm);var Xl=function(s){$(i,s);function i(r,e){var t;return e===void 0&&(e={}),t=s.call(this,r,e)||this,e.replay=e.replay===void 0||e.replay,t.on(r,"play",function(a){return t.handlePlay(a)}),t.on(r,"pause",function(a){return t.handlePause(a)}),e.replay&&t.on(r,"ended",function(a){return t.handleEnded(a)}),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?pt(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return t.handleSeeked(a)})},i}(ot);Xl.prototype.controlText_="Play";q.registerComponent("PlayToggle",Xl);var Ql=function(i,n){i=i<0?0:i;var r=Math.floor(i%60),e=Math.floor(i/60%60),t=Math.floor(i/3600),a=Math.floor(n/60%60),o=Math.floor(n/3600);return(isNaN(i)||i===1/0)&&(t=e=r="-"),t=t>0||o>0?t+":":"",e=((t||a>=10)&&e<10?"0"+e:e)+":",r=r<10?"0"+r:r,t+e+r},ms=Ql;function Rm(s){ms=s}function Nm(){ms=Ql}function Pi(s,i){return i===void 0&&(i=s),ms(s,i)}var Mi=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on(r,["timeupdate","ended"],function(a){return t.updateContent(a)}),t.updateTextNode_(),t}var n=i.prototype;return n.createEl=function(){var e=this.buildCSSClass(),t=s.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=le("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return t.appendChild(a),this.contentEl_=le("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},n.updateTextNode_=function(e){var t=this;e===void 0&&(e=0),e=Pi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var a=t.textNode_;a&&t.contentEl_.firstChild!==a&&(a=null,ue.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=K.createTextNode(t.formattedTime_),t.textNode_&&(a?t.contentEl_.replaceChild(t.textNode_,a):t.contentEl_.appendChild(t.textNode_))}}))},n.updateContent=function(e){},i}(q);Mi.prototype.labelText_="Time";Mi.prototype.controlText_="Time";q.registerComponent("TimeDisplay",Mi);var gs=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},i}(Mi);gs.prototype.labelText_="Current Time";gs.prototype.controlText_="Current Time";q.registerComponent("CurrentTimeDisplay",gs);var vs=function(s){$(i,s);function i(r,e){var t;t=s.call(this,r,e)||this;var a=function(u){return t.updateContent(u)};return t.on(r,"durationchange",a),t.on(r,"loadstart",a),t.on(r,"loadedmetadata",a),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},i}(Mi);vs.prototype.labelText_="Duration";vs.prototype.controlText_="Duration";q.registerComponent("DurationDisplay",vs);var Um=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return t.appendChild(a),e.appendChild(t),e},i}(q);
16q.registerComponent("TimeDivider",Um);var ys=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on(r,"durationchange",function(a){return t.updateContent(a)}),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var e=s.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(le("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},n.updateContent=function(e){if(typeof this.player_.duration()=="number"){var t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}},i}(Mi);ys.prototype.labelText_="Remaining Time";ys.prototype.controlText_="Remaining Time";q.registerComponent("RemainingTimeDisplay",ys);var Bm=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.updateShowing(),t.on(t.player(),"durationchange",function(a){return t.updateShowing(a)}),t}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=le("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(le("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(K.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},n.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},i}(q);q.registerComponent("LiveDisplay",Bm);var Yl=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.updateLiveEdgeStatus(),t.player_.liveTracker&&(t.updateLiveEdgeStatusHandler_=function(a){return t.updateLiveEdgeStatus(a)},t.on(t.player_.liveTracker,"liveedgechange",t.updateLiveEdgeStatusHandler_)),t}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=le("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},n.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"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},i}(ot);Yl.prototype.controlText_="Seek to live, currently playing live";q.registerComponent("SeekToLive",Yl);var Rn=function(i,n,r){return i=Number(i),Math.min(r,Math.max(n,isNaN(i)?n:i))},_s=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.handleMouseDown_=function(a){return t.handleMouseDown(a)},t.handleMouseUp_=function(a){return t.handleMouseUp(a)},t.handleKeyDown_=function(a){return t.handleKeyDown(a)},t.handleClick_=function(a){return t.handleClick(a)},t.handleMouseMove_=function(a){return t.handleMouseMove(a)},t.update_=function(a){return t.update(a)},t.bar=t.getChild(t.options_.barName),t.vertical(!!t.options_.vertical),t.enable(),t}var n=i.prototype;return n.enabled=function(){return this.enabled_},n.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)},n.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}},n.createEl=function(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),t.className=t.className+" vjs-slider",t=be({tabIndex:0},t),a=be({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,e,t,a)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Ot&&e.preventDefault(),kl(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;wl(),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()},n.update=function(){var e=this;if(!(!this.el_||!this.bar)){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(t*100).toFixed(2)+"%"})),t}},n.getProgress=function(){return Number(Rn(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=An(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(e){se.isEventKey(e,"Left")||se.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):se.isEventKey(e,"Right")||se.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,e)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.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")},i}(q);q.registerComponent("Slider",_s);var pa=function(i,n){return Rn(i/n*100,0,100).toFixed(2)+"%"},jm=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.partEls_=[],t.on(r,"progress",function(a){return t.update(a)}),t}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),t=le("span",{className:"vjs-control-text"}),a=le("span",{textContent:this.localize("Loaded")}
16),o=K.createTextNode(": ");return this.percentageEl_=le("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(a),t.appendChild(o),t.appendChild(this.percentageEl_),e},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=t.player_.liveTracker,o=t.player_.buffered(),u=a&&a.isLive()?a.seekableEnd():t.player_.duration(),l=t.player_.bufferedEnd(),c=t.partEls_,g=pa(l,u);t.percent_!==g&&(t.el_.style.width=g,ii(t.percentageEl_,g),t.percent_=g);for(var m=0;m<o.length;m++){var _=o.start(m),b=o.end(m),E=c[m];E||(E=t.el_.appendChild(le()),c[m]=E),!(E.dataset.start===_&&E.dataset.end===b)&&(E.dataset.start=_,E.dataset.end=b,E.style.left=pa(_,l),E.style.width=pa(b-_,l))}for(var S=c.length;S>o.length;S--)t.el_.removeChild(c[S-1]);c.length=o.length})},i}(q);q.registerComponent("LoadProgressBar",jm);var Vm=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.update=It(ye(ne(t),t.update),ut),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,a){var o=nr(this.el_),u=Ci(this.player_.el()),l=e.width*t;if(!(!u||!o)){var c=e.left-u.left+l,g=e.width-l+(u.right-e.right),m=o.width/2;c<m?m+=m-c:g<m&&(m=g),m<0?m=0:m>o.width&&(m=o.width),m=Math.round(m),this.el_.style.right="-"+m+"px",this.write(a)}},n.write=function(e){ii(this.el_,e)},n.updateTime=function(e,t,a,o){var u=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,c=u.player_.duration();if(u.player_.liveTracker&&u.player_.liveTracker.isLive()){var g=u.player_.liveTracker.liveWindow(),m=g-t*g;l=(m<1?"":"-")+Pi(m,g)}else l=Pi(a,c);u.update(e,t,l),o&&o()})},i}(q);q.registerComponent("TimeTooltip",Vm);var Ts=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.update=It(ye(ne(t),t.update),ut),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,t,o)}},i}(q);Ts.prototype.options_={children:[]};!Ge&&!At&&Ts.prototype.options_.children.push("timeTooltip");q.registerComponent("PlayProgressBar",Ts);var Jl=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.update=It(ye(ne(t),t.update),ut),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var a=this,o=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,o,function(){a.el_.style.left=e.width*t+"px"})},i}(q);Jl.prototype.options_={children:["timeTooltip"]};q.registerComponent("MouseTimeDisplay",Jl);var Wr=5,lu=12,bs=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.setEventHandlers_(),t}var n=i.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=ye(this,this.update),this.update=It(this.update_,ut),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(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in K&&"visibilityState"in K&&this.on(K,"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){K.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,ut))},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(e){var t=this;if(K.visibilityState!=="hidden"){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=t.player_.ended()?t.player_.duration():t.getCurrentTime_(),u=t.player_.liveTracker,l=t.player_.duration();
16u&&u.isLive()&&(l=t.player_.liveTracker.liveCurrentTime()),t.percent_!==a&&(t.el_.setAttribute("aria-valuenow",(a*100).toFixed(2)),t.percent_=a),(t.currentTime_!==o||t.duration_!==l)&&(t.el_.setAttribute("aria-valuetext",t.localize("progress bar timing: currentTime={1} duration={2}",[Pi(o,l),Pi(l,l)],"{1} of {2}")),t.currentTime_=o,t.duration_=l),t.bar&&t.bar.update(Ci(t.el()),t.getProgress())}),a}},n.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var e=this.getCurrentTime_(),t,a=this.player_.liveTracker;return a&&a.isLive()?(t=(e-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t},n.handleMouseDown=function(e){ar(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,e))},n.handleMouseMove=function(e,t){if(t===void 0&&(t=!1),!!ar(e)){!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(e),u=this.player_.liveTracker;if(!u||!u.isLive())a=o*this.player_.duration(),a===this.player_.duration()&&(a=a-.1);else{if(o>=.99){u.seekToLiveEdge();return}var l=u.seekableStart(),c=u.liveCurrentTime();if(a=l+o*u.liveWindow(),a>=c&&(a=c),a<=l&&(a=l+.1),a===1/0)return}this.userSeek_(a)}},n.enable=function(){s.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},n.disable=function(){s.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},n.handleMouseUp=function(e){s.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?pt(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+Wr)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-Wr)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(e){var t=this.player_.liveTracker;if(se.isEventKey(e,"Space")||se.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(se.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(se.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(se(e))){e.preventDefault(),e.stopPropagation();var a=(se.codes[se(e)]-se.codes[0])*10/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else se.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Wr*lu)):se.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Wr*lu)):s.prototype.handleKeyDown.call(this,e)},n.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 K&&"visibilityState"in K&&this.off(K,"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},i}(_s);bs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Ge&&!At&&bs.prototype.options_.children.splice(1,0,"mouseTimeDisplay");q.registerComponent("SeekBar",bs);var Zl=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.handleMouseMove=It(ye(ne(t),t.handleMouseMove),ut),t.throttledHandleMouseSeek=It(ye(ne(t),t.handleMouseSeek),ut),t.handleMouseUpHandler_=function(a){return t.handleMouseUp(a)},t.handleMouseDownHandler_=function(a){return t.handleMouseDown(a)},t.enable(),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var a=t.getChild("playProgressBar"),o=t.getChild("mouseTimeDisplay");if(!(!a&&!o)){var u=t.el(),l=nr(u),c=An(u,e).x;c=Rn(c,0,1),o&&o.update(l,c),a&&a.update(l,t.getProgress())}}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_}
16,n.disable=function(){if(this.children().forEach(function(t){return t.disable&&t.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&&pt(this.player_.play())}},n.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)},n.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_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},i}(q);Zl.prototype.options_={children:["seekBar"]};q.registerComponent("ProgressControl",Zl);var ed=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on(r,["enterpictureinpicture","leavepictureinpicture"],function(a){return t.handlePictureInPictureChange(a)}),t.on(r,["disablepictureinpicturechanged","loadedmetadata"],function(a){return t.handlePictureInPictureEnabledChange(a)}),t.on(r,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var a=r.currentType().substring(0,5)==="audio";a||r.audioPosterMode()||r.audioOnlyMode()?(r.isInPictureInPicture()&&r.exitPictureInPicture(),t.hide()):t.show()}),t.disable(),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){K.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(ot);ed.prototype.controlText_="Picture-in-Picture";q.registerComponent("PictureInPictureToggle",ed);var td=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on(r,"fullscreenchange",function(a){return t.handleFullscreenChange(a)}),K[r.fsApi_.fullscreenEnabled]===!1&&t.disable(),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(ot);td.prototype.controlText_="Fullscreen";q.registerComponent("FullscreenToggle",td);var Hm=function(i,n){n.tech_&&!n.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})},Wm=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return e.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),e},i}(q);q.registerComponent("VolumeLevel",Wm);var qm=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.update=It(ye(ne(t),t.update),ut),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,a,o){if(!a){var u=Ci(this.el_),l=Ci(this.player_.el()),c=e.width*t;if(!l||!u)return;var g=e.left-l.left+c,m=e.width-c+(l.right-e.right),_=u.width/2;g<_?_+=_-g:m<_&&(_=m),_<0?_=0:_>u.width&&(_=u.width),this.el_.style.right="-"+_+"px"}this.write(o+"%")},n.write=function(e){ii(this.el_,e)},n.updateVolume=function(e,t,a,o,u){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,t,a,o.toFixed(0)),u&&u()})},i}(q);
16q.registerComponent("VolumeLevelTooltip",qm);var id=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.update=It(ye(ne(t),t.update),ut),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t,a){var o=this,u=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,a,u,function(){a?o.el_.style.bottom=e.height*t+"px":o.el_.style.left=e.width*t+"px"})},i}(q);id.prototype.options_={children:["volumeLevelTooltip"]};q.registerComponent("MouseVolumeLevelDisplay",id);var Nn=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on("slideractive",function(a){return t.updateLastVolume_(a)}),t.on(r,"volumechange",function(a){return t.updateARIAAttributes(a)}),r.ready(function(){return t.updateARIAAttributes()}),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(e){ar(e)&&s.prototype.handleMouseDown.call(this,e)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var a=this.el(),o=Ci(a),u=this.vertical(),l=An(a,e);l=u?l.y:l.x,l=Rn(l,0,1),t.update(o,l,u)}ar(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(t)})},i}(_s);Nn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Ge&&!At&&Nn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Nn.prototype.playerEvent="volumechange";q.registerComponent("VolumeBar",Nn);var rd=function(s){$(i,s);function i(r,e){var t;return e===void 0&&(e={}),e.vertical=e.vertical||!1,(typeof e.volumeBar>"u"||ir(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),t=s.call(this,r,e)||this,Hm(ne(t),r),t.throttledHandleMouseMove=It(ye(ne(t),t.handleMouseMove),ut),t.handleMouseUpHandler_=function(a){return t.handleMouseUp(a)},t.on("mousedown",function(a){return t.handleMouseDown(a)}),t.on("touchstart",function(a){return t.handleMouseDown(a)}),t.on("mousemove",function(a){return t.handleMouseMove(a)}),t.on(t.volumeBar,["focus","slideractive"],function(){t.volumeBar.addClass("vjs-slider-active"),t.addClass("vjs-slider-active"),t.trigger("slideractive")}),t.on(t.volumeBar,["blur","sliderinactive"],function(){t.volumeBar.removeClass("vjs-slider-active"),t.removeClass("vjs-slider-active"),t.trigger("sliderinactive")}),t}var n=i.prototype;return n.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},i}(q);rd.prototype.options_={children:["volumeBar"]};
16q.registerComponent("VolumeControl",rd);var Gm=function(i,n){n.tech_&&!n.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(n,"loadstart",function(){n.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})},nd=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,Gm(ne(t),r),t.on(r,["loadstart","volumechange"],function(a){return t.update(a)}),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),a=this.player_.lastVolume_();if(t===0){var o=a<.1?.1:a;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;Ge&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var a=0;a<4;a++)cr(this.el_,"vjs-vol-"+a);Et(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var e=this.player_.muted()||this.player_.volume()===0,t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},i}(ot);nd.prototype.controlText_="Mute";q.registerComponent("MuteToggle",nd);var ad=function(s){$(i,s);function i(r,e){var t;return e===void 0&&(e={}),typeof e.inline<"u"?e.inline=e.inline:e.inline=!0,(typeof e.volumeControl>"u"||ir(e.volumeControl))&&(e.volumeControl=e.volumeControl||{},e.volumeControl.vertical=!e.inline),t=s.call(this,r,e)||this,t.handleKeyPressHandler_=function(a){return t.handleKeyPress(a)},t.on(r,["loadstart"],function(a){return t.volumePanelState_(a)}),t.on(t.muteToggle,"keyup",function(a){return t.handleKeyPress(a)}),t.on(t.volumeControl,"keyup",function(a){return t.handleVolumeControlKeyUp(a)}),t.on("keydown",function(a){return t.handleKeyPress(a)}),t.on("mouseover",function(a){return t.handleMouseOver(a)}),t.on("mouseout",function(a){return t.handleMouseOut(a)}),t.on(t.volumeControl,["slideractive"],t.sliderActive_),t.on(t.volumeControl,["sliderinactive"],t.sliderInactive_),t}var n=i.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.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")},n.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},n.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){se.isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),Ze(K,"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),Re(K,"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){se.isEventKey(e,"Esc")&&this.handleMouseOut()},i}(q);ad.prototype.options_={children:["muteToggle","volumeControl"]};q.registerComponent("VolumePanel",ad);var sd=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,e&&(t.menuButton_=e.menuButton),t.focusedChild_=-1,t.on("keydown",function(a){return t.handleKeyDown(a)}),t.boundHandleBlur_=function(a){return t.handleBlur(a)},t.boundHandleTapClick_=function(a){return t.handleTapClick(a)},t}var n=i.prototype;return n.addEventListenerForItem=function(e){e instanceof q&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof q&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),s.prototype.removeChild.call(this,e)},n.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},n.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=le(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var t=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Ze(t,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),t},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||K.activeElement;if(!this.children().some(function(o){return o.el()===t})){var a=this.menuButton_;a&&a.buttonPressed_&&t!==a.el().firstChild&&a.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var a=t.filter(function(o){return o.el()===e.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},n.handleKeyDown=function(e){se.isEventKey(e,"Left")||se.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(se.isEventKey(e,"Right")||se.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){e===void 0&&(e=0);var t=this.children().slice(),a=t.length&&t[0].hasClass("vjs-menu-title");a&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},i}(q);q.registerComponent("Menu",sd);var Ss=function(s){$(i,s);function i(r,e){var t;e===void 0&&(e={}),t=s.call(this,r,e)||this,t.menuButton_=new ot(r,e),t.menuButton_.controlText(t.controlText_),t.menuButton_.el_.setAttribute("aria-haspopup","true");var a=ot.prototype.buildCSSClass();t.menuButton_.el_.className=t.buildCSSClass()+" "+a,t.menuButton_.removeClass("vjs-control"),t.addChild(t.menuButton_),t.update(
16),t.enabled_=!0;var o=function(l){return t.handleClick(l)};return t.handleMenuKeyUp_=function(u){return t.handleMenuKeyUp(u)},t.on(t.menuButton_,"tap",o),t.on(t.menuButton_,"click",o),t.on(t.menuButton_,"keydown",function(u){return t.handleKeyDown(u)}),t.on(t.menuButton_,"mouseenter",function(){t.addClass("vjs-hover"),t.menu.show(),Ze(K,"keyup",t.handleMenuKeyUp_)}),t.on("mouseleave",function(u){return t.handleMouseLeave(u)}),t.on("keydown",function(u){return t.handleSubmenuKeyDown(u)}),t}var n=i.prototype;return n.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"))},n.createMenu=function(){var e=new sd(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=le("li",{className:"vjs-menu-title",textContent:Ee(this.options_.title),tabIndex:-1}),a=new q(this.player_,{el:t});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)e.addItem(this.items[o]);return e},n.createItems=function(){},n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";var t=ot.prototype.buildCSSClass();return"vjs-menu-button "+e+" "+t+" "+s.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+s.prototype.buildCSSClass.call(this)},n.controlText=function(e,t){return t===void 0&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},n.dispose=function(){this.handleMouseLeave(),s.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),Re(K,"keyup",this.handleMenuKeyUp_)},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){se.isEventKey(e,"Esc")||se.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),se.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(se.isEventKey(e,"Up")||se.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(se.isEventKey(e,"Esc")||se.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(se.isEventKey(e,"Esc")||se.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),se.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ge&&bl())return;this.menu.focus()}},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},i}(q);q.registerComponent("MenuButton",Ss);var xs=function(s){$(i,s);function i(n,r){var e,t=r.tracks;if(e=s.call(this,n,r)||this,e.items.length<=1&&e.hide(),!t)return ne(e);var a=ye(ne(e),e.update);return t.addEventListener("removetrack",a),t.addEventListener("addtrack",a),t.addEventListener("labelchange",a),e.player_.on("ready",a),e.player_.on("dispose",function(){t.removeEventListener("removetrack",a),t.removeEventListener("addtrack",a),t.removeEventListener("labelchange",a)}),e}return i}(Ss);q.registerComponent("TrackButton",xs);var zm=["Tab","Esc","Up","Down","Right","Left"],hr=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.selectable=e.selectable,t.isSelected_=e.selected||!1,t.multiSelectable=e.multiSelectable,t.selected(t.isSelected_),t.selectable?t.multiSelectable?t.el_.setAttribute("role","menuitemcheckbox"):t.el_.setAttribute("role","menuitemradio"):t.el_.setAttribute("role","menuitem"),t}var n=i.prototype;
16return n.createEl=function(e,t,a){this.nonIconControl=!0;var o=s.prototype.createEl.call(this,"li",be({className:"vjs-menu-item",tabIndex:-1},t),a);return o.replaceChild(le("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},n.handleKeyDown=function(e){zm.some(function(t){return se.isEventKey(e,t)})||s.prototype.handleKeyDown.call(this,e)},n.handleClick=function(e){this.selected(!0)},n.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))},i}(Fn);q.registerComponent("MenuItem",hr);var pr=function(s){$(i,s);function i(r,e){var t,a=e.track,o=r.textTracks();e.label=a.label||a.language||"Unknown",e.selected=a.mode==="showing",t=s.call(this,r,e)||this,t.track=a,t.kinds=(e.kinds||[e.kind||t.track.kind]).filter(Boolean);var u=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];t.handleTracksChange.apply(ne(t),_)},l=function(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];t.handleSelectedLanguageChange.apply(ne(t),_)};if(r.on(["loadstart","texttrackchange"],u),o.addEventListener("change",u),o.addEventListener("selectedlanguagechange",l),t.on("dispose",function(){r.off(["loadstart","texttrackchange"],u),o.removeEventListener("change",u),o.removeEventListener("selectedlanguagechange",l)}),o.onchange===void 0){var c;t.on(["tap","click"],function(){if(typeof k.Event!="object")try{c=new k.Event("change")}catch{}c||(c=K.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return t.handleTracksChange(),t}var n=i.prototype;return n.handleClick=function(e){var t=this.track,a=this.player_.textTracks();if(s.prototype.handleClick.call(this,e),!!a)for(var o=0;o<a.length;o++){var u=a[o];this.kinds.indexOf(u.kind)!==-1&&(u===t?u.mode!=="showing"&&(u.mode="showing"):u.mode!=="disabled"&&(u.mode="disabled"))}},n.handleTracksChange=function(e){var t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)},n.handleSelectedLanguageChange=function(e){if(this.track.mode==="showing"){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},n.dispose=function(){this.track=null,s.prototype.dispose.call(this)},i}(hr);q.registerComponent("TextTrackMenuItem",pr);var od=function(s){$(i,s);function i(r,e){return e.track={player:r,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,s.call(this,r,e)||this}var n=i.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),a=!0,o=0,u=t.length;o<u;o++){var l=t[o];if(this.options_.kinds.indexOf(l.kind)>-1&&l.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),a=!0,o=0,u=t.length;o<u;o++){var l=t[o];if(["captions","descriptions","subtitles"].indexOf(l.kind)>-1&&l.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(pr);q.registerComponent("OffTextTrackMenuItem",od);var Fi=function(s){$(i,s);function i(r,e){return e===void 0&&(e={}),e.tracks=r.textTracks(),s.call(this,r,e)||this}var n=i.prototype;return n.createItems=function(e,t){e===void 0&&(e=[]),t===void 0&&(t=pr);var a;this.label_&&(a=this.label_+" off"),e.push(new od(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),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 t(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},i}(xs);q.registerComponent("TextTrackButton",Fi);var ud=function(s){$(i,s);function i(r,e){var t,a=e.track,o=e.cue,u=r.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=o.text,e.selected=o.startTime<=u&&u<o.endTime,t=s.call(this,r,e)||this,t.track=a,t.cue=o,t}var n=i.prototype;return n.handleClick=function(e){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},i}(hr);q.registerComponent("ChaptersTrackMenuItem",ud);var Es=function(s){$(i,s);function i(r,e,t){var a;return a=s.call(this,r,e,t)||this,a.selectCurrentItem_=function(){a.items.forEac
16h(function(o){o.selected(a.track_.activeCues[0]===o.cue)})},a}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildWrapperCSSClass.call(this)},n.update=function(e){if(!(e&&e.track&&e.track.kind!=="chapters")){var t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),s.prototype.update.call(this)):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&s.prototype.update.call(this)}},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var a=e[t];if(a.kind===this.kind_)return a}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ee(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var a=0,o=t.length;a<o;a++){var u=t[a],l=new ud(this.player_,{track:this.track_,cue:u});e.push(l)}return e},i}(Fi);Es.prototype.kind_="chapters";Es.prototype.controlText_="Chapters";q.registerComponent("ChaptersButton",Es);var Cs=function(s){$(i,s);function i(r,e,t){var a;a=s.call(this,r,e,t)||this;var o=r.textTracks(),u=ye(ne(a),a.handleTracksChange);return o.addEventListener("change",u),a.on("dispose",function(){o.removeEventListener("change",u)}),a}var n=i.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),a=!1,o=0,u=t.length;o<u;o++){var l=t[o];if(l.kind!==this.kind_&&l.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},i}(Fi);Cs.prototype.kind_="descriptions";Cs.prototype.controlText_="Descriptions";q.registerComponent("DescriptionsButton",Cs);var ks=function(s){$(i,s);function i(r,e,t){return s.call(this,r,e,t)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildWrapperCSSClass.call(this)},i}(Fi);ks.prototype.kind_="subtitles";ks.prototype.controlText_="Subtitles";q.registerComponent("SubtitlesButton",ks);var ws=function(s){$(i,s);function i(r,e){var t;return e.track={player:r,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,e.name="CaptionSettingsMenuItem",t=s.call(this,r,e)||this,t.addClass("vjs-texttrack-settings"),t.controlText(", opens "+e.kind+" settings dialog"),t}var n=i.prototype;return n.handleClick=function(e){this.player().getChild("textTrackSettings").open()},i}(pr);q.registerComponent("CaptionSettingsMenuItem",ws);var Ps=function(s){$(i,s);function i(r,e,t){return s.call(this,r,e,t)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+s.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new ws(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,e)},i}(Fi);Ps.prototype.kind_="captions";Ps.prototype.controlText_="Captions";q.registerComponent("CaptionsButton",Ps);var ld=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(e,t,a){var o=s.prototype.createEl.call(this,e,t,a),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(u.appendChild(le("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(le("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},i}(pr);q.registerComponent("SubsCapsMenuItem",ld);var Is=function(s){$(i,s);function i(r,e){var t;return e===void 0&&(e={}),t=s.call(this,r,e)||this,t.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(t.player_.language_)>-1&&(t.label_="captions"),t.menuButton_.controlText(Ee(t.label_)),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new ws(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=s.prototype.createItems.call(this,e,ld),e},i}(Fi);Is.prototype.kinds_=["captions","subtitles"];Is.prototype.controlText_="Subtitles";q.registerComponent("SubsCapsButton",Is);var dd=function(s){$(i,s);function i(r,e){var t,a=e.track,o=r.audioTracks();e.label=a.label||a.language||"Unknown",e.selected=a.enabled,t=s.call(this,r,e)||this,t.track=a,t.addClass("vjs-"+a.kind+"-menu-item");var u=function(){for(var c=arguments.length,g=new Array(c),m=0;m<c;m++)g[m]=arguments[m];t.handleTracksChange.apply(ne(t),g)};return o.addEventListener("change",u),t.on("dispose",function(){o.removeEventListener("change",u)}),t}var n=i.prototype;return n.createEl=function(e,t,a){var o=s.prototype.createEl.call(this,e,t,a),u=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(u.appendChild(le("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),u.appendChild(le("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},n.handleClick=function(e){if(s.prototype.handleClick.call(this,e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var t=this.player_.audioTracks(),a=0;a<t.length;a++){var o=t[a];o!==this.track&&(o.enabled=o===this.track)}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},i}(hr);q.registerComponent("AudioTrackMenuItem",dd);var cd=function(s){$(i,s);function i(r,e){return e===void 0&&(e={}),e.tracks=r.audioTracks(),s.call(this,r,e)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+s.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),a=0;a<t.length;a++){var o=t[a];e.push(new dd(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return e},i}(xs);cd.prototype.controlText_="Audio Track";q.registerComponent("AudioTrackButton",cd);var As=function(s){$(i,s);function i(r,e){var t,a=e.rate,o=parseFloat(a,10);return e.label=a,e.selected=o===r.playbackRate(),e.selectable=!0,e.multiSelectable=!1,t=s.call(this,r,e)||this,t.label=a,t.rate=o,t.on(r,"ratechange",function(u){return t.update(u)}),t}var n=i.prototype;return n.handleClick=function(e){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},i}(hr);As.prototype.contentElType="button";q.registerComponent("PlaybackRateMenuItem",As);var fd=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.menuButton_.el_.setAttribute("aria-describedby",t.labelElId_),t.updateVisibility(),t.updateLabel(),t.on(r,"loadstart",function(a){return t.updateVisibility(a)}),t.on(r,"ratechange",function(a){return t.updateLabel(a)}),t.on(r,"playbackrateschange",function(a){return t.handlePlaybackRateschange(a)}),t}var n=i.prototype;return n.createEl=function(){var e=s.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=le("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e},n.dispose=function(){this.labelEl_=null,s.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){for(var e=this.playbackRates(),t=[],a=e.length-1;a>=0;a--)t.push(new As(this.player(),{rate:e[a]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){var t=this.player().playbackRate(),a=this.playbackRates(),o=a.indexOf(t),u=(o+1)%a.length;this.player().playbackRate(a[u])},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},i}(Ss);fd.prototype.controlText_="Playback Rate";q.registerComponent("PlaybackRateMenuButton",fd);var hd=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},n.createEl=function(e,t,a){return e===void 0&&(e="div"),t===void 0&&(t={}),a===void 0&&(a={}),t.className||(t.className=this.buildCSSClass()),s.prototype.createEl.call(this,e,t,a)},i}(q);q.registerComponent("Spacer",hd);var Km=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},i}(hd);q.registerComponent("CustomControlSpacer",Km);var ln=function(s){$(i,s);function i(){return s.apply(this,arguments)||this}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(q);ln.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in K&&ln.prototype.options_.children.splice(ln.prototype.options_.children.length-1,0,"pictureInPictureToggle");q.registerComponent("ControlBar",ln);var pd=function(s){$(i,s);function i(r,e){var t;return t=s.call(this,r,e)||this,t.on(r,"error",function(a){return t.open(a)}),t}var n=i.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},i}(Di);pd.prototype.options_=wt({}
16,Di.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});q.registerComponent("ErrorDisplay",pd);var ma="vjs-text-track-settings",du=["#000","Black"],cu=["#00F","Blue"],fu=["#0FF","Cyan"],hu=["#0F0","Green"],pu=["#F0F","Magenta"],mu=["#F00","Red"],gu=["#FFF","White"],vu=["#FF0","Yellow"],ga=["1","Opaque"],va=["0.5","Semi-Transparent"],yu=["0","Transparent"],Xt={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[du,gu,mu,hu,cu,vu,pu,fu]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ga,va,yu]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[gu,du,mu,hu,cu,vu,pu,fu]},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(i){return i==="1.00"?null:Number(i)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ga,va]},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:[yu,va,ga]}};Xt.windowColor.options=Xt.backgroundColor.options;function md(s,i){if(i&&(s=i(s)),s&&s!=="none")return s}function $m(s,i){var n=s.options[s.options.selectedIndex].value;return md(n,i)}function Xm(s,i,n){if(i){for(var r=0;r<s.options.length;
16r++)if(md(s.options[r].value,n)===i){s.selectedIndex=r;break}}}var Qm=function(s){$(i,s);function i(r,e){var t;return e.temporary=!1,t=s.call(this,r,e)||this,t.updateDisplay=t.updateDisplay.bind(ne(t)),t.fill(),t.hasBeenOpened_=t.hasBeenFilled_=!0,t.endDialog=le("p",{className:"vjs-control-text",textContent:t.localize("End of dialog window.")}),t.el().appendChild(t.endDialog),t.setDefaults(),e.persistTextTrackSettings===void 0&&(t.options_.persistTextTrackSettings=t.options_.playerOptions.persistTextTrackSettings),t.on(t.$(".vjs-done-button"),"click",function(){t.saveSettings(),t.close()}),t.on(t.$(".vjs-default-button"),"click",function(){t.setDefaults(),t.updateDisplay()}),gi(Xt,function(a){t.on(t.$(a.selector),"change",t.updateDisplay)}),t.options_.persistTextTrackSettings&&t.restoreSettings(),t}var n=i.prototype;return n.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},n.createElSelect_=function(e,t,a){var o=this;t===void 0&&(t=""),a===void 0&&(a="label");var u=Xt[e],l=u.id.replace("%s",this.id_),c=[t,l].join(" ").trim();return["<"+a+' id="'+l+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(u.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(u.options.map(function(g){var m=l+"-"+g[1].replace(/\W+/g,"");return['<option id="'+m+'" value="'+g[0]+'" ','aria-labelledby="'+c+" "+m+'">',o.localize(g[1]),"</option>"].join("")})).concat("</select>").join("")},n.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("")},n.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("")},n.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("")},n.createElColors_=function(){return le("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return le("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("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return le("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("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e=this;return Up(Xt,function(t,a,o){var u=$m(e.$(a.selector),a.parser);return u!==void 0&&(t[o]=u),t},{})},n.setValues=function(e){var t=this;gi(Xt,function(a,o){Xm(t.$(a.selector),e[o],a.parser)})},n.setDefaults=function(){var e=this;gi(Xt,function(t){var a=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=a})},n.restoreSettings=function(){var e;try{e=JSON.parse(k.localStorage.getItem(ma))}catch(t){ue.warn(t)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?k.localStorage.setItem(ma,JSON.stringify(e)):k.localStorage.removeItem(ma)}catch(t){ue.warn(t)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,a=e&&e.captionsButton;
16t?t.focus():a&&a.focus()},i}(Di);q.registerComponent("TextTrackSettings",Qm);var Ym=function(s){$(i,s);function i(r,e){var t,a=e.ResizeObserver||k.ResizeObserver;e.ResizeObserver===null&&(a=!1);var o=ve({createEl:!a,reportTouchActivity:!1},e);return t=s.call(this,r,o)||this,t.ResizeObserver=e.ResizeObserver||k.ResizeObserver,t.loadListener_=null,t.resizeObserver_=null,t.debouncedHandler_=Xp(function(){t.resizeHandler()},100,!1,ne(t)),a?(t.resizeObserver_=new t.ResizeObserver(t.debouncedHandler_),t.resizeObserver_.observe(r.el())):(t.loadListener_=function(){if(!(!t.el_||!t.el_.contentWindow)){var u=t.debouncedHandler_,l=t.unloadListener_=function(){Re(this,"resize",u),Re(this,"unload",l),l=null};Ze(t.el_.contentWindow,"unload",l),Ze(t.el_.contentWindow,"resize",u)}},t.one("load",t.loadListener_)),t}var n=i.prototype;return n.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},n.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},n.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,s.prototype.dispose.call(this)},i}(q);q.registerComponent("ResizeManager",Ym);var Jm={trackingThreshold:20,liveTolerance:15},Zm=function(s){$(i,s);function i(r,e){var t,a=ve(Jm,e,{createEl:!1});return t=s.call(this,r,a)||this,t.handleVisibilityChange_=function(o){return t.handleVisibilityChange(o)},t.trackLiveHandler_=function(){return t.trackLive_()},t.handlePlay_=function(o){return t.handlePlay(o)},t.handleFirstTimeupdate_=function(o){return t.handleFirstTimeupdate(o)},t.handleSeeked_=function(o){return t.handleSeeked(o)},t.seekToLiveEdge_=function(o){return t.seekToLiveEdge(o)},t.reset_(),t.on(t.player_,"durationchange",function(o){return t.handleDurationchange(o)}),t.on(t.player_,"canplay",function(){return t.toggleTracking()}),dr&&"hidden"in K&&"visibilityState"in K&&t.on(K,"visibilitychange",t.handleVisibilityChange_),t}var n=i.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(K.hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e=this.player_.seekable();if(!(!e||!e.length)){var t=Number(k.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+a;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"))}},n.handleDurationchange=function(){this.toggleTracking()},n.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())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,ut),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_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.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_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],a=e?e.length:0;a--;)t.push(e.end(a));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],a=e?e.length:0;a--;)t.push(e.start(a));return t.length?t.sort()[0]:0}
16,n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return typeof this.trackingInterval_=="number"},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(K,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},i}(q);q.registerComponent("LiveTracker",Zm);var Ra=function(i){var n=i.el();if(n.hasAttribute("src"))return i.triggerSourceset(n.src),!0;var r=i.$$("source"),e=[],t="";if(!r.length)return!1;for(var a=0;a<r.length;a++){var o=r[a].src;o&&e.indexOf(o)===-1&&e.push(o)}return e.length?(e.length===1&&(t=e[0]),i.triggerSourceset(t),!0):!1},eg=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(i){var n=K.createElement(this.nodeName.toLowerCase());n.innerHTML=i;for(var r=K.createDocumentFragment();n.childNodes.length;)r.appendChild(n.childNodes[0]);return this.innerText="",k.Element.prototype.appendChild.call(this,r),this.innerHTML}}),gd=function(i,n){for(var r={},e=0;e<i.length&&(r=Object.getOwnPropertyDescriptor(i[e],n),!(r&&r.set&&r.get));e++);return r.enumerable=!0,r.configurable=!0,r},tg=function(i){return gd([i.el(),k.HTMLMediaElement.prototype,k.Element.prototype,eg],"innerHTML")},_u=function(i){var n=i.el();if(!n.resetSourceWatch_){var r={},e=tg(i),t=function(o){return function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];var g=o.apply(n,l);return Ra(i),g}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){n[a]&&(r[a]=n[a],n[a]=t(r[a]))}),Object.defineProperty(n,"innerHTML",ve(e,{set:t(e.set)})),n.resetSourceWatch_=function(){n.resetSourceWatch_=null,Object.keys(r).forEach(function(a){n[a]=r[a]}),Object.defineProperty(n,"innerHTML",e)},i.one("sourceset",n.resetSourceWatch_)}},ig=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Wl(k.Element.prototype.getAttribute.call(this,"src")):""},set:function(i){return k.Element.prototype.setAttribute.call(this,"src",i),i}}),rg=function(i){return gd([i.el(),k.HTMLMediaElement.prototype,ig],"src")},ng=function(i){if(i.featuresSourceset){var n=i.el();if(!n.resetSourceset_){var r=rg(i),e=n.setAttribute,t=n.load;Object.defineProperty(n,"src",ve(r,{set:function(o){var u=r.set.call(n,o);return i.triggerSourceset(n.src),u}})),n.setAttribute=function(a,o){var u=e.call(n,a,o);return/src/i.test(a)&&i.triggerSourceset(n.src),u},n.load=function(){var a=t.call(n);return Ra(i)||(i.triggerSourceset(""),_u(i)),a},n.currentSrc?i.triggerSourceset(n.currentSrc):Ra(i)||_u(i),n.resetSourceset_=function(){n.resetSourceset_=null,n.load=t,n.setAttribute=e,Object.defineProperty(n,"src",r),n.resetSourceWatch_&&n.resetSourceWatch_()}}}},Os=function(i,n,r,e){e===void 0&&(e=!0);var t=function(u){return Object.defineProperty(i,n,{value:u,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var u=r();return t(u),u}};return e&&(a.set=t),Object.defineProperty(i,n,a)},Y=function(s){$(i,s);function i(r,e){var t;t=s.call(this,r,e)||this;var a=r.source,o=!1;if(t.featuresVideoFrameCallback=t.featuresVideoFrameCallback&&t.el_.tagName==="VIDEO",a&&(t.el_.currentSrc!==a.src||r.tag&&r.tag.initNetworkState_===3)?t.setSource(a):t.handleLateInit_(t.el_),r.enableSourceset&&t.setupSourcesetHandling_(),t.isScrubbing_=!1,t.el_.hasChildNodes()){for(var u=t.el_.childNodes,l=u.length,c=[];l--;){var g=u[l],m=g.nodeName.toLowerCase();m==="track"&&(t.featuresNativeTextTracks?(t.remoteTextTrackEls().addTrackElement_(g),t.remoteTextTracks().addTrack(g.track),t.textTracks().addTrack(g.track),!o&&!t.el_.hasAttribute("crossorigin")&&Mn(g.src)&&(o=!0)):c.push(g))}for(var _=0;_<c.length;_++)t.el_.removeChild(c[_])}return t.proxyNativeTracks_(),t.featuresNativeTextTracks&&o&&ue.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
17This may prevent text tracks from loading.`),t.restoreMetadataTracksInIOSNativePlayer_(),(xi||ss||gl)&&r.nativeControlsForTouch===!0&&t.setControls(!0),t.proxyWebkitFullscreen_(),t.triggerReady(),t}var n=i.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,s.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){ng(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t,a=function(){t=[];for(var l=0;l<e.length;l++){var c=e[l];c.kind==="metadata"&&t.push({track:c,storedMode:c.mode})}};a(),e.addEventListener("change",a),this.on("dispose",function(){return e.removeEventListener("change",a)});var o=function u(){for(var l=0;l<t.length;l++){var c=t[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",a),e.removeEventListener("change",o),e.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){e.removeEventListener("change",a),e.addEventListener("change",a),e.removeEventListener("change",o)})},n.overrideNative_=function(e,t){var a=this;if(t===this["featuresNative"+e+"Tracks"]){var o=e.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEac
17h(function(u){var l=a.el()[o+"Tracks"];l.removeEventListener(u,a[o+"TracksListeners_"][u])}),this["featuresNative"+e+"Tracks"]=!t,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t=this,a=it[e],o=this.el()[a.getterName],u=this[a.getterName]();if(!(!this["featuresNative"+a.capitalName+"Tracks"]||!o||!o.addEventListener)){var l={change:function(m){var _={type:"change",target:u,currentTarget:u,srcElement:u};u.trigger(_),e==="text"&&t[wi.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,E=0;E<o.length;E++)if(o[E]===u[_]){b=!0;break}b||m.push(u[_])}for(;m.length;)u.removeTrack(m.shift())};this[a.getterName+"Listeners_"]=l,Object.keys(l).forEach(function(g){var m=l[g];o.addEventListener(g,m),t.on("dispose",function(_){return o.removeEventListener(g,m)})}),this.on("loadstart",c),this.on("dispose",function(g){return t.off("loadstart",c)})}},n.proxyNativeTracks_=function(){var e=this;it.names.forEach(function(t){e.proxyNativeTracksForType_(t)})},n.createEl=function(){var e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){var t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),i.disposeMediaElement(e),e=t}else{e=K.createElement("video");var a=this.options_.tag&&bt(this.options_.tag),o=ve({},a);(!xi||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,El(e,be(o,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Ei(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var u=["loop","muted","playsinline","autoplay"],l=0;l<u.length;l++){var c=u[l],g=this.options_[c];typeof g<"u"&&(g?Ei(e,c,c):In(e,c),e[c]=g)}return e},n.handleLateInit_=function(e){if(!(e.networkState===0||e.networkState===3)){if(e.readyState===0){var t=!1,a=function(){t=!0};this.on("loadstart",a);var o=function(){t||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",o),t||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)})}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Pn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){ue(t,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;if(this.el_.duration===1/0&&At&&Ot&&this.el_.currentTime===0){var t=function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",t)})}},n.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=k.navigator&&k.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)pt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},n.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):s.prototype.requestVideoFrameCallback.call(this,e)},n.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):s.prototype.cancelVideoFrameCallback.call(this,e)},n.src=function(e){if(e===void 0)return this.el_.src;this.setSrc(e)},n.reset=function(){i.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(e,t,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,a):s.prototype.addTextTrack.call(this,e,t,a)},n.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,e);var t=K.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t},n.addRemoteTextTrack=function(e,t){var a=s.prototype.addRemoteTextTrack.call(this,e,t);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},n.removeRemoteTextTrack=function(e){if(s.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var t=this.$$("track"),a=t.length;a--;)(e===t[a]||e===t[a].track)&&this.el().removeChild(t[a])},n.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),k.performance&&typeof k.performance.now=="function"?e.creationTime=k.performance.now():k.performance&&k.performance.timing&&typeof k.performance.timing.navigationStart=="number"&&(e.creationTime=k.Date.now()-k.performance.timing.navigationStart),e},i}(pe);Os(Y,"TEST_VID",function(){if(Ii()){var s=K.createElement("video"),i=K.createElement("track");return i.kind="captions",i.srclang="en",i.label="English",s.appendChild(i),s}});Y.isSupported=function(){try{Y.TEST_VID.volume=.5}catch{return!1}return!!(Y.TEST_VID&&Y.TEST_VID.canPlayType)};Y.canPlayType=function(s){return Y.TEST_VID.canPlayType(s)};Y.canPlaySource=function(s,i){return Y.canPlayType(s.type)};Y.canControlVolume=function(){try{var s=Y.TEST_VID.volume;Y.TEST_VID.volume=s/2+.1;var i=s!==Y.TEST_VID.volume;return i&&Ge?(k.setTimeout(function(){Y&&Y.prototype&&(Y.prototype.featuresVolumeControl=s!==Y.TEST_VID.volume)}),!1):i}catch{return!1}};Y.canMuteVolume=function(){try{var s=Y.TEST_VID.muted;return Y.TEST_VID.muted=!s,Y.TEST_VID.muted?Ei(Y.TEST_VID,"muted","muted"):In(Y.TEST_VID,"muted","muted"),s!==Y.TEST_VID.muted}catch{return!1}};Y.canControlPlaybackRate=function(){if(At&&Ot&&yl<58)return!1;try{var s=Y.TEST_VID.playbackRate;return Y.TEST_VID.playbackRate=s/2+.1,s!==Y.TEST_VID.playbackRate}catch{return!1}};Y.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(K.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(K.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(K.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(K.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Y.supportsNativeTextTracks=function(){return Pn||Ge&&Ot};Y.supportsNativeVideoTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.videoTracks)};Y.supportsNativeAudioTracks=function(){return!!(Y.TEST_VID&&Y.TEST_VID.audioTracks)};Y.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"]].forEac
17h(function(s){var i=s[0],n=s[1];Os(Y.prototype,i,function(){return Y[n]()},!0)});Y.prototype.featuresVolumeControl=Y.canControlVolume();Y.prototype.movingMediaElementInDOM=!Ge;Y.prototype.featuresFullscreenResize=!0;Y.prototype.featuresProgressEvents=!0;Y.prototype.featuresTimeupdateEvents=!0;Y.prototype.featuresVideoFrameCallback=!!(Y.TEST_VID&&Y.TEST_VID.requestVideoFrameCallback);var dn;Y.patchCanPlayType=function(){rs>=4&&!vl&&!Ot&&(dn=Y.TEST_VID&&Y.TEST_VID.constructor.prototype.canPlayType,Y.TEST_VID.constructor.prototype.canPlayType=function(s){var i=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&i.test(s)?"maybe":dn.call(this,s)})};Y.unpatchCanPlayType=function(){var s=Y.TEST_VID.constructor.prototype.canPlayType;return dn&&(Y.TEST_VID.constructor.prototype.canPlayType=dn),s};Y.patchCanPlayType();Y.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}};Y.resetMediaElement=function(s){if(s){for(var i=s.querySelectorAll("source"),n=i.length;n--;)s.removeChild(i[n]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Y.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Y.prototype["set"+Ee(s)]=function(i){this.el_[s]=i,i?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Y.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Y.prototype["set"+Ee(s)]=function(i){this.el_[s]=i}});["pause","load","play"].forEach(function(s){Y.prototype[s]=function(){return this.el_[s]()}});pe.withSourceHandlers(Y);Y.nativeSourceHandler={};Y.nativeSourceHandler.canPlayType=function(s){try{return Y.TEST_VID.canPlayType(s)}catch{return""}};Y.nativeSourceHandler.canHandleSource=function(s,i){if(s.type)return Y.nativeSourceHandler.canPlayType(s.type);if(s.src){var n=hs(s.src);return Y.nativeSourceHandler.canPlayType("video/"+n)}return""};Y.nativeSourceHandler.handleSource=function(s,i,n){i.setSrc(s.src)};Y.nativeSourceHandler.dispose=function(){};Y.registerSourceHandler(Y.nativeSourceHandler);pe.registerTech("Html5",Y);var vd=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ya={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Na=["tiny","xsmall","small","medium","large","xlarge","huge"],Yr={};Na.forEach(function(s){var i=s.charAt(0)==="x"?"x-"+s.substring(1):s;Yr[s]="vjs-layout-"+i});var ag={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ce=function(s){$(i,s);function i(r,e,t){var a;if(r.id=r.id||e.id||"vjs_video_"+Dt(),e=be(i.getTagSettings(r),e),e.initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language)if(typeof r.closest=="function"){var o=r.closest("[lang]");o&&o.getAttribute&&(e.language=o.getAttribute("lang"))}else for(var u=r;u&&u.nodeType===1;){if(bt(u).hasOwnProperty("lang")){e.language=u.getAttribute("lang");break}u=u.parentNode}if(a=s.call(this,null,e,t)||this,a.boundDocumentFullscreenChange_=function(m){return a.documentFullscreenChange_(m)},a.boundFullWindowOnEscKey_=function(m){return a.fullWindowOnEscKey(m)},a.boundUpdateStyleEl_=function(m){return a.updateStyleEl_(m)},a.boundApplyInitTime_=function(m){return a.applyInitTime_(m)},a.boundUpdateCurrentBreakpoint_=function(m){return a.updateCurrentBreakpoint_(m)},a.boundHandleTechClick_=function(m){return a.handleTechClick_(m)},a.boundHandleTechDoubleClick_=function(m){return a.handleTechDoubleClick_(m)},a.boundHandleTechTouchStart_=function(m){return a.handleTechTouchStart_(m)},a.boundHandleTechTouchMove_=function(m){return a.handleTechTouchMove_(m)},a.boundHandleTechTouchEnd_=function(m){return a.handleTechTouchEnd_(m)},a.boundHandleTechTap_=function(m){return a.handleTechTap_(m)},a.isFullscreen_=!1,a.log=hl(a.id_),a.fsApi_=an,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHe
17ight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.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(a.tag=r,a.tagAttributes=r&&bt(r),a.language(a.options_.language),e.languages){var l={};Object.getOwnPropertyNames(e.languages).forEach(function(m){l[m.toLowerCase()]=e.languages[m]}),a.languages_=l}else a.languages_=i.prototype.options_.languages;a.resetCache_(),a.poster_=e.poster||"",a.controls_=!!e.controls,r.controls=!1,r.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],r.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach(function(m){if(typeof a[m]!="function")throw new Error('plugin "'+m+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),ds(ne(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Ze(K,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=ve(a.options_);e.plugins&&Object.keys(e.plugins).forEach(function(m){a[m](e.plugins[m])}),e.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(e.playbackRates),a.initChildren(),a.isAudio(r.nodeName.toLowerCase()==="audio"),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),xi&&a.addClass("vjs-touch-enabled"),Ge||a.addClass("vjs-workinghover"),i.players[a.id_]=ne(a);var g=dl.split(".")[0];return a.addClass("vjs-v"+g),a.userActive(!0),a.reportUserActivity(),a.one("play",function(m){return a.listenForUserActivity_(m)}),a.on("stageclick",function(m){return a.handleStageClick_(m)}),a.on("keydown",function(m){return a.handleKeyDown(m)}),a.on("languagechange",function(m){return a.handleLanguagechange(m)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}var n=i.prototype;return n.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Re(K,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Re(K,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Cm(this),Ve.names.forEach(function(t){var a=Ve[t],o=e[a.getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},n.createEl=function(){var e=this.tag,t,a=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";a?t=this.el_=e.parentNode:o||(t=this.el_=s.prototype.createEl.call(this,"div"));var u=bt(e);if(o){for(t=this.el_=e,e=this.tag=K.createElement("video");t.children.length;)e.appendChild(t.firstChild);Jt(t,"video-js")||Et(t,"video-js"),t.appendChild(e),a=this.playerElIngest_=t,Object.keys(t).forEach(function(b){try{e[b]=t[b]}catch{}})}if(e.setAttribute("tabindex","-1"),u.tabindex="-1",(dr||Ot&&_l)&&(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"||t.setAttribute(b,u[b]),o&&e.setAttribute(b,u[b])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused"),k.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Ml("vjs-styles-dimensions");var l=Rt(".vjs-styles-defaults"),c=Rt("head");c.insertBefore(this.styleEl_,l?l.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var g=e.getElementsByTagName("a"),m=0;m<g.length;m++){var _=g.item(m);Et(_,"vjs-hidden"),_.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!a&&e.parentNode.insertBefore(t,e),Ia(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");if(e!=="anonymous"&&e!=="use-credentials"){ue.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"');return}this.techCall_("setCrossOrigin",e)},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var a=e+"_";if(t===void 0)return this[a]||0;if(t===""||t==="auto"){this[a]=void 0,this.updateStyleEl_();return}var o=parseFloat(t);if(isNaN(o)){ue.error('Improper value "'+t+'" supplied for for '+e);return}this[a]=o,this.updateStyleEl_()},n.fluid=function(e){var t=this;if(e===void 0)return!!this.fluid_;
17this.fluid_=!!e,Ct(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),Qp(this,function(){t.on(["playerreset","resize"],t.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.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")},n.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_()},n.updateStyleEl_=function(){if(k.VIDEOJS_NO_DYNAMIC_STYLE===!0){var e=typeof this.width_=="number"?this.width_:this.options_.width,t=typeof this.height_=="number"?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(e>=0&&(a.width=e),t>=0&&(a.height=t));return}var o,u,l,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?l=this.aspectRatio_:this.videoWidth()>0?l=this.videoWidth()+":"+this.videoHeight():l="16:9";var g=l.split(":"),m=g[1]/g[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/m:o=this.videoWidth()||300,this.height_!==void 0?u=this.height_:u=o*m,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Fl(this.styleEl_,`
18      .`+c+` {
19        width: `+o+`px;
20        height: `+u+`px;
21      }
22
23      .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
24        padding-top: `+m*100+`%;
25      }
26    `)},n.loadTech_=function(e,t){var a=this;this.tech_&&this.unloadTech_();var o=Ee(e),u=e.charAt(0).toLowerCase()+e.slice(1);o!=="Html5"&&this.tag&&(pe.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);var c={source:t,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};Ve.names.forEach(function(m){var _=Ve[m];c[_.getterName]=a[_.privateName]}),be(c,this.options_[o]),be(c,this.options_[u]),be(c,this.options_[e.toLowerCase()]),this.tag&&(c.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var g=pe.getTech(e);if(!g)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new g(c),this.tech_.ready(ye(this,this.handleTechReady_),!0),eu.jsonToTextTracks(this.textTracksJson_||[],this.tech_),vd.forEach(function(m){a.on(a.tech_,m,function(_){return a["handleTech"+Ee(m)+"_"](_)})}),Object.keys(ya).forEach(function(m){a.on(a.tech_,m,function(_){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+ya[m]+"_"].bind(a),event:_});return}a["handleTech"+ya[m]+"_"](_)})}),this.on(this.tech_,"loadstart",function(m){return a.handleTechLoadStart_(m)}),this.on(this.tech_,"sourceset",function(m){return a.handleTechSourceset_(m)}),this.on(this.tech_,"waiting",function(m){return a.handleTechWaiting_(m)}),this.on(this.tech_,"ended",function(m){return a.handleTechEnded_(m)}),this.on(this.tech_,"seeking",function(m){return a.handleTechSeeking_(m)}),this.on(this.tech_,"play",function(m){return a.handleTechPlay_(m)}),this.on(this.tech_,"firstplay",function(m){return a.handleTechFirstPlay_(m)}),this.on(this.tech_,"pause",function(m){return a.handleTechPause_(m)}),this.on(this.tech_,"durationchange",function(m){return a.handleTechDurationChange_(m)}),this.on(this.tech_,"fullscreenchange",function(m,_){return a.handleTechFullscreenChange_(m,_)}),this.on(this.tech_,"fullscreenerror",function(m,_){return a.handleTechFullscreenError_(m,_)}),this.on(this.tech_,"enterpictureinpicture",function(m){return a.handleTechEnterPictureInPicture_(m)}),this.on(this.tech_,"leavepictureinpicture",function(m){return a.handleTechLeavePictureInPicture_(m)}),this.on(this.tech_,"error",function(m){return a.handleTechError_(m)}),this.on(this.tech_,"posterchange",function(m){return a.handleTechPosterChange_(m)}),this.on(this.tech_,"textdata",function(m){return a.handleTechTextData_(m)}
26),this.on(this.tech_,"ratechange",function(m){return a.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)&&Ia(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;Ve.names.forEach(function(t){var a=Ve[t];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=eu.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return e===void 0&&ue.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
27See https://github.com/videojs/video.js/issues/2617 for more info.
28`),this.tech_},n.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_)},n.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_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.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())},n.manualAutoplay_=function(e){var t=this;if(!(!this.tech_||typeof e!="string")){var a=function(){var l=t.muted();t.muted(!0);var c=function(){t.muted(l)};t.playTerminatedQueue_.push(c);var g=t.play();if(Yi(g))return g.catch(function(m){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(m||""))})},o;if(e==="any"&&!this.muted()?(o=this.play(),Yi(o)&&(o=o.catch(a))):e==="muted"&&!this.muted()?o=a():o=this.play(),!!Yi(o))return o.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){t.trigger({type:"autoplay-failure",autoplay:e})})}},n.updateSourceCaches_=function(e){e===void 0&&(e="");var t=e,a="";typeof t!="string"&&(t=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!a&&(a=Pm(this,t)),this.cache_.source=ve({},e,{src:t,type:a});for(var o=this.cache_.sources.filter(function(_){return _.src&&_.src===t}),u=[],l=this.$$("source"),c=[],g=0;g<l.length;g++){var m=bt(l[g]);u.push(m),m.src&&m.src===t&&c.push(m.src)}c.length&&!o.length?this.cache_.sources=u:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var a=function(c){return t.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)&&(a=function(){}),a(u),e.src||this.tech_.any(["sourceset","loadstart"],function(l){if(l.type!=="sourceset"){var c=t.techGet("currentSrc");t.lastSource_.tech=c,t.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.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"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.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")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime(),a=function o(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",o))};this.on("timeupdate",a)},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(ue.warn("Passing the `starttime` option to the player will be deprecated 
28in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.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")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.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()?pt(this.play()):this.pause())},n.handleTechDoubleClick_=function(e){if(this.controls_){var t=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(e.target)});t||(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())}},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;if(!(t&&t!==this)){var a=this.el(),o=K[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},n.handleTechFullscreenChange_=function(e,t){var a=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},n.getCache=function(){return this.cache_},n.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}},n.techCall_=function(e,t){this.ready(function(){if(e in xm)return bm(this.middleware_,this.tech_,e,t);if(e in su)return au(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(a){throw ue(a),a}},!0)},n.techGet_=function(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Sm)return Tm(this.middleware_,this.tech_,e);if(e in su)return au(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(ue("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t):t.name==="TypeError"?(ue("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t):(ue(t),t)}}},n.play=function(){var e=this,t=this.options_.Promise||k.Promise;
28return t?new t(function(a){e.play_(a)}):this.play_()},n.play_=function(e){var t=this;e===void 0&&(e=pt),this.playCallbacks_.push(e);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(Pn||Ge);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a){this.waitToPlay_=function(c){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!a&&o&&this.load();return}var u=this.techGet_("play"),l=o&&this.hasClass("vjs-ended");l&&this.resetProgressBar_(),u===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(u)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(a){a(e)})},n.pause=function(){this.techCall_("pause")},n.paused=function(){return this.techGet_("paused")!==!1},n.played=function(){return this.techGet_("played")||Zt(0,0)},n.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")},n.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},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.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"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=Zt(0,0)),e},n.bufferedPercent=function(){return Vl(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),a=e.end(e.length-1);return a>t&&(a=t),a},n.volume=function(e){var t;if(e!==void 0){t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t},n.muted=function(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1},n.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(e!==void 0){var t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},n.requestFullscreen=function(e){var t=this.options_.Promise||k.Promise;if(t){var a=this;return new t(function(o,u){function l(){a.off("fullscreenerror",g),a.off("fullscreenchange",c)}function c(){l(),o()}function g(_,b){l(),u(b)}a.one("fullscreenchange",c),a.one("fullscreenerror",g);var m=a.requestFullscreenHelper_(e);m&&(m.then(l,l),m.then(o,u))})}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t=this,a;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(a=e)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return t.isFullscreen(!0)},function(){return t.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||k.Promise;if(e){var t=this;return new e(function(a,o){function u(){t.off("fullscreenerror",c),t.off("fullscreenchange",l)}function l(){u(),a()}function c(m,_){u(),o(_)}t.one("fullscreenchange",l),t.one("fullscreenerror",c);var g=t.exitFullscreenHelper_();g&&(g.then(u,u),g.then(a,o))})}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=K[this.fsApi_.exitFullscreen]();return t&&pt(t.then(function(){return e.isFullscreen(!1)})),t}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=K.documentElement.style.overflow,Ze(K,"keydown",this.boundFullWindowOnEscKey_),K.documentElement.style.overflow="hidden",Et(K.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){se.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Re(K,"keydown",this.boundFullWindowOnEscKey_),K.documentElement.style.overflow=this.docOrigOverflow,cr(K.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in K&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in K)return K.exitPictureInPicture()},n.handleKeyDown=function(e){var t=this.options_.userActions;if(!(!t||!t.hotkeys)){var a=function(u){var l=u.tagName.toLowerCase();if(u.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(l==="input")return c.indexOf(u.type)===-1;var g=["textarea"];return g.indexOf(l)!==-1};a(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},a=t.fullscreenKey,o=a===void 0?function(E){return se.isEventKey(E,"f")}:a,u=t.muteKey,l=u===void 0?function(E){return se.isEventKey(E,"m")}:u,c=t.playPauseKey,g=c===void 0?function(E){return se.isEventKey(E,"k")||se.isEventKey(E,"Space")}:c;
28if(o.call(this,e)){e.preventDefault(),e.stopPropagation();var m=q.getComponent("FullscreenToggle");K[this.fsApi_.fullscreenEnabled]!==!1&&m.prototype.handleClick.call(this,e)}else if(l.call(this,e)){e.preventDefault(),e.stopPropagation();var _=q.getComponent("MuteToggle");_.prototype.handleClick.call(this,e)}else if(g.call(this,e)){e.preventDefault(),e.stopPropagation();var b=q.getComponent("PlayToggle");b.prototype.handleClick.call(this,e)}},n.canPlayType=function(e){for(var t,a=0,o=this.options_.techOrder;a<o.length;a++){var u=o[a],l=pe.getTech(u);if(l||(l=q.getComponent(u)),!l){ue.error('The "'+u+'" tech is undefined. Skipped browser support check for that tech.');continue}if(l.isSupported()&&(t=l.canPlayType(e),t))return t}return""},n.selectSource=function(e){var t=this,a=this.options_.techOrder.map(function(g){return[g,pe.getTech(g)]}).filter(function(g){var m=g[0],_=g[1];return _?_.isSupported():(ue.error('The "'+m+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(m,_,b){var E;return m.some(function(S){return _.some(function(R){if(E=b(S,R),E)return!0})}),E},u,l=function(m){return function(_,b){return m(b,_)}},c=function(m,_){var b=m[0],E=m[1];if(E.canPlaySource(_,t.options_[b.toLowerCase()]))return{source:_,tech:b}};return this.options_.sourceOrder?u=o(e,a,l(c)):u=o(a,e,c),u||!1},n.handleSrc_=function(e,t){var a=this;if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=Im(e);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),ym(this,o[0],function(c,g){a.middleware_=g,t||(a.cache_.sources=o),a.updateSourceCaches_(c);var m=a.src_(c);if(m){if(o.length>1)return a.handleSrc_(o.slice(1));a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),a.triggerReady();return}_m(g,a.tech_)}),this.options_.retryOnError&&o.length>1){var u=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},l=function(){a.off("error",u)};this.one("error",u),this.one("playing",l),this.resetRetryOnError_=function(){a.off("error",u),a.off("playing",l)}}},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t=this,a=this.selectSource([e]);return a?Zp(a.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_(a.tech,a.source),this.tech_.ready(function(){t.changingSrc_=!1}),!1):!0},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||k.Promise;if(this.paused()||!t)this.doReset_();else{var a=this.play();pt(a.then(function(){return e.doReset_()}))}},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Ct(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,a=e.remainingTimeDisplay;t&&t.updateContent(),a&&a.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")},n.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")},n.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"))},n.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"))}},n.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.addTechControl
28sListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.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")))},n.error=function(e){var t=this;if(e===void 0)return this.error_||null;if(Ft("beforeerror").forEach(function(o){var u=o(t,e);if(!(Pt(u)&&!Array.isArray(u)||typeof u=="string"||typeof u=="number"||u===null)){t.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=u}),this.options_.suppressNotSupportedError&&e&&e.code===4){var a=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),this.one("loadstart",function(){this.off(["click","touchstart"],a)});return}if(e===null){this.error_=e,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new qe(e),this.addClass("vjs-error"),ue.error("(CODE:"+this.error_.code+" "+qe.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Ft("error").forEach(function(o){return o(t,t.error_)})},n.reportUserActivity=function(e){this.userActivity_=!0},n.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(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,a,o=ye(this,this.reportUserActivity),u=function(b){(b.screenX!==t||b.screenY!==a)&&(t=b.screenX,a=b.screenY,o())},l=function(){o(),this.clearInterval(e),e=this.setInterval(o,250)},c=function(b){o(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",u),this.on("mouseup",c),this.on("mouseleave",c);var g=this.getChild("controlBar");g&&!Ge&&!At&&(g.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),g.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var m;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(m);var _=this.options_.inactivityTimeout;_<=0||(m=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},_))}},250)},n.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},n.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_},n.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),a=this.getChild("ControlBar"),o=a&&a.currentHeight();t.forEach(function(u){u!==a&&u.el_&&!u.hasClass("vjs-hidden")&&(u.hide(),e.audioOnlyCache_.hiddenChildren.push(u))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},n.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")},n.audioOnlyMode=function(e){var t=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var a=this.options_.Promise||k.Promise;if(a){if(e){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),a.all(o).then(function(){return t.enableAudioOnlyUI_()})}return a.resolve().then(function(){return t.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},n.enablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.disablePosterModeUI_=function(){var e=this.tech_&&this.tech_;e.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.audioPosterMode=function(e){var t=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var a=this.options_.Promise||k.Promise;if(a){if(e){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){t.enablePosterModeUI_()})}return a.resolve().then(function(){t.enablePosterModeUI_()})}return a.resolve().then(function(){t.disablePosterModeUI_()})}if(e){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},n.addTextTrack=function(e,t,a){if(this.tech_)return this.tech_.addTextTrack(e,t,a)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){e===void 0&&(e={});var t=e,a=t.track;if(a||(a=e),this.tech_)return this.tech_.removeRemoteTextTrack(a)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ct(this)&&this.trigger("languagechange"))},n.languages=function(){return ve(i.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=ve(this.options_),t=e.tracks;e.tracks=[];for(var a=0;a<t.length;a++){var o=t[a];o=ve(o),o.player=void 0,e.tracks[a]=o}return e},n.createModal=function(e,t){var a=this;t=t||{},t.content=e||"";var o=new Di(this,t);return this.addChild(o),o.on("dispose",function(){a.removeChild(o)}),o.open(),o},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),a=0;a<Na.length;a++){var o=Na[a],u=this.breakpoints_[o];if(t<=u){if(e===o)return;e&&this.removeClass(Yr[e]),this.addClass(Yr[o]),this.breakpoint_=o;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return e===void 0?be(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=be({},ag,e),this.updateCurrentBreakpoint_(),be(this.breakpoints_))},n.responsive=function(e){if(e===void 0)return this.responsive_;e=!!e;var t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return Yr[this.breakpoint_]||""},n.loadMedia=function(e,t){var a=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,g=o.textTracks;!u&&l&&(this.cache_.media.artwork=[{src:l,type:un(l)}]),c&&this.src(c),l&&this.poster(l),Array.isArray(g)&&g.forEach(function(m){return a.addRemoteTextTrack(m,!1)}),this.ready(t)}},n.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(u){return{kind:u.kind,label:u.label,language:u.language,src:u.src}}),o={src:t,textTracks:a};return e&&(o.poster=e,o.artwork=[{src:o.poster,type:un(o.poster)}]),o}return ve(this.cache_.media)},i.getTagSettings=function(e){var t={sources:[],tracks:[]},a=bt(e),o=a["data-setup"];if(Jt(e,"vjs-fill")&&(a.fill=!0),Jt(e,"vjs-fluid")&&(a.fluid=!0),o!==null){var u=Zf(o||"{}"),l=u[0],c=u[1];l&&ue.error(l),be(a,c)}if(be(t,a),e.hasChildNodes())for(var g=e.childNodes,m=0,_=g.length;m<_;m++){var b=g[m],E=b.nodeName.toLowerCase();E==="source"?t.sources.push(bt(b)):E==="track"&&t.tracks.push(bt(b))}return t},n.flexNotSupported_=function(){var e=K.createElement("i");
28return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.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)},n.playbackRates=function(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(function(t){return typeof t=="number"})&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},i}(q);Ve.names.forEach(function(s){var i=Ve[s];Ce.prototype[i.getterName]=function(){return this.tech_?this.tech_[i.getterName]():(this[i.privateName]=this[i.privateName]||new i.ListClass,this[i.privateName])}});Ce.prototype.crossorigin=Ce.prototype.crossOrigin;Ce.players={};var Gi=k.navigator;Ce.prototype.options_={techOrder:pe.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(s){Ce.prototype[s]=function(){return this.techGet_(s)}});vd.forEach(function(s){Ce.prototype["handleTech"+Ee(s)+"_"]=function(){return this.trigger(s)}});q.registerComponent("Player",Ce);var cn="plugin",vi="activePlugins_",hi={},fn=function(i){return hi.hasOwnProperty(i)},Jr=function(i){return fn(i)?hi[i]:void 0},yd=function(i,n){i[vi]=i[vi]||{},i[vi][n]=!0},hn=function(i,n,r){var e=(r?"before":"")+"pluginsetup";i.trigger(e,n),i.trigger(e+":"+n.name,n)},sg=function(i,n){var r=function(){hn(this,{name:i,plugin:n,instance:null},!0);var t=n.apply(this,arguments);return yd(this,i),hn(this,{name:i,plugin:n,instance:t}),t};return Object.keys(n).forEach(function(e){r[e]=n[e]}),r},Tu=function(i,n){return n.prototype.name=i,function(){hn(this,{name:i,plugin:n,instance:null},!0);for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var a=Qu(n,[this].concat(e));return this[i]=function(){return a},hn(this,a.getEventHash()),a}},vt=function(){function s(n){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=n,this.log||(this.log=this.player.log.createLogger(this.name)),ds(this),delete this.trigger,jl(this,this.constructor.defaultState),yd(n,this.name),this.dispose=this.dispose.bind(this),n.on("dispose",this.dispose)}var i=s.prototype;return i.version=function(){return this.constructor.VERSION},i.getEventHash=function(r){return r===void 0&&(r={}),r.name=this.name,r.plugin=this.constructor,r.instance=this,r},i.trigger=function(r,e){return e===void 0&&(e={}),Oi(this.eventBusEl_,r,this.getEventHash(e))},i.handleStateChanged=function(r){},i.dispose=function(){var r=this.name,e=this.player;this.trigger("dispose"),this.off(),e.off("dispose",this.dispose),e[vi][r]=!1,this.player=this.state=null,e[r]=Tu(r,hi[r])},s.isBasic=function(r){var e=typeof r=="string"?Jr(r):r;return typeof e=="function"&&!s.prototype.isPrototypeOf(e.prototype)},s.registerPlugin=function(r,e){if(typeof r!="string")throw new Error('Illegal plugin name, "'+r+'", must be a string, was '+typeof r+".");if(fn(r))ue.warn('A plugin named "'+r+'" already exists. You may want to avoid re-registering plugins!');else if(Ce.prototype.hasOwnProperty(r))throw new Error('Illegal plugin name, "'+r+'", cannot share a name with an existing player method!');if(typeof e!="function")throw new Error('Illegal plugin for "'+r+'", must be a function, was '+typeof e+".");return hi[r]=e,r!==cn&&(s.isBasic(e)?Ce.prototype[r]=sg(r,e):Ce.prototype[r]=Tu(r,e)),e},s.deregisterPlugin=function(r){if(r===cn)throw new Error("Cannot de-register base plugin.");fn(r)&&(delete hi[r],delete Ce.prototype[r])},s.getPlugins=function(r){r===void 0&&(r=Object.keys(hi));var e;return r.forEach(function(t){var a=Jr(t);a&&(e=e||{},e[t]=a)}),e},s.getPluginVersion=function(r){var e=Jr(r);return e&&e.VERSION||""},s}();vt.getPlugin=Jr;vt.BASE_PLUGIN_NAME=cn;vt.registerPlugin(cn,vt);Ce.prototype.usingPlugin=function(s){return!!this[vi]&&this[vi][s]===!0};Ce.prototype.hasPlugin=function(s){return!!fn(s)};var bu=!1,og=function(i,n){n===void 0&&(n={}),bu||(ue.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),bu=!0);var r=function(){i.apply(this,arguments)},e={};typeof n=="object"?(n.constructor!==Object.prototype.constructor&&(r=n.constructor),e=n):typeof n=="function"&&(r=n),th(r,i),i&&(r.super_=i);for(var t in e)e.hasOwnProperty(t)&&(r.prototype[t]=e[t]);return r},_d=function(i){return i.indexOf("#")===0?i.slice(1):i};function A(s,i,n){var r=A.getPlayer(s);if(r)return i&&ue.warn('Player "'+s+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var e=typeof s=="string"?Rt("#"+_d(s)):s;if(!Ai(e))throw new TypeError("The element or ID supplied is not val
28id. (videojs)");(!e.ownerDocument.defaultView||!e.ownerDocument.body.contains(e))&&ue.warn("The element supplied is not included in the DOM"),i=i||{},i.restoreEl===!0&&(i.restoreEl=(e.parentNode&&e.parentNode.hasAttribute("data-vjs-player")?e.parentNode:e).cloneNode(!0)),Ft("beforesetup").forEach(function(a){var o=a(e,ve(i));if(!Pt(o)||Array.isArray(o)){ue.error("please return an object in beforesetup hooks");return}i=ve(i,o)});var t=q.getComponent("Player");return r=new t(e,i,n),Ft("setup").forEach(function(a){return a(r)}),r}A.hooks_=St;A.hooks=Ft;A.hook=Mp;A.hookOnce=Fp;A.removeHook=cl;if(k.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ii()){var qr=Rt(".vjs-styles-defaults");if(!qr){qr=Ml("vjs-styles-defaults");var _a=Rt("head");_a&&_a.insertBefore(qr,_a.firstChild),Fl(qr,`
29      .video-js {
30        width: 300px;
31        height: 150px;
32      }
33
34      .vjs-fluid:not(.vjs-audio-only-mode) {
35        padding-top: 56.25%
36      }
37    `)}}Oa(1,A);A.VERSION=dl;A.options=Ce.prototype.options_;A.getPlayers=function(){return Ce.players};A.getPlayer=function(s){var i=Ce.players,n;if(typeof s=="string"){var r=_d(s),e=i[r];if(e)return e;n=Rt("#"+r)}else n=s;if(Ai(n)){var t=n,a=t.player,o=t.playerId;if(a||i[o])return a||i[o]}};A.getAllPlayers=function(){return Object.keys(Ce.players).map(function(s){return Ce.players[s]}).filter(Boolean)};A.players=Ce.players;A.getComponent=q.getComponent;A.registerComponent=function(s,i){pe.isTech(i)&&ue.warn("The "+s+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),q.registerComponent.call(q,s,i)};A.getTech=pe.getTech;A.registerTech=pe.registerTech;A.use=vm;Object.defineProperty(A,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(A.middleware,"TERMINATOR",{value:on,writeable:!1,enumerable:!0});A.browser=Vp;A.TOUCH_ENABLED=xi;A.extend=og;A.mergeOptions=ve;A.bind=ye;A.registerPlugin=vt.registerPlugin;A.deregisterPlugin=vt.deregisterPlugin;A.plugin=function(s,i){return ue.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),vt.registerPlugin(s,i)};A.getPlugins=vt.getPlugins;A.getPlugin=vt.getPlugin;A.getPluginVersion=vt.getPluginVersion;A.addLanguage=function(s,i){var n;return s=(""+s).toLowerCase(),A.options.languages=ve(A.options.languages,(n={},n[s]=i,n)),A.options.languages[s]};A.log=ue;A.createLogger=hl;A.createTimeRange=A.createTimeRanges=Zt;A.formatTime=Pi;A.setFormatTime=Rm;A.resetFormatTime=Nm;A.parseUrl=fs;A.isCrossOrigin=Mn;A.EventTarget=Ae;A.on=Ze;A.one=Dn;A.off=Re;A.trigger=Oi;A.xhr=$u;A.TextTrack=fr;A.AudioTrack=ql;A.VideoTrack=Gl;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){A[s]=function(){return ue.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),Dl[s].apply(null,arguments)}});A.computedStyle=rr;A.dom=Dl;A.url=hm;A.defineLazyProperty=Os;A.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var st=En,pn=function(i,n,r){return i&&r&&r.responseURL&&n!==r.responseURL?r.responseURL:n},lt=function(i){return A.log.debug?A.log.debug.bind(A,"VHS:",i+" >"):function(){}},Nt=1/30,mt=Nt*3,Td=function(i,n){var r=[],e;if(i&&i.length)for(e=0;e<i.length;e++)n(i.start(e),i.end(e))&&r.push([i.start(e),i.end(e)]);return A.createTimeRanges(r)},pi=function(i,n){return Td(i,function(r,e){return r-mt<=n&&e+mt>=n})},Gr=function(i,n){return Td(i,function(r){return r-Nt>=n})},ug=function(i){if(i.length<2)return A.createTimeRanges();for(var n=[],r=1;r<i.length;r++){var e=i.end(r-1),t=i.start(r);n.push([e,t])}return A.createTimeRanges(n)},lg=function(i,n){var r=null,e=null,t=0,a=[],o=[];if(!i||!i.length||!n||!n.length)return A.createTimeRange();for(var u=i.length;u--;)a.push({time:i.start(u),type:"start"}),a.push({time:i.end(u),type:"end"});for(u=n.length;u--;)a.push({time:n.start(u),type:"start"}),a.push({time:n.end(u),type:"end"});for(a.sort(function(l,c){return l.time-c.time}),u=0;u<a.length;u++)a[u].type==="start"?(t++,t===2&&(r=a[u].time)):a[u].type==="end"&&(t--,t===1&&(e=a[u].time)),r!==null&&e!==null&&(o.push([r,e]),r=null,e=null);return A.createTimeRanges(o)},bd=function(i){var n=[];if(!i||!i.length)return"";for(var r=0;r<i.length;r++)n.push(i.start(r)+" => "+i.end(r));return n.join(", ")},dg=function(i,n,r){r===void 0&&(r=1);var e=i.length?i.end(i.length-1):0;return(e-n)/r},Qt=function(i){for(var n=[],r=0;r<i.length;r++)n.push({start:i.start(r),end:i.end(r)});return n},cg=function(i,n){if(i===n)return!1;if(!i&&n||!n&&i||i.length!==n.length)return!0;for(var r=0;r<i.length;r++)if(i.start(r)!==n.start(r)||i.end(r)!==n.end(r))return!0;return!1},Su=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Ds=function(i,n){var r=0;if(!i||!i.length)return r;for(var e=0;e<i.length;e++){var t=i.start(e),a=i.end(e);if(!(n>a)){if(n>t&&n<=a){r+=a-n;continue}r+=a-t}}return r},xu=A.createTimeRange,Ls=function(i,n){if(!n.preload)return n.duration;var r=0;
37return(n.parts||[]).forEach(function(e){r+=e.duration}),(n.preloadHints||[]).forEach(function(e){e.type==="PART"&&(r+=i.partTargetDuration)}),r},Ua=function(i){return(i.segments||[]).reduce(function(n,r,e){return r.parts?r.parts.forEach(function(t,a){n.push({duration:t.duration,segmentIndex:e,partIndex:a,part:t,segment:r})}):n.push({duration:r.duration,segmentIndex:e,partIndex:null,segment:r,part:null}),n},[])},Sd=function(i){var n=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return n&&n.parts||[]},xd=function(i){var n=i.preloadSegment;if(n){var r=n.parts,e=n.preloadHints,t=(e||[]).reduce(function(a,o){return a+(o.type==="PART"?1:0)},0);return t+=r&&r.length?r.length:0,t}},Ed=function(i,n){if(n.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;var r=Sd(n).length>0;return r&&n.serverControl&&n.serverControl.partHoldBack?n.serverControl.partHoldBack:r&&n.partTargetDuration?n.partTargetDuration*3:n.serverControl&&n.serverControl.holdBack?n.serverControl.holdBack:n.targetDuration?n.targetDuration*3:0},fg=function(i,n){var r=0,e=n-i.mediaSequence,t=i.segments[e];if(t){if(typeof t.start<"u")return{result:t.start,precise:!0};if(typeof t.end<"u")return{result:t.end-t.duration,precise:!0}}for(;e--;){if(t=i.segments[e],typeof t.end<"u")return{result:r+t.end,precise:!0};if(r+=Ls(i,t),typeof t.start<"u")return{result:r+t.start,precise:!0}}return{result:r,precise:!1}},hg=function(i,n){for(var r=0,e,t=n-i.mediaSequence;t<i.segments.length;t++){if(e=i.segments[t],typeof e.start<"u")return{result:e.start-r,precise:!0};if(r+=Ls(i,e),typeof e.end<"u")return{result:e.end-r,precise:!0}}return{result:-1,precise:!1}},Cd=function(i,n,r){if(typeof n>"u"&&(n=i.mediaSequence+i.segments.length),n<i.mediaSequence)return 0;var e=fg(i,n);if(e.precise)return e.result;var t=hg(i,n);return t.precise?t.result:e.result+r},kd=function(i,n,r){if(!i)return 0;if(typeof r!="number"&&(r=0),typeof n>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return k.Infinity}return Cd(i,n,r)},Ji=function(i){var n=i.defaultDuration,r=i.durationList,e=i.startIndex,t=i.endIndex,a=0;if(e>t){var o=[t,e];e=o[0],t=o[1]}if(e<0){for(var u=e;u<Math.min(0,t);u++)a+=n;e=0}for(var l=e;l<t;l++)a+=r[l].duration;return a},wd=function(i,n,r,e){if(!i||!i.segments)return null;if(i.endList)return kd(i);if(n===null)return null;n=n||0;var t=Cd(i,i.mediaSequence+i.segments.length,n);return r&&(e=typeof e=="number"?e:Ed(null,i),t-=e),Math.max(0,t)},pg=function(i,n,r){var e=!0,t=n||0,a=wd(i,n,e,r);return a===null?xu():xu(t,a)},mg=function(i){for(var n=i.playlist,r=i.currentTime,e=i.startingSegmentIndex,t=i.startingPartIndex,a=i.startTime,o=i.experimentalExactManifestTimings,u=r-a,l=Ua(n),c=0,g=0;g<l.length;g++){var m=l[g];if(e===m.segmentIndex&&!(typeof t=="number"&&typeof m.partIndex=="number"&&t!==m.partIndex)){c=g;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+Nt<=0)continue;return{partIndex:b.partIndex,segmentIndex:b.segmentIndex,startTime:a-Ji({defaultDuration:n.targetDuration,durationList:l,startIndex:c,endIndex:_})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:r}}if(c<0){for(var E=c;E<0;E++)if(u-=n.targetDuration,u<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:r};c=0}for(var S=c;S<l.length;S++){var R=l[S];if(u-=R.duration,o){if(u>0)continue}else if(u-Nt>=0)continue;return{partIndex:R.partIndex,segmentIndex:R.segmentIndex,startTime:a+Ji({defaultDuration:n.targetDuration,durationList:l,startIndex:c,endIndex:S})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:r}},Pd=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Ms=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Un=function(i){var n=Pd(i);return!i.disabled&&!n}
37,gg=function(i){return i.disabled},vg=function(i){for(var n=0;n<i.segments.length;n++)if(i.segments[n].key)return!0;return!1},Id=function(i,n){return n.attributes&&n.attributes[i]},yg=function(i,n,r,e){if(e===void 0&&(e=0),!Id("BANDWIDTH",r))return NaN;var t=i*r.attributes.BANDWIDTH;return(t-e*8)/n},Ba=function(i,n){if(i.playlists.length===1)return!0;var r=n.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(function(e){return Un(e)?(e.attributes.BANDWIDTH||0)<r:!1}).length===0},Fs=function(i,n){return!i&&!n||!i&&n||i&&!n?!1:!!(i===n||i.id&&n.id&&i.id===n.id||i.resolvedUri&&n.resolvedUri&&i.resolvedUri===n.resolvedUri||i.uri&&n.uri&&i.uri===n.uri)},Eu=function(i,n){var r=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{},e=!1;for(var t in r){for(var a in r[t])if(e=n(r[t][a]),e)break;if(e)break}return!!e},mr=function(i){if(!i||!i.playlists||!i.playlists.length){var n=Eu(i,function(a){return a.playlists&&a.playlists.length||a.uri});return n}for(var r=function(o){var u=i.playlists[o],l=u.attributes&&u.attributes.CODECS;if(l&&l.split(",").every(function(g){return Zu(g)}))return"continue";var c=Eu(i,function(g){return Fs(u,g)});return c?"continue":{v:!1}},e=0;e<i.playlists.length;e++){var t=r(e);if(t!=="continue"&&typeof t=="object")return t.v}return!0},Xe={liveEdgeDelay:Ed,duration:kd,seekable:pg,getMediaInfoForTime:mg,isEnabled:Un,isDisabled:gg,isBlacklisted:Pd,isIncompatible:Ms,playlistEnd:wd,isAes:vg,hasAttribute:Id,estimateSegmentRequestTime:yg,isLowestEnabledRendition:Ba,isAudioOnly:mr,playlistMatch:Fs,segmentDurationWithParts:Ls},Ad=A.log,Rs=function(i,n){return i+"-"+n},_g=function(i,n,r){return"placeholder-uri-"+i+"-"+n+"-"+r},Tg=function(i){var n=i.onwarn,r=i.oninfo,e=i.manifestString,t=i.customTagParsers,a=t===void 0?[]:t,o=i.customTagMappers,u=o===void 0?[]:o,l=i.experimentalLLHLS,c=new uh;n&&c.on("warn",n),r&&c.on("info",r),a.forEach(function(E){return c.addParser(E)}),u.forEach(function(E){return c.addTagMapper(E)}),c.push(e),c.end();var g=c.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(E){g.hasOwnProperty(E)&&delete g[E]}),g.segments&&g.segments.forEach(function(E){["parts","preloadHints"].forEach(function(S){E.hasOwnProperty(S)&&delete E[S]})})),!g.targetDuration){var m=10;g.segments&&g.segments.length&&(m=g.segments.reduce(function(E,S){return Math.max(E,S.duration)},0)),n&&n("manifest has no targetDuration defaulting to "+m),g.targetDuration=m}var _=Sd(g);if(_.length&&!g.partTargetDuration){var b=_.reduce(function(E,S){return Math.max(E,S.duration)},0);n&&(n("manifest has no partTargetDuration defaulting to "+b),Ad.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),g.partTargetDuration=b}return g},Ri=function(i,n){i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(r){if(i.mediaGroups[r])for(var e in i.mediaGroups[r])for(var t in i.mediaGroups[r][e]){var a=i.mediaGroups[r][e][t];n(a,r,e,t)}})},Od=function(i){var n=i.playlist,r=i.uri,e=i.id;n.id=e,n.playlistErrors_=0,r&&(n.uri=r),n.attributes=n.attributes||{}},bg=function(i){for(var n=i.playlists.length;n--;){var r=i.playlists[n];Od({playlist:r,id:Rs(n,r.uri)}),r.resolvedUri=st(i.uri,r.uri),i.playlists[r.id]=r,i.playlists[r.uri]=r,r.attributes.BANDWIDTH||Ad.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Sg=function(i){Ri(i,function(n){n.uri&&(n.resolvedUri=st(i.uri,n.uri))})},xg=function(i,n){var r=Rs(0,n),e={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:k.location.href,resolvedUri:k.location.href,playlists:[{uri:n,id:r,resolvedUri:n,attributes:{}}]};return e.playlists[r]=e.playlists[0],e.playlists[n]=e.playlists[0],e},Dd=function(i,n,r){r===void 0&&(r=_g),i.uri=n;for(var e=0;e<i.playlists.length;e++)if(!i.playlists[e].uri){var t="placeholder-uri-"+e;i.playlists[e].uri=t}var a=mr(i);Ri(i,function(o,u,l,c){if(!o.playlists||!o.playlists.length){if(a&&u==="AUDIO"&&!o.uri)for(var g=0;g<i.playlists.length;g++){var m=i.playlists[g];if(m.attributes&&m.attributes.AUDIO&&m.attributes.AUDIO===l)return}o.playlists=[wt({},o)]}
37o.playlists.forEach(function(_,b){var E=r(u,l,c,_),S=Rs(b,E);_.uri?_.resolvedUri=_.resolvedUri||st(i.uri,_.uri):(_.uri=b===0?E:S,_.resolvedUri=_.uri),_.id=_.id||S,_.attributes=_.attributes||{},i.playlists[_.id]=_,i.playlists[_.uri]=_})}),bg(i),Sg(i)},mn=A.mergeOptions,Eg=A.EventTarget,Cg=function(i,n){if(n.endList||!n.serverControl)return i;var r={};if(n.serverControl.canBlockReload){var e=n.preloadSegment,t=n.mediaSequence+n.segments.length;if(e){var a=e.parts||[],o=xd(n)-1;o>-1&&o!==a.length-1&&(r._HLS_part=o),(o>-1||a.length)&&t--}r._HLS_msn=t}if(n.serverControl&&n.serverControl.canSkipUntil&&(r._HLS_skip=n.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var u=new k.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){r.hasOwnProperty(l)&&u.searchParams.set(l,r[l])}),i=u.toString()}return i},kg=function(i,n){if(!i)return n;var r=mn(i,n);if(i.preloadHints&&!n.preloadHints&&delete r.preloadHints,i.parts&&!n.parts)delete r.parts;else if(i.parts&&n.parts)for(var e=0;e<n.parts.length;e++)i.parts&&i.parts[e]&&(r.parts[e]=mn(i.parts[e],n.parts[e]));return!i.skipped&&n.skipped&&(r.skipped=!1),i.preload&&!n.preload&&(r.preload=!1),r},wg=function(i,n,r){var e=i.slice(),t=n.slice();r=r||0;for(var a=[],o,u=0;u<t.length;u++){var l=e[u+r],c=t[u];l?(o=l.map||o,a.push(kg(l,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},Ld=function(i,n){!i.resolvedUri&&i.uri&&(i.resolvedUri=st(n,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=st(n,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=st(n,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=st(n,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(function(r){r.resolvedUri||(r.resolvedUri=st(n,r.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(function(r){r.resolvedUri||(r.resolvedUri=st(n,r.uri))})},Md=function(i){var n=i.segments||[],r=i.preloadSegment;if(r&&r.parts&&r.parts.length){if(r.preloadHints){for(var e=0;e<r.preloadHints.length;e++)if(r.preloadHints[e].type==="MAP")return n}r.duration=i.targetDuration,r.preload=!0,n.push(r)}return n},Fd=function(i,n){return i===n||i.segments&&n.segments&&i.segments.length===n.segments.length&&i.endList===n.endList&&i.mediaSequence===n.mediaSequence&&i.preloadSegment===n.preloadSegment},ja=function(i,n,r){r===void 0&&(r=Fd);var e=mn(i,{}),t=e.playlists[n.id];if(!t||r(t,n))return null;n.segments=Md(n);var a=mn(t,n);if(a.preloadSegment&&!n.preloadSegment&&delete a.preloadSegment,t.segments){if(n.skip){n.segments=n.segments||[];for(var o=0;o<n.skip.skippedSegments;o++)n.segments.unshift({skipped:!0})}a.segments=wg(t.segments,n.segments,n.mediaSequence-t.mediaSequence)}a.segments.forEach(function(l){Ld(l,a.resolvedUri)});for(var u=0;u<e.playlists.length;u++)e.playlists[u].id===n.id&&(e.playlists[u]=a);return e.playlists[n.id]=a,e.playlists[n.uri]=a,Ri(i,function(l,c,g,m){if(l.playlists)for(var _=0;_<l.playlists.length;_++)n.id===l.playlists[_].id&&(l.playlists[_]=a)}),e},Va=function(i,n){var r=i.segments||[],e=r[r.length-1],t=e&&e.parts&&e.parts[e.parts.length-1],a=t&&t.duration||e&&e.duration;return n&&a?a*1e3:(i.partTargetDuration||i.targetDuration||10)*500},mi=function(s){$(i,s);function i(r,e,t){var a;if(t===void 0&&(t={}),a=s.call(this)||this,!r)throw new Error("A non-empty playlist URL or object is required");a.logger_=lt("PlaylistLoader");var o=t,u=o.withCredentials,l=u===void 0?!1:u,c=o.handleManifestRedirects,g=c===void 0?!1:c;a.src=r,a.vhs_=e,a.withCredentials=l,a.handleManifestRedirects=g;var m=e.options_;return a.customTagParsers=m&&m.customTagParsers||[],a.customTagMappers=m&&m.customTagMappers||[],a.experimentalLLHLS=m&&m.experimentalLLHLS||!1,A.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(ne(a)),a.on("mediaupdatetimeout",a.handleMediaupdatetimeout_),a}var n=i.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if(this.state==="HAVE_METADATA"){var t=this.media(),a=st(this.master.uri,t.uri);this.experimentalLLHLS&&(a=Cg(a,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,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})}})}},n.playlistRequestError=function(e,t,a){var o=t.uri,u=t.id;this.request=null,a&&(this.state=a),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")},n.parseManifest_=function(e){var t=this,a=e.url,o=e.manifestString;return Tg({onwarn:function(l){var c=l.message;return t.logger_("m3u8-parser warn for "+a+": "+c)},oninfo:function(l){var c=l.message;return t.logger_("m3u8-parser info for "+a+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,a=e.playlistOb
37ject,o=e.url,u=e.id;this.request=null,this.state="HAVE_METADATA";var l=a||this.parseManifest_({url:o,manifestString:t});l.lastRequest=Date.now(),Od({playlist:l,uri:o,id:u});var c=ja(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_(Va(this.media(),!!c)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var a=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(k.clearTimeout(this.finalRenditionTimeout),t){var o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=k.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_(Va(e,!0)),!!l){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(g,m){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=pn(a.handleManifestRedirects,e.resolvedUri,m),g)return a.playlistRequestError(a.request,e,u);a.haveMetadata({playlistString:m.responseText,url:e.uri,id:e.id}),u==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},n.pause=function(){this.mediaUpdateTimeout&&(k.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")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=k.setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},n.start=function(){var e=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=k.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(t,a){if(e.request){if(e.request=null,t)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=pn(e.handleManifestRedirects,e.src,a);var o=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(o)}})},n.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists){this.master=e,Dd(this.master,this.srcUri()),e.playlists.forEac
37h(function(a){a.segments=Md(a),a.segments.forEach(function(o){Ld(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var t=this.srcUri()||k.location.href;this.master=xg(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},i}(Eg),Pg=A.xhr,Ig=A.mergeOptions,Ha=function(i,n,r,e){var t=i.responseType==="arraybuffer"?i.response:i.responseText;!n&&t&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=t.byteLength||t.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),r.headers&&(i.responseHeaders=r.headers),n&&n.code==="ETIMEDOUT"&&(i.timedout=!0),!n&&!i.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(n=new Error("XHR Failed with a response of: "+(i&&(t||i.responseText)))),e(n,i)},Rd=function(){var i=function n(r,e){r=Ig({timeout:45e3},r);var t=n.beforeRequest||A.Vhs.xhr.beforeRequest;if(t&&typeof t=="function"){var a=t(r);a&&(r=a)}var o=A.Vhs.xhr.original===!0?Pg:A.Vhs.xhr,u=o(r,function(c,g){return Ha(u,c,g,e)}),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=r.uri,u.requestTime=Date.now(),u};return i.original=!0,i},Ag=function(i){var n,r=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?n=k.BigInt(i.offset)+k.BigInt(i.length)-k.BigInt(1):n=i.offset+i.length-1,"bytes="+r+"-"+n},Wa=function(i){var n={};return i.byterange&&(n.Range=Ag(i.byterange)),n},Og=function(i,n){return i.start(n)+"-"+i.end(n)},Dg=function(i,n){var r=i.toString(16);return"00".substring(0,2-r.length)+r+(n%2?" ":"")},Lg=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},Nd=function(i){var n={};
37return Object.keys(i).forEach(function(r){var e=i[r];tl(e)?n[r]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:n[r]=e}),n},gn=function(i){var n=i.byterange||{length:1/0,offset:0};return[n.length,n.offset,i.resolvedUri].join(",")},Ud=function(i){return i.resolvedUri},Bd=function(i){for(var n=Array.prototype.slice.call(i),r=16,e="",t,a,o=0;o<n.length/r;o++)t=n.slice(o*r,o*r+r).map(Dg).join(""),a=n.slice(o*r,o*r+r).map(Lg).join(""),e+=t+" "+a+`
38`;return e},Mg=function(i){var n=i.bytes;return Bd(n)},Fg=function(i){var n="",r;for(r=0;r<i.length;r++)n+=Og(i,r)+" ";return n},Rg=Object.freeze({__proto__:null,createTransferableMessage:Nd,initSegmentId:gn,segmentKeyId:Ud,hexDump:Bd,tagDump:Mg,textRanges:Fg}),jd=.25,Ng=function(i,n){if(!n.dateTimeObject)return null;var r=n.videoTimingInfo.transmuxerPrependedSeconds,e=n.videoTimingInfo.transmuxedPresentationStart,t=e+r,a=i-t;return new Date(n.dateTimeObject.getTime()+a*1e3)},Ug=function(i){return i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds},Bg=function(i,n){var r;try{r=new Date(i)}catch{return null}if(!n||!n.segments||n.segments.length===0)return null;var e=n.segments[0];if(r<e.dateTimeObject)return null;for(var t=0;t<n.segments.length-1;t++){e=n.segments[t];var a=n.segments[t+1].dateTimeObject;if(r<a)break}var o=n.segments[n.segments.length-1],u=o.dateTimeObject,l=o.videoTimingInfo?Ug(o.videoTimingInfo):o.duration+o.duration*jd,c=new Date(u.getTime()+l*1e3);return r>c?null:(r>u&&(e=o),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:Xe.duration(n,n.mediaSequence+n.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},jg=function(i,n){if(!n||!n.segments||n.segments.length===0)return null;for(var r=0,e,t=0;t<n.segments.length&&(e=n.segments[t],r=e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationEnd:r+e.duration,!(i<=r));t++);var a=n.segments[n.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>r){if(i>r+a.duration*jd)return null;e=a}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:r-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}},Vg=function(i,n){var r,e;try{r=new Date(i),e=new Date(n)}catch{}var t=r.getTime(),a=e.getTime();return(a-t)/1e3},Hg=function(i){if(!i.segments||i.segments.length===0)return!1;for(var n=0;n<i.segments.length;n++){var r=i.segments[n];if(!r.dateTimeObject)return!1}return!0},Wg=function(i){var n=i.playlist,r=i.time,e=r===void 0?void 0:r,t=i.callback;if(!t)throw new Error("getProgramTime: callback must be provided");if(!n||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});var a=jg(e,n);if(!a)return t({message:"valid programTime was not found"});if(a.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:e},u=Ng(e,a.segment);return u&&(o.programDateTime=u.toISOString()),t(null,o)},qg=function s(i){var n=i.programTime,r=i.playlist,e=i.retryCount,t=e===void 0?2:e,a=i.seekTo,o=i.pauseAfterSeek,u=o===void 0?!0:o,l=i.tech,c=i.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof n>"u"||!r||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!Hg(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var g=Bg(n,r);if(!g)return c({message:n+" was not found in the stream"});var m=g.segment,_=Vg(m.dateTimeObject,n);if(g.type==="estimate"){if(t===0)return c({message:n+" is not buffered yet. Try again"});a(g.estimatedStart+_),l.one("seeked",function(){s({programTime:n,playlist:r,retryCount:t-1,seekTo:a,pauseAfterSeek:u,tech:l,callback:c})});return}var b=m.start+_,E=function(){return c(null,l.currentTime())};l.one("seeked",E),u&&l.pause(),a(b)},Ta=function(i,n){if(i.readyState===4)return n()},Gg=function(i,n,r){var e=[],t,a=!1,o=function(m,_,b,E){return _.abort(),a=!0,r(m,_,b,E)},u=function(m,_){if(!a){if(m)return o(m,_,"",e);var b=_.responseText.substring(e&&e.byteLength||0,_.responseText.length);if(e=Th(e,il(b,!0)),t=t||$i(e),e.length<10||t&&e.length<t+2)return Ta(_,function(){return o(m,_,"",e)});var E=is(e);return E==="ts"&&e.length<188?Ta(_,function(){return o(m,_,"",e)}):!E&&e.length<376?Ta(_,function(){return o(m,_,"",e)}):o(null,_,E,e)}},l={uri:i,beforeSend:function(m){m.overrideMimeType("text/plain;
38 charset=x-user-defined"),m.addEventListener("progress",function(_){return _.total,_.loaded,Ha(m,null,{statusCode:m.status},u)})}},c=n(l,function(g,m){return Ha(c,g,m,u)});return c},zg=A.EventTarget,Vd=A.mergeOptions,Cu=function(i,n){if(!Fd(i,n)||i.sidx&&n.sidx&&(i.sidx.offset!==n.sidx.offset||i.sidx.length!==n.sidx.length))return!1;if(!i.sidx&&n.sidx||i.sidx&&!n.sidx||i.segments&&!n.segments||!i.segments&&n.segments)return!1;if(!i.segments&&!n.segments)return!0;for(var r=0;r<i.segments.length;r++){var e=i.segments[r],t=n.segments[r];if(e.uri!==t.uri)return!1;if(!(!e.byterange&&!t.byterange)){var a=e.byterange,o=t.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}}return!0},Kg=function(i,n,r,e){var t=e.attributes.NAME||r;return"placeholder-uri-"+i+"-"+n+"-"+t},$g=function(i){var n=i.masterXml,r=i.srcUrl,e=i.clientOffset,t=i.sidxMapping,a=i.previousManifest,o=cp(n,{manifestUri:r,clientOffset:e,sidxMapping:t,previousManifest:a});return Dd(o,r,Kg),o},Xg=function(i,n){Ri(i,function(r,e,t,a){a in n.mediaGroups[e][t]||delete i.mediaGroups[e][t][a]})},Qg=function(i,n,r){for(var e=!0,t=Vd(i,{duration:n.duration,minimumUpdatePeriod:n.minimumUpdatePeriod,timelineStarts:n.timelineStarts}),a=0;a<n.playlists.length;a++){var o=n.playlists[a];if(o.sidx){var u=kn(o.sidx);r&&r[u]&&r[u].sidx&&Ja(o,r[u].sidx,o.sidx.resolvedUri)}var l=ja(t,o,Cu);l&&(t=l,e=!1)}return Ri(n,function(c,g,m,_){if(c.playlists&&c.playlists.length){var b=c.playlists[0].id,E=ja(t,c.playlists[0],Cu);E&&(t=E,_ in t.mediaGroups[g][m]||(t.mediaGroups[g][m][_]=c),t.mediaGroups[g][m][_].playlists[0]=t.playlists[b],e=!1)}}),Xg(t,n),n.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(e=!1),e?null:t},Yg=function(i,n){var r=!i.map&&!n.map,e=r||!!(i.map&&n.map&&i.map.byterange.offset===n.map.byterange.offset&&i.map.byterange.length===n.map.byterange.length);return e&&i.uri===n.uri&&i.byterange.offset===n.byterange.offset&&i.byterange.length===n.byterange.length},ku=function(i,n){var r={};for(var e in i){var t=i[e],a=t.sidx;if(a){var o=kn(a);if(!n[o])break;var u=n[o].sidxInfo;Yg(u,a)&&(r[o]=n[o])}}return r},Jg=function(i,n){var r=ku(i.playlists,n),e=r;return Ri(i,function(t,a,o,u){if(t.playlists&&t.playlists.length){var l=t.playlists;e=Vd(e,ku(l,n))}}),e},qa=function(s){$(i,s);function i(r,e,t,a){var o;t===void 0&&(t={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||ne(o),a||(o.isMaster_=!0);var u=t,l=u.withCredentials,c=l===void 0?!1:l,g=u.handleManifestRedirects,m=g===void 0?!1:g;if(o.vhs_=e,o.withCredentials=c,o.handleManifestRedirects=m,!r)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_=lt("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=r,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=r,o}var n=i.prototype;return n.requestErrored_=function(e,t,a){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2},a&&(this.state=a),this.trigger("error"),!0},n.addSidxSegments_=function(e,t,a){var o=this,u=e.sidx&&kn(e.sidx);if(!e.sidx||!u||this.masterPlaylistLoader_.sidxMapping_[u]){this.mediaRequest_=k.setTimeout(function(){return a(!1)},0);return}var l=pn(this.handleManifestRedirects,e.sidx.resolvedUri),c=function(m,_){if(!o.requestErrored_(m,_,t)){var b=o.masterPlaylistLoader_.sidxMapping_,E;try{E=gp(te(_.response).subarray(8))}catch(S){o.requestErrored_(S,_,t);return}return b[u]={sidxInfo:e.sidx,sidx:E},Ja(e,E,e.sidx.resolvedUri),a(!0)}};this.request=Gg(l,this.vhs_.xhr,function(g,m,_,b){if(g)return c(g,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 E=e.sidx.byterange,S=E.offset,R=E.length;if(b.length>=R+S)return c(g,{response:b.subarray(S,S+R),status:m.status,uri:m.uri});o.request=o.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:Wa({byterange:e.sidx.byterange})},c)})},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},k.clearTimeout(this.minimumUpdatePeriodTimeout_),k.clearTimeout(this.mediaRequest_),k.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()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=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,a,function(u){t.haveMetadata({startingState:a,playlist:e})}))},n.haveMetadata=function(e){var t=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),t==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(k.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},n.load=function(e){var t=this;k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=k.setTimeout(function(){return t.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},n.start=function(){var e=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=k.setTimeout(function(){return e.haveMaster_()},0);return}this.requestMaster_(function(t,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])})},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(t.requestErrored_(a,o)){t.state==="HAVE_NOTHING"&&(t.started=!1);return}var u=o.responseText!==t.masterPlaylistLoader_.masterXml_;if(t.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?t.masterLoaded_=Date.parse(o.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=pn(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,o),u){t.handleMaster_(),t.syncClientServerClock_(function(){return e(o,u)});return}return e(o,u)})},n.syncClientServerClock_=function(e){var t=this,a=fp(this.masterPlaylistLoader_.masterXml_);if(a===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e();if(a.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e();this.request=this.vhs_.xhr({uri:st(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,u){if(t.request){if(o)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var l;a.method==="HEAD"?!u.responseHeaders||!u.responseHeaders.date?l=t.masterLoaded_:l=Date.parse(u.responseHeaders.date):l=Date.parse(u.responseText),t.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}})},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,t=$g({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=Qg(e,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||e;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!t},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(k.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;
38if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout");return}this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=k.setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},n.refreshXml_=function(){var e=this;this.requestMaster_(function(t,a){a&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=Jg(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(o){e.refreshMedia_(e.media().id)}))})},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==a[e];if(o?this.media_=a[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var u=function l(){t.media().endList||(t.mediaUpdateTimeout=k.setTimeout(function(){t.trigger("mediaupdatetimeout"),l()},Va(t.media(),!!o)))};u()}this.trigger("loadedplaylist")},i}(zg),Pe={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},Zg=function(i){for(var n=new Uint8Array(new ArrayBuffer(i.length)),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n.buffer},Hd=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},ev=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{var n=new BlobBuilder;return n.append(i),URL.createObjectURL(n.getBlob())}},Wd=function(i){return function(){var n=ev(i),r=Hd(new Worker(n));r.objURL=n;var e=r.terminate;return r.on=r.addEventListener,r.off=r.removeEventListener,r.terminate=function(){return URL.revokeObjectURL(n),e.call(this)},r}},qd=function(i){return"var browserWorkerPolyFill = "+Hd.toString()+`;
39browserWorkerPolyFill(self);
40`+i},Gd=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},tv=qd(Gd(function(){var s=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 p;return d[h]?(p=d[h].indexOf(f),d[h]=d[h].slice(),d[h].splice(p,1),p>-1):!1},this.trigger=function(h){var f,p,v,y;if(f=d[h],!!f)if(arguments.length===2)for(v=f.length,p=0;p<v;++p)f[p].call(this,arguments[1]);else{for(y=[],p=arguments.length,p=1;p<arguments.length;++p)y.push(arguments[p]);for(v=f.length,p=0;p<v;++p)f[p].apply(this,y)}},this.dispose=function(){d={}}}};s.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},s.prototype.push=function(T){this.trigger("data",T)},s.prototype.flush=function(T){this.trigger("done",T)},s.prototype.partialFlush=function(T){this.trigger("partialdone",T)},s.prototype.endTimeline=function(T){this.trigger("endedtimeline",T)},s.prototype.reset=function(T){this.trigger("reset",T)};var i=s,n=Math.pow(2,32),r=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)*n+h.getUint32(4)},e={getUint64:r,MAX_UINT32:n},t=e.MAX_UINT32,a,o,u,l,c,g,m,_,b,E,S,R,F,B,O,L,j,U,D,W,V,ee,M,N,G,Z,Q,ie,ae,ce,oe,rt,we,Oe,Lt,Ut;(function(){var T;if(M={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 M)M.hasOwnProperty(T)&&(M[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);N=new Uint8Array([105,115,111,109]),Z=new Uint8Array([97,118,99,49]),G=new Uint8Array([0,0,0,1]),Q=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]),ie=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]),ae={video:Q,audio:ie},rt=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),oe=new Uint8Array([0,0,0,0,0,0,0,0]),we=new Uint8Array([0,0,0,0,0,0,0,0]),Oe=we,Lt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ut=we,ce=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(d){var h=[],f=0,p,v,y;for(p=1;p<arguments.length;p++)h.push(arguments[p]);for(p=h.length;p--;)f+=h[p].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),p=0,f=8;p<h.length;p++)v.set(h[p],f),f+=h[p].byteLength;return v},o=function(){return a(M.dinf,a(M.dref,rt))},u=function(d){return a(M.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 a(M.ftyp,N,G,N,Z)},L=function(d){return a(M.hdlr,ae[d])},c=function(d){return a(M.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),a(M.mdhd,h)},B=function(d){return a(M.mdia,O(d),L(d.type),m(d))},g=function(d){return a(M.mfhd,new Uint8Array([0,0,0,0,(d&4278190080)>>24,(d&16711680)>>16,(d&65280)>>8,d&255]))},m=function(d){return a(M.minf,d.type==="video"?a(M.vmhd,ce):a(M.smhd,oe),o(),U(d))},_=function(d,h){for(var f=[],p=h.length;p--;)f[p]=W(h[p]);
40return a.apply(null,[M.moof,g(d)].concat(f))},b=function(d){for(var h=d.length,f=[];h--;)f[h]=R(d[h]);return a.apply(null,[M.moov,S(4294967295)].concat(f).concat(E(d)))},E=function(d){for(var h=d.length,f=[];h--;)f[h]=V(d[h]);return a.apply(null,[M.mvex].concat(f))},S=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 a(M.mvhd,h)},j=function(d){var h=d.samples||[],f=new Uint8Array(4+h.length),p,v;for(v=0;v<h.length;v++)p=h[v].flags,f[v+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return a(M.sdtp,f)},U=function(d){return a(M.stbl,D(d),a(M.stts,Ut),a(M.stsc,Oe),a(M.stsz,Lt),a(M.stco,we))},function(){var T,d;D=function(f){return a(M.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),f.type==="video"?T(f):d(f))},T=function(f){var p=f.sps||[],v=f.pps||[],y=[],x=[],C,P;for(C=0;C<p.length;C++)y.push((p[C].byteLength&65280)>>>8),y.push(p[C].byteLength&255),y=y.concat(Array.prototype.slice.call(p[C]));for(C=0;C<v.length;C++)x.push((v[C].byteLength&65280)>>>8),x.push(v[C].byteLength&255),x=x.concat(Array.prototype.slice.call(v[C]));if(P=[M.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]),a(M.avcC,new Uint8Array([1,f.profileIdc,f.profileCompatibility,f.levelIdc,255].concat([p.length],y,[v.length],x))),a(M.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],f.sarRatio){var w=f.sarRatio[0],I=f.sarRatio[1];P.push(a(M.pasp,new Uint8Array([(w&4278190080)>>24,(w&16711680)>>16,(w&65280)>>8,w&255,(I&4278190080)>>24,(I&16711680)>>16,(I&65280)>>8,I&255])))}return a.apply(null,P)},d=function(f){return a(M.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))}}(),F=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 a(M.tkhd,h)},W=function(d){var h,f,p,v,y,x,C;return h=a(M.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])),x=Math.floor(d.baseMediaDecodeTime/t),C=Math.floor(d.baseMediaDecodeTime%t),f=a(M.tfdt,new Uint8Array([1,0,0,0,x>>>24&255,x>>>16&255,x>>>
408&255,x&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255])),y=92,d.type==="audio"?(p=ee(d,y),a(M.traf,h,f,p)):(v=j(d),p=ee(d,v.length+y),a(M.traf,h,f,p,v))},R=function(d){return d.duration=d.duration||4294967295,a(M.trak,F(d),B(d))},V=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),a(M.trex,h)},function(){var T,d,h;h=function(p,v){var y=0,x=0,C=0,P=0;return p.length&&(p[0].duration!==void 0&&(y=1),p[0].size!==void 0&&(x=2),p[0].flags!==void 0&&(C=4),p[0].compositionTimeOffset!==void 0&&(P=8)),[0,0,y|x|C|P,1,(p.length&4278190080)>>>24,(p.length&16711680)>>>16,(p.length&65280)>>>8,p.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]},d=function(p,v){var y,x,C,P,w,I;for(P=p.samples||[],v+=20+16*P.length,C=h(P,v),x=new Uint8Array(C.length+P.length*16),x.set(C),y=C.length,I=0;I<P.length;I++)w=P[I],x[y++]=(w.duration&4278190080)>>>24,x[y++]=(w.duration&16711680)>>>16,x[y++]=(w.duration&65280)>>>8,x[y++]=w.duration&255,x[y++]=(w.size&4278190080)>>>24,x[y++]=(w.size&16711680)>>>16,x[y++]=(w.size&65280)>>>8,x[y++]=w.size&255,x[y++]=w.flags.isLeading<<2|w.flags.dependsOn,x[y++]=w.flags.isDependedOn<<6|w.flags.hasRedundancy<<4|w.flags.paddingValue<<1|w.flags.isNonSyncSample,x[y++]=w.flags.degradationPriority&61440,x[y++]=w.flags.degradationPriority&15,x[y++]=(w.compositionTimeOffset&4278190080)>>>24,x[y++]=(w.compositionTimeOffset&16711680)>>>16,x[y++]=(w.compositionTimeOffset&65280)>>>8,x[y++]=w.compositionTimeOffset&255;return a(M.trun,x)},T=function(p,v){var y,x,C,P,w,I;for(P=p.samples||[],v+=20+8*P.length,C=h(P,v),y=new Uint8Array(C.length+P.length*8),y.set(C),x=C.length,I=0;I<P.length;I++)w=P[I],y[x++]=(w.duration&4278190080)>>>24,y[x++]=(w.duration&16711680)>>>16,y[x++]=(w.duration&65280)>>>8,y[x++]=w.duration&255,y[x++]=(w.size&4278190080)>>>24,y[x++]=(w.size&16711680)>>>16,y[x++]=(w.size&65280)>>>8,y[x++]=w.size&255;return a(M.trun,y)},ee=function(p,v){return p.type==="audio"?T(p,v):d(p,v)}}();var dt={ftyp:l,mdat:c,moof:_,moov:b,initSegment:function(d){var h=l(),f=b(d),p;return p=new Uint8Array(h.byteLength+f.byteLength),p.set(h),p.set(f,h.byteLength),p}},ri=function(d){var h,f,p=[],v=[];for(v.byteLength=0,v.nalCount=0,v.duration=0,p.byteLength=0,h=0;h<d.length;h++)f=d[h],f.nalUnitType==="access_unit_delimiter_rbsp"?(p.length&&(p.duration=f.dts-p.dts,v.byteLength+=p.byteLength,v.nalCount+=p.length,v.duration+=p.duration,v.push(p)),p=[f],p.byteLength=f.data.byteLength,p.pts=f.pts,p.dts=f.dts):(f.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(p.keyFrame=!0),p.duration=f.dts-p.dts,p.byteLength+=f.data.byteLength,p.push(f));return v.length&&(!p.duration||p.duration<=0)&&(p.duration=v[v.length-1].duration),v.byteLength+=p.byteLength,v.nalCount+=p.length,v.duration+=p.duration,v.push(p),v},ni=function(d){var h,f,p=[],v=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,p.pts=d[0].pts,p.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?(p.length&&(v.push(p),v.byteLength+=p.byteLength,v.nalCount+=p.nalCount,v.duration+=p.duration),p=[f],p.nalCount=f.length,p.byteLength=f.byteLength,p.pts=f.pts,p.dts=f.dts,p.duration=f.duration):(p.duration+=f.duration,p.nalCount+=f.length,p.byteLength+=f.byteLength,p.push(f));return v.length&&p.duration<=0&&(p.duration=v[v.length-1].duration),v.byteLength+=p.byteLength,v.nalCount+=p.nalCount,v.duration+=p.duration,v.push(p),v},ai=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},_c=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Ws=function(d,h){var f=_c();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},Tc=function(d,h){var f,p,v,y,x,C=h||0,P=[];for(f=0;f<d.length;f++)for(y=d[f],p=0;p<y.length;p++)x=y[p],v=Ws(x,C),C+=v.size,P.push(v);return P},bc=function(d){var h,f,p,v,y,x,C=0,P=d.byteLength,w=d.nalCount,I=P+4*w,H=new Uint8Array(I),X=new DataView(H.buffer);for(h=0;h<d.length;h++)for(v=d[h],f=0;f<v.length;f++)for(y=v[f],p=0;p<y.length;p++)x=y[p],X.setUint32(C,x.data.byteLength),C+=4,H.set(x.data,C),C+=x.data.byteLength;return H},Sc=function(d,h){var f,p=h||0,v=[];return f=Ws(d,p),v.push(f),v},xc=function(d){var h,f,p=0,v=d.byteLength,y=d.length,x=v+4*y,C=new Uint8Array(x),P=new DataView(C.buffer);for(h=0;h<d.length;h++)f=d[h],P.setUint32(p,f.data.byteLength),p+=4,C.set(f.data,p),p+=f.data.byteLength;return C},Ni={groupNalsIntoFrames:ri,groupFramesIntoGops:ni,extendFirstKeyFrame:ai,generateSampleTable:Tc,concatenateNalData:bc,generateSampleTableForFrame:Sc,concatenateNalDataForFrame:xc},Mt=[33,16,5,32,164,27],jn=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],fe=function(d){for(var h=[];d--;)h.push(0);return h},Ec=function(d){return Object.keys(d).reduce(function(h,f){return h[f]=new Uint8Array(d[f].reduce(function(p,v){return p.concat(v)},[])),h},{})},Vn,Cc=function(){if(!Vn){var d={96e3:[Mt,[227,64],fe(154),[56]],88200:[Mt,[231],fe(170),[56]],64e3:[Mt,[248,192],fe(240),[56]],48e3:[Mt,[255,192],fe(268),[55,148,128],fe(54),[112]],44100:[Mt,[255,192],fe(268),[55,163,128],fe(84),[112]],32e3:[Mt,[255,192],fe(268),[55,234],fe(226),[112]],24e3:[Mt,[255,192],fe(268),[55,255,128],fe(268),[111,112],fe(126),[224]],16e3:[Mt,[255,192],fe(268),[55,255,128],fe(268),[111,255],fe(269),[223,108],fe(195),[1,192]],12e3:[jn,fe(268),[3,127,248],fe(268),[6,255,240],fe(268),[13,255,224],fe(268),[27,253,128],fe(259),[56]],11025:[jn,fe(268),[3,127,248],fe(268),[6,255,240],fe(268),[13,255,224],fe(268),[27,255,192],fe(268),[55,175,128],fe(108),[112]],8e3:[jn,fe(268),[3,121,16],fe(47),[7]]};Vn=Ec(d)}return Vn},Hn=9e4,Wn,qn,gr,Gn,qs,Gs,zs;Wn=function(d){return d*Hn},qn=function(d,h){return d*h},gr=function(d){return d/Hn},Gn=function(d,h){return d/h},qs=function(d,h){return Wn(Gn(d,h))},Gs=function(d,h){return qn(gr(d),h)},zs=function(d,h,f){return gr(f?d:d-h)};var de={ONE_SECOND_IN_TS:Hn,secondsToVideoTs:Wn,secondsToAudioTs:qn,videoTsToSeconds:gr,audioTsToSeconds:Gn,audioTsToVideoTs:qs,videoTsToAudioTs:Gs,metadataTsToSeconds:zs},kc=function(d){var h,f,p=0;for(h=0;h<d.length;h++)f=d[h],p+=f.data.byteLength;return p},wc=function(d,h,f,p){var v,y=0,x=0,C=0,P=0,w,I,H;if(h.length&&(v=de.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),y=Math.ceil(de.ONE_SECOND_IN_TS/(d.samplerate/1024)),f&&p&&(x=v-Math.max(f,p),C=Math.floor(x/y),P=C*y),!(C<1||P>
40de.ONE_SECOND_IN_TS/2))){for(w=Cc()[d.samplerate],w||(w=h[0].data),I=0;I<C;I++)H=h[0],h.splice(0,0,{data:w,dts:H.dts-y,pts:H.pts-y});return d.baseMediaDecodeTime-=Math.floor(de.videoTsToAudioTs(P,d.samplerate)),P}},Pc=function(d,h,f){return h.minSegmentDts>=f?d:(h.minSegmentDts=1/0,d.filter(function(p){return p.dts>=f?(h.minSegmentDts=Math.min(h.minSegmentDts,p.dts),h.minSegmentPts=h.minSegmentDts,!0):!1}))},Ic=function(d){var h,f,p=[];for(h=0;h<d.length;h++)f=d[h],p.push({size:f.data.byteLength,duration:1024});return p},Ac=function(d){var h,f,p=0,v=new Uint8Array(kc(d));for(h=0;h<d.length;h++)f=d[h],v.set(f.data,p),p+=f.data.byteLength;return v},vr={prefixWithSilence:wc,trimAdtsFramesByEarliestDts:Pc,generateSampleTable:Ic,concatenateFrameData:Ac},Oc=de.ONE_SECOND_IN_TS,Dc=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))},Lc=function(d){delete d.minSegmentDts,delete d.maxSegmentDts,delete d.minSegmentPts,delete d.maxSegmentPts},Mc=function(d,h){var f,p,v=d.minSegmentDts;return h||(v-=d.timelineStartInfo.dts),f=d.timelineStartInfo.baseMediaDecodeTime,f+=v,f=Math.max(0,f),d.type==="audio"&&(p=d.samplerate/Oc,f*=p,f=Math.floor(f)),f},nt={clearDtsInfo:Lc,calculateTrackBaseMediaDecodeTime:Mc,collectDtsInfo:Dc},Ks=4,Fc=128,Rc=function(d){for(var h=0,f={payloadType:-1,payloadSize:0},p=0,v=0;h<d.byteLength&&d[h]!==Fc;){for(;d[h]===255;)p+=255,h++;for(p+=d[h++];d[h]===255;)v+=255,h++;if(v+=d[h++],!f.payload&&p===Ks){var y=String.fromCharCode(d[h+3],d[h+4],d[h+5],d[h+6]);if(y==="GA94"){f.payloadType=p,f.payloadSize=v,f.payload=d.subarray(h,h+v);break}else f.payload=void 0}h+=v,p=0,v=0}return f},Nc=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)},Uc=function(d,h){var f=[],p,v,y,x;if(!(h[0]&64))return f;for(v=h[0]&31,p=0;p<v;p++)y=p*3,x={type:h[y+2]&3,pts:d},h[y+2]&4&&(x.ccData=h[y+3]<<8|h[y+4],f.push(x));return f},Bc=function(d){for(var h=d.byteLength,f=[],p=1,v,y;p<h-2;)d[p]===0&&d[p+1]===0&&d[p+2]===3?(f.push(p+2),p+=2):p++;if(f.length===0)return d;v=h-f.length,y=new Uint8Array(v);var x=0;for(p=0;p<v;x++,p++)x===f[0]&&(x++,f.shift()),y[p]=d[x];return y},Ui={parseSei:Rc,parseUserData:Nc,parseCaptionPackets:Uc,discardEmulationPreventionBytes:Bc,USER_DATA_REGISTERED_ITU_T_T35:Ks},Qe=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")))};Qe.prototype=new i,Qe.prototype.push=function(T){var d,h,f;if(T.nalUnitType==="sei_rbsp"&&(d=Ui.parseSei(T.escapedRBSP),!!d.payload&&d.payloadType===Ui.USER_DATA_REGISTERED_ITU_T_T35&&(h=Ui.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=Ui.parseCaptionPackets(T.pts,h),this.captionPackets_=this.captionPackets_.concat(f),this.latestDts_!==T.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=T.dts}}
40,Qe.prototype.flushCCStreams=function(T){this.ccStreams_.forEach(function(d){return T==="flush"?d.flush():d.partialFlush()},this)},Qe.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)},Qe.prototype.flush=function(){return this.flushStream("flush")},Qe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Qe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(T){T.reset()})},Qe.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)},Qe.prototype.setsChannel1Active=function(T){return(T.ccData&30720)===4096},Qe.prototype.setsChannel2Active=function(T){return(T.ccData&30720)===6144},Qe.prototype.setsTextOrXDSActive=function(T){return(T.ccData&28928)===256||(T.ccData&30974)===4138||(T.ccData&30974)===6186},Qe.prototype.dispatchCea708Packet=function(T){this.parse708captions_&&this.cc708Stream_.push(T)};var jc={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},Vc=function(d){var h=jc[d]||d;return d&4096&&d===h?"":String.fromCharCode(h)},yr=function(d){return 32<=d&&d<=127||160<=d&&d<=255},yt=function(d){this.windowNum=d,this.reset()};yt.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},yt.prototype.getText=function(){return this.rows.join(`
41`)},yt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},yt.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--},yt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},yt.prototype.addText=function(T){this.rows[this.rowIdx]+=T},yt.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var _r=function(d,h,f){this.serviceNum=d,this.text="",this.currentWindow=new yt(-1),this.windows=[],this.stream=f,typeof h=="string"&&this.createTextDecoder(h)};_r.prototype.init=function(T,d){this.startPts=T;for(var h=0;h<8;h++)this.windows[h]=new yt(h),typeof d=="function"&&(this.windows[h].beforeRowOverflow=d)},_r.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},_r.prototype.createTextDecoder=function(T){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(T)}catch(d){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+T+" encoding. "+d})}};var me=function T(d){d=d||{},T.prototype.init.call(this);var h=this,f=d.captionServices||{},p={},v;Object.keys(f).forEach(function(y){v=f[y],/^SERVICE/.test(y)&&(p[y]=v.encoding)}),this.serviceEncodings=p,this.current708Packet=null,this.services={},this.push=function(y){y.type===3?(h.new708Packet(),h.add708Bytes(y)):(h.current708Packet===null&&h.new708Packet(),h.add708Bytes(y))}};me.prototype=new i,me.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},me.prototype.add708Bytes=function(T){var d=T.ccData,h=d>>>8,f=d&255;this.current708Packet.ptsVals.push(T.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(f)},me.prototype.push708Packet=function(){var T=this.current708Packet,d=T.data,h=null,f=null,p=0,v=d[p++];for(T.seq=v>>6,T.sizeCode=v&63;p<d.length;p++)v=d[p++],h=v>>5,f=v&31,h===7&&f>0&&(v=d[p++],h=v),this.pushServiceBlock(h,p,f),f>0&&(p+=f-1)},me.prototype.pushServiceBlock=function(T,d,h){var f,p=d,v=this.current708Packet.data,y=this.services[T];for(y||(y=this.initService(T,p));p<d+h&&p<v.length;p++)f=v[p],yr(f)?p=this.handleText(p,y):f===24?p=this.multiByteCharacter(p,y):f===16?p=this.extendedCommands(p,y):128<=f&&f<=135?p=this.setCurrentWindow(p,y):152<=f&&f<=159?p=this.defineWindow(p,y):f===136?p=this.clearWindows(p,y):f===140?p=this.deleteWindows(p,y):f===137?p=this.displayWindows(p,y):f===138?p=this.hideWindows(p,y):f===139?p=this.toggleWindows(p,y):f===151?p=this.setWindowAttributes(p,y):f===144?p=this.setPenAttributes(p,y):f===145?p=this.setPenColor(p,y):f===146?p=this.setPenLocation(p,y):f===143?y=this.reset(p,y):f===8?y.currentWindow.backspace():f===12?y.currentWindow.clearText():f===13?y.currentWindow.pendingNewLine=!0:f===14?y.currentWindow.clearText():f===141&&p++},me.prototype.extendedCommands=function(T,d){var h=this.current708Packet.data,f=h[++T];return yr(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,p;return f in this.serviceEncodings&&(p=this.serviceEncodings[f]),this.services[T]=new _r(T,p,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,p=h&&h.isMultiByte,v=this.current708Packet.data,y=f?4096:0,x=v[T],C=v[T+1],P=d.currentWindow,w,I;return d.textDecoder_&&!f?(p?(I=[x,C],T++):I=[x],w=d.textDecoder_.decode(new Uint8Array(I))):w=Vc(y|x),P.pendingNewLine&&!P.isEmpty()&&P.newLine(this.getPts(T)),P.pendingNewLine=!1,P.addText(w),T},me.prototype.multiByteCharacter=function(T,d){var h=this.current708Packet.data,f=h[T+1],p=h[T+2];return yr(f)&&yr(p)&&(T=this.handleText(++T,d,{isMultiByte:!0})),T},me.prototype.setCurrentWindow=function(T,d){var h=this.current708Packet.data,f=h[T],p=f&7;return d.setCurrentWindow(p),T},me.prototype.defineWindow=function(T,d){var h=this.current708Packet.data,f=h[T],p=f&7;d.setCurrentWindow(p);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],p=d.currentWindow.winAttr;return f=h[++T],p.fillOpacity=(f&192)>>6,p.fillRed=(f&48)>>4,p.fillGreen=(f&12)>>2,p.fillBlue=f&3,f=h[++T],p.borderType=(f&192)>>6,p.borderRed=(f&48)>>4,p.borderGreen=(f&12)>>2,p.borderBlue=f&3,f=h[++T],p.borderType+=(f&128)>>5,p.wordWrap=(f&64)>>6,p.printDirection=(f&48)>>4,p.scrollDirection=(f&12)>>2,p.justify=f&3,f=h[++T],p.effectSpeed=(f&240)>>4,p.effectDirection=(f&12)>>2,p.displayEffect=f&3,T},me.prototype.flushDisplayed=function(T,d){for(var h=[],f=0;f<8;f++)d.windows[f].visible&&!d.windows[f].isEmpty()&&h.push(d.windows[f].getText());d.endPts=T,d.text=h.join(`
42
43`),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
43:"cc708_"+T.serviceNum}),T.text="",T.startPts=T.endPts)},me.prototype.displayWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=1);return T},me.prototype.hideWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible=0);return T},me.prototype.toggleWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<<v&&(d.windows[v].visible^=1);return T},me.prototype.clearWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].clearText();return T},me.prototype.deleteWindows=function(T,d){var h=this.current708Packet.data,f=h[++T],p=this.getPts(T);this.flushDisplayed(p,d);for(var v=0;v<8;v++)f&1<<v&&d.windows[v].reset();return T},me.prototype.setPenAttributes=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.penAttr;return f=h[++T],p.textTag=(f&240)>>4,p.offset=(f&12)>>2,p.penSize=f&3,f=h[++T],p.italics=(f&128)>>7,p.underline=(f&64)>>6,p.edgeType=(f&56)>>3,p.fontStyle=f&7,T},me.prototype.setPenColor=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.penColor;return f=h[++T],p.fgOpacity=(f&192)>>6,p.fgRed=(f&48)>>4,p.fgGreen=(f&12)>>2,p.fgBlue=f&3,f=h[++T],p.bgOpacity=(f&192)>>6,p.bgRed=(f&48)>>4,p.bgGreen=(f&12)>>2,p.bgBlue=f&3,f=h[++T],p.edgeRed=(f&48)>>4,p.edgeGreen=(f&12)>>2,p.edgeBlue=f&3,T},me.prototype.setPenLocation=function(T,d){var h=this.current708Packet.data,f=h[T],p=d.currentWindow.penLoc;return d.currentWindow.pendingNewLine=!0,f=h[++T],p.row=f&15,f=h[++T],p.column=f&63,T},me.prototype.reset=function(T,d){var h=this.getPts(T);return this.flushDisplayed(h,d),this.initService(d.serviceNum,T)};var Hc={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},Tr=function(d){return d===null?"":(d=Hc[d]||d,String.fromCharCode(d))},br=14,Wc=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Bt=function(){for(var d=[],h=br+1;h--;)d.push("");return d},Te=function T(d,h){T.prototype.init.call(this),this.field_=d||0,this.dataChannel_=h||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(f){var p,v,y,x,C;if(p=f.ccData&32639,p===this.lastControlCode_){this.lastControlCode_=null;return}if((p&61440)===4096?this.lastControlCode_=p:p!==this.PADDING_&&(this.lastControlCode_=null),y=p>>>8,x=p&255,p!==this.PADDING_)if(p===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(p===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(f.pts),this.flushDisplayed(f.pts),v=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=v,this.startPts_=f.pts;else if(p===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(f.pts);else if(p===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(f.pts);else if(p===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(f.pts);else if(p===this.CARRIAGE_RETURN_)this.clearFormatting(f.pts),this.flushDisplayed(f.pts),this.shiftRowsUp_(),this.startPts_=f.pts;else if(p===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(p===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(f.pts),this.displayed_=Bt();else if(p===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Bt();else if(p===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(f.pts),this.displayed_=Bt()),this.mode_="paintOn",this.startPts_=f.pts;else if(this.isSpecialCharacter(y,x))y=(y&3)<<8,C=Tr(y|x),this[this.mode_](f.pts,C),this.column_++;else if(this.isExtCharacter(y,x))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=Tr(y|x),this[this.mode_](f.pts,C),this.column_++;else if(this.isMidRowCode(y,x))this.clearFormatting(f.pts),this[this.mode_](f.pts," "),this.column_++,(x&14)===14&&this.addFormatting(f.pts,["i"]),(x&1)===1&&this.addFormatting(f.pts,["u"]);else if(this.isOffsetControlCode(y,x))this.column_+=x&3;else if(this.isPAC(y,x)){var P=Wc.indexOf(p&7968);this.mode_==="rollUp"&&(P-this.rollUpRows_+1<0&&(P=this.rollUpRows_-1),this.setRollUp(f.pts,P)),P!==this.row_&&(this.clearFormatting(f.pts),this.row_=P),x&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(f.pts,["u"]),(p&16)===16&&(this.column_=((p&14)>>1)*4),this.isColorPAC(x)&&(x&14)===14&&this.addFormatting(f.pts,["i"])}else this.isNormalChar(y)&&(x===0&&(x=null),C=Tr(y),C+=Tr(x),this[this.mode_](f.pts,C),this.column_+=C.length)}};Te.prototype=new i,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(`
44`).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_=Bt(),this.nonDisplayed_=Bt(),this.lastControlCode_=null,this.column_=0,this.row_=br,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_=br,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=Bt(),this.displayed_=Bt()),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,p){return f+"<"+p+">"},"");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<br+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 Sr={CaptionStream:Qe,Cea608Stream:Te,Cea708Stream:me},De={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},qc=8589934592,Gc=4294967296,$s="shared",zn=function(d,h){var f=1;for(d>h&&(f=-1);Math.abs(h-d)>Gc;)d+=f*qc;return d},Xs=function T(d){var h,f;T.prototype.init.call(this),this.type_=d||$s,this.push=function(p){this.type_!==$s&&p.type!==this.type_||(f===void 0&&(f=p.dts),p.dts=zn(p.dts,f),p.pts=zn(p.pts,f),h=p.dts,this.trigger("data",p))},this.flush=function(){f=h,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){f=void 0,h=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Xs.prototype=new i;var Qs={TimestampRolloverStream:Xs,handleRollover:zn},Ys=function(d,h,f){var p,v="";for(p=h;p<f;p++)v+="%"+("00"+d[p].toString(16)).slice(-2);return v},xr=function(d,h,f){return decodeURIComponent(Ys(d,h,f))},zc=function(d,h,f){return unescape(Ys(d,h,f))},Er=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},Js={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=xr(d.data,1,h),d.value=xr(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=xr(d.data,1,h),d.url=xr(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=zc(d.data,0,h);break}d.privateData=d.data.subarray(h+1),d.data=d.privateData}},Cr;Cr=function(d){var h={descriptor:d&&d.descriptor},f=0,p=[],v=0,y;if(Cr.prototype.init.call(this),this.dispatchType=De.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(x){var C,P,w,I,H,X;if(x.type==="timed-metadata"){if(x.dataAlignmentIndicator&&(v=0,p.length=0),p.length===0&&(x.data.length<10||x.data[0]!==73||x.data[1]!==68||x.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(p.push(x),v+=x.data.byteLength,p.length===1&&(f=Er(x.data.subarray(6,10)),f+=10),!(v<f)){for(C={data:new Uint8Array(f),frames:[],pts:p[0].pts,dts:p[0].dts},H=0;H<f;)C.data.set(p[0].data.subarray(0,f-H),H),H+=p[0].data.byteLength,v-=p[0].data.byteLength,p.shift();
44P=10,C.data[5]&64&&(P+=4,P+=Er(C.data.subarray(10,14)),f-=Er(C.data.subarray(16,20)));do{if(w=Er(C.data.subarray(P+4,P+8)),w<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(X=String.fromCharCode(C.data[P],C.data[P+1],C.data[P+2],C.data[P+3]),I={id:X,data:C.data.subarray(P+10,P+w+10)},I.key=I.id,Js[I.id]&&(Js[I.id](I),I.owner==="com.apple.streaming.transportStreamTimestamp")){var J=I.data,z=(J[3]&1)<<30|J[4]<<22|J[5]<<14|J[6]<<6|J[7]>>>2;z*=4,z+=J[7]&3,I.timeStamp=z,C.pts===void 0&&C.dts===void 0&&(C.pts=I.timeStamp,C.dts=I.timeStamp),this.trigger("timestamp",I)}C.frames.push(I),P+=10,P+=w}while(P<f);this.trigger("data",C)}}}},Cr.prototype=new i;var Kc=Cr,$c=Qs.TimestampRolloverStream,kr,Bi,wr,si=188,Kn=71;kr=function(){var d=new Uint8Array(si),h=0;kr.prototype.init.call(this),this.push=function(f){var p=0,v=si,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[p]===Kn&&y[v]===Kn){this.trigger("data",y.subarray(p,v)),p+=si,v+=si;continue}p++,v++}p<y.byteLength&&(d.set(y.subarray(p),0),h=y.byteLength-p)},this.flush=function(){h===si&&d[0]===Kn&&(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")}},kr.prototype=new i,Bi=function(){var d,h,f,p;Bi.prototype.init.call(this),p=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,d=function(y,x){var C=0;x.payloadUnitStartIndicator&&(C+=y[C]+1),x.type==="pat"?h(y.subarray(C),x):f(y.subarray(C),x)},h=function(y,x){x.section_number=y[7],x.last_section_number=y[8],p.pmtPid=(y[10]&31)<<8|y[11],x.pmtPid=p.pmtPid},f=function(y,x){var C,P,w,I;if(y[5]&1){for(p.programMapTable={video:null,audio:null,"timed-metadata":{}},C=(y[1]&15)<<8|y[2],P=3+C-4,w=(y[10]&15)<<8|y[11],I=12+w;I<P;){var H=y[I],X=(y[I+1]&31)<<8|y[I+2];H===De.H264_STREAM_TYPE&&p.programMapTable.video===null?p.programMapTable.video=X:H===De.ADTS_STREAM_TYPE&&p.programMapTable.audio===null?p.programMapTable.audio=X:H===De.METADATA_STREAM_TYPE&&(p.programMapTable["timed-metadata"][X]=H),I+=((y[I+3]&15)<<8|y[I+4])+5}x.programMapTable=p.programMapTable}},this.push=function(v){var y={},x=4;if(y.payloadUnitStartIndicator=!!(v[1]&64),y.pid=v[1]&31,y.pid<<=8,y.pid|=v[2],(v[3]&48)>>>4>1&&(x+=v[x]+1),y.pid===0)y.type="pat",d(v.subarray(x),y),this.trigger("data",y);else if(y.pid===this.pmtPid)for(y.type="pmt",d(v.subarray(x),y),this.trigger("data",y);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([v,x,y]):this.processPes_(v,x,y)},this.processPes_=function(v,y,x){x.pid===this.programMapTable.video?x.streamType=De.H264_STREAM_TYPE:x.pid===this.programMapTable.audio?x.streamType=De.ADTS_STREAM_TYPE:x.streamType=this.programMapTable["timed-metadata"][x.pid],x.type="pes",x.data=v.subarray(y),this.trigger("data",x)}},Bi.prototype=new i,Bi.STREAM_TYPES={h264:27,adts:15},wr=function(){var d=this,h=!1,f={data:[],size:0},p={data:[],size:0},v={data:[],size:0},y,x=function(w,I){var H,X=w[0]<<16|w[1]<<8|w[2];I.data=new Uint8Array,X===1&&(I.packetLength=6+(w[4]<<8|w[5]),I.dataAlignmentIndicator=(w[6]&4)!==0,H=w[7],H&192&&(I.pts=(w[9]&14)<<27|(w[10]&255)<<20|(w[11]&254)<<12|(w[12]&255)<<5|(w[13]&254)>>>3,I.pts*=4,I.pts+=(w[13]&6)>>>1,I.dts=I.pts,H&64&&(I.dts=(w[14]&14)<<27|(w[15]&255)<<20|(w[16]&254)<<12|(w[17]&255)<<5|(w[18]&254)>>>3,I.dts*=4,I.dts+=(w[18]&6)>>>1)),I.data=w.subarray(9+w[8]))},C=function(w,I,H){var X=new Uint8Array(w.size),J={type:I},z=0,re=0,ke=!1,Ue;if(!(!w.data.length||w.size<9)){for(J.trackId=w.data[0].pid,z=0;z<w.data.length;z++)Ue=w.data[z],X.set(Ue.data,re),re+=Ue.data.byteLength;x(X,J),ke=I==="video"||J.packetLength<=w.size,(H||ke)&&(w.size=0,w.data.length=0),ke&&d.trigger("data",J)}};wr.prototype.init.call(this),this.push=function(P){({pat:function(){},pes:function(){var I,H;switch(P.streamType){case De.H264_STREAM_TYPE:I=f,H="video";break;case De.ADTS_STREAM_TYPE:I=p,H="audio";break;case De.METADATA_STREAM_TYPE:I=v,H="timed-metadata";break;default:return}P.payloadUnitStartIndicator&&C(I,H,!0),I.data.push(P),I.size+=P.data.byteLength},pmt:function(){var I={type:"metadata",tracks:[]};y=P.programMapTable,y.video!==null&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.video,codec:"avc",type:"video"}),y.audio!==null&&I.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+y.audio,codec:"adts",type:"audio"}),h=!0,d.trigger("data",I)}})[P.type]()},this.reset=function(){f.size=0,f.data.length=0,p.size=0,p.data.length=0,this.trigger("reset")},this.flushStreams_=function(){C(f,"video"),C(p,"audio"),C(v,"timed-metadata")},this.flush=function(){if(!h&&y){var P={type:"metadata",tracks:[]};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"}),d.trigger("data",P)}h=!1,this.flushStreams_(),this.trigger("done")}},wr.prototype=new i;var Zs={PAT_PID:0,MP2T_PACKET_LENGTH:si,TransportPacketStream:kr,TransportParseStream
44:Bi,ElementaryStream:wr,TimestampRolloverStream:$c,CaptionStream:Sr.CaptionStream,Cea608Stream:Sr.Cea608Stream,Cea708Stream:Sr.Cea708Stream,MetadataStream:Kc};for(var $n in De)De.hasOwnProperty($n)&&(Zs[$n]=De[$n]);var _t=Zs,Xc=de.ONE_SECOND_IN_TS,Pr,eo=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Pr=function(d){var h,f=0;Pr.prototype.init.call(this),this.skipWarn_=function(p,v){this.trigger("log",{level:"warn",message:"adts skiping bytes "+p+" to "+v+" in frame "+f+" outside syncword"})},this.push=function(p){var v=0,y,x,C,P,w;if(d||(f=0),p.type==="audio"){h&&h.length?(C=h,h=new Uint8Array(C.byteLength+p.data.byteLength),h.set(C),h.set(p.data,C.byteLength)):h=p.data;for(var I;v+7<h.length;){if(h[v]!==255||(h[v+1]&246)!==240){typeof I!="number"&&(I=v),v++;continue}if(typeof I=="number"&&(this.skipWarn_(I,v),I=null),x=(~h[v+1]&1)*2,y=(h[v+3]&3)<<11|h[v+4]<<3|(h[v+5]&224)>>5,P=((h[v+6]&3)+1)*1024,w=P*Xc/eo[(h[v+2]&60)>>>2],h.byteLength-v<y)break;this.trigger("data",{pts:p.pts+f*w,dts:p.dts+f*w,sampleCount:P,audioobjecttype:(h[v+2]>>>6&3)+1,channelcount:(h[v+2]&1)<<2|(h[v+3]&192)>>>6,samplerate:eo[(h[v+2]&60)>>>2],samplingfrequencyindex:(h[v+2]&60)>>>2,samplesize:16,data:h.subarray(v+7+x,v+y)}),f++,v+=y}typeof I=="number"&&(this.skipWarn_(I,v),I=null),h=h.subarray(v)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){h=void 0,this.trigger("reset")},this.endTimeline=function(){h=void 0,this.trigger("endedtimeline")}},Pr.prototype=new i;var to=Pr,io;io=function(d){var h=d.byteLength,f=0,p=0;this.length=function(){return 8*h},this.bitsAvailable=function(){return 8*h+p},this.loadWord=function(){var v=d.byteLength-h,y=new Uint8Array(4),x=Math.min(4,h);if(x===0)throw new Error("no bytes available");y.set(d.subarray(v,v+x)),f=new DataView(y.buffer).getUint32(0),p=x*8,h-=x},this.skipBits=function(v){var y;p>v?(f<<=v,p-=v):(v-=p,y=Math.floor(v/8),v-=y*8,h-=y,this.loadWord(),f<<=v,p-=v)},this.readBits=function(v){var y=Math.min(p,v),x=f>>>32-y;return p-=y,p>0?f<<=y:h>0&&this.loadWord(),y=v-y,y>0?x<<y|this.readBits(y):x},this.skipLeadingZeros=function(){var v;for(v=0;v<p;++v)if((f&2147483648>>>v)!==0)return f<<=v,p-=v,v;return this.loadWord(),v+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1},this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Qc=io,Ir,Ar,ro;Ar=function(){var d=0,h,f;Ar.prototype.init.call(this),this.push=function(p){var v;f?(v=new Uint8Array(f.byteLength+p.data.byteLength),v.set(f),v.set(p.data,f.byteLength),f=v):f=p.data;for(var y=f.byteLength;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")}},Ar.prototype=new i,ro={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ir=function(){var d=new Ar,h,f,p,v,y,x,C;Ir.prototype.init.call(this),h=this,this.push=function(P){P.type==="video"&&(f=P.trackId,p=P.pts,v=P.dts,d.push(P))},d.on("data",function(P){var w={trackId:f,pts:p,dts:v,data:P,nalUnitTypeCode:P[0]&31};switch(w.nalUnitTypeCode){case 5:w.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:w.nalUnitType="sei_rbsp",w.escapedRBSP=y(P.subarray(1));break;case 7:w.nalUnitType="seq_parameter_set_rbsp",w.escapedRBSP=y(P.subarray(1)),w.config=x(w.escapedRBSP);break;case 8:w.nalUnitType="pic_parameter_set_rbsp";break;case 9:w.nalUnitType="access_unit_delimiter_rbsp";break}h.trigger("data",w)}),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(w,I){var H=8,X=8,J,z;for(J=0;J<w;J++)X!==0&&(z=I.readExpGolomb(),X=(H+z+256)%256),H=X===0?H:X},y=function(w){for(var I=w.byteLength,H=[],X=1,J,z;X<I-2;
44)w[X]===0&&w[X+1]===0&&w[X+2]===3?(H.push(X+2),X+=2):X++;if(H.length===0)return w;J=I-H.length,z=new Uint8Array(J);var re=0;for(X=0;X<J;re++,X++)re===H[0]&&(re++,H.shift()),z[X]=w[re];return z},x=function(w){var I=0,H=0,X=0,J=0,z,re,ke,Ue,Wt,Yn,ko,wo,Po,Jn,Io,Se=[1,1],Ao,qt;if(z=new Qc(w),re=z.readUnsignedByte(),Ue=z.readUnsignedByte(),ke=z.readUnsignedByte(),z.skipUnsignedExpGolomb(),ro[re]&&(Wt=z.readUnsignedExpGolomb(),Wt===3&&z.skipBits(1),z.skipUnsignedExpGolomb(),z.skipUnsignedExpGolomb(),z.skipBits(1),z.readBoolean()))for(Io=Wt!==3?8:12,qt=0;qt<Io;qt++)z.readBoolean()&&(qt<6?C(16,z):C(64,z));if(z.skipUnsignedExpGolomb(),Yn=z.readUnsignedExpGolomb(),Yn===0)z.readUnsignedExpGolomb();else if(Yn===1)for(z.skipBits(1),z.skipExpGolomb(),z.skipExpGolomb(),ko=z.readUnsignedExpGolomb(),qt=0;qt<ko;qt++)z.skipExpGolomb();if(z.skipUnsignedExpGolomb(),z.skipBits(1),wo=z.readUnsignedExpGolomb(),Po=z.readUnsignedExpGolomb(),Jn=z.readBits(1),Jn===0&&z.skipBits(1),z.skipBits(1),z.readBoolean()&&(I=z.readUnsignedExpGolomb(),H=z.readUnsignedExpGolomb(),X=z.readUnsignedExpGolomb(),J=z.readUnsignedExpGolomb()),z.readBoolean()&&z.readBoolean()){switch(Ao=z.readUnsignedByte(),Ao){case 1:Se=[1,1];break;case 2:Se=[12,11];break;case 3:Se=[10,11];break;case 4:Se=[16,11];break;case 5:Se=[40,33];break;case 6:Se=[24,11];break;case 7:Se=[20,11];break;case 8:Se=[32,11];break;case 9:Se=[80,33];break;case 10:Se=[18,11];break;case 11:Se=[15,11];break;case 12:Se=[64,33];break;case 13:Se=[160,99];break;case 14:Se=[4,3];break;case 15:Se=[3,2];break;case 16:Se=[2,1];break;case 255:{Se=[z.readUnsignedByte()<<8|z.readUnsignedByte(),z.readUnsignedByte()<<8|z.readUnsignedByte()];break}}Se&&Se[0]/Se[1]}return{profileIdc:re,levelIdc:ke,profileCompatibility:Ue,width:(wo+1)*16-I*2-H*2,height:(2-Jn)*(Po+1)*16-X*2-J*2,sarRatio:Se}}},Ir.prototype=new i;var Yc={H264Stream:Ir},Jc=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],no=function(d,h){var f=d[h+6]<<21|d[h+7]<<14|d[h+8]<<7|d[h+9],p=d[h+5],v=(p&16)>>4;return f=f>=0?f:0,v?f+20:f+10},Zc=function T(d,h){return d.length-h<10||d[h]!==73||d[h+1]!==68||d[h+2]!==51?h:(h+=no(d,h),T(d,h))},ef=function(d){var h=Zc(d,0);return d.length>=h+2&&(d[h]&255)===255&&(d[h+1]&240)===240&&(d[h+1]&22)===16},ao=function(d){return d[0]<<21|d[1]<<14|d[2]<<7|d[3]},tf=function(d,h,f){var p,v="";for(p=h;p<f;p++)v+="%"+("00"+d[p].toString(16)).slice(-2);return v},rf=function(d,h,f){return unescape(tf(d,h,f))},nf=function(d,h){var f=(d[h+5]&224)>>5,p=d[h+4]<<3,v=d[h+3]&6144;return v|p|f},af=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},sf=function(d){for(var h=0;h+5<d.length;){if(d[h]!==255||(d[h+1]&246)!==240){h++;continue}return Jc[(d[h+2]&60)>>>2]}return null},of=function(d){var h,f,p,v;h=10,d[5]&64&&(h+=4,h+=ao(d.subarray(10,14)));do{if(f=ao(d.subarray(h+4,h+8)),f<1)return null;if(v=String.fromCharCode(d[h],d[h+1],d[h+2],d[h+3]),v==="PRIV"){p=d.subarray(h+10,h+f+10);for(var y=0;y<p.byteLength;y++)if(p[y]===0){var x=rf(p,0,y);if(x==="com.apple.streaming.transportStreamTimestamp"){var C=p.subarray(y+1),P=(C[3]&1)<<30|C[4]<<22|C[5]<<14|C[6]<<6|C[7]>>>2;return P*=4,P+=C[7]&3,P}break}}h+=10,h+=f}while(h<d.byteLength);return null},Or={isLikelyAacData:ef,parseId3TagSize:no,parseAdtsSize:nf,parseType:af,parseSampleRate:sf,parseAacTimestamp:of},Dr;Dr=function(){var d=new Uint8Array,h=0;Dr.prototype.init.call(this),this.setTimestamp=function(f){h=f},this.push=function(f){var p=0,v=0,y,x,C,P;for(d.length?(P=d.length,d=new Uint8Array(f.byteLength+P),d.set(d.subarray(0,P)),d.set(f,P)):d=f;d.length-v>=3;){if(d[v]===73&&d[v+1]===68&&d[v+2]===51){if(d.length-v<10||(p=Or.parseId3TagSize(d,v),v+p>d.length))break;x={type:"timed-metadata",data:d.subarray(v,v+p)},this.trigger("data",x),v+=p;continue}else if((d[v]&255)===255&&(d[v+1]&240)===240){if(d.length-v<7||(p=Or.parseAdtsSize(d,v),v+p>d.length))break;C={type:"audio",data:d.subarray(v,v+p),pts:h,dts:h},this.trigger("data",C),v+=p;continue}v++}y=d.length-v,y>0?d=d.subarray(v):d=new Uint8Array},this.reset=function(){d=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){d=new Uint8Array,this.trigger("endedtimeline")}},Dr.prototype=new i;var uf=Dr,lf=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],so=lf,df=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],oo=df,cf=Yc.H264Stream,ff=Or.isLikelyAacData,hf=de.ONE_SECOND_IN_TS,Lr,ji,Mr,jt,pf=function(d,h){h.stream=d,this.trigger("log",h)},uo=function(d,h){for(var f=Object.keys(h),p=0;p<f.length;p++){var v=f[p];v==="headOfPipeline"||!h[v].on||h[v].on("log",pf.bind(d,v))}},lo=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},co=function(d,h,f,p,v,y){var x=f-h,C=p-h,P=v-f;return{start:{dts:d,pts:d+x},end:{dts:d+C,pts:d+P},prependedContentDuration:y,baseMediaDecodeTime:d}};ji=function(d,h){var f=[],p,v=0,y=0,x=1/0;h=h||{},p=h.firstSequenceNumber||0,ji.prototype.init.call(this),this.push=function(C){nt.collectDtsInfo(d,C),d&&so.forEac
44h(function(P){d[P]=C[P]}),f.push(C)},this.setEarliestDts=function(C){v=C},this.setVideoBaseMediaDecodeTime=function(C){x=C},this.setAudioAppendStart=function(C){y=C},this.flush=function(){var C,P,w,I,H,X,J;if(f.length===0){this.trigger("done","AudioSegmentStream");return}C=vr.trimAdtsFramesByEarliestDts(f,d,v),d.baseMediaDecodeTime=nt.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),J=vr.prefixWithSilence(d,C,y,x),d.samples=vr.generateSampleTable(C),w=dt.mdat(vr.concatenateFrameData(C)),f=[],P=dt.moof(p,[d]),I=new Uint8Array(P.byteLength+w.byteLength),p++,I.set(P),I.set(w,P.byteLength),nt.clearDtsInfo(d),H=Math.ceil(hf*1024/d.samplerate),C.length&&(X=C.length*H,this.trigger("segmentTimingInfo",co(de.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),C[0].dts,C[0].pts,C[0].dts+X,C[0].pts+X,J||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+X})),this.trigger("data",{track:d,boxes:I}),this.trigger("done","AudioSegmentStream")},this.reset=function(){nt.clearDtsInfo(d),f=[],this.trigger("reset")}},ji.prototype=new i,Lr=function(d,h){var f,p=[],v=[],y,x;h=h||{},f=h.firstSequenceNumber||0,Lr.prototype.init.call(this),delete d.minPTS,this.gopCache_=[],this.push=function(C){nt.collectDtsInfo(d,C),C.nalUnitType==="seq_parameter_set_rbsp"&&!y&&(y=C.config,d.sps=[C.data],oo.forEach(function(P){d[P]=y[P]},this)),C.nalUnitType==="pic_parameter_set_rbsp"&&!x&&(x=C.data,d.pps=[C.data]),p.push(C)},this.flush=function(){for(var C,P,w,I,H,X,J=0,z,re;p.length&&p[0].nalUnitType!=="access_unit_delimiter_rbsp";)p.shift();if(p.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(C=Ni.groupNalsIntoFrames(p),w=Ni.groupFramesIntoGops(C),w[0][0].keyFrame||(P=this.getGopForFusion_(p[0],d),P?(J=P.duration,w.unshift(P),w.byteLength+=P.byteLength,w.nalCount+=P.nalCount,w.pts=P.pts,w.dts=P.dts,w.duration+=P.duration):w=Ni.extendFirstKeyFrame(w)),v.length){var ke;if(h.alignGopsAtEnd?ke=this.alignGopsAtEnd_(w):ke=this.alignGopsAtStart_(w),!ke){this.gopCache_.unshift({gop:w.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),p=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}nt.clearDtsInfo(d),w=ke}nt.collectDtsInfo(d,w),d.samples=Ni.generateSampleTable(w),H=dt.mdat(Ni.concatenateNalData(w)),d.baseMediaDecodeTime=nt.calculateTrackBaseMediaDecodeTime(d,h.keepOriginalTimestamps),this.trigger("processedGopsInfo",w.map(function(Ue){return{pts:Ue.pts,dts:Ue.dts,byteLength:Ue.byteLength}})),z=w[0],re=w[w.length-1],this.trigger("segmentTimingInfo",co(d.baseMediaDecodeTime,z.dts,z.pts,re.dts+re.duration,re.pts+re.duration,J)),this.trigger("timingInfo",{start:w[0].pts,end:w[w.length-1].pts+w[w.length-1].duration}),this.gopCache_.unshift({gop:w.pop(),pps:d.pps,sps:d.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),p=[],this.trigger("baseMediaDecodeTime",d.baseMediaDecodeTime),this.trigger("timelineStartInfo",d.timelineStartInfo),I=dt.moof(f,[d]),X=new Uint8Array(I.byteLength+H.byteLength),f++,X.set(I),X.set(H,I.byteLength),this.trigger("data",{track:d,boxes:X}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),p=[],this.gopCache_.length=0,v.length=0,this.trigger("reset")},this.resetStream_=function(){nt.clearDtsInfo(d),y=void 0,x=void 0},this.getGopForFusion_=function(C){var P=45e3,w=1/0,I,H,X,J,z;for(z=0;z<this.gopCache_.length;z++)J=this.gopCache_[z],X=J.gop,!(!(d.pps&&lo(d.pps[0],J.pps[0]))||!(d.sps&&lo(d.sps[0],J.sps[0])))&&(X.dts<d.timelineStartInfo.dts||(I=C.dts-X.dts-X.duration,I>=-1e4&&I<=P&&(!H||w>I)&&(H=J,w=I)));return H?H.gop:null},this.alignGopsAtStart_=function(C){var P,w,I,H,X,J,z,re;for(X=C.byteLength,J=C.nalCount,z=C.duration,P=w=0;P<v.length&&w<C.length&&(I=v[P],H=C[w],I.pts!==H.pts);){if(H.pts>I.pts){P++;continue}w++,X-=H.byteLength,J-=H.nalCount,z-=H.duration}return w===0?C:w===C.length?null:(re=C.slice(w),re.byteLength=X,re.duration=z,re.nalCount=J,re.pts=re[0].pts,re.dts=re[0].dts,re)},this.alignGopsAtEnd_=function(C){var P,w,I,H,X,J;for(P=v.length-1,w=C.length-1,X=null,J=!1;P>=0&&w>=0;){if(I=v[P],H=C[w],I.pts===H.pts){J=!0;break}if(I.pts>H.pts){P--;continue}P===v.length-1&&(X=w),w--}if(!J&&X===null)return null;var z;if(J?z=w:z=X,z===0)return C;var re=C.slice(z),ke=re.reduce(function(Ue,Wt){return Ue.byteLength+=Wt.byteLength,Ue.duration+=Wt.duration,Ue.nalCount+=Wt.nalCount,Ue},{byteLength:0,duration:0,nalCount:0});return re.byteLength=ke.byteLength,re.duration=ke.duration,re.nalCount=ke.nalCount,re.pts=re[0].pts,re.dts=re[0].dts,re},this.alignGopsWith=function(C){v=C}},Lr.prototype=new i,jt=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,jt.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))}},jt.prototype=new i,jt.prototype.flush=function(T){var d=0,h={captions:[],captionStream
44s:{},metadata:[],info:{}},f,p,v,y=0,x;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,oo.forEach(function(C){h.info[C]=this.videoTrack[C]},this)):this.audioTrack&&(y=this.audioTrack.timelineStartInfo.pts,so.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=dt.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(v.byteLength),h.initSegment.set(v),h.data=new Uint8Array(this.pendingBytes),x=0;x<this.pendingBoxes.length;x++)h.data.set(this.pendingBoxes[x],d),d+=this.pendingBoxes[x].byteLength;for(x=0;x<this.pendingCaptions.length;x++)f=this.pendingCaptions[x],f.startTime=de.metadataTsToSeconds(f.startPts,y,this.keepOriginalTimestamps),f.endTime=de.metadataTsToSeconds(f.endPts,y,this.keepOriginalTimestamps),h.captionStreams[f.stream]=!0,h.captions.push(f);for(x=0;x<this.pendingMetadata.length;x++)p=this.pendingMetadata[x],p.cueTime=de.metadataTsToSeconds(p.pts,y,this.keepOriginalTimestamps),h.metadata.push(p);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),x=0;x<h.captions.length;x++)f=h.captions[x],this.trigger("caption",f);for(x=0;x<h.metadata.length;x++)p=h.metadata[x],this.trigger("id3Frame",p)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},jt.prototype.setRemux=function(T){this.remuxTracks=T},Mr=function(d){var h=this,f=!0,p,v;Mr.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 _t.MetadataStream,y.aacStream=new uf,y.audioTimestampRolloverStream=new _t.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new _t.TimestampRolloverStream("timed-metadata"),y.adtsStream=new to,y.coalesceStream=new jt(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(x){y.aacStream.setTimestamp(x.timeStamp)}),y.aacStream.on("data",function(x){x.type!=="timed-metadata"&&x.type!=="audio"||y.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new ji(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!p}))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),uo(this,y)},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new _t.MetadataStream,y.packetStream=new _t.TransportPacketStream,y.parseStream=new _t.TransportParseStream,y.elementaryStream=new _t.ElementaryStream,y.timestampRolloverStream=new _t.TimestampRolloverStream,y.adtsStream=new to,y.h264Stream=new cf,y.captionStream=new _t.CaptionStream(d),y.coalesceStream=new jt(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(x){var C;if(x.type==="metadata"){for(C=x.tracks.length;C--;)!p&&x.tracks[C].type==="video"?(p=x.tracks[C],p.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):!v&&x.tracks[C].type==="audio"&&(v=x.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime);p&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new Lr(p,d),y.videoSegmentStream.on("log",h.getLogTrigger_("videoSegmentStream")),y.videoSegmentStream.on("timelineStartInfo",function(P){v&&!d.keepOriginalTimestamps&&(v.timelineStartInfo=P,y.audioSegmentStream.setEarliestDts(P.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(P){v&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(P)}
44),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 ji(v,d),y.audioSegmentStream.on("log",h.getLogTrigger_("audioSegmentStream")),y.audioSegmentStream.on("timingInfo",h.trigger.bind(h,"audioTimingInfo")),y.audioSegmentStream.on("segmentTimingInfo",h.trigger.bind(h,"audioSegmentTimingInfo")),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream)),h.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!p})}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("id3Frame",function(x){x.dispatchType=y.metadataStream.dispatchType,h.trigger("id3Frame",x)}),y.coalesceStream.on("caption",this.trigger.bind(this,"caption")),y.coalesceStream.on("done",this.trigger.bind(this,"done")),uo(this,y)},this.setBaseMediaDecodeTime=function(y){var x=this.transmuxPipeline_;d.keepOriginalTimestamps||(this.baseMediaDecodeTime=y),v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,nt.clearDtsInfo(v),x.audioTimestampRolloverStream&&x.audioTimestampRolloverStream.discontinuity()),p&&(x.videoSegmentStream&&(x.videoSegmentStream.gopCache_=[]),p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,nt.clearDtsInfo(p),x.captionStream.reset()),x.timestampRolloverStream&&x.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.setRemux=function(y){var x=this.transmuxPipeline_;d.remux=y,x&&x.coalesceStream&&x.coalesceStream.setRemux(y)},this.alignGopsWith=function(y){p&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(y)},this.getLogTrigger_=function(y){var x=this;return function(C){C.stream=y,x.trigger("log",C)}},this.push=function(y){if(f){var x=ff(y);x&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!x&&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()}},Mr.prototype=new i;var mf={Transmuxer:Mr},gf=function(d){return d>>>0},vf=function(d){return("00"+d.toString(16)).slice(-2)},Fr={toUnsigned:gf,toHexString:vf},yf=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},Vt=yf,_f=Fr.toUnsigned,Tf=function T(d,h){var f=[],p,v,y,x,C;if(!h.length)return null;for(p=0;p<d.byteLength;)v=_f(d[p]<<24|d[p+1]<<16|d[p+2]<<8|d[p+3]),y=Vt(d.subarray(p+4,p+8)),x=v>1?p+v:d.byteLength,y===h[0]&&(h.length===1?f.push(d.subarray(p+8,x)):(C=T(d.subarray(p+8,x),h.slice(1)),C.length&&(f=f.concat(C)))),p=x;return f},ge=Tf,bf=Fr.toUnsigned,Sf=e.getUint64,xf=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4))};return h.version===1?h.baseMediaDecodeTime=Sf(d.subarray(4)):h.baseMediaDecodeTime=bf(d[4]<<24|d[5]<<16|d[6]<<8|d[7]),h},fo=xf,Ef=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]}},ho=Ef,Cf=function(d){var h={version:d[0],flags:new Uint8Array(d.subarray(1,4)),samples:[]},f=new DataView(d.buffer,d.byteOffset,d.byteLength),p=h.flags[2]&1,v=h.flags[2]&4,y=h.flags[1]&1,x=h.flags[1]&2,C=h.flags[1]&4,P=h.flags[1]&8,w=f.getUint32(4),I=8,H;for(p&&(h.dataOffset=f.getInt32(I),I+=4),v&&w&&(H={flags:ho(d.subarray(I,I+4))},I+=4,y&&(H.duration=f.getUint32(I),I+=4),x&&(H.size=f.getUint32(I),I+=4),P&&(h.version===1?H.compositionTimeOffset=f.getInt32(I):H.compositionTimeOffset=f.getUint32(I),I+=4),h.samples.push(H),w--);w--;)H={},y&&(H.duration=f.getUint32(I),I+=4),x&&(H.size=f.getUint32(I),I+=4),C&&(H.flags=ho(d.subarray(I,I+4)),I+=4),P&&(h.version===1?H.compositionTimeOffset=f.getInt32(I):H.compositionTimeOffset=f.getUint32(I),I+=4),h.samples.push(H);return h},po=Cf,kf=function(d){var h=new DataView(d.buffer,d.byteOffset,d.byteLength),f={version:d[0],flags:new Uint8Array(d.subarray(1,4)),trackId:h.getUint32(4)},p=f.flags[2]&1,v=f.flags[2]&2,y=f.flags[2]&8,x=f.flags[2]&16,C=f.flags[2]&32,P=f.flags[0]&65536,w=f.flags[0]&131072,I;return I=8,p&&(I+=4,f.baseDataOffset=h.getUint32(12),I+=4),v&&(f.sampleDescriptionIndex=h.getUint32(I),I+=4),y&&(f.defaultSampleDuration=h.getUint32(I),I+=4),x&&(f.defaultSampleSize=h.getUint32(I),I+=4),C&&(f.defaultSampleFlags=h.getUint32(I)),P&&(f.durationIsEmpty=!0),!p&&w&&(f.baseDataOffsetIsMoof=!0),f},mo=kf,go=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vi;typeof window<"u"?Vi=window:typeof go<"u"?Vi=go:typeof self<"u"?Vi=self:Vi={};var Hi=Vi,wf=Ui.discardEmulationPreventionBytes,Pf=Sr.CaptionStream,If=function(d,h){for(var f=d,p=0;p<h.length;p++){var v=h[p];if(f<v.size)return v;f-=v.size}return null},Af=function(d,h,f){var p=new DataView(d.buffer,d.byteOffset,d.byteLength),v={logs:[],seiNals:[]},y,x,C,P;for(x=0;x+4<d.length;x+=C)if(C=p.getUint32(x),x+=4,!(C<=0))switch(d[x]&31){case 6:var w=d.subarray(x+1,x+1+C),I=If(x,h);if(y={nalUnitType:"sei_rbsp",size:C,data:w,escapedRBSP:wf(w),trackId:f},I)y.pts=I.pts,y.dts=I.dts,P=I;else if(P)y.pts=P.pts,y.dts=P.dts;else{v.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+x+" for trackId "+f+". See mux.js#223."});break}v.seiNals.push(y);break}return v},Of=function(d,h,f){var p=h,v=f.defaultSampleDuration||0,y=f.defaultSampleSize||0,x=f.trackId,C=[];return d.forEach(function(P){var w=po(P),I=w.samples;I.forEach(function(H){H.duration===void 0&&(H.duration=v),H.size===void 0&&(H.size=y),H.trackId=x,H.dts=p,H.compositionTimeOffset===void 0&&(H.compositionTimeOffset=0),typeof p=="bigint"?(H.pts=p+Hi.BigInt(H.compositionTimeOffset),p+=Hi.BigInt(H.duration)):(H.pts=p+H.compositionTimeOffset,p+=H.duration)}
44),C=C.concat(I)}),C},Df=function(d,h){var f=ge(d,["moof","traf"]),p=ge(d,["mdat"]),v={},y=[];return p.forEach(function(x,C){var P=f[C];y.push({mdat:x,traf:P})}),y.forEach(function(x){var C=x.mdat,P=x.traf,w=ge(P,["tfhd"]),I=mo(w[0]),H=I.trackId,X=ge(P,["tfdt"]),J=X.length>0?fo(X[0]).baseMediaDecodeTime:0,z=ge(P,["trun"]),re,ke;h===H&&z.length>0&&(re=Of(z,J,I),ke=Af(C,re,H),v[H]||(v[H]={seiNals:[],logs:[]}),v[H].seiNals=v[H].seiNals.concat(ke.seiNals),v[H].logs=v[H].logs.concat(ke.logs))}),v},Lf=function(d,h,f){var p;if(h===null)return null;p=Df(d,h);var v=p[h]||{};return{seiNals:v.seiNals,logs:v.logs,timescale:f}},Mf=function(){var d=!1,h,f,p,v,y,x;this.isInitialized=function(){return d},this.init=function(C){h=new Pf,d=!0,x=C?C.isPartial:!1,h.on("data",function(P){P.startTime=P.startPts/v,P.endTime=P.endPts/v,y.captions.push(P),y.captionStreams[P.stream]=!0}),h.on("log",function(P){y.logs.push(P)})},this.isNewInit=function(C,P){return C&&C.length===0||P&&typeof P=="object"&&Object.keys(P).length===0?!1:p!==C[0]||v!==P[p]},this.parse=function(C,P,w){var I;if(this.isInitialized()){if(!P||!w)return null;if(this.isNewInit(P,w))p=P[0],v=w[p];else if(p===null||!v)return f.push(C),null}else return null;for(;f.length>0;){var H=f.shift();this.parse(H,P,w)}return I=Lf(C,p,v),I&&I.logs&&(y.logs=y.logs.concat(I.logs)),I===null||!I.seiNals?y.logs.length?{logs:y.logs,captions:[],captionStreams:[]}:null:(this.pushNals(I.seiNals),this.flushStream(),y)},this.pushNals=function(C){if(!this.isInitialized()||!C||C.length===0)return null;C.forEach(function(P){h.push(P)})},this.flushStream=function(){if(!this.isInitialized())return null;x?h.partialFlush():h.flush()},this.clearParsedCaptions=function(){y.captions=[],y.captionStreams={},y.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;h.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){f=[],p=null,v=null,y?this.clearParsedCaptions():y={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ff=Mf,Rr=Fr.toUnsigned,Wi=Fr.toHexString,Rf=e.getUint64,vo,yo,_o,To,bo,Xn;vo=function(d){var h={},f=ge(d,["moov","trak"]);return f.reduce(function(p,v){var y,x,C,P,w;return y=ge(v,["tkhd"])[0],!y||(x=y[0],C=x===0?12:20,P=Rr(y[C]<<24|y[C+1]<<16|y[C+2]<<8|y[C+3]),w=ge(v,["mdia","mdhd"])[0],!w)?null:(x=w[0],C=x===0?12:20,p[P]=Rr(w[C]<<24|w[C+1]<<16|w[C+2]<<8|w[C+3]),p)},h)},yo=function(d,h){var f;f=ge(h,["moof","traf"]);var p=f.reduce(function(v,y){var x=ge(y,["tfhd"])[0],C=Rr(x[4]<<24|x[5]<<16|x[6]<<8|x[7]),P=d[C]||9e4,w=ge(y,["tfdt"])[0],I=new DataView(w.buffer,w.byteOffset,w.byteLength),H;w[0]===1?H=Rf(w.subarray(4,12)):H=I.getUint32(4);var X;return typeof H=="bigint"?X=H/Hi.BigInt(P):typeof H=="number"&&!isNaN(H)&&(X=H/P),X<Number.MAX_SAFE_INTEGER&&(X=Number(X)),X<v&&(v=X),v},1/0);return typeof p=="bigint"||isFinite(p)?p:0},_o=function(d,h){var f=ge(h,["moof","traf"]),p=0,v=0,y;if(f&&f.length){var x=ge(f[0],["tfhd"])[0],C=ge(f[0],["trun"])[0],P=ge(f[0],["tfdt"])[0];if(x){var w=mo(x);y=w.trackId}if(P){var I=fo(P);p=I.baseMediaDecodeTime}if(C){var H=po(C);H.samples&&H.samples.length&&(v=H.samples[0].compositionTimeOffset||0)}}var X=d[y]||9e4;typeof p=="bigint"&&(v=Hi.BigInt(v),X=Hi.BigInt(X));var J=(p+v)/X;return typeof J=="bigint"&&J<Number.MAX_SAFE_INTEGER&&(J=Number(J)),J},To=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(p){var v=ge(p,["mdia","hdlr"]),y=ge(p,["tkhd"]);v.forEach(function(x,C){var P=Vt(x.subarray(8,12)),w=y[C],I,H,X;P==="vide"&&(I=new DataView(w.buffer,w.byteOffset,w.byteLength),H=I.getUint8(0),X=H===0?I.getUint32(12):I.getUint32(20),f.push(X))})}),f},Xn=function(d){var h=d[0],f=h===0?12:20;return Rr(d[f]<<24|d[f+1]<<16|d[f+2]<<8|d[f+3])},bo=function(d){var h=ge(d,["moov","trak"]),f=[];return h.forEach(function(p){var v={},y=ge(p,["tkhd"])[0],x,C;y&&(x=new DataView(y.buffer,y.byteOffset,y.byteLength),C=x.getUint8(0),v.id=C===0?x.getUint32(12):x.getUint32(20));var P=ge(p,["mdia","hdlr"])[0];if(P){var w=Vt(P.subarray(8,12));w==="vide"?v.type="video":w==="soun"?v.type="audio":v.type=w}var I=ge(p,["mdia","minf","stbl","stsd"])[0];
44if(I){var H=I.subarray(8);v.codec=Vt(H.subarray(4,8));var X=ge(H,[v.codec])[0],J,z;X&&(/^[asm]vc[1-9]$/i.test(v.codec)?(J=X.subarray(78),z=Vt(J.subarray(4,8)),z==="avcC"&&J.length>11?(v.codec+=".",v.codec+=Wi(J[9]),v.codec+=Wi(J[10]),v.codec+=Wi(J[11])):v.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(v.codec)?(J=X.subarray(28),z=Vt(J.subarray(4,8)),z==="esds"&&J.length>20&&J[19]!==0?(v.codec+="."+Wi(J[19]),v.codec+="."+Wi(J[20]>>>2&63).replace(/^0/,"")):v.codec="mp4a.40.2"):v.codec=v.codec.toLowerCase())}var re=ge(p,["mdia","mdhd"])[0];re&&(v.timescale=Xn(re)),f.push(v)}),f};var So={findBox:ge,parseType:Vt,timescale:vo,startTime:yo,compositionStartTime:_o,videoTrackIds:To,tracks:bo,getTimescaleFromMediaHeader:Xn},xo=function(d){var h=d[1]&31;return h<<=8,h|=d[2],h},Nr=function(d){return!!(d[1]&64)},Ur=function(d){var h=0;return(d[3]&48)>>>4>1&&(h+=d[4]+1),h},Nf=function(d,h){var f=xo(d);return f===0?"pat":f===h?"pmt":h?"pes":null},Uf=function(d){var h=Nr(d),f=4+Ur(d);return h&&(f+=d[f]+1),(d[f+10]&31)<<8|d[f+11]},Bf=function(d){var h={},f=Nr(d),p=4+Ur(d);if(f&&(p+=d[p]+1),!!(d[p+5]&1)){var v,y,x;v=(d[p+1]&15)<<8|d[p+2],y=3+v-4,x=(d[p+10]&15)<<8|d[p+11];for(var C=12+x;C<y;){var P=p+C;h[(d[P+1]&31)<<8|d[P+2]]=d[P],C+=((d[P+3]&15)<<8|d[P+4])+5}return h}},jf=function(d,h){var f=xo(d),p=h[f];switch(p){case De.H264_STREAM_TYPE:return"video";case De.ADTS_STREAM_TYPE:return"audio";case De.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Vf=function(d){var h=Nr(d);if(!h)return null;var f=4+Ur(d);if(f>=d.byteLength)return null;var p=null,v;return v=d[f+7],v&192&&(p={},p.pts=(d[f+9]&14)<<27|(d[f+10]&255)<<20|(d[f+11]&254)<<12|(d[f+12]&255)<<5|(d[f+13]&254)>>>3,p.pts*=4,p.pts+=(d[f+13]&6)>>>1,p.dts=p.pts,v&64&&(p.dts=(d[f+14]&14)<<27|(d[f+15]&255)<<20|(d[f+16]&254)<<12|(d[f+17]&255)<<5|(d[f+18]&254)>>>3,p.dts*=4,p.dts+=(d[f+18]&6)>>>1)),p},Qn=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}},Hf=function(d){for(var h=4+Ur(d),f=d.subarray(h),p=0,v=0,y=!1,x;v<f.byteLength-3;v++)if(f[v+2]===1){p=v+5;break}for(;p<f.byteLength;)switch(f[p]){case 0:if(f[p-1]!==0){p+=2;break}else if(f[p-2]!==0){p++;break}v+3!==p-2&&(x=Qn(f[v+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0));do p++;while(f[p]!==1&&p<f.length);v=p-2,p+=3;break;case 1:if(f[p-1]!==0||f[p-2]!==0){p+=3;break}x=Qn(f[v+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0),v=p-2,p+=3;break;default:p+=3;break}return f=f.subarray(v),p-=v,v=0,f&&f.byteLength>3&&(x=Qn(f[v+3]&31),x==="slice_layer_without_partitioning_rbsp_idr"&&(y=!0)),y},Wf={parseType:Nf,parsePat:Uf,parsePmt:Bf,parsePayloadUnitStartIndicator:Nr,parsePesType:jf,parsePesTime:Vf,videoPacketContainsKeyFrame:Hf},oi=Qs.handleRollover,he={};he.ts=Wf,he.aac=Or;var Ht=de.ONE_SECOND_IN_TS,Ne=188,ct=71,qf=function(d,h){for(var f=0,p=Ne,v,y;p<d.byteLength;){if(d[f]===ct&&d[p]===ct){switch(v=d.subarray(f,p),y=he.ts.parseType(v,h.pid),y){case"pat":h.pid=he.ts.parsePat(v);break;case"pmt":var x=he.ts.parsePmt(v);h.table=h.table||{},Object.keys(x).forEach(function(C){h.table[C]=x[C]});break}f+=Ne,p+=Ne;continue}f++,p++}},Eo=function(d,h,f){for(var p=0,v=Ne,y,x,C,P,w,I=!1;v<=d.byteLength;){if(d[p]===ct&&(d[v]===ct||v===d.byteLength)){switch(y=d.subarray(p,v),x=he.ts.parseType(y,h.pid),x){case"pes":C=he.ts.parsePesType(y,h.table),P=he.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&P&&(w=he.ts.parsePesTime(y),w&&(w.type="audio",f.audio.push(w),I=!0));break}if(I)break;p+=Ne,v+=Ne;continue}p++,v++}for(v=d.byteLength,p=v-Ne,I=!1;p>=0;){if(d[p]===ct&&(d[v]===ct||v===d.byteLength)){switch(y=d.subarray(p,v),x=he.ts.parseType(y,h.pid),x){case"pes":C=he.ts.parsePesType(y,h.table),P=he.ts.parsePayloadUnitStartIndicator(y),C==="audio"&&P&&(w=he.ts.parsePesTime(y),w&&(w.type="audio",f.audio.push(w),I=!0));break}if(I)break;p-=Ne,v-=Ne;continue}p--,v--}},Gf=function(d,h,f){for(var p=0,v=Ne,y,x,C,P,w,I,H,X,J=!1,z={data:[],size:0};v<d.byteLength;){if(d[p]===ct&&d[v]===ct){switch(y=d.subarray(p,v),x=he.ts.parseType(y,h.pid),x){case"pes":if(C=he.ts.parsePesType(y,h.table),P=he.ts.parsePayloadUnitStartIndicator(y),C==="video"&&(P&&!J&&(w=he.ts.parsePesTime(y),w&&(w.type="video",f.video.push(w),J=!0)),!f.firstKeyFrame)){if(P&&z.size!==0){for(I=new Uint8Array(z.size),H=0;z.data.length;)X=z.data.shift(),I.set(X,H),H+=X.byteLength;if(he.ts.videoPacketContainsKeyFrame(I)){var re=he.ts.parsePesTime(I);re?(f.firstKeyFrame=re,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.")}z.size=0}z.data.push(y),z.size+=y.byteLength}break}if(J&&f.firstKeyFrame)break;p+=Ne,v+=Ne;continue}p++,v++}for(v=d.byteLength,p=v-Ne,J=!1;p>=0;){if(d[p]===ct&&d[v]===ct){switch(y=d.subarray(p,v),x=he.ts.parseType(y,h.pid),x){case"pes":C=he.ts.parsePesType(y,h.table),P=he.ts.parsePayloadUnitStartIndicator(y),C==="video"&&P&&(w=he.ts.parsePesTime(y),w&&(w.type="video",f.video.push(w),J=!0));break}if(J)break;p-=Ne,v-=Ne;continue}p--,v--}
44},zf=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=oi(y.dts,f),y.pts=oi(y.pts,f),y.dtsTime=y.dts/Ht,y.ptsTime=y.pts/Ht})}if(d.video&&d.video.length){var p=h;if((typeof p>"u"||isNaN(p))&&(p=d.video[0].dts),d.video.forEach(function(y){y.dts=oi(y.dts,p),y.pts=oi(y.pts,p),y.dtsTime=y.dts/Ht,y.ptsTime=y.pts/Ht}),d.firstKeyFrame){var v=d.firstKeyFrame;v.dts=oi(v.dts,p),v.pts=oi(v.pts,p),v.dtsTime=v.dts/Ht,v.ptsTime=v.pts/Ht}}},Kf=function(d){for(var h=!1,f=0,p=null,v=null,y=0,x=0,C;d.length-x>=3;){var P=he.aac.parseType(d,x);switch(P){case"timed-metadata":if(d.length-x<10){h=!0;break}if(y=he.aac.parseId3TagSize(d,x),y>d.length){h=!0;break}v===null&&(C=d.subarray(x,x+y),v=he.aac.parseAacTimestamp(C)),x+=y;break;case"audio":if(d.length-x<7){h=!0;break}if(y=he.aac.parseAdtsSize(d,x),y>d.length){h=!0;break}p===null&&(C=d.subarray(x,x+y),p=he.aac.parseSampleRate(C)),f++,x+=y;break;default:x++;break}if(h)return null}if(p===null||v===null)return null;var w=Ht/p,I={audio:[{type:"audio",dts:v,pts:v},{type:"audio",dts:v+f*1024*w,pts:v+f*1024*w}]};return I},$f=function(d){var h={pid:null,table:null},f={};qf(d,h);for(var p in h.table)if(h.table.hasOwnProperty(p)){var v=h.table[p];switch(v){case De.H264_STREAM_TYPE:f.video=[],Gf(d,h,f),f.video.length===0&&delete f.video;break;case De.ADTS_STREAM_TYPE:f.audio=[],Eo(d,h,f),f.audio.length===0&&delete f.audio;break}}return f},Xf=function(d,h){var f=he.aac.isLikelyAacData(d),p;return f?p=Kf(d):p=$f(d),!p||!p.audio&&!p.video?null:(zf(p,h),p)},Qf={inspect:Xf,parseAudioPes_:Eo},Yf=function(d,h){h.on("data",function(f){var p=f.initSegment;f.initSegment={data:p.buffer,byteOffset:p.byteOffset,byteLength:p.byteLength};var v=f.data;f.data=v.buffer,d.postMessage({action:"data",segment:f,byteOffset:v.byteOffset,byteLength:v.byteLength},[f.data])}),h.on("done",function(f){d.postMessage({action:"done"})}),h.on("gopInfo",function(f){d.postMessage({action:"gopInfo",gopInfo:f})}),h.on("videoSegmentTimingInfo",function(f){var p={start:{decode:de.videoTsToSeconds(f.start.dts),presentation:de.videoTsToSeconds(f.start.pts)},end:{decode:de.videoTsToSeconds(f.end.dts),presentation:de.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(p.prependedContentDuration=de.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:p})}),h.on("audioSegmentTimingInfo",function(f){var p={start:{decode:de.videoTsToSeconds(f.start.dts),presentation:de.videoTsToSeconds(f.start.pts)},end:{decode:de.videoTsToSeconds(f.end.dts),presentation:de.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:de.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(p.prependedContentDuration=de.videoTsToSeconds(f.prependedContentDuration)),d.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:p})}),h.on("id3Frame",function(f){d.postMessage({action:"id3Frame",id3Frame:f})}),h.on("caption",function(f){d.postMessage({action:"caption",caption:f})}),h.on("trackinfo",function(f){d.postMessage({action:"trackinfo",trackInfo:f})}),h.on("audioTimingInfo",function(f){d.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:de.videoTsToSeconds(f.start),end:de.videoTsToSeconds(f.end)}})}),h.on("videoTimingInfo",function(f){d.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:de.videoTsToSeconds(f.start),end:de.videoTsToSeconds(f.end)}})}),h.on("log",function(f){d.postMessage({action:"log",log:f})})},Co=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 mf.Transmuxer(this.options),Yf(this.self,this.transmuxer)},d.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Ff,this.captionParser.init());var p=new Uint8Array(f.data,f.byteOffset,f.byteLength),v=this.captionParser.parse(p,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:v&&v.captions||[],logs:v&&v.logs||[],data:p.buffer},[p.buffer])}
44,d.probeMp4StartTime=function(f){var p=f.timescales,v=f.data,y=So.startTime(p,v);this.self.postMessage({action:"probeMp4StartTime",startTime:y,data:v},[v.buffer])},d.probeMp4Tracks=function(f){var p=f.data,v=So.tracks(p);this.self.postMessage({action:"probeMp4Tracks",tracks:v,data:p},[p.buffer])},d.probeTs=function(f){var p=f.data,v=f.baseStartTime,y=typeof v=="number"&&!isNaN(v)?v*de.ONE_SECOND_IN_TS:void 0,x=Qf.inspect(p,y),C=null;x&&(C={hasVideo:x.video&&x.video.length===2||!1,hasAudio:x.audio&&x.audio.length===2||!1},C.hasVideo&&(C.videoStart=x.video[0].ptsTime),C.hasAudio&&(C.audioStart=x.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:C,data:p},[p.buffer])},d.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},d.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},d.push=function(f){var p=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(p)},d.reset=function(){this.transmuxer.reset()},d.setTimestampOffset=function(f){var p=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(de.secondsToVideoTs(p)))},d.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(de.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 Co(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new Co(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}})),iv=Wd(tv),rv=function(i,n,r){var e=i.data.segment,t=e.type,a=e.initSegment,o=e.captions,u=e.captionStreams,l=e.metadata,c=e.videoFrameDtsTime,g=e.videoFramePtsTime;n.buffer.push({captions:o,captionStreams:u,metadata:l});var m=i.data.segment.boxes||{data:i.data.segment.data},_={type:t,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof c<"u"&&(_.videoFrameDtsTime=c),typeof g<"u"&&(_.videoFramePtsTime=g),r(_)},nv=function(i){var n=i.transmuxedData,r=i.callback;n.buffer=[],r(n)},av=function(i,n){n.gopInfo=i.data.gopInfo},zd=function(i){var n=i.transmuxer,r=i.bytes,e=i.audioAppendStart,t=i.gopsToAlignWith,a=i.remux,o=i.onData,u=i.onTrackInfo,l=i.onAudioTimingInfo,c=i.onVideoTimingInfo,g=i.onVideoSegmentTimingInfo,m=i.onAudioSegmentTimingInfo,_=i.onId3,b=i.onCaptions,E=i.onDone,S=i.onEndedTimeline,R=i.onTransmuxerLog,F=i.isEndOfTimeline,B={buffer:[]},O=F,L=function(W){n.currentTransmux===i&&(W.data.action==="data"&&rv(W,B,o),W.data.action==="trackinfo"&&u(W.data.trackInfo),W.data.action==="gopInfo"&&av(W,B),W.data.action==="audioTimingInfo"&&l(W.data.audioTimingInfo),W.data.action==="videoTimingInfo"&&c(W.data.videoTimingInfo),W.data.action==="videoSegmentTimingInfo"&&g(W.data.videoSegmentTimingInfo),W.data.action==="audioSegmentTimingInfo"&&m(W.data.audioSegmentTimingInfo),W.data.action==="id3Frame"&&_([W.data.id3Frame],W.data.id3Frame.dispatchType),W.data.action==="caption"&&b(W.data.caption),W.data.action==="endedtimeline"&&(O=!1,S()),W.data.action==="log"&&R(W.data.log),W.data.type==="transmuxed"&&(O||(n.onmessage=null,nv({transmuxedData:B,callback:E}),Kd(n))))};if(n.onmessage=L,e&&n.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(t)&&n.postMessage({action:"alignGopsWith",gopsToAlignWith:t}),typeof a<"u"&&n.postMessage({action:"setRemux",remux:a}),r.byteLength){var j=r instanceof ArrayBuffer?r:r.buffer,U=r instanceof ArrayBuffer?0:r.byteOffset;n.postMessage({action:"push",data:j,byteOffset:U,byteLength:r.byteLength},[j])}F&&n.postMessage({action:"endTimeline"}),n.postMessage({action:"flush"})},Kd=function(i){i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():zd(i.currentTransmux))},wu=function(i,n){i.postMessage({action:n}),Kd(i)},$d=function(i,n){if(!n.currentTransmux){n.currentTransmux=i,wu(n,i);return}n.transmuxQueue.push(wu.bind(null,n,i))},sv=function(i){$d("reset",i)},ov=function(i){$d("endTimeline",i)},Xd=function(i){if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,zd(i);return}i.transmuxer.transmuxQueue.push(i)},uv=function(i){var n=new iv;n.currentTransmux=null,n.transmuxQueue=[];var r=n.terminate;return n.terminate=function(){return n.currentTransmux=null,n.transmuxQueue.length=0,r.call(n)},n.postMessage({action:"init",options:i}),n},ba={reset:sv,endTimeline:ov,transmux:Xd,createTransmuxer:uv},vn=function(i){var n=i.transmuxer,r=i.endAction||i.action,e=i.callback,t=wt({},i,{endAction:null,transmuxer:null,callback:null}),a=function l(c){c.data.action===r&&(n.removeEventListener("message",l),c.data.data&&(c.data.data=new Uint8Array(c.data.data,i.byteOffset||0,i.byteLength||c.data.data.byteLength),i.data&&(i.data=c.data.data)),e(c.data))};if(n.addEventListener("message",a),i.data){var o=i.data instanceof ArrayBuffer;t.byteOffset=o?0:i.data.byteOffset,t.byteLength=i.data.byteLength;var u=[o?i.data:i.data.buffer];n.postMessage(t,u)}else n.postMessage(t)},gt={FAILURE:2,TIMEOUT:-101,ABORTED:-102}
44,Ga=function(i){i.forEach(function(n){n.abort()})},lv=function(i){return{bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}},dv=function(i){var n=i.target,r=Date.now()-n.requestTime,e={bandwidth:1/0,bytesReceived:0,roundTripTime:r||0};return e.bytesReceived=i.loaded,e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3),e},Ns=function(i,n){return n.timedout?{status:n.status,message:"HLS request timed-out at URL: "+n.uri,code:gt.TIMEOUT,xhr:n}:n.aborted?{status:n.status,message:"HLS request aborted at URL: "+n.uri,code:gt.ABORTED,xhr:n}:i?{status:n.status,message:"HLS request errored at URL: "+n.uri,code:gt.FAILURE,xhr:n}:n.responseType==="arraybuffer"&&n.response.byteLength===0?{status:n.status,message:"Empty HLS response at URL: "+n.uri,code:gt.FAILURE,xhr:n}:null},Pu=function(i,n,r){return function(e,t){var a=t.response,o=Ns(e,t);if(o)return r(o,i);if(a.byteLength!==16)return r({status:t.status,message:"Invalid HLS key at URL: "+t.uri,code:gt.FAILURE,xhr:t},i);for(var u=new DataView(a),l=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]),c=0;c<n.length;c++)n[c].bytes=l;return r(null,i)}},Qd=function(i,n){var r=is(i.map.bytes);if(r!=="mp4"){var e=i.map.resolvedUri||i.map.uri;return n({internal:!0,message:"Found unsupported "+(r||"unknown")+" container for initialization segment at URL: "+e,code:gt.FAILURE})}vn({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:function(a){var o=a.tracks,u=a.data;return i.map.bytes=u,o.forEach(function(l){i.map.tracks=i.map.tracks||{},!i.map.tracks[l.type]&&(i.map.tracks[l.type]=l,typeof l.id=="number"&&l.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[l.id]=l.timescale))}),n(null)}})},cv=function(i){var n=i.segment,r=i.finishProcessingFn;return function(e,t){var a=Ns(e,t);if(a)return r(a,n);var o=new Uint8Array(t.response);if(n.map.key)return n.map.encryptedBytes=o,r(null,n);n.map.bytes=o,Qd(n,function(u){if(u)return u.xhr=t,u.status=t.status,r(u,n);r(null,n)})}},fv=function(i){var n=i.segment,r=i.finishProcessingFn,e=i.responseType;return function(t,a){var o=Ns(t,a);if(o)return r(o,n);var u=e==="arraybuffer"||!a.responseText?a.response:Zg(a.responseText.substring(n.lastReachedChar||0));return n.stats=lv(a),n.key?n.encryptedBytes=new Uint8Array(u):n.bytes=new Uint8Array(u),r(null,n)}},hv=function(i){var n=i.segment,r=i.bytes,e=i.trackInfoFn,t=i.timingInfoFn,a=i.videoSegmentTimingInfoFn,o=i.audioSegmentTimingInfoFn,u=i.id3Fn,l=i.captionsFn,c=i.isEndOfTimeline,g=i.endedTimelineFn,m=i.dataFn,_=i.doneFn,b=i.onTransmuxerLog,E=n.map&&n.map.tracks||{},S=!!(E.audio&&E.video),R=t.bind(null,n,"audio","start"),F=t.bind(null,n,"audio","end"),B=t.bind(null,n,"video","start"),O=t.bind(null,n,"video","end"),L=function(){return Xd({bytes:r,transmuxer:n.transmuxer,audioAppendStart:n.audioAppendStart,gopsToAlignWith:n.gopsToAlignWith,remux:S,onData:function(D){D.type=D.type==="combined"?"video":D.type,m(n,D)},onTrackInfo:function(D){e&&(S&&(D.isMuxed=!0),e(n,D))},onAudioTimingInfo:function(D){R&&typeof D.start<"u"&&(R(D.start),R=null),F&&typeof D.end<"u"&&F(D.end)},onVideoTimingInfo:function(D){B&&typeof D.start<"u"&&(B(D.start),B=null),O&&typeof D.end<"u"&&O(D.end)},onVideoSegmentTimingInfo:function(D){a(D)},onAudioSegmentTimingInfo:function(D){o(D)},onId3:function(D,W){u(n,D,W)},onCaptions:function(D){l(n,[D])},isEndOfTimeline:c,onEndedTimeline:function(){g()},onTransmuxerLog:b,onDone:function(D){_&&(D.type=D.type==="combined"?"video":D.type,_(null,n,D))}})};vn({action:"probeTs",transmuxer:n.transmuxer,data:r,baseStartTime:n.baseStartTime,callback:function(U){n.bytes=r=U.data;var D=U.result;D&&(e(n,{hasAudio:D.hasAudio,hasVideo:D.hasVideo,isMuxed:S}),e=null,D.hasAudio&&!S&&R(D.audioStart),D.hasVideo&&B(D.videoStart),R=null,B=null),L()}})},Yd=function(i){var n=i.segment,r=i.bytes,e=i.trackInfoFn,t=i.timingInfoFn,a=i.videoSegmentTimingInfoFn,o=i.audioSegmentTimingInfoFn,u=i.id3Fn,l=i.captionsFn,c=i.isEndOfTimeline,g=i.endedTimelineFn,m=i.dataFn,_=i.doneFn,b=i.onTransmuxerLog,E=new Uint8Array(r);if(Op(E)){n.isFmp4=!0;var S=n.map.tracks,R={isFmp4:!0,hasVideo:!!S.video,hasAudio:!!S.audio};S.audio&&S.audio.codec&&S.audio.codec!=="enca"&&(R.audioCodec=S.audio.codec),S.video&&S.video.codec&&S.video.codec!=="encv"&&(R.videoCodec=S.video.codec),S.video&&S.audio&&(R.isMuxed=!0),e(n,R);var F=function(O){m(n,{data:E,type:R.hasAudio&&!R.isMuxed?"audio":"video"}),O&&O.length&&l(n,O),_(null,n,{})};vn({action:"probeMp4StartTime",timescales:n.map.timescales,data:E,transmuxer:n.transmuxer,callback:function(O){var L=O.data,j=O.startTime;if(r=L.buffer,n.bytes=E=L,R.hasAudio&&!R.isMuxed&&t(n,"audio","start",j),R.hasVideo&&t(n,"video","start",j),!S.video||!L.byteLength||!n.transmuxer){F();return}vn({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:n.transmuxer,data:E,timescales:n.map.timescales,trackIds:[S.video.id],callback:function(D){r=D.data.buffer,n.bytes=E=D.data,D.logs.forEac
44h(function(W){b(A.mergeOptions(W,{stream:"mp4CaptionParser"}))}),F(D.captions)}})}});return}if(!n.transmuxer){_(null,n,{});return}if(typeof n.container>"u"&&(n.container=is(E)),n.container!=="ts"&&n.container!=="aac"){e(n,{hasAudio:!1,hasVideo:!1}),_(null,n,{});return}hv({segment:n,bytes:r,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})},Jd=function(i,n){var r=i.id,e=i.key,t=i.encryptedBytes,a=i.decryptionWorker,o=function l(c){if(c.data.source===r){a.removeEventListener("message",l);var g=c.data.decrypted;n(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};a.addEventListener("message",o);var u;e.bytes.slice?u=e.bytes.slice():u=new Uint32Array(Array.prototype.slice.call(e.bytes)),a.postMessage(Nd({source:r,encrypted:t,key:u,iv:e.iv}),[t.buffer,u.buffer])},pv=function(i){var n=i.decryptionWorker,r=i.segment,e=i.trackInfoFn,t=i.timingInfoFn,a=i.videoSegmentTimingInfoFn,o=i.audioSegmentTimingInfoFn,u=i.id3Fn,l=i.captionsFn,c=i.isEndOfTimeline,g=i.endedTimelineFn,m=i.dataFn,_=i.doneFn,b=i.onTransmuxerLog;Jd({id:r.requestId,key:r.key,encryptedBytes:r.encryptedBytes,decryptionWorker:n},function(E){r.bytes=E,Yd({segment:r,bytes:r.bytes,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})})},mv=function(i){var n=i.activeXhrs,r=i.decryptionWorker,e=i.trackInfoFn,t=i.timingInfoFn,a=i.videoSegmentTimingInfoFn,o=i.audioSegmentTimingInfoFn,u=i.id3Fn,l=i.captionsFn,c=i.isEndOfTimeline,g=i.endedTimelineFn,m=i.dataFn,_=i.doneFn,b=i.onTransmuxerLog,E=0,S=!1;return function(R,F){if(!S){if(R)return S=!0,Ga(n),_(R,F);if(E+=1,E===n.length){var B=function(){if(F.encryptedBytes)return pv({decryptionWorker:r,segment:F,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b});Yd({segment:F,bytes:F.bytes,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:u,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:g,dataFn:m,doneFn:_,onTransmuxerLog:b})};if(F.endOfAllRequests=Date.now(),F.map&&F.map.encryptedBytes&&!F.map.bytes)return Jd({decryptionWorker:r,id:F.requestId+"-init",encryptedBytes:F.map.encryptedBytes,key:F.map.key},function(O){F.map.bytes=O,Qd(F,function(L){if(L)return Ga(n),_(L,F);B()})});B()}}}},gv=function(i){var n=i.loadendState,r=i.abortFn;return function(e){var t=e.target;t.aborted&&r&&!n.calledAbortFn&&(r(),n.calledAbortFn=!0)}},vv=function(i){var n=i.segment,r=i.progressFn;return function(e){var t=e.target;if(!t.aborted)return n.stats=A.mergeOptions(n.stats,dv(e)),!n.stats.firstBytesReceivedAt&&n.stats.bytesReceived&&(n.stats.firstBytesReceivedAt=Date.now()),r(e,n)}},yv=function(i){var n=i.xhr,r=i.xhrOptions,e=i.decryptionWorker,t=i.segment,a=i.abortFn,o=i.progressFn,u=i.trackInfoFn,l=i.timingInfoFn,c=i.videoSegmentTimingInfoFn,g=i.audioSegmentTimingInfoFn,m=i.id3Fn,_=i.captionsFn,b=i.isEndOfTimeline,E=i.endedTimelineFn,S=i.dataFn,R=i.doneFn,F=i.onTransmuxerLog,B=[],O=mv({activeXhrs:B,decryptionWorker:e,trackInfoFn:u,timingInfoFn:l,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:g,id3Fn:m,captionsFn:_,isEndOfTimeline:b,endedTimelineFn:E,dataFn:S,doneFn:R,onTransmuxerLog:F});if(t.key&&!t.key.bytes){var L=[t.key];t.map&&!t.map.bytes&&t.map.key&&t.map.key.resolvedUri===t.key.resolvedUri&&L.push(t.map.key);var j=A.mergeOptions(r,{uri:t.key.resolvedUri,responseType:"arraybuffer"}),U=Pu(t,L,O),D=n(j,U);B.push(D)}if(t.map&&!t.map.bytes){var W=t.map.key&&(!t.key||t.key.resolvedUri!==t.map.key.resolvedUri);if(W){var V=A.mergeOptions(r,{uri:t.map.key.resolvedUri,responseType:"arraybuffer"}),ee=Pu(t,[t.map.key],O),M=n(V,ee);B.push(M)}var N=A.mergeOptions(r,{uri:t.map.resolvedUri,responseType:"arraybuffer",headers:Wa(t.map)}),G=cv({segment:t,finishProcessingFn:O}),Z=n(N,G);B.push(Z)}var Q=A.mergeOptions(r,{uri:t.part&&t.part.resolvedUri||t.resolvedUri,responseType:"arraybuffer",headers:Wa(t)}),ie=fv({segment:t,finishProcessingFn:O,responseType:Q.responseType}),ae=n(Q,ie);ae.addEventListener("progress",vv({segment:t,progressFn:o})),B.push(ae);var ce={};return B.forEach(function(oe){oe.addEventListener("loadend",gv({loadendState:ce,abortFn:a}))}),function(){return Ga(B)}},_v=lt("CodecUtils"),Tv=function(i){var n=i.attributes||{};if(n.CODECS)return ft(n.CODECS)},Zd=function(i,n){var r=n.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&r.AUDIO&&i.mediaGroups.AUDIO[r.AUDIO]},bv=function(i,n){if(!Zd(i,n))return!0;var r=n.attributes||{},e=i.mediaGroups.AUDIO[r.AUDIO];for(var t in e)if(!e[t].uri&&!e[t].playlists)return!0;return!1},yn=function(i){var n={};
44return i.forEach(function(r){var e=r.mediaType,t=r.type,a=r.details;n[e]=n[e]||[],n[e].push(Ju(""+t+a))}),Object.keys(n).forEach(function(r){if(n[r].length>1){_v("multiple "+r+" codecs found as attributes: "+n[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),n[r]=null;return}n[r]=n[r][0]}),n},Iu=function(i){var n=0;return i.audio&&n++,i.video&&n++,n},Zi=function(i,n){var r=n.attributes||{},e=yn(Tv(n)||[]);if(Zd(i,n)&&!e.audio&&!bv(i,n)){var t=yn(dh(i,r.AUDIO)||[]);t.audio&&(e.audio=t.audio)}return e},zr=lt("PlaylistSelector"),Au=function(i){if(!(!i||!i.playlist)){var n=i.playlist;return JSON.stringify({id:n.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:n.attributes&&n.attributes.CODECS||""})}},_n=function(i,n){if(!i)return"";var r=k.getComputedStyle(i);return r?r[n]:""},yi=function(i,n){var r=i.slice();i.sort(function(e,t){var a=n(e,t);return a===0?r.indexOf(e)-r.indexOf(t):a})},Us=function(i,n){var r,e;return i.attributes.BANDWIDTH&&(r=i.attributes.BANDWIDTH),r=r||k.Number.MAX_VALUE,n.attributes.BANDWIDTH&&(e=n.attributes.BANDWIDTH),e=e||k.Number.MAX_VALUE,r-e},Sv=function(i,n){var r,e;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(r=i.attributes.RESOLUTION.width),r=r||k.Number.MAX_VALUE,n.attributes.RESOLUTION&&n.attributes.RESOLUTION.width&&(e=n.attributes.RESOLUTION.width),e=e||k.Number.MAX_VALUE,r===e&&i.attributes.BANDWIDTH&&n.attributes.BANDWIDTH?i.attributes.BANDWIDTH-n.attributes.BANDWIDTH:r-e},ec=function(i,n,r,e,t,a){if(i){var o={bandwidth:n,width:r,height:e,limitRenditionByPlayerDimensions:t},u=i.playlists;Xe.isAudioOnly(i)&&(u=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=u.map(function(V){var ee,M=V.attributes&&V.attributes.RESOLUTION&&V.attributes.RESOLUTION.width,N=V.attributes&&V.attributes.RESOLUTION&&V.attributes.RESOLUTION.height;return ee=V.attributes&&V.attributes.BANDWIDTH,ee=ee||k.Number.MAX_VALUE,{bandwidth:ee,width:M,height:N,playlist:V}});yi(l,function(V,ee){return V.bandwidth-ee.bandwidth}),l=l.filter(function(V){return!Xe.isIncompatible(V.playlist)});var c=l.filter(function(V){return Xe.isEnabled(V.playlist)});c.length||(c=l.filter(function(V){return!Xe.isDisabled(V.playlist)}));var g=c.filter(function(V){return V.bandwidth*Pe.BANDWIDTH_VARIANCE<n}),m=g[g.length-1],_=g.filter(function(V){return V.bandwidth===m.bandwidth})[0];if(t===!1){var b=_||c[0]||l[0];if(b&&b.playlist){var E="sortedPlaylistReps";return _&&(E="bandwidthBestRep"),c[0]&&(E="enabledPlaylistReps"),zr("choosing "+Au(b)+" using "+E+" with options",o),b.playlist}return zr("could not choose a playlist with options",o),null}var S=g.filter(function(V){return V.width&&V.height});yi(S,function(V,ee){return V.width-ee.width});var R=S.filter(function(V){return V.width===r&&V.height===e});m=R[R.length-1];var F=R.filter(function(V){return V.bandwidth===m.bandwidth})[0],B,O,L;F||(B=S.filter(function(V){return V.width>r||V.height>e}),O=B.filter(function(V){return V.width===B[0].width&&V.height===B[0].height}),m=O[O.length-1],L=O.filter(function(V){return V.bandwidth===m.bandwidth})[0]);var j;if(a.experimentalLeastPixelDiffSelector){var U=S.map(function(V){return V.pixelDiff=Math.abs(V.width-r)+Math.abs(V.height-e),V});yi(U,function(V,ee){return V.pixelDiff===ee.pixelDiff?ee.bandwidth-V.bandwidth:V.pixelDiff-ee.pixelDiff}),j=U[0]}var D=j||L||F||_||c[0]||l[0];if(D&&D.playlist){var W="sortedPlaylistReps";return j?W="leastPixelDiffRep":L?W="resolutionPlusOneRep":F?W="resolutionBestRep":_?W="bandwidthBestRep":c[0]&&(W="enabledPlaylistReps"),zr("choosing "+Au(D)+" using "+W+" with options",o),D.playlist}return zr("could not choose a playlist with options",o),null}},Ou=function(){var i=this.useDevicePixelRatio&&k.devicePixelRatio||1;return ec(this.playlists.master,this.systemBandwidth,parseInt(_n(this.tech_.el(),"width"),10)*i,parseInt(_n(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},xv=function(i){var n=-1,r=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&k.devicePixelRatio||1;return n<0&&(n=this.systemBandwidth,r=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==r&&(n=i*this.systemBandwidth+(1-i)*n,r=this.systemBandwidth),ec(this.playlists.master,n,parseInt(_n(this.tech_.el(),"width"),10)*e,parseInt(_n(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},Ev=function(i){var n=i.master,r=i.currentTime,e=i.bandwidth,t=i.duration,a=i.segmentDuration,o=i.timeUntilRebuffer,u=i.currentTimeline,l=i.syncController,c=n.playlists.filter(function(E){return!Xe.isIncompatible(E)}),g=c.filter(Xe.isEnabled);g.length||(g=c.filter(function(E){return!Xe.isDisabled(E)}));var m=g.filter(Xe.hasAttribute.bind(null,"BANDWIDTH")),_=m.map(function(E){var S=l.getSyncPoint(E,t,u,r),R=S?1:2,F=Xe.estimateSegmentRequestTime(a,e,E),B=F*R-o;return{playlist:E,rebufferingImpact:B}}),b=_.filter(function(E){return E.rebufferingImpact<=0});return yi(b,function(E,S){return Us(S.playlist,E.playlist)}),b.length?b[0]:(yi(_,function(E,S){return E.rebufferingImpact-S.rebufferingImpact}),_[0]||null)},Cv=function(){var i=this,n=this.playlists.master.playlists.filter(Xe.isEnabled);yi(n,function(e,t){return Us(e,t)});var r=n.filter(function(e){return!!Zi(i.playlists.master,e).video});return r[0]||null},kv=function(i){var n=0,r;
44return i.bytes&&(r=new Uint8Array(i.bytes),i.segments.forEach(function(e){r.set(e,n),n+=e.byteLength})),r},wv=function(i,n,r){if(!i[r]){n.trigger({type:"usage",name:"vhs-608"}),n.trigger({type:"usage",name:"hls-608"});var e=r;/^cc708_/.test(r)&&(e="SERVICE"+r.split("_")[1]);var t=n.textTracks().getTrackById(e);if(t)i[r]=t;else{var a=n.options_.vhs&&n.options_.vhs.captionServices||{},o=r,u=r,l=!1,c=a[e];c&&(o=c.label,u=c.language,l=c.default),i[r]=n.addRemoteTextTrack({kind:"captions",id:e,default:l,label:o,language:u},!1).track}}},Pv=function(i){var n=i.inbandTextTracks,r=i.captionArray,e=i.timestampOffset;if(r){var t=k.WebKitDataCue||k.VTTCue;r.forEach(function(a){var o=a.stream;n[o].addCue(new t(a.startTime+e,a.endTime+e,a.text))})}},Iv=function(i){Object.defineProperties(i.frame,{id:{get:function(){return A.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get:function(){return A.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get:function(){return A.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},Av=function(i){var n=i.inbandTextTracks,r=i.metadataArray,e=i.timestampOffset,t=i.videoDuration;if(r){var a=k.WebKitDataCue||k.VTTCue,o=n.metadataTrack_;if(o&&(r.forEach(function(_){var b=_.cueTime+e;typeof b!="number"||k.isNaN(b)||b<0||!(b<1/0)||_.frames.forEach(function(E){var S=new a(b,b,E.value||E.url||E.data||"");S.frame=E,S.value=E,Iv(S),o.addCue(S)})}),!(!o.cues||!o.cues.length))){for(var u=o.cues,l=[],c=0;c<u.length;c++)u[c]&&l.push(u[c]);var g=l.reduce(function(_,b){var E=_[b.startTime]||[];return E.push(b),_[b.startTime]=E,_},{}),m=Object.keys(g).sort(function(_,b){return Number(_)-Number(b)});m.forEach(function(_,b){var E=g[_],S=Number(m[b+1])||t;E.forEach(function(R){R.endTime=S})})}}},Ov=function(i,n,r){i.metadataTrack_||(i.metadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,i.metadataTrack_.inBandMetadataTrackDispatchType=n)},Qi=function(i,n,r){var e,t;if(r&&r.cues)for(e=r.cues.length;e--;)t=r.cues[e],t.startTime>=i&&t.endTime<=n&&r.removeCue(t)},Dv=function(i){var n=i.cues;if(n)for(var r=0;r<n.length;r++){for(var e=[],t=0,a=0;a<n.length;a++)n[r].startTime===n[a].startTime&&n[r].endTime===n[a].endTime&&n[r].text===n[a].text&&(t++,t>1&&e.push(n[a]));e.length&&e.forEach(function(o){return i.removeCue(o)})}},Lv=function(i,n,r){if(typeof n>"u"||n===null||!i.length)return[];var e=Math.ceil((n-r+3)*nn.ONE_SECOND_IN_TS),t;for(t=0;t<i.length&&!(i[t].pts>e);t++);return i.slice(t)},Mv=function(i,n,r){if(!n.length)return i;if(r)return n.slice();var e=n[0].pts,t=0;for(t;t<i.length&&!(i[t].pts>=e);t++);return i.slice(0,t).concat(n)},Fv=function(i,n,r,e){for(var t=Math.ceil((n-e)*nn.ONE_SECOND_IN_TS),a=Math.ceil((r-e)*nn.ONE_SECOND_IN_TS),o=i.slice(),u=i.length;u--&&!(i[u].pts<=a););if(u===-1)return o;for(var l=u+1;l--&&!(i[l].pts<=t););return l=Math.max(l,0),o.splice(l,u-l+1),o},Rv=function(i,n){if(!i&&!n||!i&&n||i&&!n)return!1;if(i===n)return!0;var r=Object.keys(i).sort(),e=Object.keys(n).sort();if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++){var a=r[t];if(a!==e[t]||i[a]!==n[a])return!1}return!0},tc=22,Nv=function(i,n,r){n=n||[];for(var e=[],t=0,a=0;a<n.length;a++){var o=n[a];if(i===o.timeline&&(e.push(a),t+=o.duration,t>r))return a}return e.length===0?0:e[e.length-1]},zi=1,Uv=500,Du=function(i){return typeof i=="number"&&isFinite(i)},Kr=1/60,Bv=function(i,n,r){return i!=="main"||!n||!r?null:!r.hasAudio&&!r.hasVideo?"Neither audio nor video found in segment.":n.hasVideo&&!r.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.":!n.hasVideo&&r.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},jv=function(i,n,r){var e=n-Pe.BACK_BUFFER_LENGTH;i.length&&(e=Math.max(e,i.start(0)));var t=n-r;return Math.min(t,e)},ci=function(i){var n=i.startOfSegment,r=i.duration,e=i.segment,t=i.part,a=i.playlist,o=a.mediaSequence,u=a.id,l=a.segments,c=l===void 0?[]:l,g=i.mediaIndex,m=i.partIndex,_=i.timeline,b=c.length-1,E="mediaIndex/partIndex increment";i.getMediaInfoForTime?E="getMediaInfoForTime ("+i.getMediaInfoForTime+")":i.isSyncRequest&&(E="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(E+=" with independent "+i.independent);var S=typeof m=="number",R=i.segment.uri?"segment":"pre-segment",F=S?xd({preloadSegment:e})-1:0;return R+" ["+(o+g)+"/"+(o+b)+"]"+(S?" part ["+m+"/"+F+"]":"")+(" segment start/end ["+e.start+" => "+e.end+"]")+(S?" part start/end ["+t.start+" => "+t.end+"]":"")+(" startOfSegment ["+n+"]")+(" duration ["+r+"]")+(" timeline ["+_+"]")+(" selected by ["+E+"]")+(" playlist ["+u+"]")},Lu=function(i){return i+"TimingInfo"},Vv=function(i){var n=i.segmentTimeline,r=i.currentTimeline,e=i.startOfSegment,t=i.buffered,a=i.overrideCheck;return!a&&n===r?null:n<r?e:t.length?t.end(t.length-1):e},Mu=function(i){var n=i.timelineChangeController,r=i.currentTimeline,e=i.segmentTimeline,t=i.loaderType,a=i.audioDisabled;if(r===e)return!1;if(t==="audio"){var o=n.lastTimelineChange({type:"main"});return!o||o.to!==e}if(t==="main"&&a){var u=n.pendingTimelineChange({type:"audio"});return!(u&&u.to===e)}return!1},Hv=function(i){var n=0;return["video","audio"].forEach(function(r){var e=i[r+"TimingInfo"];if(e){var t=e.start,a=e.end,o;typeof t=="bigint"||typeof a=="bigint"?o=k.BigInt(a)-k.BigInt(t):typeof t=="number"&&typeof a=="number"&&(o=a-t),typeof o<"u"&&o>n&&(n=o)}}),typeof n=="bigint"&&n<Number.MAX_SAFE_INTEGER&&(n=Number(n)),n},Fu=function(i){var n=i.segmentDuration,r=i.maxDuration;return n?Math.round(n)>r+Nt:!1},Wv=function(i,n){if(n!=="hls")return null;var r=Hv({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!r)return null;var e=i.playlist.targetDuration,t=Fu({segmentDuration:r,maxDuration:e*2}),a=Fu({segmentDuration:r,maxDuration:e}),o="Segment with index "+i.mediaIndex+" "+("from playlist "+i.playlist.id+" ")+("has a duration of "+r+" ")+("when the reported duration is "+i.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 t||a?{severity:t?"warn":"info",message:o}:null},za=function(s){$(i,s);function i(r,e){var t;if(t=s.call(this)||this,!r)throw new TypeError("Initialization settings are required");if(typeof r.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!r.mediaSource)throw new TypeError("No MediaSource specified");return t.bandwidth=r.bandwidth,t.throughput={rate:0,count:0},t.roundTrip=NaN,t.resetStats_(),t.mediaIndex=null,t.partIndex=null,t.hasPlayed_=r.hasPlayed,t.currentTime_=r.currentTime,t.seekable_=r.seekable,t.seeking_=r.seeking,t.duration_=r.duration,t.mediaSource_=r.mediaSource,t.vhs_=r.vhs,t.loaderType_=r.loaderType,t.currentMediaInfo_=void 0,t.startingMediaInfo_=void 0,t.segmentMetadataTrack_=r.segmentMetadataTrack,t.goalBufferLength_=r.goalBufferLength,t.sourceType_=r.sourceType,t.sourceUpdater_=r.sourceUpdater,t.inbandTextTracks_=r.inbandTextTracks,t.state_="INIT",t.timelineChangeController_=r.timelineChangeController,t.shouldSaveSegmentTimingInfo_=!0,t.parse708captions_=r.parse708captions,t.useDtsForTimestampOffset_=r.useDtsForTimestampOffset,t.captionServices_=r.captionServices,t.experimentalExactManifestTimings=r.experimentalExactManifestTimings,t.checkBufferTimeout_=null,t.error_=void 0,t.currentTimeline_=-1,t.pendingSegment_=null,t.xhrOptions_=null,t.pendingSegments_=[],t.audioDisabled_=!1,t.isPendingTimestampOffset_=!1,t.gopBuffer_=[],t.timeMapping_=0,t.safeAppend_=A.browser.IE_VERSION>=11,t.appendInitSegment_={audio:!0,video:!0},t.playlistOfLastInitSegment_={audio:null,video:null},t.callQueue_=[],t.loadQueue_=[],t.metadataQueue_={id3:[],caption:[]},t.waitingOnRemove_=!1,t.quotaExceededErrorRetryTimeout_=null,t.activeInitSegmentId_=null,t.initSegments_={},t.cacheEncryptionKeys_=r.cacheEncryptionKeys,t.keyCache_={},t.decrypter_=r.decrypter,t.syncController_=r.syncController,t.syncPoint_={segmentIndex:0,time:0},t.transmuxer_=t.createTransmuxer_(),t.triggerSyncInfoUpdate_=function(){return t.trigger("syncinfoupdate")},t.syncController_.on("syncinfoupdate",t.triggerSyncInfoUpdate_),t.mediaSource_.addEventListener("sourceopen",function(){t.isEndOfStream_
44()||(t.ended_=!1)}),t.fetchAtBuffer_=!1,t.logger_=lt("SegmentLoader["+t.loaderType_+"]"),Object.defineProperty(ne(t),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),t.sourceUpdater_.on("ready",function(){t.hasEnoughInfoToAppend_()&&t.processCallQueue_()}),t.loaderType_==="main"&&t.timelineChangeController_.on("pendingtimelinechange",function(){t.hasEnoughInfoToAppend_()&&t.processCallQueue_()}),t.loaderType_==="audio"&&t.timelineChangeController_.on("timelinechange",function(){t.hasEnoughInfoToLoad_()&&t.processLoadQueue_(),t.hasEnoughInfoToAppend_()&&t.processCallQueue_()}),t}var n=i.prototype;return n.createTransmuxer_=function(){return ba.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.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},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},n.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,k.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e},n.error=function(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&ba.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return A.createTimeRanges();if(this.loaderType_==="main"){var t=e.hasAudio,a=e.hasVideo,o=e.isMuxed;if(a&&t&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(t===void 0&&(t=!1),!e)return null;var a=gn(e),o=this.initSegments_[a];return t&&!o&&e.bytes&&(this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),o||e},n.segmentKey=function(e,t){if(t===void 0&&(t=!1),!e)return null;var a=Ud(e),o=this.keyCache_[a];this.cacheEncryptionKeys_&&t&&!o&&e.bytes&&(this.keyCache_[a]=o={resolvedUri:e.resolvedUri,bytes:e.bytes});var u={resolvedUri:(o||e).resolvedUri};return o&&(u.bytes=o.bytes),u},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.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")}},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(t===void 0&&(t={}),!!e){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var u=null;if(a&&(a.id?u=a.id:a.uri&&(u=a.uri)),this.logger_("playlist update ["+u+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri){this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var l=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var g=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=g}}o&&(o.mediaIndex-=l,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=e.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,e)}},n.pause=function(){this.checkBufferTimeout_&&(k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return this.checkBufferTimeout_===null},n.resetEverything=function(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&ba.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"})},n.remove=function(e,t,a,o){if(a===void 0&&(a=function(){}),o===void 0&&(o=!1),t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var u=1,l=function(){u--,u===0&&a()};(o||!this.audioDisabled_)&&(u++,this.sourceUpdater_.removeAudio(e,t,l)),(
44o||this.loaderType_==="main")&&(this.gopBuffer_=Fv(this.gopBuffer_,e,t,this.timeMapping_),u++,this.sourceUpdater_.removeVideo(e,t,l));for(var c in this.inbandTextTracks_)Qi(e,t,this.inbandTextTracks_[c]);Qi(e,t,this.segmentMetadataTrack_),l()},n.monitorBuffer_=function(){this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&k.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=k.setTimeout(this.monitorBufferTick_.bind(this),Uv)},n.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))}},n.isEndOfStream_=function(e,t,a){if(e===void 0&&(e=this.mediaIndex),t===void 0&&(t=this.playlist_),a===void 0&&(a=this.partIndex),!t||!this.mediaSource_)return!1;var o=typeof e=="number"&&t.segments[e],u=e+1===t.segments.length,l=!o||!o.parts||a+1===o.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&u&&l},n.chooseNextRequest_=function(){var e=this.buffered_(),t=Su(e)||0,a=Ds(e,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,u=a>=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=Nv(this.currentTimeline_,l,t);else if(this.mediaIndex!==null){var g=l[this.mediaIndex],m=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=g.end?g.end:t,g.parts&&g.parts[m+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=m+1):c.mediaIndex=this.mediaIndex+1}else{var _=Xe.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=_.segmentIndex,E=_.startTime,S=_.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),c.mediaIndex=b,c.startOfSegment=E,c.partIndex=S}var R=l[c.mediaIndex],F=R&&typeof c.partIndex=="number"&&R.parts&&R.parts[c.partIndex];if(!R||typeof c.partIndex=="number"&&!F)return null;if(typeof c.partIndex!="number"&&R.parts&&(c.partIndex=0,F=R.parts[0]),!a&&F&&!F.independent)if(c.partIndex===0){var B=l[c.mediaIndex-1],O=B.parts&&B.parts.length&&B.parts[B.parts.length-1];O&&O.independent&&(c.mediaIndex-=1,c.partIndex=B.parts.length-1,c.independent="previous segment")}else R.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var L=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=l.length-1&&L&&!this.seeking_()?null:this.generateSegmentInfo_(c)},n.generateSegmentInfo_=function(e){var t=e.independent,a=e.playlist,o=e.mediaIndex,u=e.startOfSegment,l=e.isSyncRequest,c=e.partIndex,g=e.forceTimestampOffset,m=e.getMediaInfoForTime,_=a.segments[o],b=typeof c=="number"&&_.parts[c],E={requestId:"segment-loader-"+Math.random(),uri:b&&b.resolvedUri||_.resolvedUri,mediaIndex:o,partIndex:b?c:null,isSyncRequest:l,startOfSegment:u,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:b&&b.duration||_.duration,segment:_,part:b,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:m,independent:t},S=typeof g<"u"?g:this.isPendingTimestampOffset_;E.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:u,buffered:this.buffered_(),overrideCheck:S});var R=Su(this.sourceUpdater_.audioBuffered());return typeof R=="number"&&(E.audioAppendStart=R-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(E.gopsToAlignWith=Lv(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),E},n.timestampOffsetForSegment_=function(e){return Vv(e)},n.earlyAbortWhenNeeded_=function(e){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),a=e.bandwidth,o=this.pendingSegment_.duration,u=Xe.estimateSegmentRequestTime(o,a,this.playlist_,e.bytesReceived),l=dg(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(u<=l)){var c=Ev({master:this.vhs_.playlists.master,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var g=u-l,m=g-c.rebufferingImpact,_=.5;l<=Nt&&(_=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||m<_)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*Pe.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+ci(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},Rv(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},n.handleTimingInfo_=function(e,t,a,o){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var u=this.pendingSegment_,l=Lu(t);u[l]=u[l]||{},u[l][a]=o,this.logger_("timinginfo: "+t+" - "+a+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var a=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(t.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,t));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),l={};t.forEach(function(c){l[c.stream]=l[c.stream]||{startTime:1/0,captions:[],endTime:0};var g=l[c.stream];g.startTime=Math.min(g.startTime,c.startTime+u),g.endTime=Math.max(g.endTime,c.endTime+u),g.captions.push(c)}),Object.keys(l).forEach(function(c){var g=l[c],m=g.startTime,_=g.endTime,b=g.captions,E=a.inbandTextTracks_;a.logger_("adding cues from "+m+" -> "+_+" for "+c),wv(E,a.vhs_.tech_,c),Qi(m,_,E[c]),Pv({captionArray:b,inbandTextTracks:E,timestampOffset:u})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},n.handleId3_=function(e,t,a){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,t,a));return}var u=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();Ov(this.inbandTextTracks_,a,this.vhs_.tech_),Av({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:u,videoDuration:this.duration_()})}},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(t){return t()})},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(t){return t()})},n.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Mu({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},n.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var a=t.hasAudio,o=t.hasVideo,u=t.isMuxed;return!(o&&!e.videoTimingInfo||a&&!this.audioDisabled_&&!u&&!e.audioTimingInfo||Mu({t
44imelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),a.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),a.isFmp4=e.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Lu(t.type)].start;else{var o=this.getCurrentMediaInfo_(),u=this.loaderType_==="main"&&o&&o.hasVideo,l;u&&(l=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:u,firstVideoFrameTimeForData:l,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,t.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,t)}}},n.updateAppendInitSegmentStatus=function(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,a=e.initSegment,o=e.map,u=e.playlist;if(o){var l=gn(o);if(this.activeInitSegmentId_===l)return null;a=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=l}return a&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=u,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,a):null},n.handleQuotaExceededError_=function(e,t){var a=this,o=e.segmentInfo,u=e.type,l=e.bytes,c=this.sourceUpdater_.audioBuffered(),g=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Qt(c).join(", ")),g.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Qt(g).join(", "));var m=c.length?c.start(0):0,_=c.length?c.end(c.length-1):0,b=g.length?g.start(0):0,E=g.length?g.end(g.length-1):0;if(_-m<=zi&&E-b<=zi){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+l.byteLength+", ")+("audio buffer: "+Qt(c).join(", ")+", ")+("video buffer: "+Qt(g).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:u,bytes:l}));var S=this.currentTime_(),R=S-zi;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+R),this.remove(0,R,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+zi+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=k.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},zi*1e3)},!0)},n.handleAppendError_=function(e,t){var a=e.segmentInfo,o=e.type,u=e.bytes;if(t){if(t.code===tc){this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:u});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(o+" append of "+u.length+"b failed for segment "+("#"+a.mediaIndex+" in playlist "+a.playlist.id)),this.trigger("appenderror")}},n.appendToSourceBuffer_=function(e){var t=e.segmentInfo,a=e.type,o=e.initSegment,u=e.data,l=e.bytes;if(!l){var c=[u],g=u.byteLength;o&&(c.unshift(o),g+=o.byteLength),l=kv({bytes:g,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:a,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:t,type:a,bytes:l}))},n.handleSegmentTimingInfo_=function(e,t,a){if(!(!this.pendingSegment_||t!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,u=e+"TimingInfo";o[u]||(o[u]={}),o[u].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[u].transmuxedPresentationStart=a.start.presentation,o[u].transmuxedDecodeStart=a.start.decode,o[u].transmuxedPresentationEnd=a.end.presentation,o[u].transmuxedDecodeEnd=a.end.decode,o[u].baseMediaDecodeTime=a.baseMediaDecodeTime}},n.appendData_=function(e,t){var a=t.type,o=t.data;if(!(!o||!o.byteLength)&&!(a==="audio"&&this.audioDisabled_)){var u=this.getInitSegmentAndUpdateState_({type:a,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:u,data:o})}},n.loadSegment_=function(e){var t=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 a=wt({},e,{forceTimestampOffset:!0});wt(e,t.generateSegmentInfo_(a)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)},n.updateTransmuxerAndRequestSegment_=function(e){var t=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}));
44var a=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 "+ci(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=yv({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,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(){t.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,E=m.stream;t.logger_(ci(e)+" logged from transmuxer stream "+E+" as a "+b+": "+_)}})},n.trimBackBuffer_=function(e){var t=jv(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,a=e.part,o={resolvedUri:a?a.resolvedUri:t.resolvedUri,byterange:a?a.byterange:t.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===t.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),t.key){var l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(t.key),o.key.iv=l}return t.map&&(o.map=this.initSegmentForMap(t.map)),o},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Kr){this.logger_("Ignoring segment's bandwidth because its duration of "+e+(" is less than the min to record "+Kr));return}this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},n.segmentRequestFinished_=function(e,t,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,a));return}if(this.saveTransferStats_(t.stats),!!this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===gt.ABORTED)return;if(this.pause(),e.code===gt.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,t.stats),o.endOfAllRequests=t.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=Mv(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()},n.trueSegmentStart_=function(e){var t=e.currentStart,a=e.playlist,o=e.mediaIndex,u=e.firstVideoFrameTimeForData,l=e.currentVideoTimestampOffset,c=e.useVideoTimingInfo,g=e.videoTimingInfo,m=e.audioTimingInfo;if(typeof t<"u")return t;if(!c)return m.start;var _=a.segments[o-1];return o===0||!_||typeof _.start>"u"||_.end!==u+l?u:g.start},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var a=t.hasAudio,o=t.hasVideo,u=t.isMuxed,l=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&a&&!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))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||
44(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t=Bv(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0):!1},n.updateSourceBufferTimestampOffset_=function(e){if(!(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")){var t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,a=e.audioTimingInfo,o=e.timingInfo;return this.useDtsForTimestampOffset_?t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:o.start:o.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),a=this.loaderType_==="main"&&t&&t.hasVideo,o=a&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;o&&(e.timingInfo.end=typeof o.end=="number"?o.end:o.start+e.duration)},n.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 t=Wv(e,this.sourceType_);if(t&&(t.severity==="warn"?A.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+ci(e));return}this.logger_("Appended "+ci(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 a=e.segment,o=e.part,u=a.end&&this.currentTime_()-a.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")+" "+ci(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_()},n.recordThroughput_=function(e){if(e.duration<Kr){this.logger_("Ignoring segment's throughput because its duration of "+e.duration+(" is less than the min to record "+Kr));return}var t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,o=Math.floor(e.byteLength/a*8*1e3);this.throughput.rate+=(o-t)/++this.throughput.count},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,a=t.start,o=t.end;if(!(!Du(a)||!Du(o))){Qi(a,o,this.segmentMetadataTrack_);var u=k.WebKitDataCue||k.VTTCue,l={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.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:a,end:o},c=JSON.stringify(l),g=new u(a,o,c);g.value=l,this.segmentMetadataTrack_.addCue(g)}}},i}(A.EventTarget);
44function xt(){}var ic=function(i){return typeof i!="string"?i:i.replace(/./,function(n){return n.toUpperCase()})},qv=["video","audio"],Ka=function(i,n){var r=n[i+"Buffer"];return r&&r.updating||n.queuePending[i]},Gv=function(i,n){for(var r=0;r<n.length;r++){var e=n[r];if(e.type==="mediaSource")return null;if(e.type===i)return r}return null},Bs=function s(i,n){if(n.queue.length!==0){var r=0,e=n.queue[r];if(e.type==="mediaSource"){!n.updating()&&n.mediaSource.readyState!=="closed"&&(n.queue.shift(),e.action(n),e.doneFn&&e.doneFn(),s("audio",n),s("video",n));return}if(i!=="mediaSource"&&!(!n.ready()||n.mediaSource.readyState==="closed"||Ka(i,n))){if(e.type!==i){if(r=Gv(i,n.queue),r===null)return;e=n.queue[r]}if(n.queue.splice(r,1),n.queuePending[i]=e,e.action(i,n),!e.doneFn){n.queuePending[i]=null,s(i,n);return}}}},rc=function(i,n){var r=n[i+"Buffer"],e=ic(i);r&&(r.removeEventListener("updateend",n["on"+e+"UpdateEnd_"]),r.removeEventListener("error",n["on"+e+"Error_"]),n.codecs[i]=null,n[i+"Buffer"]=null)},ht=function(i,n){return i&&n&&Array.prototype.indexOf.call(i.sourceBuffers,n)!==-1},Ye={appendBuffer:function(i,n,r){return function(e,t){var a=t[e+"Buffer"];if(ht(t.mediaSource,a)){t.logger_("Appending segment "+n.mediaIndex+"'s "+i.length+" bytes to "+e+"Buffer");try{a.appendBuffer(i)}catch(o){t.logger_("Error with code "+o.code+" "+(o.code===tc?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+n.mediaIndex+" to "+e+"Buffer")),t.queuePending[e]=null,r(o)}}}},remove:function(i,n){return function(r,e){var t=e[r+"Buffer"];if(ht(e.mediaSource,t)){e.logger_("Removing "+i+" to "+n+" from "+r+"Buffer");try{t.remove(i,n)}catch{e.logger_("Remove "+i+" to "+n+" from "+r+"Buffer failed")}}}},timestampOffset:function(i){return function(n,r){var e=r[n+"Buffer"];ht(r.mediaSource,e)&&(r.logger_("Setting "+n+"timestampOffset to "+i),e.timestampOffset=i)}},callback:function(i){return function(n,r){i()}},endOfStream:function(i){return function(n){if(n.mediaSource.readyState==="open"){n.logger_("Calling mediaSource endOfStream("+(i||"")+")");try{n.mediaSource.endOfStream(i)}catch(r){A.log.warn("Failed to call media source endOfStream",r)}}}},duration:function(i){return function(n){n.logger_("Setting mediaSource duration to "+i);try{n.mediaSource.duration=i}catch(r){A.log.warn("Failed to set media source duration",r)}}},abort:function(){return function(i,n){if(n.mediaSource.readyState==="open"){var r=n[i+"Buffer"];if(ht(n.mediaSource,r)){n.logger_("calling abort on "+i+"Buffer");try{r.abort()}catch(e){A.log.warn("Failed to abort on "+i+"Buffer",e)}}}}},addSourceBuffer:function(i,n){return function(r){var e=ic(i),t=er(n);r.logger_("Adding "+i+"Buffer with codec "+n+" to mediaSource");var a=r.mediaSource.addSourceBuffer(t);a.addEventListener("updateend",r["on"+e+"UpdateEnd_"]),a.addEventListener("error",r["on"+e+"Error_"]),r.codecs[i]=n,r[i+"Buffer"]=a}},removeSourceBuffer:function(i){return function(n){var r=n[i+"Buffer"];if(rc(i,n),!!ht(n.mediaSource,r)){n.logger_("Removing "+i+"Buffer with codec "+n.codecs[i]+" from mediaSource");try{n.mediaSource.removeSourceBuffer(r)}catch(e){A.log.warn("Failed to removeSourceBuffer "+i+"Buffer",e)}}}},changeType:function(i){return function(n,r){var e=r[n+"Buffer"],t=er(i);if(ht(r.mediaSource,e)&&r.codecs[n]!==i){r.logger_("changing "+n+"Buffer codec from "+r.codecs[n]+" to "+i);try{e.changeType(t),r.codecs[n]=i}catch(a){A.log.warn("Failed to changeType on "+n+"Buffer",a)}}}}},Je=function(i){var n=i.type,r=i.sourceUpdater,e=i.action,t=i.doneFn,a=i.name;r.queue.push({type:n,action:e,doneFn:t,name:a}),Bs(n,r)},Ru=function(i,n){return function(r){if(n.queuePending[i]){var e=n.queuePending[i].doneFn;n.queuePending[i]=null,e&&e(n[i+"Error_"])}Bs(i,n)}},nc=function(s){$(i,s);function i(r){var e;return e=s.call(this)||this,e.mediaSource=r,e.sourceopenListener_=function(){return Bs("mediaSource",ne(e))},e.mediaSource.addEventListener("sourceopen",e.sourceopenListener_),e.logger_=lt("SourceUpdater"),e.audioTimestampOffset_=0,e.videoTimestampOffset_=0,e.queue=[],e.queuePending={audio:null,video:null},e.delayedAudioAppendQueue_=[],e.videoAppendQueued_=!1,e.codecs={},e.onVideoUpdateEnd_=Ru("video",ne(e)),e.onAudioUpdateEnd_=Ru("audio",ne(e)),e.onVideoError_=function(t){e.videoError_=t},e.onAudioError_=function(t){e.audioError_=t},e.createdSourceBuffers_=!1,e.initializedEme_=!1,e.triggeredReady_=!1,e}var n=i.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}
44,n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){Je({type:"mediaSource",sourceUpdater:this,action:Ye.addSourceBuffer(e,t),name:"addSourceBuffer"})},n.abort=function(e){Je({type:e,sourceUpdater:this,action:Ye.abort(e),name:"abort"})},n.removeSourceBuffer=function(e){if(!this.canRemoveSourceBuffer()){A.log.error("removeSourceBuffer is not supported!");return}Je({type:"mediaSource",sourceUpdater:this,action:Ye.removeSourceBuffer(e),name:"removeSourceBuffer"})},n.canRemoveSourceBuffer=function(){return!A.browser.IE_VERSION&&!A.browser.IS_FIREFOX&&k.MediaSource&&k.MediaSource.prototype&&typeof k.MediaSource.prototype.removeSourceBuffer=="function"},i.canChangeType=function(){return k.SourceBuffer&&k.SourceBuffer.prototype&&typeof k.SourceBuffer.prototype.changeType=="function"},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){if(!this.canChangeType()){A.log.error("changeType is not supported!");return}Je({type:e,sourceUpdater:this,action:Ye.changeType(t),name:"changeType"})},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(a){var o=e[a];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(a,o);t.canChangeType()&&t.changeType(a,o)})},n.appendBuffer=function(e,t){var a=this,o=e.segmentInfo,u=e.type,l=e.bytes;if(this.processedAppend_=!0,u==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_("delayed audio append of "+l.length+" until video append");return}var c=t;if(Je({type:u,sourceUpdater:this,action:Ye.appendBuffer(l,o||{mediaIndex:-1},c),doneFn:t,name:"appendBuffer"}),u==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var g=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+g.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,g.forEach(function(m){a.appendBuffer.apply(a,m)})}},n.audioBuffered=function(){return ht(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:A.createTimeRange()},n.videoBuffered=function(){return ht(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:A.createTimeRange()},n.buffered=function(){var e=ht(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=ht(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():lg(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){t===void 0&&(t=xt),Je({type:"mediaSource",sourceUpdater:this,action:Ye.duration(e),name:"duration",doneFn:t})},n.endOfStream=function(e,t){e===void 0&&(e=null),t===void 0&&(t=xt),typeof e!="string"&&(e=void 0),Je({type:"mediaSource",sourceUpdater:this,action:Ye.endOfStream(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,a){if(a===void 0&&(a=xt),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}Je({type:"audio",sourceUpdater:this,action:Ye.remove(e,t),doneFn:a,name:"remove"})},n.removeVideo=function(e,t,a){if(a===void 0&&(a=xt),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}Je({type:"video",sourceUpdater:this,action:Ye.remove(e,t),doneFn:a,name:"remove"})},n.updating=function(){return!!(Ka("audio",this)||Ka("video",this))},n.audioTimestampOffset=function(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Je({type:"audio",sourceUpdater:this,action:Ye.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Je({type:"video",sourceUpdater:this,action:Ye.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&Je({type:"audio",sourceUpdater:this,action:Ye.callback(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&Je({type:"video",sourceUpdater:this,action:Ye.callback(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),qv.forEach(function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"](function(){return rc(t,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},i}(A.EventTarget),Nu=function(i){return decodeURIComponent(escape(String.fromCharCode.apply(null,i)))},Uu=new Uint8Array(`
45
46`.split("").map(function(s){return s.charCodeAt(0)})),zv=function(s){$(i,s);function i(){return s.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return i}(Pa(Error)),Kv=function(s){$(i,s);function i(r,e){var t;return e===void 0&&(e={}),t=s.call(this,r,e)||this,t.mediaSource_=null,t.subtitlesTrack_=null,t.loaderType_="subtitle",t.featuresNativeTextTracks_=r.featuresNativeTextTracks,t.loadVttJs=r.loadVttJs,t.shouldSaveSegmentTimingInfo_=!1,t}var n=i.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return A.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,a=e[e.length-1].startTime;return A.createTimeRanges([[t,a]])},n.initSegmentForMap=function(e,t){if(t===void 0&&(t=!1),!e)return null;var a=gn(e),o=this.initSegments_[a];if(t&&!o&&e.bytes){var u=Uu.byteLength+e.bytes.byteLength,l=new Uint8Array(u);l.set(e.bytes),l.set(Uu,e.bytes.byteLength),this.initSegments_[a]=o={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:l}}return o||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},n.remove=function(e,t){Qi(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(this.syncController_.timestampOffsetForTimeline(t.timeline)===null){var a=function(){e.state="READY",e.paused()||e.monitorBuffer_()};this.syncController_.one("timestampoffset",a),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},n.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},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,a){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===gt.TIMEOUT&&this.handleTimeout_(),e.code===gt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}var u=this.pendingSegment_;this.saveBandwidthRelatedStats_(u.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var l=u.segment;if(l.map&&(l.map.bytes=t.map.bytes),u.bytes=t.bytes,typeof k.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(e,t,a)},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 k.VTTCue(c.startTime,c.endTime,c.text):c)}),Dv(this.subtitlesTrack_),this.handleAppendsDone_()},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,a=!1;if(typeof k.WebVTT!="function")throw new zv;typeof k.TextDecoder=="function"?t=new k.TextDecoder("utf8"):(t=k.WebVTT.StringDecoder(),a=!0);var o=new k.WebVTT.Parser(k,k.vttjs,t);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){A.log.warn("Error encountered when parsing cues: "+c.message)},e.segment.map){var u=e.segment.map.bytes;a&&(u=Nu(u)),o.parse(u)}var l=e.bytes;a&&(l=Nu(l)),o.parse(l),o.flush()},n.updateTimeMapping_=function(e,t,a){var o=e.segment;if(t){if(!e.cues.length){o.empty=!0;return}var u=e.timestampmap,l=u.MPEGTS/nn.ONE_SECOND_IN_TS-u.LOCAL+t.mapping;
46if(e.cues.forEach(function(m){m.startTime+=l,m.endTime+=l}),!a.syncInfo){var c=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(c,g-o.duration)}}}},i}(za),$v=function(i,n){for(var r=i.cues,e=0;e<r.length;e++){var t=r[e];if(n>=t.adStartTime&&n<=t.adEndTime)return t}return null},Xv=function(i,n,r){if(r===void 0&&(r=0),!!i.segments)for(var e=r,t,a=0;a<i.segments.length;a++){var o=i.segments[a];if(t||(t=$v(n,e+o.duration/2)),t){if("cueIn"in o){t.endTime=e,t.adEndTime=e,e+=o.duration,t=null;continue}if(e<t.endTime){e+=o.duration;continue}t.endTime+=o.duration}else if("cueOut"in o&&(t=new k.VTTCue(e,e+o.duration,o.cueOut),t.adStartTime=e,t.adEndTime=e+parseFloat(o.cueOut),n.addCue(t)),"cueOutCont"in o){var u=o.cueOutCont.split("/").map(parseFloat),l=u[0],c=u[1];t=new k.VTTCue(e,e+o.duration,""),t.adStartTime=e-l,t.adEndTime=t.adStartTime+c,n.addCue(t)}e+=o.duration}},Qv=86400,Bu=[{name:"VOD",run:function(i,n,r,e,t){if(r!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(i,n,r,e,t){if(!Object.keys(i.timelineToDatetimeMappings).length)return null;var a=null,o=null,u=Ua(n);t=t||0;for(var l=0;l<u.length;l++){var c=n.endList||t===0?l:u.length-(l+1),g=u[c],m=g.segment,_=i.timelineToDatetimeMappings[m.timeline];if(!(!_||!m.dateTimeObject)){var b=m.dateTimeObject.getTime()/1e3,E=b+_;if(m.parts&&typeof g.partIndex=="number")for(var S=0;S<g.partIndex;S++)E+=m.parts[S].duration;var R=Math.abs(t-E);if(o!==null&&(R===0||o<R))break;o=R,a={time:E,segmentIndex:g.segmentIndex,partIndex:g.partIndex}}}return a}},{name:"Segment",run:function(i,n,r,e,t){var a=null,o=null;t=t||0;for(var u=Ua(n),l=0;l<u.length;l++){var c=n.endList||t===0?l:u.length-(l+1),g=u[c],m=g.segment,_=g.part&&g.part.start||m&&m.start;if(m.timeline===e&&typeof _<"u"){var b=Math.abs(t-_);if(o!==null&&o<b)break;(!a||o===null||o>=b)&&(o=b,a={time:_,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return a}},{name:"Discontinuity",run:function(i,n,r,e,t){var a=null;if(t=t||0,n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=null,u=0;u<n.discontinuityStarts.length;u++){var l=n.discontinuityStarts[u],c=n.discontinuitySequence+u+1,g=i.discontinuities[c];if(g){var m=Math.abs(t-g.time);if(o!==null&&o<m)break;(!a||o===null||o>=m)&&(o=m,a={time:g.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(i,n,r,e,t){if(n.syncInfo){var a={time:n.syncInfo.time,segmentIndex:n.syncInfo.mediaSequence-n.mediaSequence,partIndex:null};return a}return null}}],Yv=function(s){$(i,s);function i(r){var e;return e=s.call(this)||this,e.timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={},e.logger_=lt("SyncController"),e}var n=i.prototype;return n.getSyncPoint=function(e,t,a,o){var u=this.runStrategies_(e,t,a,o);return u.length?this.selectSyncPoint_(u,{key:"time",value:o}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var a=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+Ji({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:o.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,a,o){for(var u=[],l=0;l<Bu.length;l++){var c=Bu[l],g=c.run(this,e,t,a,o);g&&(g.strategy=c.name,u.push({strategy:c.name,syncPoint:g}))}return u},n.selectSyncPoint_=function(e,t){for(var a=e[0].syncPoint,o=Math.abs(e[0].syncPoint[t.key]-t.value),u=e[0].strategy,l=1;l<e.length;l++){var c=Math.abs(e[l].syncPoint[t.key]-t.value);c<o&&(o=c,a=e[l].syncPoint,u=e[l].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy"+(" ["+u+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex)+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},n.saveExpiredSegmentInfo=function(e,t){var a=t.mediaSequence-e.mediaSequence;if(a>Qv){A.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");return}for(var o=a-1;o>=0;o--){var u=e.segments[o];if(u&&typeof u.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+o,time:u.start}
46,this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+","+(" mediaSequence: "+t.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],a=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-a}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,a=e.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(t,t.timingInfo,a),u=t.segment;o&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:u.start}));var l=u.dateTimeObject;u.discontinuity&&a&&l&&(this.timelineToDatetimeMappings[u.timeline]=-(l.getTime()/1e3))},n.timestampOffsetForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time},n.mappingForTimeline=function(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,a){var o=e.segment,u=e.part,l=this.timelines[e.timeline],c,g;if(typeof e.timestampOffset=="number")l={time:e.startOfSegment,mapping:e.startOfSegment-t.start},a&&(this.timelines[e.timeline]=l,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": "+("[time: "+l.time+"] [mapping: "+l.mapping+"]"))),c=e.startOfSegment,g=t.end+l.mapping;else if(l)c=t.start+l.mapping,g=t.end+l.mapping;else return!1;return u&&(u.start=c,u.end=g),(!o.start||c<o.start)&&(o.start=c),o.end=g,!0},n.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,a=e.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=u-e.mediaIndex,g=Math.abs(c);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>g){var m=void 0;c<0?m=a.start-Ji({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:u}):m=a.end+Ji({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:u}),this.discontinuities[l]={time:m,accuracy:g}}}},n.dispose=function(){this.trigger("dispose"),this.off()},i}(A.EventTarget),Jv=function(s){$(i,s);function i(){var r;return r=s.call(this)||this,r.pendingTimelineChanges_={},r.lastTimelineChanges_={},r}var n=i.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,a=e.from,o=e.to;return typeof a=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[t]={type:t,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,a=e.from,o=e.to;return typeof a=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[t]={type:t,from:a,to:o},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},i}(A.EventTarget),Zv=qd(Gd(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i(O,L,j){return j={path:L,exports:{},require:function(D,W){return n(D,W??j.path)}},O(j,j.exports),j.exports}function n(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var r=i(function(O){function L(U,D){for(var W=0;W<D.length;W++){var V=D[W];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(U,V.key,V
46)}}function j(U,D,W){return D&&L(U.prototype,D),W&&L(U,W),U}O.exports=j,O.exports.default=O.exports,O.exports.__esModule=!0}),e=i(function(O){function L(j,U){return O.exports=L=Object.setPrototypeOf||function(W,V){return W.__proto__=V,W},O.exports.default=O.exports,O.exports.__esModule=!0,L(j,U)}O.exports=L,O.exports.default=O.exports,O.exports.__esModule=!0}),t=i(function(O){function L(j,U){j.prototype=Object.create(U.prototype),j.prototype.constructor=j,e(j,U)}O.exports=L,O.exports.default=O.exports,O.exports.__esModule=!0}),a=function(){function O(){this.listeners={}}var L=O.prototype;return L.on=function(U,D){this.listeners[U]||(this.listeners[U]=[]),this.listeners[U].push(D)},L.off=function(U,D){if(!this.listeners[U])return!1;var W=this.listeners[U].indexOf(D);return this.listeners[U]=this.listeners[U].slice(0),this.listeners[U].splice(W,1),W>-1},L.trigger=function(U){var D=this.listeners[U];if(D)if(arguments.length===2)for(var W=D.length,V=0;V<W;++V)D[V].call(this,arguments[1]);else for(var ee=Array.prototype.slice.call(arguments,1),M=D.length,N=0;N<M;++N)D[N].apply(this,ee)},L.dispose=function(){this.listeners={}},L.pipe=function(U){this.on("data",function(D){U.push(D)})},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 L=[[[],[],[],[],[]],[[],[],[],[],[]]],j=L[0],U=L[1],D=j[4],W=U[4],V,ee,M,N=[],G=[],Z,Q,ie,ae,ce,oe;for(V=0;V<256;V++)G[(N[V]=V<<1^(V>>7)*283)^V]=V;for(ee=M=0;!D[ee];ee^=Z||1,M=G[M]||1)for(ae=M^M<<1^M<<2^M<<3^M<<4,ae=ae>>8^ae&255^99,D[ee]=ae,W[ae]=ee,ie=N[Q=N[Z=N[ee]]],oe=ie*16843009^Q*65537^Z*257^ee*16843008,ce=N[ae]*257^ae*16843008,V=0;V<4;V++)j[V][ee]=ce=ce<<24^ce>>>8,U[V][ae]=oe=oe<<24^oe>>>8;for(V=0;V<5;V++)j[V]=j[V].slice(0),U[V]=U[V].slice(0);return L},l=null,c=function(){function O(j){l||(l=u()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var U,D,W,V=this._tables[0][4],ee=this._tables[1],M=j.length,N=1;if(M!==4&&M!==6&&M!==8)throw new Error("Invalid aes key size");var G=j.slice(0),Z=[];for(this._key=[G,Z],U=M;U<4*M+28;U++)W=G[U-1],(U%M===0||M===8&&U%M===4)&&(W=V[W>>>24]<<24^V[W>>16&255]<<16^V[W>>8&255]<<8^V[W&255],U%M===0&&(W=W<<8^W>>>24^N<<24,N=N<<1^(N>>7)*283)),G[U]=G[U-M]^W;for(D=0;U;D++,U--)W=G[D&3?U:U-4],U<=4||D<4?Z[D]=W:Z[D]=ee[0][V[W>>>24]]^ee[1][V[W>>16&255]]^ee[2][V[W>>8&255]]^ee[3][V[W&255]]}var L=O.prototype;return L.decrypt=function(U,D,W,V,ee,M){var N=this._key[1],G=U^N[0],Z=V^N[1],Q=W^N[2],ie=D^N[3],ae,ce,oe,rt=N.length/4-2,we,Oe=4,Lt=this._tables[1],Ut=Lt[0],dt=Lt[1],ri=Lt[2],ni=Lt[3],ai=Lt[4];for(we=0;we<rt;we++)ae=Ut[G>>>24]^dt[Z>>16&255]^ri[Q>>8&255]^ni[ie&255]^N[Oe],ce=Ut[Z>>>24]^dt[Q>>16&255]^ri[ie>>8&255]^ni[G&255]^N[Oe+1],oe=Ut[Q>>>24]^dt[ie>>16&255]^ri[G>>8&255]^ni[Z&255]^N[Oe+2],ie=Ut[ie>>>24]^dt[G>>16&255]^ri[Z>>8&255]^ni[Q&255]^N[Oe+3],Oe+=4,G=ae,Z=ce,Q=oe;for(we=0;we<4;we++)ee[(3&-we)+M]=ai[G>>>24]<<24^ai[Z>>16&255]<<16^ai[Q>>8&255]<<8^ai[ie&255]^N[Oe++],ae=G,G=Z,Z=Q,Q=ie,ie=ae},O}(),g=function(O){t(L,O);function L(){var U;return U=O.call(this,a)||this,U.jobs=[],U.delay=1,U.timeout_=null,U}var j=L.prototype;return j.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},j.push=function(D){this.jobs.push(D),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},L}(a),m=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},_=function(L,j,U){var D=new Int32Array(L.buffer,L.byteOffset,L.byteLength>>2),W=new c(Array.prototype.slice.call(j)),V=new Uint8Array(L.byteLength),ee=new Int32Array(V.buffer),M,N,G,Z,Q,ie,ae,ce,oe;for(M=U[0],N=U[1],G=U[2],Z=U[3],oe=0;oe<D.length;oe+=4)Q=m(D[oe]),ie=m(D[oe+1]),ae=m(D[oe+2]),ce=m(D[oe+3]),W.decrypt(Q,ie,ae,ce,ee,oe),ee[oe]=m(ee[oe]^M),ee[oe+1]=m(ee[oe+1]^N),ee[oe+2]=m(ee[oe+2]^G),ee[oe+3]=m(ee[oe+3]^Z),M=Q,N=ie,G=ae,Z=ce;return V},b=function(){function O(j,U,D,W){var V=O.STEP,ee=new Int32Array(j.buffer),M=new Uint8Array(j.byteLength),N=0;for(this.asyncStream_=new g,this.asyncStream_.push(this.decryptChunk_(ee.subarray(N,N+V),U,D,M)),N=V;N<ee.length;N+=V)D=new Uint32Array([m(ee[N-4]),m(ee[N-3]),m(ee[N-2]),m(ee[N-1])]),this.asyncStream_.push(this.decryptChunk_(ee.subarray(N,N+V),U,D,M));this.asyncStream_.push(function(){W(null,o(M))})}var L=O.prototype;return L.decryptChunk_=function(U,D,W,V){return function(){var ee=_(U,D,W);V.set(ee,U.byteOffset)}},r(O,null,[{key:"STEP",get:function(){return 32e3}}]),O}(),E;typeof window<"u"?E=window:typeof s<"u"?E=s:typeof self<"u"?E=self:E={};var S=E,R=function(L){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(L):L&&L.buffer instanceof ArrayBuffer},F=S.BigInt||Number;F("0x1"),F("0x100"),F("0x10000"),F("0x1000000"),F("0x100000000"),F("0x10000000000"),F("0x1000000000000"),F("0x100000000000000"),F("0x10000000000000000");var B=function(L){var j={};
46return Object.keys(L).forEach(function(U){var D=L[U];R(D)?j[U]={bytes:D.buffer,byteOffset:D.byteOffset,byteLength:D.byteLength}:j[U]=D}),j};self.onmessage=function(O){var L=O.data,j=new Uint8Array(L.encrypted.bytes,L.encrypted.byteOffset,L.encrypted.byteLength),U=new Uint32Array(L.key.bytes,L.key.byteOffset,L.key.byteLength/4),D=new Uint32Array(L.iv.bytes,L.iv.byteOffset,L.iv.byteLength/4);new b(j,U,D,function(W,V){self.postMessage(B({source:L.source,decrypted:V}),[V.buffer])})}})),e0=Wd(Zv),t0=function(i){var n=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(n="main-desc"),n},Tn=function(i,n){i.abort(),i.pause(),n&&n.activePlaylistLoader&&(n.activePlaylistLoader.pause(),n.activePlaylistLoader=null)},$a=function(i,n){n.activePlaylistLoader=i,i.load()},i0=function(i,n){return function(){var r=n.segmentLoaders,e=r[i],t=r.main,a=n.mediaTypes[i],o=a.activeTrack(),u=a.getActiveGroup(),l=a.activePlaylistLoader,c=a.lastGroup_;if(!(u&&c&&u.id===c.id)&&(a.lastGroup_=u,a.lastTrack_=o,Tn(e,a),!(!u||u.isMasterPlaylist))){if(!u.playlistLoader){l&&t.resetEverything();return}e.resyncLoader(),$a(u.playlistLoader,a)}}},r0=function(i,n){return function(){var r=n.segmentLoaders[i],e=n.mediaTypes[i];e.lastGroup_=null,r.abort(),r.pause()}},n0=function(i,n){return function(){var r=n.masterPlaylistLoader,e=n.segmentLoaders,t=e[i],a=e.main,o=n.mediaTypes[i],u=o.activeTrack(),l=o.getActiveGroup(),c=o.activePlaylistLoader,g=o.lastTrack_;if(!(g&&u&&g.id===u.id)&&(o.lastGroup_=l,o.lastTrack_=u,Tn(t,o),!!l)){if(l.isMasterPlaylist){if(!u||!g||u.id===g.id)return;var m=n.vhs.masterPlaylistController_,_=m.selectPlaylist();if(m.media()===_)return;o.logger_("track change. Switching master audio from "+g.id+" to "+u.id),r.pause(),a.resetEverything(),m.fastQualityChange_(_);return}if(i==="AUDIO"){if(!l.playlistLoader){a.setAudio(!0),a.resetEverything();return}t.setAudio(!0),a.setAudio(!1)}if(c===l.playlistLoader){$a(l.playlistLoader,o);return}t.track&&t.track(u),t.resetEverything(),$a(l.playlistLoader,o)}}},bn={AUDIO:function(i,n){return function(){var r=n.segmentLoaders[i],e=n.mediaTypes[i],t=n.blacklistCurrentPlaylist;Tn(r,e);var a=e.activeTrack(),o=e.activeGroup(),u=(o.filter(function(g){return g.default})[0]||o[0]).id,l=e.tracks[u];if(a===l){t({message:"Problem encountered loading the default audio track."});return}A.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(i,n){return function(){var r=n.segmentLoaders[i],e=n.mediaTypes[i];A.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Tn(r,e);var t=e.activeTrack();t&&(t.mode="disabled"),e.onTrackChanged()}}},ju={AUDIO:function(i,n,r){if(n){var e=r.tech,t=r.requestOptions,a=r.segmentLoaders[i];n.on("loadedmetadata",function(){var o=n.media();a.playlist(o,t),(!e.paused()||o.endList&&e.preload()!=="none")&&a.load()}),n.on("loadedplaylist",function(){a.playlist(n.media(),t),e.paused()||a.load()}),n.on("error",bn[i](i,r))}},SUBTITLES:function(i,n,r){var e=r.tech,t=r.requestOptions,a=r.segmentLoaders[i],o=r.mediaTypes[i];n.on("loadedmetadata",function(){var u=n.media();a.playlist(u,t),a.track(o.activeTrack()),(!e.paused()||u.endList&&e.preload()!=="none")&&a.load()}),n.on("loadedplaylist",function(){a.playlist(n.media(),t),e.paused()||a.load()}),n.on("error",bn[i](i,r))}},a0={AUDIO:function(i,n){var r=n.vhs,e=n.sourceType,t=n.segmentLoaders[i],a=n.requestOptions,o=n.master.mediaGroups,u=n.mediaTypes[i],l=u.groups,c=u.tracks,g=u.logger_,m=n.masterPlaylistLoader,_=mr(m.master);(!o[i]||Object.keys(o[i]).length===0)&&(o[i]={main:{default:{default:!0}}},_&&(o[i].main.default.playlists=m.master.playlists));for(var b in o[i]){l[b]||(l[b]=[]);for(var E in o[i][b]){var S=o[i][b][E],R=void 0;if(_?(g("AUDIO group '"+b+"' label '"+E+"' is a master playlist"),S.isMasterPlaylist=!0,R=null):e==="vhs-json"&&S.playlists?R=new mi(S.playlists[0],r,a):S.resolvedUri?R=new mi(S.resolvedUri,r,a):S.playlists&&e==="dash"?R=new qa(S.playlists[0],r,a,m):R=null,S=A.mergeOptions({id:E,playlistLoader:R},S),ju[i](i,S.playlistLoader,n),l[b].push(S),typeof c[E]>"u"){var F=new A.AudioTrack({id:E,kind:t0(S),enabled:!1,language:S.language,default:S.default,label:E});c[E]=F}}}t.on("error",bn[i](i,n))},SUBTITLES:function(i,n){var r=n.tech,e=n.vhs,t=n.sourceType,a=n.segmentLoaders[i],o=n.requestOptions,u=n.master.mediaGroups,l=n.mediaTypes[i],c=l.groups,g=l.tracks,m=n.masterPlaylistLoader;for(var _ in u[i]){c[_]||(c[_]=[]);for(var b in u[i][_])if(!u[i][_][b].forced){var E=u[i][_][b],S=void 0;if(t==="hls")S=new mi(E.resolvedUri,e,o);else if(t==="dash"){var R=E.playlists.filter(function(B){return B.excludeUntil!==1/0});if(!R.length)return;S=new qa(E.playlists[0],e,o,m)}else t==="vhs-json"&&(S=new mi(E.playlists?E.playlists[0]:E.resolvedUri,e,o));if(E=A.mergeOptions({id:b,playlistLoader:S},E),ju[i](i,E.playlistLoader,n),c[_].push(E),typeof g[b]>"u"){var F=r.addRemoteTextTrack({id:b,kind:"subtitles",default:E.default&&E.autoselect,language:E.language,label:b},!1).track;g[b]=F}}}a.on("error",bn[i](i,n))},"CLOSED-CAPTIONS":function(i,n){var r=n.tech,e=n.master.mediaGroups,t=n.mediaTypes[i],a=t.groups,o=t.tracks;for(var u in e[i]){a[u]||(a[u]=[]);for(var l in e[i][u]){var c=e[i][u][l];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var g=r.options_.vhs&&r.options_.vhs.captionServices||{},m={label:l,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(g[m.instreamId]&&(m=A.mergeOptions(m,g[m.instreamId])),m.default===void 0&&delete m.default,a[u].push(A.mergeOptions({id:l},c)),typeof o[l]>
46"u"){var _=r.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;o[l]=_}}}}}},s0=function s(i,n){for(var r=0;r<i.length;r++)if(Fs(n,i[r])||i[r].playlists&&s(i[r].playlists,n))return!0;return!1},o0=function(i,n){return function(r){var e=n.masterPlaylistLoader,t=n.mediaTypes[i].groups,a=e.media();if(!a)return null;var o=null;a.attributes[i]&&(o=t[a.attributes[i]]);var u=Object.keys(t);if(!o)if(i==="AUDIO"&&u.length>1&&mr(n.master))for(var l=0;l<u.length;l++){var c=t[u[l]];if(s0(c,a)){o=c;break}}else t.main?o=t.main:u.length===1&&(o=t[u[0]]);return typeof r>"u"?o:r===null||!o?null:o.filter(function(g){return g.id===r.id})[0]||null}},u0={AUDIO:function(i,n){return function(){var r=n.mediaTypes[i].tracks;for(var e in r)if(r[e].enabled)return r[e];return null}},SUBTITLES:function(i,n){return function(){var r=n.mediaTypes[i].tracks;for(var e in r)if(r[e].mode==="showing"||r[e].mode==="hidden")return r[e];return null}}},l0=function(i,n){var r=n.mediaTypes;return function(){var e=r[i].activeTrack();return e?r[i].activeGroup(e):null}},d0=function(i){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){a0[b](b,i)});var n=i.mediaTypes,r=i.masterPlaylistLoader,e=i.tech,t=i.vhs,a=i.segmentLoaders,o=a.AUDIO,u=a.main;["AUDIO","SUBTITLES"].forEach(function(b){n[b].activeGroup=o0(b,i),n[b].activeTrack=u0[b](b,i),n[b].onGroupChanged=i0(b,i),n[b].onGroupChanging=r0(b,i),n[b].onTrackChanged=n0(b,i),n[b].getActiveGroup=l0(b,i)});var l=n.AUDIO.activeGroup();if(l){var c=(l.filter(function(b){return b.default})[0]||l[0]).id;n.AUDIO.tracks[c].enabled=!0,n.AUDIO.onGroupChanged(),n.AUDIO.onTrackChanged();var g=n.AUDIO.getActiveGroup();g.playlistLoader?(u.setAudio(!1),o.setAudio(!0)):u.setAudio(!0)}r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(b){return n[b].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(b){return n[b].onGroupChanging()})});var m=function(){n.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",n.SUBTITLES.onTrackChanged),t.on("dispose",function(){e.audioTracks().removeEventListener("change",m),e.remoteTextTracks().removeEventListener("change",n.SUBTITLES.onTrackChanged)}),e.clearTracks("audio");for(var _ in n.AUDIO.tracks)e.audioTracks().addTrack(n.AUDIO.tracks[_])},c0=function(){var i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(n){i[n]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:xt,activeTrack:xt,getActiveGroup:xt,onGroupChanged:xt,onTrackChanged:xt,lastTrack_:null,logger_:lt("MediaGroups["+n+"]")}}),i},f0=60*2,Tt,h0=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],p0=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},m0=function(i){var n=i.currentPlaylist,r=i.buffered,e=i.currentTime,t=i.nextPlaylist,a=i.bufferLowWaterLine,o=i.bufferHighWaterLine,u=i.duration,l=i.experimentalBufferBasedABR,c=i.log;if(!t)return A.log.warn("We received no playlist to switch to. Please check your stream."),!1;var g="allowing switch "+(n&&n.id||"null")+" -> "+t.id;if(!n)return c(g+" as current playlist is not set"),!0;if(t.id===n.id)return!1;var m=!!pi(r,e).length;if(!n.endList)return!m&&typeof n.partTargetDuration=="number"?(c("not "+g+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(g+" as current playlist is live"),!0);var _=Ds(r,e),b=l?Pe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Pe.MAX_BUFFER_LOW_WATER_LINE;if(u<b)return c(g+" as duration < max low water line ("+u+" < "+b+")"),!0;var E=t.attributes.BANDWIDTH,S=n.attributes.BANDWIDTH;if(E<S&&(!l||_<o)){var R=g+" as next bandwidth < current bandwidth ("+E+" < "+S+")";return l&&(R+=" and forwardBuffer < bufferHighWaterLine ("+_+" < "+o+")"),c(R),!0}if((!l||E>S)&&_>=a){var F=g+" as forwardBuffer >= bufferLowWaterLine ("+_+" >= "+a+")";return l&&(F+=" and next bandwidth > current bandwidth ("+E+" >
46 "+S+")"),c(F),!0}return c("not "+g+" as no switching criteria met"),!1},g0=function(s){$(i,s);function i(r){var e;e=s.call(this)||this;var t=r.src,a=r.handleManifestRedirects,o=r.withCredentials,u=r.tech,l=r.bandwidth,c=r.externVhs,g=r.useCueTags,m=r.blacklistDuration,_=r.enableLowInitialPlaylist,b=r.sourceType,E=r.cacheEncryptionKeys,S=r.experimentalBufferBasedABR,R=r.experimentalLeastPixelDiffSelector,F=r.captionServices;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");var B=r.maxPlaylistRetries;(B===null||typeof B>"u")&&(B=1/0),Tt=c,e.experimentalBufferBasedABR=!!S,e.experimentalLeastPixelDiffSelector=!!R,e.withCredentials=o,e.tech_=u,e.vhs_=u.vhs,e.sourceType_=b,e.useCueTags_=g,e.blacklistDuration=m,e.maxPlaylistRetries=B,e.enableLowInitialPlaylist=_,e.useCueTags_&&(e.cueTagsTrack_=e.tech_.addTextTrack("metadata","ad-cues"),e.cueTagsTrack_.inBandMetadataTrackDispatchType=""),e.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:B,timeout:null},e.on("error",e.pauseLoading),e.mediaTypes_=c0(),e.mediaSource=new k.MediaSource,e.handleDurationChange_=e.handleDurationChange_.bind(ne(e)),e.handleSourceOpen_=e.handleSourceOpen_.bind(ne(e)),e.handleSourceEnded_=e.handleSourceEnded_.bind(ne(e)),e.mediaSource.addEventListener("durationchange",e.handleDurationChange_),e.mediaSource.addEventListener("sourceopen",e.handleSourceOpen_),e.mediaSource.addEventListener("sourceended",e.handleSourceEnded_),e.seekable_=A.createTimeRanges(),e.hasPlayed_=!1,e.syncController_=new Yv(r),e.segmentMetadataTrack_=u.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,e.decrypter_=new e0,e.sourceUpdater_=new nc(e.mediaSource),e.inbandTextTracks_={},e.timelineChangeController_=new Jv;var O={vhs:e.vhs_,parse708captions:r.parse708captions,useDtsForTimestampOffset:r.useDtsForTimestampOffset,captionServices:F,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:E,sourceUpdater:e.sourceUpdater_,timelineChangeController:e.timelineChangeController_,experimentalExactManifestTimings:r.experimentalExactManifestTimings};e.masterPlaylistLoader_=e.sourceType_==="dash"?new qa(t,e.vhs_,e.requestOptions_):new mi(t,e.vhs_,e.requestOptions_),e.setupMasterPlaylistLoaderListeners_(),e.mainSegmentLoader_=new za(A.mergeOptions(O,{segmentMetadataTrack:e.segmentMetadataTrack_,loaderType:"main"}),r),e.audioSegmentLoader_=new za(A.mergeOptions(O,{loaderType:"audio"}),r),e.subtitleSegmentLoader_=new Kv(A.mergeOptions(O,{loaderType:"vtt",featuresNativeTextTracks:e.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(U,D){function W(){u.off("vttjserror",V),U()}function V(){u.off("vttjsloaded",W),D()}u.one("vttjsloaded",W),u.one("vttjserror",V),u.addWebVttScript_()})}}),r),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_()})),h0.forEach(function(j){e[j+"_"]=p0.bind(ne(e),j)}),e.logger_=lt("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 L=e.tech_.preload()==="none"?"play":"loadstart";return e.tech_.one(L,function(){var j=Date.now();e.tech_.one("loadeddata",function(){e.timeToLoadedData__=Date.now()-j,e.mainAppendsToLoadedData__=e.mainSegmentLoader_.mediaAppends,e.audioAppendsToLoadedData__=e.audioSegmentLoader_.mediaAppends})}),e}var n=i.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(e){e===void 0&&(e="abr");var t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)},n.switchMedia_=function(e,t,a){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 "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,a)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=k.setInterval(function(){return e.checkABR_()},250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(k.clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var a=e.mediaGroups.AUDIO,o=Object.keys(a),u;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)u=this.mediaTypes_.AUDIO.activeTrack();else{var l=a.main||o.length&&a[o[0]];for(var c in l)if(l[c].default){u={label:c};break}}if(!u)return t;var g=[];for(var m in a)if(a[m][u.label]){var _=a[m][u.label];if(_.playlists&&_.playlists.length)g.push.apply(g,_.playlists);else if(_.uri)g.push(_);else if(e.playlists.length)for(var b=0;b<e.playlists.length;b++){var E=e.playlists[b];E.attributes&&E.attributes.AUDIO&&E.attributes.AUDIO===m&&g.push(E)}}return g.length?g:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var t=e.masterPlaylistLoader_.media(),a=t.targetDuration*1.5*1e3;Ba(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=a,t.endList&&e.tech_.preload()!=="none"&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),d0({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(),t),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 t=e.masterPlaylistLoader_.media();if(!t){e.excludeUnsupportedVariants_();var a;if(e.enableLowInitialPlaylist&&(a=e.selectInitialPlaylist()),a||(a=e.selectPlaylist()),!a||!e.shouldSwitchToMedia_(a))return;e.initialMedia_=a,e.switchMedia_(e.initialMedia_,"initial");var o=e.sourceType_==="vhs-json"&&e.initialMedia_.segments;if(!o)return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)}
46),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 t=e.masterPlaylistLoader_.media(),a=t.targetDuration*1.5*1e3;Ba(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=a,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var t=e.masterPlaylistLoader_.media();if(t.lastExcludeReason_!=="playlist-unchanged"){var a=e.stuckAtPlaylistEnd_(t);a&&(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"})})},n.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())},n.triggerPresenceUsage_=function(e,t){var a=e.mediaGroups||{},o=!0,u=Object.keys(a.AUDIO);for(var l in a.AUDIO)for(var c in a.AUDIO[l]){var g=a.AUDIO[l][c];g.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Tt.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),u.length&&Object.keys(a.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"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),u=this.bufferHighWaterLine(),l=this.tech_.buffered();return m0({buffered:l,currentTime:a,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:o,bufferHighWaterLine:u,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.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(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},f0))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var o=e.getCodecsOrExclude_();o&&e.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),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()})},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=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(){A.browser.IE_VERSION||A.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})},n.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))}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var a=this.seekable();if(!a.length)return!1;if(A.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(a.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,function(t){})}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(!(!e||!e.length)){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")}
46,n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){var t=this.seekable();if(!t.length)return!1;var a=this.syncController_.getExpiredTime(e,this.duration());if(a===null)return!1;var o=Tt.Playlist.playlistEnd(e,a),u=this.tech_.currentTime(),l=this.tech_.buffered();if(!l.length)return o-u<=mt;var c=l.end(l.length-1);return c-u<=mt&&o-c<=mt},n.blacklistCurrentPlaylist=function(e,t){e===void 0&&(e={});var a=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!a){this.error=e,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}a.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,u=o.filter(Un),l=u.length===1&&u[0]===a;if(o.length===1&&t!==1/0)return A.log.warn("Problem encountered with playlist "+a.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(R){if(R!==a){var F=R.excludeUntil;typeof F<"u"&&F!==1/0&&(c=!0,delete R.excludeUntil)}}),c&&(A.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var g;a.playlistErrors_>this.maxPlaylistRetries?g=1/0:g=Date.now()+t*1e3,a.excludeUntil=g,e.reason&&(a.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_:A.log.warn,b=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(b+" Switching to playlist "+m.id+".")),m.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),m.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var E=m.targetDuration/2*1e3||5*1e3,S=typeof m.lastRequest=="number"&&Date.now()-m.lastRequest<=E;return this.switchMedia_(m,"exclude",l||S)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var a=this,o=[],u=e==="all";(u||e==="main")&&o.push(this.masterPlaylistLoader_);var l=[];(u||e==="audio")&&l.push("AUDIO"),(u||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(c){var g=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;g&&o.push(g)}),["main","audio","subtitle"].forEach(function(c){var g=a[c+"SegmentLoader_"];g&&(e===c||e==="all")&&o.push(g)}),o.forEach(function(c){return t.forEach(function(g){typeof c[g]=="function"&&c[g]()})})},n.setCurrentTime=function(e){var t=pi(this.tech_.buffered(),e);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(t&&t.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()},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Tt.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var a=this.syncController_.getExpiredTime(t,this.duration());if(a!==null){var o=this.masterPlaylistLoader_.master,u=Tt.Playlist.seekable(t,a,Tt.Playlist.liveEdgeDelay(o,t));if(u.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),a=this.syncController_.getExpiredTime(t,this.duration()),a===null||(e=Tt.Playlist.seekable(t,a,Tt.Playlist.liveEdgeDelay(o,t)),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_=A.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 ["+bd(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.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 t=this.seekable();if(!t.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1));return}var a=this.tech_.buffered(),o=Tt.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},n.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(t){var a=e.mediaTypes_[t].groups;
46for(var o in a)a[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()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!a)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;var o=Zi(this.master(),a),u={},l=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(u.video=o.video||t.main.videoCodec||fh),t.main.isMuxed&&(u.video+=","+(o.audio||t.main.audioCodec||Fo)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||l)&&(u.audio=o.audio||t.main.audioCodec||t.audio.audioCodec||Fo,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!u.audio&&!u.video){this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(R,F){return R?$r(F):ta(F)},g={},m;if(["video","audio"].forEach(function(S){if(u.hasOwnProperty(S)&&!c(t[S].isFmp4,u[S])){var R=t[S].isFmp4?"browser":"muxer";g[R]=g[R]||[],g[R].push(u[S]),S==="audio"&&(m=R)}}),l&&m&&a.attributes.AUDIO){var _=a.attributes.AUDIO;
46this.master().playlists.forEach(function(S){var R=S.attributes&&S.attributes.AUDIO;R===_&&S!==a&&(S.excludeUntil=1/0)}),this.logger_("excluding audio group "+_+" as "+m+' does not support codec(s): "'+u.audio+'"')}if(Object.keys(g).length){var b=Object.keys(g).reduce(function(S,R){return S&&(S+=", "),S+=R+' does not support codec(s): "'+g[R].join(",")+'"',S},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:b,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var E=[];if(["video","audio"].forEach(function(S){var R=(ft(e.sourceUpdater_.codecs[S]||"")[0]||{}).type,F=(ft(u[S]||"")[0]||{}).type;R&&F&&R.toLowerCase()!==F.toLowerCase()&&E.push('"'+e.sourceUpdater_.codecs[S]+'" -> "'+u[S]+'"')}),E.length){this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+E.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return u},n.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,a=[];Object.keys(t).forEach(function(o){var u=t[o];if(a.indexOf(u.id)===-1){a.push(u.id);var l=Zi(e.master,u),c=[];l.audio&&!ta(l.audio)&&!$r(l.audio)&&c.push("audio codec "+l.audio),l.video&&!ta(l.video)&&!$r(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(", ")))}})},n.excludeIncompatibleVariants_=function(e){var t=this,a=[],o=this.master().playlists,u=yn(ft(e)),l=Iu(u),c=u.video&&ft(u.video)[0]||null,g=u.audio&&ft(u.audio)[0]||null;Object.keys(o).forEach(function(m){var _=o[m];if(!(a.indexOf(_.id)!==-1||_.excludeUntil===1/0)){a.push(_.id);var b=[],E=Zi(t.masterPlaylistLoader_.master,_),S=Iu(E);if(!(!E.audio&&!E.video)){if(S!==l&&b.push('codec count "'+S+'" !== "'+l+'"'),!t.sourceUpdater_.canChangeType()){var R=E.video&&ft(E.video)[0]||null,F=E.audio&&ft(E.audio)[0]||null;R&&c&&R.type.toLowerCase()!==c.type.toLowerCase()&&b.push('video codec "'+R.type+'" !== "'+c.type+'"'),F&&g&&F.type.toLowerCase()!==g.type.toLowerCase()&&b.push('audio codec "'+F.type+'" !== "'+g.type+'"')}b.length&&(_.excludeUntil=1/0,t.logger_("blacklisting "+_.id+": "+b.join(" && ")))}}})},n.updateAdCues_=function(e){var t=0,a=this.seekable();a.length&&(t=a.start(0)),Xv(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=Pe.GOAL_BUFFER_LENGTH,a=Pe.GOAL_BUFFER_LENGTH_RATE,o=Math.max(t,Pe.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*a,o)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=Pe.BUFFER_LOW_WATER_LINE,a=Pe.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(t,Pe.MAX_BUFFER_LOW_WATER_LINE),u=Math.max(t,Pe.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*a,this.experimentalBufferBasedABR?u:o)},n.bufferHighWaterLine=function(){return Pe.BUFFER_HIGH_WATER_LINE},i}(A.EventTarget),v0=function(i,n,r){return function(e){var t=i.master.playlists[n],a=Ms(t),o=Un(t);return typeof e>"u"?o:(e?delete t.disabled:t.disabled=!0,e!==o&&!a&&(r(),e?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),e)}},y0=function(i,n,r){var e=i.masterPlaylistController_,t=i.options_.smoothQualityChange,a=t?"smooth":"fast",o=e[a+"QualityChange_"].bind(e);if(n.attributes){var u=n.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=n.attributes.BANDWIDTH,this.frameRate=n.attributes["FRAME-RATE"]}this.codecs=Zi(e.master(),n),this.playlist=n,this.id=r,this.enabled=v0(i.playlists,n.id,o)},_0=function(i){i.representations=function(){var n=i.masterPlaylistController_.master(),r=mr(n)?i.masterPlaylistController_.getAudioTrackPlaylists_():n.playlists;return r?r.filter(function(e){return!Ms(e)}).map(function(e,t){return new y0(i,e,e.id)}):[]}},Vu=["seeking","seeked","pause","playing","error"],T0=function(){function s(n){var r=this;this.masterPlaylistController_=n.masterPlaylistController,this.tech_=n.tech,this.seekable=n.seekable,this.allowSeeksWithinUnsafeLiveWindow=n.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=n.liveRangeSafeTimeDelta,this.media=n.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=lt("PlaybackWatcher"),this.logger_("initialize");var e=function(){return r.monitorCurrentTime_()},t=function(){return r.monitorCurrentTime_()},a=function(){return r.techWaiting_()},o=function(){return r.cancelTimer_()},u=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach(function(m){c[m]={reset:function(){return r.resetSegmentDownloads_(m)},updateend:function(){return r.checkSegmentDownloads_(m)}},u[m+"SegmentLoader_"].on("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].on("playlistupdate",c[m].reset),r.tech_.on(["seeked","seeking"],c[m].reset)});var g=function(_){["main","audio"].forEach(function(b){u[b+"SegmentLoader_"][_]("appended",r.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){r.fixesBadSeeks_()&&(r.consecutiveUpdates=0,r.lastRecordedTime=r.tech_.currentTime(),g("off"))},this.clearSeekingAppendCheck_=function(){return g("off")},this.watchForBadSeeking_=function(){r.clearSeekingAppendCheck_(),g("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(Vu,o),this.tech_.on("canplay",t),this.tech_.one("play",e),this.dispose=function(){r.clearSeekingAppendCheck_(),r.logger_("dispose"),r.tech_.off("waiting",a),r.tech_.off(Vu,o),r.tech_.off("canplay",t),r.tech_.off("play",e),r.tech_.off("seeking",r.watchForBadSeeking_),r.tech_.off("seeked",r.clearSeekingAppendCheck_),l.forEach(function(m){u[m+"SegmentLoader_"].off("appendsdone",c[m].updateend),u[m+"SegmentLoader_"].off("playlistupdate",c[m].reset),r.tech_.off(["seeked","seeking"],c[m].reset)}),r.checkCurrentTimeTimeout_&&k.clearTimeout(r.checkCurrentTimeTimeout_),r.cancelTimer_()}}var i=s.prototype;return i.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&k.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=k.setTimeout(this.monitorCurrentTime_.bind(this),250)},i.resetSegmentDownloads_=function(r){var e=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=e.buffered_()},i.checkSegmentDownloads_=function(r){var e=this.masterPlaylistController_,t=e[r+"SegmentLoader_"],a=t.buffered_(),o=cg(this[r+"Buffered_"],a);if(this[r+"Buffered_"]=a,o){this.resetSegmentDownloads_(r);return}this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:t.playlist_&&t.playlist_.id,buffered:Qt(a)}),!(this[r+"StalledDownloads_"]<10)&&(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0))},i.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var r=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===r&&(!e.length||r+mt>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},i.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},i.fixesBadSeeks_=function(){var r=this.tech_.seeking();if(!r)return!1;var e=this.seekable(),t=this.tech_.currentTime(),a=this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(a){var u=e.end(e.length-1);o=u}if(this.beforeSeekableWindow_(e,t)){var l=e.start(0);o=l+(l===e.end(0)?0:mt)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+t+" with "+("seekable range "+bd(e)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,g=this.tech_.buffered(),m=c.audioBuffer?c.audioBuffered():null,_=c.videoBuffer?c.videoBuffered():null,b=this.media(),E=b.partTargetDuration?b.partTargetDuration:(b.targetDuration-Nt)*2,S=[m,_],R=0;R<S.length;R++)if(S[R]){var F=Ds(S[R],t);if(F<E)return!1}var B=Gr(g,t);return B.length===0?!1:(o=B.start(0)+mt,this.logger_("Buffered region starts ("+B.start(0)+") "+(" just beyond seek point ("+t+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},i.waiting_=function(){if(!this.techWaiting_()){var r=this.tech_.currentTime(),e=this.tech_.buffered(),t=pi(e,r);if(t.length&&r+3<=t.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(r),this.logger_("Stopped at "+r+" while inside a buffered region "+("["+t.start(0)+" -> "+t.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}}},i.techWaiting_=function(){var r=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;
46if(this.beforeSeekableWindow_(r,e)){var t=r.end(r.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to "+("live point (seekable end) "+t)),this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),u=this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.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=Gr(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},i.afterSeekableWindow_=function(r,e,t,a){if(a===void 0&&(a=!1),!r.length)return!1;var o=r.end(r.length-1)+mt,u=!t.endList;return u&&a&&(o=r.end(r.length-1)+t.targetDuration*3),e>o},i.beforeSeekableWindow_=function(r,e){return!!(r.length&&r.start(0)>0&&e<r.start(0)-this.liveRangeSafeTimeDelta)},i.videoUnderflow_=function(r){var e=r.videoBuffered,t=r.audioBuffered,a=r.currentTime;if(e){var o;if(e.length&&t.length){var u=pi(e,a-3),l=pi(e,a),c=pi(t,a);c.length&&!l.length&&u.length&&(o={start:u.end(0),end:c.end(0)})}else{var g=Gr(e,a);g.length||(o=this.gapFromVideoUnderflow_(e,a))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+a)),!0):!1}},i.skipTheGap_=function(r){var e=this.tech_.buffered(),t=this.tech_.currentTime(),a=Gr(e,t);this.cancelTimer_(),!(a.length===0||t!==r)&&(this.logger_("skipTheGap_:","currentTime:",t,"scheduled currentTime:",r,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+Nt),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},i.gapFromVideoUnderflow_=function(r,e){for(var t=ug(r),a=0;a<t.length;a++){var o=t.start(a),u=t.end(a);if(e-o<4&&e-o>2)return{start:o,end:u}}return null},s}(),b0={errorInterval:30,getSource:function(i){var n=this.tech({IWillNotUseThisInPlugins:!0}),r=n.currentSource_||this.currentSource();return i(r)}},S0=function s(i,n){var r=0,e=0,t=A.mergeOptions(b0,n);i.ready(function(){i.trigger({type:"usage",name:"vhs-error-reload-initialized"}),i.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){e&&i.currentTime(e)},o=function(m){m!=null&&(e=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",a),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.trigger({type:"usage",name:"hls-error-reload"}),i.play())},u=function(){if(Date.now()-r<t.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"}),i.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!t.getSource||typeof t.getSource!="function"){A.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return r=Date.now(),t.getSource.call(i,o)},l=function g(){i.off("loadedmetadata",a),i.off("error",u),i.off("dispose",g)},c=function(m){l(),s(i,m)};i.on("error",u),i.on("dispose",l),i.reloadSourceOnError=c},x0=function(i){S0(this,i)},ac="2.16.3",E0="6.0.1",C0="0.22.1",k0="4.8.0",w0="3.1.3",Me={PlaylistLoader:mi,Playlist:Xe,utils:Rg,STANDARD_PLAYLIST_SELECTOR:Ou,INITIAL_PLAYLIST_SELECTOR:Cv,lastBandwidthSelector:Ou,movingAverageBandwidthSelector:xv,comparePlaylistBandwidth:Us,comparePlaylistResolution:Sv,xhr:Rd()};Object.keys(Pe).forEach(function(s){Object.defineProperty(Me,s,{get:function(){return A.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Pe[s]},set:function(n){if(A.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof n!="number"||n<0){A.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}Pe[s]=n}})});var sc="videojs-vhs",oc=function(i,n){for(var r=n.media(),e=-1,t=0;t<i.length;t++)if(i[t].id===r.id){e=t;break}i.selectedIndex_=e,i.trigger({selectedIndex:e,type:"change"})}
46,P0=function(i,n){n.representations().forEach(function(r){i.addQualityLevel(r)}),oc(i,n.playlists)};Me.canPlaySource=function(){return A.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var I0=function(i,n,r){if(!i)return i;var e={};n&&n.attributes&&n.attributes.CODECS&&(e=yn(ft(n.attributes.CODECS))),r&&r.attributes&&r.attributes.CODECS&&(e.audio=r.attributes.CODECS);var t=er(e.video),a=er(e.audio),o={};for(var u in i)o[u]={},a&&(o[u].audioContentType=a),t&&(o[u].videoContentType=t),n.contentProtection&&n.contentProtection[u]&&n.contentProtection[u].pssh&&(o[u].pssh=n.contentProtection[u].pssh),typeof i[u]=="string"&&(o[u].url=i[u]);return A.mergeOptions(i,o)},A0=function(i,n){return i.reduce(function(r,e){if(!e.contentProtection)return r;var t=n.reduce(function(a,o){var u=e.contentProtection[o];return u&&u.pssh&&(a[o]={pssh:u.pssh}),a},{});return Object.keys(t).length&&r.push(t),r},[])},O0=function(i){var n=i.player,r=i.sourceKeySystems,e=i.audioMedia,t=i.mainPlaylists;if(!n.eme.
46initializeMediaKeys)return Promise.resolve();var a=e?t.concat([e]):t,o=A0(a,Object.keys(r)),u=[],l=[];return o.forEach(function(c){l.push(new Promise(function(g,m){n.tech_.one("keysessioncreated",g)})),u.push(new Promise(function(g,m){n.eme.initializeMediaKeys({keySystems:c},function(_){if(_){m(_);return}g()})}))}),Promise.race([Promise.all(u),Promise.race(l)])},D0=function(i){var n=i.player,r=i.sourceKeySystems,e=i.media,t=i.audioMedia,a=I0(r,e,t);return a?(n.currentSource().keySystems=a,a&&!n.eme?(A.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},uc=function(){if(!k.localStorage)return null;var i=k.localStorage.getItem(sc);if(!i)return null;try{return JSON.parse(i)}catch{return null}},L0=function(i){if(!k.localStorage)return!1;var n=uc();n=n?A.mergeOptions(n,i):i;try{k.localStorage.setItem(sc,JSON.stringify(n))}catch{return!1}return n},M0=function(i){return i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i};Me.supportsNativeHls=function(){if(!K||!K.createElement)return!1;var s=K.createElement("video");if(!A.getTech("Html5").isSupported())return!1;var i=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return i.some(function(n){return/maybe|probably/i.test(s.canPlayType(n))})}();Me.supportsNativeDash=function(){return!K||!K.createElement||!A.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(K.createElement("video").canPlayType("application/dash+xml"))}();Me.supportsTypeNatively=function(s){return s==="hls"?Me.supportsNativeHls:s==="dash"?Me.supportsNativeDash:!1};Me.isSupported=function(){return A.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var F0=A.getComponent("Component"),js=function(s){$(i,s);function i(r,e,t){var a;if(a=s.call(this,e,A.mergeOptions(t.hls,t.vhs))||this,t.hls&&Object.keys(t.hls).length&&A.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof t.initialBandwidth=="number"&&(a.options_.bandwidth=t.initialBandwidth),a.logger_=lt("VhsHandler"),e.options_&&e.options_.playerId){var o=A(e.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return A.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"hls-player-access"}),ne(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return A.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),e.trigger({type:"usage",name:"vhs-player-access"}),ne(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return A.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),ne(a)},configurable:!0}),a.player_=o}if(a.tech_=e,a.source_=r,a.stats={},a.ignoreNextSeekingEvent_=!1,a.setOptions_(),a.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(K,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(u){var l=K.fullscreenElement||K.webkitFullscreenElement||K.mozFullScreenElement||K.msFullscreenElement;l&&l.contains(a.tech_.el())?a.masterPlaylistController_.fastQualityChange_():a.masterPlaylistController_.checkABR_()}),a.on(a.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),a.on(a.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),a.on(a.tech_,"play",a.play),a}var n=i.prototype;return n.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 t=uc();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.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=Pe.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Pe.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){typeof e.source_[a]<"u"&&(e.options_[a]=e.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var a=this;if(e){this.setOptions_(),this.options_.src=M0(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Me,this.options_.sourceType=el(t),this.options_.seekTo=function(l){a.tech_.setCurrentTime(l)},this.options_.smoothQualityChange&&A.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new g0(this.options_);var o=A.mergeOptions({liveRangeSafeTimeDelta:mt},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new T0(o),this.masterPlaylistController_.on("error",function(){var l=A.players[a.tech_.options_.playerId],c=a.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?Me.movingAverageBandwidthSelector(.55):Me.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):u.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Me.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,g=k.navigator.connection||k.navigator.mozConnection||k.navigator.webkitConnection,m=1e7;if(this.options_.useNetworkInformationApi&&g){var _=g.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),g;this.throughput>0?g=1/this.throughput:g=0;var m=Math.floor(1/(c+g));return m},set:function(){A.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 a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Qt(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Qt(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&L0({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){_0(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.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_=k.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),O0({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media ke
46ys for EME",code:3})})},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=D0({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var u=e.masterPlaylistController_.master();if(!(!u||!u.playlists)){var l=[];if(u.playlists.forEach(function(g){g&&g.attributes&&g.attributes.RESOLUTION&&g.attributes.RESOLUTION.height>=720&&(!g.excludeUntil||g.excludeUntil<1/0)&&(g.excludeUntil=1/0,l.push(g))}),l.length){var c;(c=A.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_),A.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},n.setupQualityLevels_=function(){var e=this,t=A.players[this.tech_.options_.playerId];
46!t||!t.qualityLevels||this.qualityLevels_||(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){P0(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){oc(e.qualityLevels_,e.playlists)}))},i.version=function(){return{"@videojs/http-streaming":ac,"mux.js":E0,"mpd-parser":C0,"m3u8-parser":k0,"aes-decrypter":w0}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return nc.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.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_&&k.URL.revokeObjectURL&&(k.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return Wg({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,a,o){return a===void 0&&(a=!0),o===void 0&&(o=2),qg({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},i}(F0),sr={name:"videojs-http-streaming",VERSION:ac,canHandleSource:function(i,n){n===void 0&&(n={});var r=A.mergeOptions(A.options,n);return sr.canPlayType(i.type,r)},handleSource:function(i,n,r){r===void 0&&(r={});var e=A.mergeOptions(A.options,r);return n.vhs=new js(i,n,e),A.hasOwnProperty("hls")||Object.defineProperty(n,"hls",{get:function(){return A.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),n.vhs},configurable:!0}),n.vhs.xhr=Rd(),n.vhs.src(i.src,i.type),n.vhs},canPlayType:function(i,n){var r=el(i);if(!r)return"";var e=sr.getOverrideNative(n),t=Me.supportsTypeNatively(r),a=!t||e;return a?"maybe":""},getOverrideNative:function(i){i===void 0&&(i={});var n=i,r=n.vhs,e=r===void 0?{}:r,t=n.hls,a=t===void 0?{}:t,o=!(A.browser.IS_ANY_SAFARI||A.browser.IS_IOS),u=e.overrideNative,l=u===void 0?o:u,c=a.overrideNative,g=c===void 0?!1:c;return g||l}},R0=function(){return $r("avc1.4d400d,mp4a.40.2")};R0()&&A.getTech("Html5").registerSourceHandler(sr,0);A.VhsHandler=js;Object.defineProperty(A,"HlsHandler",{get:function(){return A.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),js},configurable:!0});A.VhsSourceHandler=sr;Object.defineProperty(A,"HlsSourceHandler",{get:function(){return A.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),sr},configurable:!0});A.Vhs=Me;Object.defineProperty(A,"Hls",{get:function(){return A.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Me},configurable:!0});A.use||(A.registerComponent("Hls",Me),A.registerComponent("Vhs",Me));A.options.vhs=A.options.vhs||{};A.options.hls=A.options.hls||{};if(!A.getPlugin||!A.getPlugin("reloadSourceOnError")){var N0=A.registerPlugin||A.plugin;N0("reloadSourceOnError",x0)}/*! @vimeo/player v2.29.0 | (c) 2025 Vimeo | MIT License | https://github.com/vimeo/player.js */function Hu(s,i){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);i&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(s,e).enumerable})),n.push.apply(n,r)}return n}function Wu(s){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Hu(Object(n),!0).forEach(function(r){Zr(s,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(n,r))})}return s}function je(){je=function(){return s};var s={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(M,N,G){M[N]=G.value},e=typeof Symbol=="function"?Symbol:{},t=e.iterator||"@@iterator",a=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function u(M,N,G){return Object.defineProperty(M,N,{value:G,enumerable:!0,configurable:!0,writable:!0}),M[N]}try{u({},"")}catch{u=function(N,G,Z){return N[G]=Z}}function l(M,N,G,Z){var Q=N&&N.prototype instanceof m?N:m,ie=Object.create(Q.prototype),ae=new W(Z||[]);return r(ie,"_invoke",{value:L(M,G,ae)}),ie}function c(M,N,G){try{return{type:"normal",arg:M.call(N,G)}}catch(Z){return{type:"throw",arg:Z}}}s.wrap=l;var g={};function m(){}function _(){}function b(){}var E={};u(E,t,function(){return this});var S=Object.getPrototypeOf,R=S&&S(S(V([])));R&&R!==i&&n.call(R,t)&&(E=R);var F=b.prototype=m.prototype=Object.create(E);function B(M){["next","throw","return"].forEach(function(N){u(M,N,function(G){return this._invoke(N,G)})})}function O(M,N){function G(Q,ie,ae,ce){var oe=c(M[Q],M,ie);if(oe.type!=="throw"){var rt=oe.arg,we=rt.value;return we&&typeof we=="object"&&n.call(we,"__await")?N.resolve(we.__await).then(function(Oe){G("next",Oe,ae,ce)},function(Oe){G("throw",Oe,ae,ce)}):N.resolve(we).then(function(Oe){rt.value=Oe,ae(rt)},function(Oe){return G("throw",Oe,ae,ce)})}ce(oe.arg)}var Z;r(this,"_invoke",{value:function(Q,ie){function ae(){return new N(function(ce,oe){G(Q,ie,ce,oe)})}return Z=Z?Z.then(ae,ae):ae()}})}function L(M,N,G){var Z="suspendedStart";return function(Q,ie){if(Z==="executing")throw new Error("Generator is already running");if(Z==="completed"){if(Q==="throw")throw ie;return ee()}for(G.method=Q,G.arg=ie;;){var ae=G.delegate;if(ae){var ce=j(ae,G);if(ce){if(ce===g)continue;return ce}}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(Z==="suspendedStart")throw Z="completed",G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);Z="executing";var oe=c(M,N,G);
vendor: 4,950 bytes, line 46
46if(oe.type==="normal"){if(Z=G.done?"completed":"suspendedYield",oe.arg===g)continue;return{value:oe.arg,done:G.done}}oe.type==="throw"&&(Z="completed",G.method="throw",G.arg=oe.arg)}}}function j(M,N){var G=N.method,Z=M.iterator[G];if(Z===void 0)return N.delegate=null,G==="throw"&&M.iterator.return&&(N.method="return",N.arg=void 0,j(M,N),N.method==="throw")||G!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+G+"' method")),g;var Q=c(Z,M.iterator,N.arg);if(Q.type==="throw")return N.method="throw",N.arg=Q.arg,N.delegate=null,g;var ie=Q.arg;return ie?ie.done?(N[M.resultName]=ie.value,N.next=M.nextLoc,N.method!=="return"&&(N.method="next",N.arg=void 0),N.delegate=null,g):ie:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,g)}function U(M){var N={tryLoc:M[0]};1 in M&&(N.catchLoc=M[1]),2 in M&&(N.finallyLoc=M[2],N.afterLoc=M[3]),this.tryEntries.push(N)}function D(M){var N=M.completion||{};N.type="normal",delete N.arg,M.completion=N}function W(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(U,this),this.reset(!0)}function V(M){if(M){var N=M[t];if(N)return N.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length)){var G=-1,Z=function Q(){for(;++G<M.length;)if(n.call(M,G))return Q.value=M[G],Q.done=!1,Q;return Q.value=void 0,Q.done=!0,Q};return Z.next=Z}}return{next:ee}}function ee(){return{value:void 0,done:!0}}return _.prototype=b,r(F,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:_,configurable:!0}),_.displayName=u(b,o,"GeneratorFunction"),s.isGeneratorFunction=function(M){var N=typeof M=="function"&&M.constructor;return!!N&&(N===_||(N.displayName||N.name)==="GeneratorFunction")},s.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,b):(M.__proto__=b,u(M,o,"GeneratorFunction")),M.prototype=Object.create(F),M},s.awrap=function(M){return{__await:M}},B(O.prototype),u(O.prototype,a,function(){return this}),s.AsyncIterator=O,s.async=function(M,N,G,Z,Q){Q===void 0&&(Q=Promise);var ie=new O(l(M,N,G,Z),Q);return s.isGeneratorFunction(N)?ie:ie.next().then(function(ae){return ae.done?ae.value:ie.next()})},B(F),u(F,o,"Generator"),u(F,t,function(){return this}),u(F,"toString",function(){return"[object Generator]"}),s.keys=function(M){var N=Object(M),G=[];for(var Z in N)G.push(Z);return G.reverse(),function Q(){for(;G.length;){var ie=G.pop();if(ie in N)return Q.value=ie,Q.done=!1,Q}return Q.done=!0,Q}},s.values=V,W.prototype={constructor:W,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!M)for(var N in this)N.charAt(0)==="t"&&n.call(this,N)&&!isNaN(+N.slice(1))&&(this[N]=void 0)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var N=this;function G(oe,rt){return ie.type="throw",ie.arg=M,N.next=oe,rt&&(N.method="next",N.arg=void 0),!!rt}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var Q=this.tryEntries[Z],ie=Q.completion;if(Q.tryLoc==="root")return G("end");if(Q.tryLoc<=this.prev){var ae=n.call(Q,"catchLoc"),ce=n.call(Q,"finallyLoc");if(ae&&ce){if(this.prev<Q.catchLoc)return G(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return G(Q.finallyLoc)}else if(ae){if(this.prev<Q.catchLoc)return G(Q.catchLoc,!0)}else{if(!ce)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return G(Q.finallyLoc)}}}},abrupt:function(M,N){for(var G=this.tryEntries.length-1;G>=0;--G){var Z=this.tryEntries[G];if(Z.tryLoc<=this.prev&&n.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var Q=Z;break}}Q&&(M==="break"||M==="continue")&&Q.tryLoc<=N&&N<=Q.finallyLoc&&(Q=null);var ie=Q?Q.completion:{};return ie.type=M,ie.arg=N,Q?(this.method="next",this.next=Q.finallyLoc,g):this.complete(ie)},complete:function(M,N){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&N&&(this.next=N),g},finish:function(M){for(var N=this.tryEntries.length-1;N>=0;--N){var G=this.tryEntries[N];if(G.finallyLoc===M)return this.complete(G.completion,G.afterLoc),D(G),g}},catch:function(M){for(var N=this.tryEntries.length-1;N>=0;--N){var G=this.tryEntries[N];if(G.tryLoc===M){var Z=G.completion;if(Z.type==="throw"){var Q=Z.arg;D(G)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(M,N,G){return this.delegate={iterator:V(M),resultName:N,nextLoc:G},this.method==="next"&&(this.arg=void 0),g}},s}function qu(s,i,n,r,e,t,a){try{var o=s[t](a),u=o.value}catch(l){n(l);return}o.done?i(u):Promise.resolve(u).then(r,e)}function $t(s){return function(){var i=this,n=arguments;return new Promise(function(r,e){var t=s.apply(i,n);function a(u){qu(t,r,e,a,o,"next",u)}function o(u){qu(t,r,e,a,o,"throw",u)}a(void 0)})}}
46function lc(s,i){if(!(s instanceof i))throw new TypeError("Cannot call a class as a function")}function U0(s,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(s,fc(r.key),r)}}function dc(s,i,n){return i&&U0(s.prototype,i),Object.defineProperty(s,"prototype",{writable:!1}),s}function Zr(s,i,n){return i=fc(i),i in s?Object.defineProperty(s,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[i]=n,s}function B0(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),i&&ur(s,i)}function or(s){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},or(s)}function ur(s,i){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},ur(s,i)}function cc(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function en(s,i,n){return cc()?en=Reflect.construct.bind():en=function(e,t,a){var o=[null];o.push.apply(o,t);var u=Function.bind.apply(e,o),l=new u;return a&&ur(l,a.prototype),l},en.apply(null,arguments)}function j0(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function Xa(s){var i=typeof Map=="function"?new Map:void 0;return Xa=function(r){if(r===null||!j0(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i<"u"){if(i.has(r))return i.get(r);i.set(r,e)}function e(){return en(r,arguments,or(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),ur(e,r)},Xa(s)}function tn(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function V0(s,i){if(i&&(typeof i=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tn(s)}function H0(s){var i=cc();return function(){var r=or(s),e;if(i){var t=or(this).constructor;e=Reflect.construct(r,arguments,t)}else e=r.apply(this,arguments);return V0(this,e)}}function W0(s,i){if(typeof s!="object"||s===null)return s;var n=s[Symbol.toPrimitive];if(n!==void 0){var r=n.call(s,i);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(s)}function fc(s){var i=W0(s,"string");return typeof i=="symbol"?i:String(i)}var hc=typeof global<"u"&&{}.toString.call(global)==="[object global]";function Gu(s,i){return s.indexOf(i.toLowerCase())===0?s:"".concat(i.toLowerCase()).concat(s.substr(0,1).toUpperCase()).concat(s.substr(1))}function q0(s){return!!(s&&s.nodeType===1&&"nodeName"in s&&s.ownerDocument&&s.ownerDocument.defaultView)}function G0(s){return!isNaN(parseFloat(s))&&isFinite(s)&&Math.floor(s)==s}function ti(s){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(s)}function pc(s){var i=/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/;return i.test(s)}function z0(s){for(var i=(s||"").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(i&&i[1]||"").replace("player.",""),r=[".videoji.hk",".vimeo.work",".videoji.cn"],e=0,t=r;e<t.length;e++){var a=t[e];if(n.endsWith(a))return n}return"vimeo.com"}function mc(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=s.id,n=s.url,r=i||n;if(!r)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(G0(r))return"https://vimeo.com/".concat(r);if(ti(r))return r.replace("http:","https:");throw i?new TypeError("“".concat(i,"” is not a valid video id.")):new TypeError("“".concat(r,"” is not a vimeo.com url."))}var zu=function(i,n,r){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"addEventListener",t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"removeEventListener",a=typeof n=="string"?[n]:n;return a.forEach(function(o){i[e](o,r)}),{cancel:function(){return a.forEach(function(u){return i[t](u,r)})}}},K0=typeof Array.prototype.indexOf<"u",$0=typeof window<"u"&&typeof window.postMessage<"u";if(!hc&&(!K0||!$0))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var _i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function X0(s,i){return i={exports:{}}
46,s(i,i.exports),i.exports}/*!
47 * weakmap-polyfill v2.0.4 - ECMAScript6 WeakMap polyfill
48 * https://github.com/polygonplanet/weakmap-polyfill
49 * Copyright (c) 2015-2021 polygonplanet <[email protected]>
50 * @license MIT
51 */(function(s){if(s.WeakMap)return;var i=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}}(),r=function(t,a,o){n?Object.defineProperty(t,a,{configurable:!0,writable:!0,value:o}):t[a]=o};s.WeakMap=function(){function t(){if(this===void 0)throw new TypeError("Constructor WeakMap requires 'new'");if(r(this,"_id",o("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}r(t.prototype,"delete",function(l){if(a(this,"delete"),!e(l))return!1;var c=l[this._id];return c&&c[0]===l?(delete l[this._id],!0):!1}),r(t.prototype,"get",function(l){if(a(this,"get"),!!e(l)){var c=l[this._id];if(c&&c[0]===l)return c[1]}}),r(t.prototype,"has",function(l){if(a(this,"has"),!e(l))return!1;var c=l[this._id];return!!(c&&c[0]===l)}),r(t.prototype,"set",function(l,c){if(a(this,"set"),!e(l))throw new TypeError("Invalid value used as weak map key");var g=l[this._id];return g&&g[0]===l?(g[1]=c,this):(r(l,this._id,[l,c]),this)});function a(l,c){if(!e(l)||!i.call(l,"_id"))throw new TypeError(c+" method called on incompatible receiver "+typeof l)}function o(l){return l+"_"+u()+"."+u()}function u(){return Math.random().toString().substring(2)}return r(t,"_polyfill",!0),t}();function e(t){return Object(t)===t}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:_i);var tt=X0(function(s){/*! Native Promise Only
52    v0.8.1 (c) Kyle Simpson
53    MIT License: http://getify.mit-license.org
54*/(function(n,r,e){r[n]=r[n]||e(),s.exports&&(s.exports=r[n])})("Promise",_i,function(){var n,r,e,t=Object.prototype.toString,a=typeof setImmediate<"u"?function(B){return setImmediate(B)}:setTimeout;try{Object.defineProperty({},"x",{}),n=function(B,O,L,j){return Object.defineProperty(B,O,{value:L,writable:!0,configurable:j!==!1})}}catch{n=function(O,L,j){return O[L]=j,O}}e=function(){var B,O,L;function j(U,D){this.fn=U,this.self=D,this.next=void 0}return{add:function(D,W){L=new j(D,W),O?O.next=L:B=L,O=L,L=void 0},drain:function(){var D=B;for(B=O=r=void 0;D;)D.fn.call(D.self),D=D.next}}}();function o(F,B){e.add(F,B),r||(r=a(e.drain))}function u(F){var B,O=typeof F;return F!=null&&(O=="object"||O=="function")&&(B=F.then),typeof B=="function"?B:!1}function l(){for(var F=0;F<this.chain.length;F++)c(this,this.state===1?this.chain[F].success:this.chain[F].failure,this.chain[F]);this.chain.length=0}function c(F,B,O){var L,j;try{B===!1?O.reject(F.msg):(B===!0?L=F.msg:L=B.call(void 0,F.msg),L===O.promise?O.reject(TypeError("Promise-chain cycle")):(j=u(L))?j.call(L,O.resolve,O.reject):O.resolve(L))}catch(U){O.reject(U)}}function g(F){var B,O=this;if(!O.triggered){O.triggered=!0,O.def&&(O=O.def);try{(B=u(F))?o(function(){var L=new b(O);try{B.call(F,function(){g.apply(L,arguments)},function(){m.apply(L,arguments)})}catch(j){m.call(L,j)}}):(O.msg=F,O.state=1,O.chain.length>0&&o(l,O))}catch(L){m.call(new b(O),L)}}}function m(F){var B=this;B.triggered||(B.triggered=!0,B.def&&(B=B.def),B.msg=F,B.state=2,B.chain.length>0&&o(l,B))}function _(F,B,O,L){for(var j=0;j<B.length;j++)(function(D){F.resolve(B[D]).then(function(V){O(D,V)},L)})(j)}function b(F){this.def=F,this.triggered=!1}function E(F){this.promise=F,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function S(F){if(typeof F!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var B=new E(this);this.then=function(L,j){var U={success:typeof L=="function"?L:!0,failure:typeof j=="function"?j:!1};return U.promise=new this.constructor(function(W,V){if(typeof W!="function"||typeof V!="function")throw TypeError("Not a function");U.resolve=W,U.reject=V}),B.chain.push(U),B.state!==0&&o(l,B),U.promise},this.catch=function(L){return this.then(void 0,L)};try{F.call(void 0,function(L){g.call(B,L)},function(L){m.call(B,L)})}catch(O){m.call(B,O)}}var R=n({},"constructor",S,!1);return S.prototype=R,n(R,"__NPO__",0,!1),n(S,"resolve",function(B){var O=this;return B&&typeof B=="object"&&B.__NPO__===1?B:new O(function(j,U){if(typeof j!="function"||typeof U!="function")throw TypeError("Not a function");j(B)})}),n(S,"reject",function(B){return new this(function(L,j){if(typeof L!="function"||typeof j!="function")throw TypeError("Not a function");j(B)})}),n(S,"all",function(B){var O=this;return t.call(B)!="[object Array]"?O.reject(TypeError("Not an array")):B.length===0?O.resolve([]):new O(function(j,U){if(typeof j!="function"||typeof U!="function")throw TypeError("Not a function");var D=B.length,W=Array(D),V=0;_(O,B,function(M,N){W[M]=N,++V===D&&j(W)},U)})}),n(S,"race",function(B){var O=this;return t.call(B)!="[object Array]"?O.reject(TypeError("Not an array")):new O(function(j,U){if(typeof j!="function"||typeof U!="function")throw TypeError("Not a function");_(O,B,function(W,V){j(V)},U)})}),S})}),kt=new WeakMap;function Ki(s,i,n){var r=kt.get(s.element)||{};i in r||(r[i]=[]),r[i].push(n),kt.set(s.element,r)}function Sn(s,i){var n=kt.get(s.element)||{};return n[i]||[]}function xn(s,i,n){var r=kt.get(s.element)||{};if(!r[i])return!0;
54if(!n)return r[i]=[],kt.set(s.element,r),!0;var e=r[i].indexOf(n);return e!==-1&&r[i].splice(e,1),kt.set(s.element,r),r[i]&&r[i].length===0}function Q0(s,i){var n=Sn(s,i);if(n.length<1)return!1;var r=n.shift();return xn(s,i,r),r}function Y0(s,i){var n=kt.get(s);kt.set(i,n),kt.delete(s)}function Bn(s){if(typeof s=="string")try{s=JSON.parse(s)}catch(i){return console.warn(i),{}}return s}function zt(s,i,n){if(!(!s.element.contentWindow||!s.element.contentWindow.postMessage)){var r={method:i};n!==void 0&&(r.value=n);var e=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1"));e>=8&&e<10&&(r=JSON.stringify(r)),s.element.contentWindow.postMessage(r,s.origin)}}function J0(s,i){i=Bn(i);var n=[],r;if(i.event){if(i.event==="error"){var e=Sn(s,i.data.method);e.forEach(function(a){var o=new Error(i.data.message);o.name=i.data.name,a.reject(o),xn(s,i.data.method,a)})}n=Sn(s,"event:".concat(i.event)),r=i.data}else if(i.method){var t=Q0(s,i.method);t&&(n.push(t),r=i.value)}n.forEach(function(a){try{if(typeof a=="function"){a.call(s,r);return}a.resolve(r)}catch{}})}var Z0=["airplay","audio_tracks","audiotrack","autopause","autoplay","background","byline","cc","chapter_id","chapters","chromecast","color","colors","controls","dnt","end_time","fullscreen","height","id","initial_quality","interactive_params","keyboard","loop","maxheight","max_quality","maxwidth","min_quality","muted","play_button_position","playsinline","portrait","preload","progress_bar","quality","quality_selector","responsive","skipping_forward","speed","start_time","texttrack","thumbnail_id","title","transcript","transparent","unmute_button","url","vimeo_logo","volume","watch_full_video","width"];function gc(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Z0.reduce(function(n,r){var e=s.getAttribute("data-vimeo-".concat(r));return(e||e==="")&&(n[r]=e===""?1:e),n},i)}function Vs(s,i){var n=s.html;if(!i)throw new TypeError("An element must be provided");if(i.getAttribute("data-vimeo-initialized")!==null)return i.querySelector("iframe");var r=document.createElement("div");return r.innerHTML=n,i.appendChild(r.firstChild),i.setAttribute("data-vimeo-initialized","true"),i.querySelector("iframe")}function vc(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(r,e){if(!ti(s))throw new TypeError("“".concat(s,"” is not a vimeo.com url."));var t=z0(s),a="https://".concat(t,"/api/oembed.json?url=").concat(encodeURIComponent(s));for(var o in i)i.hasOwnProperty(o)&&(a+="&".concat(o,"=").concat(encodeURIComponent(i[o])));var u="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;u.open("GET",a,!0),u.onload=function(){if(u.status===404){e(new Error("“".concat(s,"” was not found.")));return}if(u.status===403){e(new Error("“".concat(s,"” is not embeddable.")));return}try{var l=JSON.parse(u.responseText);if(l.domain_status_code===403){Vs(l,n),e(new Error("“".concat(s,"” is not embeddable.")));return}r(l)}catch(c){e(c)}},u.onerror=function(){var l=u.status?" (".concat(u.status,")"):"";e(new Error("There was an error fetching the embed code from Vimeo".concat(l,".")))},u.send()})}function ey(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,i=[].slice.call(s.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),n=function(e){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(e))};i.forEach(function(r){try{if(r.getAttribute("data-vimeo-defer")!==null)return;var e=gc(r),t=mc(e);vc(t,e,r).then(function(a){return Vs(a,r)}).catch(n)}catch(a){n(a)}})}function ty(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoPlayerResizeEmbeds_){window.VimeoPlayerResizeEmbeds_=!0;var i=function(r){if(ti(r.origin)&&!(!r.data||r.data.event!=="spacechange")){for(var e=s.querySelectorAll("iframe"),t=0;t<e.length;t++)if(e[t].contentWindow===r.source){var a=e[t].parentElement;a.style.paddingBottom="".concat(r.data.data[0].bottom,"px");break}}};window.addEventListener("message",i)}}function iy(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoSeoMetadataAppended){window.VimeoSeoMetadataAppended=!0;var i=function(r){if(ti(r.origin)){var e=Bn(r.data);if(!(!e||e.event!=="ready"))for(var t=s.querySelectorAll("iframe"),a=0;a<t.length;a++){var o=t[a],u=o.contentWindow===r.source;if(pc(o.src)&&u){var l=new Hs(o);l.callMethod("appendVideoMetadata",window.location.href)}}}};window.addEventListener("message",i)}}function ry(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoCheckedUrlTimeParam){window.VimeoCheckedUrlTimeParam
54=!0;var i=function(e){"console"in window&&console.error&&console.error("There was an error getting video Id: ".concat(e))},n=function(e){if(ti(e.origin)){var t=Bn(e.data);if(!(!t||t.event!=="ready"))for(var a=s.querySelectorAll("iframe"),o=function(){var c=a[u],g=c.contentWindow===e.source;if(pc(c.src)&&g){var m=new Hs(c);m.getVideoId().then(function(_){var b=new RegExp("[?&]vimeo_t_".concat(_,"=([^&#]*)")).exec(window.location.href);if(b&&b[1]){var E=decodeURI(b[1]);m.setCurrentTime(E)}}).catch(i)}},u=0;u<a.length;u++)o()}};window.addEventListener("message",n)}}function ny(){var s=function(){for(var r,e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],t=0,a=e.length,o={};t<a;t++)if(r=e[t],r&&r[1]in document){for(t=0;t<r.length;t++)o[e[0][t]]=r[t];return o}return!1}(),i={fullscreenchange:s.fullscreenchange,fullscreenerror:s.fullscreenerror},n={request:function(e){return new Promise(function(t,a){var o=function l(){n.off("fullscreenchange",l),t()};n.on("fullscreenchange",o),e=e||document.documentElement;var u=e[s.requestFullscreen]();u instanceof Promise&&u.then(o).catch(a)})},exit:function(){return new Promise(function(e,t){if(!n.isFullscreen){e();return}var a=function u(){n.off("fullscreenchange",u),e()};n.on("fullscreenchange",a);var o=document[s.exitFullscreen]();o instanceof Promise&&o.then(a).catch(t)})},on:function(e,t){var a=i[e];a&&document.addEventListener(a,t)},off:function(e,t){var a=i[e];a&&document.removeEventListener(a,t)}};return Object.defineProperties(n,{isFullscreen:{get:function(){return!!document[s.fullscreenElement]}},element:{enumerable:!0,get:function(){return document[s.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!document[s.fullscreenEnabled]}}}),n}var ay={role:"viewer",autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},sy=function(s){B0(n,s);var i=H0(n);function n(r,e){var t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;return lc(this,n),t=i.call(this),Zr(tn(t),"logger",void 0),Zr(tn(t),"speedAdjustment",0),Zr(tn(t),"adjustSpeed",function(){var u=$t(je().mark(function l(c,g){var m;return je().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(t.speedAdjustment!==g){b.next=2;break}return b.abrupt("return");case 2:return b.next=4,c.getPlaybackRate();case 4:return b.t0=b.sent,b.t1=t.speedAdjustment,b.t2=b.t0-b.t1,b.t3=g,m=b.t2+b.t3,t.log("New playbackRate:  ".concat(m)),b.next=12,c.setPlaybackRate(m);case 12:t.speedAdjustment=g;case 13:case"end":return b.stop()}},l)}));return function(l,c){return u.apply(this,arguments)}}()),t.logger=o,t.init(e,r,Wu(Wu({},ay),a)),t}return dc(n,[{key:"disconnect",value:function(){this.dispatchEvent(new Event("disconnect"))}},{key:"init",value:function(){var r=$t(je().mark(function t(a,o,u){var l=this,c,g,m;return je().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.waitForTOReadyState(a,"open");case 2:if(u.role!=="viewer"){b.next=10;break}return b.next=5,this.updatePlayer(a,o,u);case 5:c=zu(a,"change",function(){return l.updatePlayer(a,o,u)}),g=this.maintainPlaybackPosition(a,o,u),this.addEventListener("disconnect",function(){g.cancel(),c.cancel()}),b.next=14;break;case 10:return b.next=12,this.updateTimingObject(a,o);case 12:m=zu(o,["seeked","play","pause","ratechange"],function(){return l.updateTimingObject(a,o)},"on","off"),this.addEventListener("disconnect",function(){return m.cancel()});case 14:case"end":return b.stop()}},t,this)}));function e(t,a,o){return r.apply(this,arguments)}return e}()},{key:"updateTimingObject",value:function(){var r=$t(je().mark(function t(a,o){return je().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.t0=a,l.next=3,o.getCurrentTime();case 3:return l.t1=l.sent,l.next=6,o.getPaused();case 6:if(!l.sent){l.next=10;break}l.t2=0,l.next=13;break;case 10:return l.next=12,o.getPlaybackRate();case 12:l.t2=l.sent;case 13:l.t3=l.t2,l.t4={position:l.t1,velocity:l.t3},l.t0.update.call(l.t0,l.t4);case 16:case"end":return l.stop()}},t)}));function e(t,a){return r.apply(this,arguments)}return e}()},{key:"updatePlayer",value:function(){var r=$t(je().mark(function t(a,o,u){var l,c,g;return je().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(l=a.query(),c=l.position,g=l.velocity,typeof c=="number"&&o.setCurrentTime(c),typeof g!="number"){_.next=25;break}if(g!==0){_.next=11;break}return _.next=6,o.getPaused();case 6:if(_.t0=_.sent,_.t0!==!1){_.next=9;break}o.pause();case 9:_.next=25;break;case 11:if(!(g>0)){_.next=25;break}return _.next=14,o.getPaused();case 14:if(_.t1=_.sent,_.t1!==!0){_.next=19;break}return _.next=18,o.play().catch(function(){var b=$t(je().mark(function E(S){return je().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(!(S.name==="NotAllowedError"&&u.autoPlayMuted)){F.next=5;break}return F.next=3,o.setMuted(!0);case 3:return F.next=5,o.play().catch(function(B){return console.error("Couldn't play the video from TimingSrcConnector. Error:",B)});case 5:case"end":return F.stop()}},E)}));return function(E){return b.apply(this,arguments)}}());case 18:this.updatePlayer(a,o,u);case 19:return _.next=21,o.getPlaybackRate();case 21:if(_.t2=_.sent,_.t3=g,_.t2===_.t3){_.next=25;break}o.setPlaybackRate(g);case 25:case"end":return _.stop()}},t,this)}));function e(t,a,o){return r.apply(this,arguments)}return e}()},{key:"maintainPlaybackPosition",value:function(e,t,a){var o=this,u=a.allowedDrift,l=a.maxAllowedDrift,c=a.minCheckInterval,g=a.maxRateAdjustment,m=a.maxTimeToCatchUp,_=Math.min(m,Math.max(c,l))*1e3,b=function(){var S=$t(je().mark(function R(){var F,B,O,L,j;return je().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(D.t0=e.query().velocity===0,D.t0){D.next=6;break}return D.next=4,t.getPaused();case 4:D.t1=D.sent,D.t0=D.t1===!0;case 6:if(!D.t0){D.next=8;break}return D.abrupt("return");case 8:return D.t2=e.query().position,D.next=11,t.getCurrentTime();case 11:if(D.t3=D.sent,F=D.t2-D.t3,B=Math.abs(F),o.log("Drift: ".concat(F)),!(B>l)){D.next=22;break}return D.next=18,o.adjustSpeed(t,0);case 18:t.setCurrentTime(e.query().position),o.log("Resync by currentTime"),D.next=29;break;case 22:if(!(B>u)){D.next=29;break}return O=B/m,L=g,j=O<L?(L-O)/2:L,D.next=28,o.adjustSpeed(t,j*Math.sign(F));case 28:o.log("Resync by playbackRate");case 29:case"end":return D.stop()}},R)}));return function(){return S.apply(this,arguments)}}(),E=setInterval(function(){return b()},_);return{cancel:function(){return clearInterval(E)}}}},{key:"log",value:function(e){var t;(t=this.logger)===null||t===void 0||t.call(this,"TimingSrcConnector: ".concat(e))}},{key:"waitForTOReadyState",value:function(e,t){return new Promise(function(a){var o=function u(){e.readyState===t?a():e.addEventListener("readystatechange",u,{once:!0})};o()})}}]),n}(Xa(EventTarget)),fi=new WeakMap,Sa=new WeakMap,Ke={},Hs=function(){function s(i){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(lc(this,s),window.jQuery&&i instanceof jQuery&&(i.length>1&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),i=i[0]),typeof document<"u"&&typeof i=="string"&&(i=document.getElementById(i)),!q0(i))throw new TypeError("You must pass either a valid element or a valid id.");if(i.nodeName!=="IFRAME"){var e=i.querySelector("iframe");e&&(i=e)}if(i.nodeName==="IFRAME"&&!ti(i.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");
54if(fi.has(i))return fi.get(i);this._window=i.ownerDocument.defaultView,this.element=i,this.origin="*";var t=new tt(function(o,u){if(n._onMessage=function(g){if(!(!ti(g.origin)||n.element.contentWindow!==g.source)){n.origin==="*"&&(n.origin=g.origin);var m=Bn(g.data),_=m&&m.event==="error",b=_&&m.data&&m.data.method==="ready";if(b){var E=new Error(m.data.message);E.name=m.data.name,u(E);return}var S=m&&m.event==="ready",R=m&&m.method==="ping";if(S||R){n.element.setAttribute("data-ready","true"),o();return}J0(n,m)}},n._window.addEventListener("message",n._onMessage),n.element.nodeName!=="IFRAME"){var l=gc(i,r),c=mc(l);vc(c,l,i).then(function(g){var m=Vs(g,i);return n.element=m,n._originalElement=i,Y0(i,m),fi.set(n.element,n),g}).catch(u)}});if(Sa.set(this,t),fi.set(this.element,this),this.element.nodeName==="IFRAME"&&zt(this,"ping"),Ke.isEnabled){var a=function(){return Ke.exit()};this.fullscreenchangeHandler=function(){Ke.isFullscreen?Ki(n,"event:exitFullscreen",a):xn(n,"event:exitFullscreen",a),n.ready().then(function(){zt(n,"fullscreenchange",Ke.isFullscreen)})},Ke.on("fullscreenchange",this.fullscreenchangeHandler)}return this}return dc(s,[{key:"callMethod",value:function(n){for(var r=this,e=arguments.length,t=new Array(e>1?e-1:0),a=1;a<e;a++)t[a-1]=arguments[a];if(n==null)throw new TypeError("You must pass a method name.");return new tt(function(o,u){return r.ready().then(function(){Ki(r,n,{resolve:o,reject:u}),zt(r,n,t)}).catch(u)})}},{key:"get",value:function(n){var r=this;return new tt(function(e,t){return n=Gu(n,"get"),r.ready().then(function(){Ki(r,n,{resolve:e,reject:t}),zt(r,n)}).catch(t)})}},{key:"set",value:function(n,r){var e=this;return new tt(function(t,a){if(n=Gu(n,"set"),r==null)throw new TypeError("There must be a value to set.");return e.ready().then(function(){Ki(e,n,{resolve:t,reject:a}),zt(e,n,r)}).catch(a)})}},{key:"on",value:function(n,r){if(!n)throw new TypeError("You must pass an event name.");if(!r)throw new TypeError("You must pass a callback function.");if(typeof r!="function")throw new TypeError("The callback must be a function.");var e=Sn(this,"event:".concat(n));e.length===0&&this.callMethod("addEventListener",n).catch(function(){}),Ki(this,"event:".concat(n),r)}},{key:"off",value:function(n,r){if(!n)throw new TypeError("You must pass an event name.");if(r&&typeof r!="function")throw new TypeError("The callback must be a function.");var e=xn(this,"event:".concat(n),r);e&&this.callMethod("removeEventListener",n).catch(function(t){})}},{key:"loadVideo",value:function(n){return this.callMethod("loadVideo",n)}},{key:"ready",value:function(){var n=Sa.get(this)||new tt(function(r,e){e(new Error("Unknown player. Probably unloaded."))});return tt.resolve(n)}},{key:"addCuePoint",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod("addCuePoint",{time:n,data:r})}},{key:"removeCuePoint",value:function(n){return this.callMethod("removeCuePoint",n)}},{key:"enableTextTrack",value:function(n,r){if(!n)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:n,kind:r})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return Ke.isEnabled?Ke.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return Ke.isEnabled?Ke.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return Ke.isEnabled?tt.resolve(Ke.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"remotePlaybackPrompt",value:function(){return this.callMethod("remotePlaybackPrompt")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var n=this;return new tt(function(r){if(Sa.delete(n),fi.delete(n.element),n._originalElement&&(fi.delete(n._originalElement),n._originalElement.removeAttribute("data-vimeo-initialized")),n.element&&n.element.nodeName==="IFRAME"&&n.element.parentNode&&(n.element.parentNode.parentNode&&n._originalElement&&n._originalElement!==n.element.parentNode?n.element.parentNode.parentNode.removeChild(n.element.parentNode):n.element.parentNode.removeChild(n.element)),n.element&&n.element.nodeName==="DIV"&&n.element.parentNode){n.element.removeAttribute("data-vimeo-initialized");var e=n.element.querySelector("iframe");e&&e.parentNode&&(e.parentNode.parentNode&&n._originalElement&&n._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}n._window.removeEventListener("message",n._onMessage),Ke.isEnabled&&Ke.off("fullscreenchange",n.fullscreenchangeHandler),r()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(n){return this.set("autopause",n)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(n){return this.set("cameraProps",n)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"getColors",value:function(){return tt.all([this.get("colorOne"),this.get("colorTwo"),this.get("colorThree"),this.get("colorFour")])}},{key:"setColor",value:function(n){return this.set("color",n)}},{key:"setColors",value:function(n){if(!Array.isArray(n))return new tt(function(t,a){return a(new TypeError("Argument must be an array."))});var r=new tt(function(t){return t(null)}),e=[n[0]?this.set("colorOne",n[0]):r,n[1]?this.set("colorTwo",n[1]):r,n[2]?this.set("colorThree",n[2]):r,n[3]?this.set("colorFour",n[3]):r];return tt.all(e)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(n){return this.set("currentTime",n)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(n){return this.set("loop",n)}},{key:"setMuted",value:function(n){return this.set("muted",n)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(n){return this.set("playbackRate",n)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}
54},{key:"setQuality",value:function(n){return this.set("quality",n)}},{key:"getRemotePlaybackAvailability",value:function(){return this.get("remotePlaybackAvailability")}},{key:"getRemotePlaybackState",value:function(){return this.get("remotePlaybackState")}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(n){return this.set("volume",n)}},{key:"setTimingSrc",value:function(){var i=$t(je().mark(function r(e,t){var a=this,o;return je().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(e){l.next=2;break}throw new TypeError("A Timing Object must be provided.");case 2:return l.next=4,this.ready();case 4:return o=new sy(this,e,t),zt(this,"notifyTimingObjectConnect"),o.addEventListener("disconnect",function(){return zt(a,"notifyTimingObjectDisconnect")}),l.abrupt("return",o);case 8:case"end":return l.stop()}},r,this)}));function n(r,e){return i.apply(this,arguments)}return n}()}]),s}();hc||(Ke=ny(),ey(),ty(),iy(),ry());let Ku=!1;function oy(){if(Ku)return;Ku=!0;const s=`
55    .vjs-vimeo iframe {
56      position: absolute;
57      top: 0;
58      left: 0;
59      width: 100%;
60      height: 100%;
61    }
62  `,i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=s:n.appendChild(document.createTextNode(s)),i.appendChild(n)}const yc=A.getTech("Tech");class ze extends yc{constructor(i,n){super(i,n),oy(),this.setPoster(i.poster),this.initVimeoPlayer()}initVimeoPlayer(){const i={url:this.options_.source.src,byline:!1,portrait:!1,title:!1};this.options_.autoplay&&(i.autoplay=!0),this.options_.height&&(i.height=this.options_.height),this.options_.width&&(i.width=this.options_.width),this.options_.maxheight&&(i.maxheight=this.options_.maxheight),this.options_.maxwidth&&(i.maxwidth=this.options_.maxwidth),this.options_.loop&&(i.loop=this.options_.loop),this.options_.color&&(i.color=this.options_.color.replace(/^#/,"")),this._player=new Hs(this.el(),i),this.initVimeoState(),["play","pause","ended","timeupdate","progress","seeked"].forEach(n=>{this._player.on(n,r=>{this._vimeoState.progress.duration!==r.duration&&this.trigger("durationchange"),this._vimeoState.progress=r,this.trigger(n)})}),this._player.on("pause",()=>this._vimeoState.playing=!1),this._player.on("play",()=>{this._vimeoState.playing=!0,this._vimeoState.ended=!1}),this._player.on("ended",()=>{this._vimeoState.playing=!1,this._vimeoState.ended=!0}),this._player.on("volumechange",n=>this._vimeoState.volume=n),this._player.on("error",n=>this.trigger("error",n)),this.triggerReady()}initVimeoState(){const i=this._vimeoState={ended:!1,playing:!1,volume:0,progress:{seconds:0,percent:0,duration:0}};this._player.getCurrentTime().then(n=>i.progress.seconds=n),this._player.getDuration().then(n=>i.progress.duration=n),this._player.getPaused().then(n=>i.playing=!n),this._player.getVolume().then(n=>i.volume=n)}createEl(){const i=A.dom.createEl("div",{id:this.options_.techId});return i.style.cssText="width:100%;height:100%;top:0;left:0;position:absolute",i.className="vjs-vimeo",i}controls(){return!0}supportsFullScreen(){return!0}src(){return this.options_.source}currentSrc(){return this.options_.source.src}currentTime(){return this._vimeoState.progress.seconds}setCurrentTime(i){this._player.setCurrentTime(i)}volume(){return this._vimeoState.volume}setVolume(i){return this._player.setVolume(i)}duration(){return this._vimeoState.progress.duration}buffered(){const i=this._vimeoState.progress;return A.createTimeRange(0,i.percent*i.duration)}paused(){return!this._vimeoState.playing}pause(){this._player.pause()}play(){this._player.play()}muted(){return this._vimeoState.volume===0}ended(){return this._vimeoState.ended}playbackRate(){return 1}}ze.prototype.featuresTimeupdateEvents=!0;ze.isSupported=function(){return!0};yc.withSourceHandlers(ze);ze.nativeSourceHandler={};
62ze.nativeSourceHandler.canPlayType=function(s){return s==="video/vimeo"?"maybe":""};ze.nativeSourceHandler.canHandleSource=function(s){return s.type?ze.nativeSourceHandler.canPlayType(s.type):s.src?ze.nativeSourceHandler.canPlayType(s.src):""};ze.nativeSourceHandler.handleSource=function(s,i){i.src(s.src)};ze.nativeSourceHandler.dispose=function(){};ze.registerSourceHandler(ze.nativeSourceHandler);typeof A.registerTech<"u"?A.registerTech("Vimeo",ze):A.registerComponent("Vimeo",ze);ze.VERSION="0.0.1";export{ze as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.