12345678910111213141516171819202122232425 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ae6e3106"],{"0de0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return/mp4a\.\d+.\d+/i.test(e)},r=function(e){return/avc1\.[\da-f]+/i.test(e)},a=function(e){var t={type:"",parameters:{}},i=e.trim().split(";");return t.type=i.shift().trim(),i.forEach((function(e){var i=e.trim().split("=");if(i.length>1){var n=i[0].replace(/"/g,"").trim(),r=i[1].replace(/"/g,"").trim();t.parameters[n]=r}})),t},s=function(e){return e.map((function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),r=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+r}))}))};t["default"]={isAudioCodec:n,parseContentType:a,isVideoCodec:r,translateLegacyCodecs:s},e.exports=t["default"]},"0ea2":function(e,t,i){"use strict";var n,r,a,s=i("4329"),o=i("4e69"),u=i("ae75"),l=i("256f").TimestampRolloverStream,c=i("ae75"),d=188,h=71;n=function(){var e=new Uint8Array(d),t=0;n.prototype.init.call(this),this.push=function(i){var n,r=0,a=d;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(a<n.byteLength)n[r]!==h||n[a]!==h?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=d,a+=d);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===d&&e[0]===h&&(this.trigger("data",e),t=0),this.trigger("done")}},n.prototype=new s,r=function(){var e,t,i,n;r.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r,a,s;if(1&e[5]){n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&e[1])<<8|e[2],r=3+i-4,a=(15&e[10])<<8|e[11],s=12+a;while(s<r){var o=e[s],l=(31&e[s+1])<<8|e[s+2];o===u.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=l:o===u.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=l:o===u.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][l]=o),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=u.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=u.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},r.prototype=new s,r.STREAM_TYPES={h264:27,adts:15},a=function(){var e=this,t={data:[],size:0},i={data:[],size:0},n={data:[],size:0},r=function(e,t){var i;t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8])},s=function(t,i,n){var a,s=new Uint8Array(t.size),o={type:i},u=0,l=0,c=!1;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,u=0;u<t.data.length;u++)a=t.data[u],s.set(a.data,l),l+=a.data.byteLength;r(s,o),c="video"===i||o.packetLength<=t.size,(n||c)&&(t.size=0,t.data.length=0),c&&e.trigger("data",o)}};a.prototype.init.call(this),this.push=function(r){({pat:function(){},pes:function(){var e,a;switch(r.streamType){case u.H264_STREAM_TYPE:case c.H264_STREAM_TYPE:e=t,a="video";break;case u.ADTS_STREAM_TYPE:e=i,a="audio";break;case u.METADATA_STREAM_TYPE:e=n,a="timed-metadata";break;default:return}r.payloadUnitStartIndicator&&s(e,a,!0),e.data.push(r),e.size+=r.data.byteLength},pmt:function(){var t={type:"metadata",tracks:[]},i=r.programMapTable;null!==i.video&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.video,codec:"avc",type:"video"}),null!==i.audio&&t.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+i.audio,codec:"adts",type:"audio"}),e.trigger("data",t)}})[r.type]()},this.flush=function(){s(t,"video"),s(i,"audio"),s(n,"timed-metadata"),this.trigger("done")}},a.prototype=new s;var p={PAT_PID:0,MP2T_PACKET_LENGTH:d,TransportPacketStream:n,TransportParseStream:r,ElementaryStream:a,TimestampRolloverStream:l,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,MetadataStream:i("5bc0")};for(var f in u)u.hasOwnProperty(f)&&(p[f]=u[f]);e.exports=p},1:function(e,t){},1148:function(e,t,i){"use strict";var n=i("a691"),r=i("1d80");e.exports=function(e){var t=String(r(this)),i="",a=n(e);if(a<0||a==1/0)throw RangeError("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(i+=t);return i}},"140c":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("3d33"),a=n(r),s={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_;return e(i)}},o=function e(t,i){var n=0,r=0,o=a["default"].mergeOptions(s,i);t.ready((function(){t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var u=function(){r&&t.currentTime(r)},l=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",u),t.src(e),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},c=function(){if(Date.now()-n<1e3*o.errorInterval)t.trigger({type:"usage",name:"hls-error-reload-canceled"});else{if(o.getSource&&"function"===typeof o.getSource)return n=Date.now(),o.getSource.call(t,l);a["default"].log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},d=function e(){t.off("loadedmetadata",u),t.off("error",c),t.off("dispose",e)},h=function(i){d(),e(t,i)};t.on("error",c),t.on("dispose",d),t.reloadSourceOnError=h},u=function(e){o(this,e)};t["default"]=u,e.exports=t["default"]},"18cc":function(e,t,i){"use strict";i("ae67")},"194a":function(e,t,i){"use strict";var n,r,a,s,o,u,l,c,d,h,p,f,m,g,y,v,_,b,T,S,w,E,k,C,O,A,x,I,L,P,D,R,M,U,N,j,B=Math.pow(2,32)-1;(function(){var e;if(k={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!==typeof Uint8Array){for(e in k)k.hasOwnProperty(e)&&(k[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),O=new Uint8Array([0,0,0,1]),x=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]),I=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]),L={video:x,audio:I},R=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),D=new Uint8Array([0,0,0,0,0,0,0,0]),M=new Uint8Array([0,0,0,0,0,0,0,0]),U=M,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j=M,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),n=function(e){var t,i,n,r=[],a=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);t=r.length;while(t--)a+=r[t].byteLength;for(i=new Uint8Array(a+8),n=new DataView(i.buffer,i.byteOffset,i.byteLength),n.setUint32(0,i.byteLength),i.set(e,4),t=0,a=8;t<r.length;t++)i.set(r[t],a),a+=r[t].byteLength;return i},r=function(){return n(k.dinf,n(k.dref,R))},a=function(e){return n(k.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},s=function(){return n(k.ftyp,C,O,C,A)},v=function(e){return n(k.hdlr,L[e])},o=function(e){return n(k.mdat,e)},y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),n(k.mdhd,t)},g=function(e){return n(k.mdia,y(e),v(e.type),l(e))},u=function(e){return n(k.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},l=function(e){return n(k.minf,"video"===e.type?n(k.vmhd,P):n(k.smhd,D),r(),b(e))},c=function(e,t){var i=[],r=t.length;while(r--)i[r]=S(t[r]);return n.apply(null,[k.moof,u(e)].concat(i))},d=function(e){var t=e.length,i=[];while(t--)i[t]=f(e[t]);return n.apply(null,[k.moov,p(4294967295)].concat(i).concat(h(e)))},h=function(e){var t=e.length,i=[];while(t--)i[t]=w(e[t]);return n.apply(null,[k.mvex].concat(i))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 n(k.mvhd,t)},_=function(e){var t,i,r=e.samples||[],a=new Uint8Array(4+r.length);for(i=0;i<r.length;i++)t=r[i].flags,a[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(k.sdtp,a)},b=function(e){return n(k.stbl,T(e),n(k.stts,j),n(k.stsc,U),n(k.stsz,N),n(k.stco,M))},function(){var e,t;T=function(i){return n(k.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){var t,i=e.sps||[],r=e.pps||[],a=[],s=[];for(t=0;t<i.length;t++)a.push((65280&i[t].byteLength)>>>8),a.push(255&i[t].byteLength),a=a.concat(Array.prototype.slice.call(i[t]));for(t=0;t<r.length;t++)s.push((65280&r[t].byteLength)>>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[t]));return n(k.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,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),n(k.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length]).concat(a).concat([r.length]).concat(s))),n(k.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},t=function(e){return n(k.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),a(e))}}(),m=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return n(k.tkhd,t)},S=function(e){var t,i,r,a,s,o,u;return t=n(k.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/(B+1)),u=Math.floor(e.baseMediaDecodeTime%(B+1)),i=n(k.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u>>>24&255,u>>>16&255,u>>>8&255,255&u])),s=92,"audio"===e.type?(r=E(e,s),n(k.traf,t,i,r)):(a=_(e),r=E(e,a.length+s),n(k.traf,t,i,r,a))},f=function(e){return e.duration=e.duration||4294967295,n(k.trak,m(e),g(e))},w=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),n(k.trex,t)},function(){var e,t,i;i=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t=function(e,t){var r,a,s,o;for(a=e.samples||[],t+=20+16*a.length,r=i(a,t),o=0;o<a.length;o++)s=a[o],r=r.concat([(4278190080&s.duration)>>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size,s.flags.isLeading<<2|s.flags.dependsOn,s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,61440&s.flags.degradationPriority,15&s.flags.degradationPriority,(4278190080&s.compositionTimeOffset)>>>24,(16711680&s.compositionTimeOffset)>>>16,(65280&s.compositionTimeOffset)>>>8,255&s.compositionTimeOffset]);return n(k.trun,new Uint8Array(r))},e=function(e,t){var r,a,s,o;for(a=e.samples||[],t+=20+8*a.length,r=i(a,t),o=0;o<a.length;o++)s=a[o],r=r.concat([(4278190080&s.duration)>>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size]);return n(k.trun,new Uint8Array(r))},E=function(i,n){return"audio"===i.type?e(i,n):t(i,n)}}(),e.exports={ftyp:s,mdat:o,moof:c,moov:d,initSegment:function(e){var t,i=s(),n=d(e);return t=new Uint8Array(i.byteLength+n.byteLength),t.set(i),t.set(n,i.byteLength),t}}},"1b8d":function(e,t){function i(e){return e.replace(/\n\r?\s*/g,"")}e.exports=function(e){for(var t="",n=0;n<arguments.length;n++)t+=i(e[n])+(arguments[n+1]||"");return t}},"1c05":function(e,t,i){"use strict";var n=i("4329"),r=function(e){this.numberOfTracks=0,this.metadataStream=e.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,this.processedTracks=0,r.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):("video"===e.track.type&&(this.videoTrack=e.track,this.videoTags=e.tags,this.pendingTracks++),void("audio"===e.track.type&&(this.audioTrack=e.track,this.audioTags=e.tags,this.pendingTracks++)))}};r.prototype=new n,r.prototype.flush=function(e){var t,i,n,r,a={tags:{},captions:[],captionStreams:{},metadata:[]};if(this.pendingTracks<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(0===this.pendingTracks&&(this.processedTracks++,this.processedTracks<this.numberOfTracks))return}if(this.processedTracks+=this.pendingTracks,this.pendingTracks=0,!(this.processedTracks<this.numberOfTracks)){for(this.videoTrack?r=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(r=this.audioTrack.timelineStartInfo.pts),a.tags.videoTags=this.videoTags,a.tags.audioTags=this.audioTags,n=0;n<this.pendingCaptions.length;n++)i=this.pendingCaptions[n],i.startTime=i.startPts-r,i.startTime/=9e4,i.endTime=i.endPts-r,i.endTime/=9e4,a.captionStreams[i.stream]=!0,a.captions.push(i);for(n=0;n<this.pendingMetadata.length;n++)t=this.pendingMetadata[n],t.cueTime=t.pts-r,t.cueTime/=9e4,a.metadata.push(t);a.metadata.dispatchType=this.metadataStream.dispatchType,this.videoTrack=null,this.audioTrack=null,this.videoTags=[],this.audioTags=[],this.pendingCaptions.length=0,this.pendingMetadata.length=0,this.pendingTracks=0,this.processedTracks=0,this.trigger("data",a),this.trigger("done")}},e.exports=r},"1fb5":function(e,t,i){"use strict";t.byteLength=c,t.toByteArray=h,t.fromByteArray=m;for(var n=[],r=[],a="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,u=s.length;o<u;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}function c(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n}function d(e,t,i){return 3*(t+i)/4-i}function h(e){var t,i,n=l(e),s=n[0],o=n[1],u=new a(d(e,s,o)),c=0,h=o>0?s-4:s;for(i=0;i<h;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,u[c++]=255&t),1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u}function p(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,i){for(var n,r=[],a=t;a<i;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(p(n));return r.join("")}function m(e){for(var t,i=e.length,r=i%3,a=[],s=16383,o=0,u=i-r;o<u;o+=s)a.push(f(e,o,o+s>u?u:o+s));return 1===r?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},2:function(e,t){},"210b":function(e,t,i){var n=i("e1c8");t.DOMImplementation=n.DOMImplementation,t.XMLSerializer=n.XMLSerializer,t.DOMParser=i("b074").DOMParser},"230d":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("3d33"),a=n(r),s=i("8c57"),o=n(s),u=function(){},l=function(e){var t=e["default"]?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},c=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)};t.stopLoaders=c;var d=function(e,t){t.activePlaylistLoader=e,e.load()};t.startLoaders=d;var h=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;c(n,a),o&&(o.playlistLoader?(n.resyncLoader(),d(o.playlistLoader,a)):u&&r.resetEverything())}};t.onGroupChanged=h;var p=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.activeGroup(s),u=a.activePlaylistLoader;c(n,a),o&&(o.playlistLoader?u!==o.playlistLoader?(n.track&&n.track(s),n.resetEverything(),d(o.playlistLoader,a)):d(o.playlistLoader,a):r.resetEverything())}};t.onTrackChanged=p;var f={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;c(i,n);var s=n.activeTrack(),o=n.activeGroup(),u=(o.filter((function(e){return e["default"]}))[0]||o[0]).id,l=n.tracks[u];if(s!==l){for(var d in a["default"].log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[d].enabled=n.tracks[d]===l;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];a["default"].log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),c(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}};t.onError=f;var m={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",f[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",f[e](e,i))}};t.setupListeners=m;var g={AUDIO:function(e,t){var i=t.mode,n=t.hls,r=t.segmentLoaders[e],s=t.requestOptions,u=t.master.mediaGroups,c=t.mediaTypes[e],d=c.groups,h=c.tracks;for(var p in u[e]&&0!==Object.keys(u[e]).length&&"html5"===i||(u[e]={main:{default:{default:!0}}}),u[e])for(var g in d[p]||(d[p]=[]),u[e][p]){var y=u[e][p][g],v=void 0;if(v=y.resolvedUri?new o["default"](y.resolvedUri,n,s):null,y=a["default"].mergeOptions({id:g,playlistLoader:v},y),m[e](e,y.playlistLoader,t),d[p].push(y),"undefined"===typeof h[g]){var _=new a["default"].AudioTrack({id:g,kind:l(y),enabled:!1,language:y.language,default:y["default"],label:g});h[g]=_}}r.on("error",f[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.hls,r=t.segmentLoaders[e],s=t.requestOptions,u=t.master.mediaGroups,l=t.mediaTypes[e],c=l.groups,d=l.tracks;for(var h in u[e])for(var p in c[h]||(c[h]=[]),u[e][h])if(!u[e][h][p].forced){var g=u[e][h][p];if(g=a["default"].mergeOptions({id:p,playlistLoader:new o["default"](g.resolvedUri,n,s)},g),m[e](e,g.playlistLoader,t),c[h].push(g),"undefined"===typeof d[p]){var y=i.addRemoteTextTrack({id:p,kind:"subtitles",enabled:!1,language:g.language,label:p},!1).track;d[p]=y}}r.on("error",f[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],s=r.groups,o=r.tracks;for(var u in n[e])for(var l in s[u]||(s[u]=[]),n[e][u]){var c=n[e][u][l];if(c.instreamId.match(/CC\d/)&&(s[u].push(a["default"].mergeOptions({id:l},c)),"undefined"===typeof o[l])){var d=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",enabled:!1,language:c.language,label:l},!1).track;o[l]=d}}}};t.initialize=g;var y=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=n.media();if(!a)return null;var s=null;return a.attributes[e]&&(s=r[a.attributes[e]]),s=s||r.main,"undefined"===typeof i?s:null===i?null:s.filter((function(e){return e.id===i.id}))[0]||null}};t.activeGroup=y;var v={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode)return i[n];return null}}};t.activeTrack=v;var _=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){g[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.hls;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=y(i,e),t[i].activeTrack=v[i](i,e),t[i].onGroupChanged=h(i,e),t[i].onTrackChanged=p(i,e)}));var a=t.AUDIO.activeGroup(),s=(a.filter((function(e){return e["default"]}))[0]||a[0]).id;t.AUDIO.tracks[s].enabled=!0,t.AUDIO.onTrackChanged(),i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))}));var o=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"hls-audio-change"})};for(var u in n.audioTracks().addEventListener("change",o),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",o),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[u])};t.setupMediaGroups=_;var b=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:u,activeTrack:u,onGroupChanged:u,onTrackChanged:u}})),e};t.createMediaTypes=b},"256f":function(e,t,i){"use strict";var n=i("4329"),r=8589934592,a=4294967296,s=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>a)e+=i*r;return e},o=function(e){var t,i;o.prototype.init.call(this),this.type_=e,this.push=function(e){e.type===this.type_&&(void 0===i&&(i=e.dts),e.dts=s(e.dts,i),e.pts=s(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.discontinuity=function(){i=void 0,t=void 0}};o.prototype=new n,e.exports={TimestampRolloverStream:o,handleRollover:s}},"269f":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("3d33"),l=a(u),c=i("9417"),d=a(c),h=i("4ea2"),p=a(h),f=i("ba2d"),m=i("78d8"),g=a(m),y=i("5c9d"),v=a(y),_=i("0de0"),b=function(){var e=void 0;try{e="5c9d"}catch(t){}return e},T=function(e,t){var i=e.addSourceBuffer(t),n=Object.create(null);n.updating=!1,n.realBuffer_=i;var r=function(e){"function"===typeof i[e]?n[e]=function(){return i[e].apply(i,arguments)}:"undefined"===typeof n[e]&&Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){return i[e]=t}})};for(var a in i)r(a);return n},S=function(e,t,i){if(!t||!e.length)return[];var n=Math.ceil(9e4*(t.currentTime()-i+3)),r=void 0;for(r=0;r<e.length;r++)if(e[r].pts>n)break;return e.slice(r)};t.gopsSafeToAlignWith=S;var w=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var n=t[0].pts,r=0;for(r;r<e.length;r++)if(e[r].pts>=n)break;return e.slice(0,r).concat(t)};t.updateGopBuffer=w;var E=function(e,t,i,n){var r=Math.ceil(9e4*(t-n)),a=Math.ceil(9e4*(i-n)),s=e.slice(),o=e.length;while(o--)if(e[o].pts<=a)break;if(-1===o)return s;var u=o+1;while(u--)if(e[u].pts<=r)break;return u=Math.max(u,0),s.splice(u,o-u+1),s};t.removeGopBuffer=E;var k=function(e){function t(e,i){var n=this;s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,l["default"].EventTarget),this.timestampOffset_=0,this.pendingBuffers_=[],this.bufferUpdating_=!1,this.mediaSource_=e,this.codecs_=i,this.audioCodec_=null,this.videoCodec_=null,this.audioDisabled_=!1,this.appendAudioInitSegment_=!0,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=l["default"].browser.IE_VERSION>=11;var a={remux:!1,alignGopsAtEnd:this.safeAppend_};this.codecs_.forEach((function(e){(0,_.isAudioCodec)(e)?n.audioCodec_=e:(0,_.isVideoCodec)(e)&&(n.videoCodec_=e)})),this.transmuxer_=(0,g["default"])(v["default"],b()),this.transmuxer_.postMessage({action:"init",options:a}),this.transmuxer_.onmessage=function(e){return"data"===e.data.action?n.data_(e):"done"===e.data.action?n.done_(e):"gopInfo"===e.data.action?n.appendGopInfo_(e):void 0},Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"===typeof e&&e>=0&&(this.timestampOffset_=e,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e}))}}),Object.defineProperty(this,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(e){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=e),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=e)}}),Object.defineProperty(this,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(this,"buffered",{get:function(){var e=null,t=null,i=0,n=[],r=[];if(!this.videoBuffer_&&!this.audioBuffer_)return l["default"].createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;if(this.audioDisabled_)return this.videoBuffer_.buffered;if(0===this.videoBuffer_.buffered.length&&0===this.audioBuffer_.buffered.length)return l["default"].createTimeRange();var a=this.videoBuffer_.buffered,s=this.audioBuffer_.buffered,o=a.length;while(o--)n.push({time:a.start(o),type:"start"}),n.push({time:a.end(o),type:"end"});o=s.length;while(o--)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(n.sort((function(e,t){return e.time-t.time})),o=0;o<n.length;o++)"start"===n[o].type?(i++,2===i&&(e=n[o].time)):"end"===n[o].type&&(i--,1===i&&(t=n[o].time)),null!==e&&null!==t&&(r.push([e,t]),e=null,t=null);return l["default"].createTimeRanges(r)}})}return o(t,e),n(t,[{key:"data_",value:function(e){var t=e.data.segment;t.data=new Uint8Array(t.data,e.data.byteOffset,e.data.byteLength),t.initSegment=new Uint8Array(t.initSegment.data,t.initSegment.byteOffset,t.initSegment.byteLength),(0,d["default"])(this,this.mediaSource_,t),this.pendingBuffers_.push(t)}},{key:"done_",value:function(e){"closed"!==this.mediaSource_.readyState?this.processPendingSegments_():this.pendingBuffers_.length=0}},{key:"createRealSourceBuffers_",value:function(){var e=this,t=["audio","video"];t.forEach((function(i){if(e[i+"Codec_"]&&!e[i+"Buffer_"]){var n=null;if(e.mediaSource_[i+"Buffer_"])n=e.mediaSource_[i+"Buffer_"],n.updating=!1;else{var r=i+"Codec_",a=i+'/mp4;codecs="'+e[r]+'"';n=T(e.mediaSource_.nativeMediaSource_,a),e.mediaSource_[i+"Buffer_"]=n}e[i+"Buffer_"]=n,["update","updatestart","updateend"].forEach((function(r){n.addEventListener(r,(function(){if("audio"!==i||!e.audioDisabled_){"updateend"===r&&(e[i+"Buffer_"].updating=!1);var n=t.every((function(t){return!("audio"!==t||!e.audioDisabled_)||(i===t||!e[t+"Buffer_"]||!e[t+"Buffer_"].updating)}));return n?e.trigger(r):void 0}}))}))}}))}},{key:"appendBuffer",value:function(e){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var t=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:t.end(t.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:S(this.gopBuffer_,this.mediaSource_.player_,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"appendGopInfo_",value:function(e){this.gopBuffer_=w(this.gopBuffer_,e.data.gopInfo,this.safeAppend_)}},{key:"remove",value:function(e,t){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(e,t),this.gopBuffer_=E(this.gopBuffer_,e,t,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(e,t)),(0,p["default"])(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)(0,p["default"])(e,t,this.inbandTextTracks_[i])}},{key:"processPendingSegments_",value:function(){var e={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};e=this.pendingBuffers_.reduce((function(e,t){var i=t.type,n=t.data,r=t.initSegment;return e[i].segments.push(n),e[i].bytes+=n.byteLength,e[i].initSegment=r,t.captions&&(e.captions=e.captions.concat(t.captions)),t.info&&(e[i].info=t.info),t.metadata&&(e.metadata=e.metadata.concat(t.metadata)),e}),e),this.videoBuffer_||this.audioBuffer_||(0===e.video.bytes&&(this.videoCodec_=null),0===e.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),e.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:e.audio.info}),e.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:e.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(e.audio.segments.unshift(e.audio.initSegment),e.audio.bytes+=e.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var t=!1;this.videoBuffer_&&e.video.bytes?(e.video.segments.unshift(e.video.initSegment),e.video.bytes+=e.video.initSegment.byteLength,this.concatAndAppendSegments_(e.video,this.videoBuffer_),(0,f.addTextTrackData)(this,e.captions,e.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(t=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(e.audio,this.audioBuffer_),this.pendingBuffers_.length=0,t&&this.trigger("updateend"),this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(e,t){var i=0,n=void 0;if(e.bytes){n=new Uint8Array(e.bytes),e.segments.forEach((function(e){n.set(e,i),i+=e.byteLength}));try{t.updating=!0,t.appendBuffer(n)}catch(r){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:r.message,originalError:r})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),t}(l["default"].EventTarget);t["default"]=k},2806:function(e,t,i){"use strict";var n,r,a,s;n=function(e,t){var i,a,s,o,u,l=[];if(!t.length)return null;for(i=0;i<e.byteLength;)a=e[i]<<24,a|=e[i+1]<<16,a|=e[i+2]<<8,a|=e[i+3],s=r(e.subarray(i+4,i+8)),o=a>1?i+a:e.byteLength,s===t[0]&&(1===t.length?l.push(e.subarray(i+8,o)):(u=n(e.subarray(i+8,o),t.slice(1)),u.length&&(l=l.concat(u)))),i=o;return l},r=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},a=function(e){var t={},i=n(e,["moov","trak"]);return i.reduce((function(e,t){var i,r,a,s,o;return i=n(t,["tkhd"])[0],i?(r=i[0],a=0===r?12:20,s=i[a]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3],o=n(t,["mdia","mdhd"])[0],o?(r=o[0],a=0===r?12:20,e[s]=o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3],e):null):null}),t)},s=function(e,t){var i,r,a;return i=n(t,["moof","traf"]),r=[].concat.apply([],i.map((function(t){return n(t,["tfhd"]).map((function(i){var r,a,s;return r=i[4]<<24|i[5]<<16|i[6]<<8|i[7],a=e[r]||9e4,s=n(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=e[4]<<24|e[5]<<16|e[6]<<8|e[7],1===t&&(i*=Math.pow(2,32),i+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),i}))[0],s=s||1/0,s/a}))}))),a=Math.min.apply(null,r),isFinite(a)?a:0},e.exports={parseType:r,timescale:a,startTime:s}},"28e5":function(e,t,i){e.exports={generator:i("194a"),Transmuxer:i("300a").Transmuxer,AudioSegmentStream:i("300a").AudioSegmentStream,VideoSegmentStream:i("300a").VideoSegmentStream}},"2b8c":function(e,t,i){var n=i("be09"),r=e.exports={WebVTT:i("d02c4"),VTTCue:i("b03c"),VTTRegion:i("f97d")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},"300a":function(e,t,i){"use strict";var n,r,a,s,o,u,l,c,d,h,p,f=i("4329"),m=i("194a"),g=i("0ea2"),y=i("4fcf"),v=i("631a").H264Stream,_=i("9d56"),b=i("7e10"),T=i("36c6"),S=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],w=["width","height","profileIdc","levelIdc","profileCompatibility"],E=9e4;o=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},u=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},h=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},p=function(e){var t,i,n=0;for(t=0;t<e.length;t++)i=e[t],n+=i.data.byteLength;return n},r=function(e){var t=[],i=0,n=0,a=0,s=1/0;r.prototype.init.call(this),this.push=function(i){l(e,i),e&&S.forEach((function(t){e[t]=i[t]})),t.push(i)},this.setEarliestDts=function(t){n=t-e.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var n,r,a,s;0!==t.length?(n=this.trimAdtsFramesByEarliestDts_(t),e.baseMediaDecodeTime=d(e),this.prefixWithSilence_(e,n),e.samples=this.generateSampleTable_(n),a=m.mdat(this.concatenateFrameData_(n)),t=[],r=m.moof(i,[e]),s=new Uint8Array(r.byteLength+a.byteLength),i++,s.set(r),s.set(a,r.byteLength),c(e),this.trigger("data",{track:e,boxes:s}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.prefixWithSilence_=function(e,t){var i,n,r,o=0,u=0,l=0,c=0;if(t.length&&(i=T.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(E/(e.samplerate/1024)),a&&s&&(u=i-Math.max(a,s),l=Math.floor(u/o),c=l*o),!(l<1||c>E/2))){for(n=b[e.samplerate],n||(n=t[0].data),r=0;r<l;r++)t.splice(r,0,{data:n});e.baseMediaDecodeTime-=Math.floor(T.videoTsToAudioTs(c,e.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(t){return e.minSegmentDts>=n?t:(e.minSegmentDts=1/0,t.filter((function(t){return t.dts>=n&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)})))},this.generateSampleTable_=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},this.concatenateFrameData_=function(e){var t,i,n=0,r=new Uint8Array(p(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r}},r.prototype=new f,n=function(e,t){var i,r,a=0,s=[],u=[];t=t||{},n.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){l(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],w.forEach((function(t){e[t]=i[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),s.push(t)},this.flush=function(){var i,n,r,o,h,p;while(s.length){if("access_unit_delimiter_rbsp"===s[0].nalUnitType)break;s.shift()}if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=this.groupNalsIntoFrames_(s),r=this.groupFramesIntoGops_(i),r[0][0].keyFrame||(n=this.getGopForFusion_(s[0],e),n?(r.unshift(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.pts=n.pts,r.dts=n.dts,r.duration+=n.duration):r=this.extendFirstKeyFrame_(r)),u.length){var f;if(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r),!f)return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");c(e),r=f}l(e,r),e.samples=this.generateSampleTable_(r),h=m.mdat(this.concatenateNalData_(r)),e.baseMediaDecodeTime=d(e),this.trigger("processedGopsInfo",r.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),o=m.moof(a,[e]),p=new Uint8Array(o.byteLength+h.byteLength),a++,p.set(o),p.set(h,o.byteLength),this.trigger("data",{track:e,boxes:p}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){c(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=45e3,u=1e4,l=1/0;for(s=0;s<this.gopCache_.length;s++)a=this.gopCache_[s],r=a.gop,e.pps&&h(e.pps[0],a.pps[0])&&e.sps&&h(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration,i>=-u&&i<=o&&(!n||l>i)&&(n=a,l=i)));return n?n.gop:null},this.extendFirstKeyFrame_=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},this.groupNalsIntoFrames_=function(e){var t,i,n=[],r=[];for(n.byteLength=0,t=0;t<e.length;t++)i=e[t],"access_unit_delimiter_rbsp"===i.nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.push(n)),n=[i],n.byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.push(n),r},this.groupFramesIntoGops_=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)i=e[t],i.keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),n=[i],n.nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},this.generateSampleTable_=function(e,t){var i,n,r,a,s,u=t||0,l=[];for(i=0;i<e.length;i++)for(a=e[i],n=0;n<a.length;n++)s=a[n],r=o(),r.dataOffset=u,r.compositionTimeOffset=s.pts-s.dts,r.duration=s.duration,r.size=4*s.length,r.size+=s.byteLength,s.keyFrame&&(r.flags.dependsOn=2),u+=r.size,l.push(r);return l},this.concatenateNalData_=function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=u+4*l,d=new Uint8Array(c),h=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,d.set(s.data,o),o+=s.data.byteLength;return d},this.alignGopsAtStart_=function(e){var t,i,n,r,a,s,o,l;a=e.byteLength,s=e.nalCount,o=e.duration,t=i=0;while(t<u.length&&i<e.length){if(n=u[t],r=e[i],n.pts===r.pts)break;r.pts>n.pts?t++:(i++,a-=r.byteLength,s-=r.nalCount,o-=r.duration)}return 0===i?e:i===e.length?null:(l=e.slice(i),l.byteLength=a,l.duration=o,l.nalCount=s,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,s,o;t=u.length-1,i=e.length-1,a=null,s=!1;while(t>=0&&i>=0){if(n=u[t],r=e[i],n.pts===r.pts){s=!0;break}n.pts>r.pts?t--:(t===u.length-1&&(a=i),i--)}if(!s&&null===a)return null;if(o=s?i:a,0===o)return e;var l=e.slice(o),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){u=e}},n.prototype=new f,l=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},c=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},d=function(e){var t,i,n=e.minSegmentDts-e.timelineStartInfo.dts;return t=e.timelineStartInfo.baseMediaDecodeTime,t+=n,t=Math.max(0,t),"audio"===e.type&&(i=e.samplerate/E,t*=i,t=Math.floor(t)),t},s=function(e,t){this.numberOfTracks=0,this.metadataStream=t,"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBoxes.push(e.boxes),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track),void("audio"===e.track.type&&(this.audioTrack=e.track)))}},s.prototype=new f,s.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,w.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,S.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=m.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=t.startPts-o,t.startTime/=9e4,t.endTime=t.endPts-o,t.endTime/=9e4,s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)i=this.pendingMetadata[r],i.cueTime=i.pts-o,i.cueTime/=9e4,s.metadata.push(i);s.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",s),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},a=function(e){var t,i,o=this,l=!0;a.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t,t.type="aac",t.metadataStream=new g.MetadataStream,t.aacStream=new _,t.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),t.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),t.adtsStream=new y,t.coalesceStream=new s(e,t.metadataStream),t.headOfPipeline=t.aacStream,t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),t.metadataStream.on("timestamp",(function(e){t.aacStream.setTimestamp(e.timeStamp)})),t.aacStream.on("data",(function(e){"timed-metadata"!==e.type||t.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},t.coalesceStream.numberOfTracks++,t.audioSegmentStream=new r(i),t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream))})),t.coalesceStream.on("data",this.trigger.bind(this,"data")),t.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a,a.type="ts",a.metadataStream=new g.MetadataStream,a.packetStream=new g.TransportPacketStream,a.parseStream=new g.TransportParseStream,a.elementaryStream=new g.ElementaryStream,a.videoTimestampRolloverStream=new g.TimestampRolloverStream("video"),a.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),a.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),a.adtsStream=new y,a.h264Stream=new v,a.captionStream=new g.CaptionStream,a.coalesceStream=new s(e,a.metadataStream),a.headOfPipeline=a.packetStream,a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream),a.elementaryStream.pipe(a.videoTimestampRolloverStream).pipe(a.h264Stream),a.elementaryStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream),a.elementaryStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream),a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream),a.elementaryStream.on("data",(function(s){var u;if("metadata"===s.type){u=s.tracks.length;while(u--)t||"video"!==s.tracks[u].type?i||"audio"!==s.tracks[u].type||(i=s.tracks[u],i.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(t=s.tracks[u],t.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime);t&&!a.videoSegmentStream&&(a.coalesceStream.numberOfTracks++,a.videoSegmentStream=new n(t,e),a.videoSegmentStream.on("timelineStartInfo",(function(e){i&&(i.timelineStartInfo=e,a.audioSegmentStream.setEarliestDts(e.dts))})),a.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),a.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)),i&&!a.audioSegmentStream&&(a.coalesceStream.numberOfTracks++,a.audioSegmentStream=new r(i),a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream))}})),a.coalesceStream.on("data",this.trigger.bind(this,"data")),a.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(e){var n=this.transmuxPipeline_;this.baseMediaDecodeTime=e,i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,c(i),i.timelineStartInfo.baseMediaDecodeTime=e,n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[],n.videoTimestampRolloverStream.discontinuity()),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,c(t),n.captionStream.reset(),t.timelineStartInfo.baseMediaDecodeTime=e),n.timedMetadataTimestampRolloverStream&&n.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.push=function(e){if(l){var t=u(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),l=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){l=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},a.prototype=new f,e.exports={Transmuxer:a,VideoSegmentStream:n,AudioSegmentStream:r,AUDIO_PROPERTIES:S,VIDEO_PROPERTIES:w}},"31ce":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i("818b"),o=r(s),u=i("8890"),l=r(u),c=i("cdad"),d=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(e,t,i){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new o["default"](Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),u=void 0,l=void 0,c=void 0,h=void 0,p=void 0,f=void 0,m=void 0,g=void 0,y=void 0;for(u=i[0],l=i[1],c=i[2],h=i[3],y=0;y<n.length;y+=4)p=d(n[y]),f=d(n[y+1]),m=d(n[y+2]),g=d(n[y+3]),r.decrypt(p,f,m,g,s,y),s[y]=d(s[y]^u),s[y+1]=d(s[y+1]^l),s[y+2]=d(s[y+2]^c),s[y+3]=d(s[y+3]^h),u=p,l=f,c=m,h=g;return a};t.decrypt=h;var p=function(){function e(t,i,n,r){a(this,e);var s=e.STEP,o=new Int32Array(t.buffer),u=new Uint8Array(t.byteLength),h=0;for(this.asyncStream_=new l["default"],this.asyncStream_.push(this.decryptChunk_(o.subarray(h,h+s),i,n,u)),h=s;h<o.length;h+=s)n=new Uint32Array([d(o[h-4]),d(o[h-3]),d(o[h-2]),d(o[h-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(h,h+s),i,n,u));this.asyncStream_.push((function(){r(null,(0,c.unpad)(u))}))}return n(e,[{key:"decryptChunk_",value:function(e,t,i,n){return function(){var r=h(e,t,i);n.set(r,e.byteOffset)}}}],[{key:"STEP",get:function(){return 32e3}}]),e}();t.Decrypter=p,t["default"]={Decrypter:p,decrypt:h}},3240:function(e,t,i){"use strict";var n;n=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return n-=r,n>0?i<<=r:t>0&&this.loadWord(),r=e-r,r>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!==(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},e.exports=n},"36c6":function(e,t){var i,n,r,a,s,o,u=9e4;i=function(e){return e*u},n=function(e,t){return e*t},r=function(e){return e/u},a=function(e,t){return e/t},s=function(e,t){return i(a(e,t))},o=function(e,t){return n(r(e),t)},e.exports={secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o}},"3c96":function(e,t){function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=i,e.exports["default"]=e.exports,e.exports.__esModule=!0},"3d33":function(e,t,i){
- /**
- * @license
- * Video.js 6.13.0 <http://videojs.com/>
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
- * Available under Apache License Version 2.0
- * <https://github.com/videojs/video.js/blob/master/LICENSE>
- *
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
- * Available under Apache License Version 2.0
- * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
- */
- function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var r=n(i("672b")),a=n(i("cc57")),s=n(i("1b8d")),o=n(i("8c10")),u=n(i("eec7")),l=n(i("2b8c")),c="6.13.0",d=r.navigator&&r.navigator.userAgent||"",h=/AppleWebKit\/([\d.]+)/i.exec(d),p=h?parseFloat(h.pop()):null,f=/iPad/i.test(d),m=/iPhone/i.test(d)&&!f,g=/iPod/i.test(d),y=m||f||g,v=function(){var e=d.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),_=/Android/i.test(d),b=function(){var e=d.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),T=_&&/webkit/i.test(d)&&b<2.3,S=_&&b<5&&p<537,w=/Firefox/i.test(d),E=/Edge/i.test(d),k=!E&&(/Chrome/i.test(d)||/CriOS/i.test(d)),C=function(){var e=d.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),O=/MSIE\s8\.0/.test(d),A=function(){var e=/MSIE\s(\d+)\.\d/.exec(d),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(d)&&/rv:11.0/.test(d)&&(t=11),t}(),x=/Safari/i.test(d)&&!k&&!_&&!E,I=(x||y)&&!k,L=ie()&&("ontouchstart"in r||r.navigator.maxTouchPoints||r.DocumentTouch&&r.document instanceof r.DocumentTouch),P=ie()&&"backgroundSize"in r.document.createElement("video").style,D=(Object.freeze||Object)({IS_IPAD:f,IS_IPHONE:m,IS_IPOD:g,IS_IOS:y,IOS_VERSION:v,IS_ANDROID:_,ANDROID_VERSION:b,IS_OLD_ANDROID:T,IS_NATIVE_ANDROID:S,IS_FIREFOX:w,IS_EDGE:E,IS_CHROME:k,CHROME_VERSION:C,IS_IE8:O,IE_VERSION:A,IS_SAFARI:x,IS_ANY_SAFARI:I,TOUCH_ENABLED:L,BACKGROUND_SIZE_SUPPORTED:P}),R="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},U=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},N=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t},j=function(e,t){return e.raw=t,e},B=Object.prototype.toString,F=function(e){return z(e)?Object.keys(e):[]};function q(e,t){F(e).forEach((function(i){return t(e[i],i)}))}function H(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return F(e).reduce((function(i,n){return t(i,e[n],n)}),i)}function V(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return Object.assign?Object.assign.apply(Object,[e].concat(i)):(i.forEach((function(t){t&&q(t,(function(t,i){e[i]=t}))})),e)}function z(e){return!!e&&"object"===("undefined"===typeof e?"undefined":R(e))}function W(e){return z(e)&&"[object Object]"===B.call(e)&&e.constructor===Object}var G=[],X=function(e,t){return function(i,n,a,s){var o=t.levels[n],u=new RegExp("^("+o+")$");if("log"!==i&&a.unshift(i.toUpperCase()+":"),a.unshift(e+":"),G&&G.push([].concat(a)),r.console){var l=r.console[i];l||"debug"!==i||(l=r.console.info||r.console.log),l&&o&&u.test(i)&&(s&&(a=a.map((function(e){if(z(e)||Array.isArray(e))try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)})).join(" ")),l.apply?l[Array.isArray(a)?"apply":"call"](r.console,a):l(a))}}};function Y(e){var t="info",i=void 0,n=function e(){for(var n=e.stringify||A&&A<11,r=arguments.length,a=Array(r),s=0;s<r;s++)a[s]=arguments[s];i("log",t,a,n)};return i=X(e,n),n.createLogger=function(t){return Y(e+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t},n.level=function(e){if("string"===typeof e){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');t=e}return t},n.history=function(){return G?[].concat(G):[]},n.history.filter=function(e){return(G||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},n.history.clear=function(){G&&(G.length=0)},n.history.disable=function(){null!==G&&(G.length=0,G=null)},n.history.enable=function(){null===G&&(G=[])},n.error=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("error",t,n)},n.warn=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("warn",t,n)},n.debug=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return i("debug",t,n)},n}var $=Y("VIDEOJS"),K=$.createLogger;function Q(e,t){if(!e||!t)return"";if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(e);return i?i[t]:""}return e.currentStyle[t]||""}var J=j(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);function Z(e){return"string"===typeof e&&/\S/.test(e)}function ee(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function te(e){return new RegExp("(^|\\s)"+e+"($|\\s)")}function ie(){return a===r.document&&"undefined"!==typeof a.createElement}function ne(e){return z(e)&&1===e.nodeType}function re(){try{return r.parent!==r.self}catch(e){return!0}}function ae(e){return function(t,i){if(!Z(t))return a[e](null);Z(i)&&(i=a.querySelector(i));var n=ne(i)?i:a;return n[e]&&n[e](t)}}function se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],r=a.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?($.warn(s(J,e,i)),r.setAttribute(e,i)):"textContent"===e?oe(r,i):r[e]=i})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&Ce(r,n),r}function oe(e,t){return"undefined"===typeof e.textContent?e.innerText=t:e.textContent=t,e}function ue(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function le(e,t){return ee(t),e.classList?e.classList.contains(t):te(t).test(e.className)}function ce(e,t){return e.classList?e.classList.add(t):le(e,t)||(e.className=(e.className+" "+t).trim()),e}function de(e,t){return e.classList?e.classList.remove(t):(ee(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function he(e,t,i){var n=le(e,t);if("function"===typeof i&&(i=i(e,t)),"boolean"!==typeof i&&(i=!n),i!==n)return i?ce(e,t):de(e,t),e}function pe(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null===n||"undefined"===typeof n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function fe(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!==typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function me(e,t){return e.getAttribute(t)}function ge(e,t,i){e.setAttribute(t,i)}function ye(e,t){e.removeAttribute(t)}function ve(){a.body.focus(),a.onselectstart=function(){return!1}}function _e(){a.onselectstart=function(){return!0}}function be(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Q(e,"height"))),i.width||(i.width=parseFloat(Q(e,"width"))),i}}function Te(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=a.documentElement,n=a.body,s=i.clientLeft||n.clientLeft||0,o=r.pageXOffset||n.scrollLeft,u=t.left+o-s,l=i.clientTop||n.clientTop||0,c=r.pageYOffset||n.scrollTop,d=t.top+c-l;return{left:Math.round(u),top:Math.round(d)}}function Se(e,t){var i={},n=Te(e),r=e.offsetWidth,a=e.offsetHeight,s=n.top,o=n.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/r)),i}function we(e){return z(e)&&3===e.nodeType}function Ee(e){while(e.firstChild)e.removeChild(e.firstChild);return e}function ke(e){return"function"===typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"===typeof e&&(e=e()),ne(e)||we(e)?e:"string"===typeof e&&/\S/.test(e)?a.createTextNode(e):void 0})).filter((function(e){return e}))}function Ce(e,t){return ke(t).forEach((function(t){return e.appendChild(t)})),e}function Oe(e,t){return Ce(Ee(e),t)}function Ae(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||(9===A||0===e.button&&1===e.buttons))}var xe=ae("querySelector"),Ie=ae("querySelectorAll"),Le=(Object.freeze||Object)({isReal:ie,isEl:ne,isInFrame:re,createEl:se,textContent:oe,prependTo:ue,hasClass:le,addClass:ce,removeClass:de,toggleClass:he,setAttributes:pe,getAttributes:fe,getAttribute:me,setAttribute:ge,removeAttribute:ye,blockTextSelection:ve,unblockTextSelection:_e,getBoundingClientRect:be,findPosition:Te,getPointerPosition:Se,isTextNode:we,emptyEl:Ee,normalizeContent:ke,appendContent:Ce,insertContent:Oe,isSingleLeftClick:Ae,$:xe,$$:Ie}),Pe=1;function De(){return Pe++}var Re={},Me="vdata"+(new Date).getTime();function Ue(e){var t=e[Me];return t||(t=e[Me]=De()),Re[t]||(Re[t]={}),Re[t]}function Ne(e){var t=e[Me];return!!t&&!!Object.getOwnPropertyNames(Re[t]).length}function je(e){var t=e[Me];if(t){delete Re[t];try{delete e[Me]}catch(i){e.removeAttribute?e.removeAttribute(Me):e[Me]=null}}}function Be(e,t){var i=Ue(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&je(e)}function Fe(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function qe(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var n=e||r.event;for(var s in e={},n)"layerX"!==s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s&&("returnValue"===s&&n.preventDefault||(e[s]=n[s]));if(e.target||(e.target=e.srcElement||a),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var o=a.documentElement,u=a.body;e.pageX=e.clientX+(o&&o.scrollLeft||u&&u.scrollLeft||0)-(o&&o.clientLeft||u&&u.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||u&&u.scrollTop||0)-(o&&o.clientTop||u&&u.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var He=!1;(function(){try{var e=Object.defineProperty({},"passive",{get:function(){He=!0}});r.addEventListener("test",null,e),r.removeEventListener("test",null,e)}catch(t){}})();var Ve=["touchstart","touchmove"];function ze(e,t,i){if(Array.isArray(t))return Fe(ze,e,t,i);var n=Ue(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=De()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=qe(t);var r=n.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o;s++){if(t.isImmediatePropagationStopped())break;try{a[s].call(e,t,i)}catch(u){$.error(u)}}}}),1===n.handlers[t].length)if(e.addEventListener){var r=!1;He&&Ve.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function We(e,t,i){if(Ne(e)){var n=Ue(e);if(n.handlers){if(Array.isArray(t))return Fe(We,e,t,i);var r=function(e,t){n.handlers[t]=[],Be(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s<a.length;s++)a[s].guid===i.guid&&a.splice(s--,1);Be(e,t)}else r(e,t)}else for(var o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(e,o)}}}function Ge(e,t,i){var n=Ne(e)?Ue(e):{},r=e.parentNode||e.ownerDocument;if("string"===typeof t?t={type:t,target:e}:t.target||(t.target=e),t=qe(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles)Ge.call(null,r,t,i);else if(!r&&!t.defaultPrevented){var a=Ue(t.target);t.target[t.type]&&(a.disabled=!0,"function"===typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function Xe(e,t,i){if(Array.isArray(t))return Fe(Xe,e,t,i);var n=function n(){We(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||De(),ze(e,t,n)}var Ye=(Object.freeze||Object)({fixEvent:qe,on:ze,off:We,trigger:Ge,one:Xe}),$e=!1,Ke=void 0,Qe=function(){if(ie()&&!1!==Ke.options.autoSetup){var e=a.getElementsByTagName("video"),t=a.getElementsByTagName("audio"),i=a.getElementsByTagName("video-js"),n=[];if(e&&e.length>0)for(var r=0,s=e.length;r<s;r++)n.push(e[r]);if(t&&t.length>0)for(var o=0,u=t.length;o<u;o++)n.push(t[o]);if(i&&i.length>0)for(var l=0,c=i.length;l<c;l++)n.push(i[l]);if(n&&n.length>0)for(var d=0,h=n.length;d<h;d++){var p=n[d];if(!p||!p.getAttribute){Je(1);break}if(void 0===p.player){var f=p.getAttribute("data-setup");null!==f&&Ke(p)}}else $e||Je(1)}};function Je(e,t){t&&(Ke=t),r.setTimeout(Qe,e)}ie()&&"complete"===a.readyState?$e=!0:Xe(r,"load",(function(){$e=!0}));var Ze=function(e){var t=a.createElement("style");return t.className=e,t},et=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},tt=function(e,t,i){t.guid||(t.guid=De());var n=function(){return t.apply(e,arguments)};return n.guid=i?i+"_"+t.guid:t.guid,n},it=function(e,t){var i=Date.now(),n=function(){var n=Date.now();n-i>=t&&(e.apply(void 0,arguments),i=n)};return n},nt=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,a=void 0,s=function(){n.clearTimeout(a),a=null},o=function(){var r=this,s=arguments,o=function(){a=null,o=null,i||e.apply(r,s)};!a&&i&&e.apply(r,s),n.clearTimeout(a),a=n.setTimeout(o,t)};return o.cancel=s,o},rt=function(){};rt.prototype.allowedEvents_={},rt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ze(this,e,t),this.addEventListener=i},rt.prototype.addEventListener=rt.prototype.on,rt.prototype.off=function(e,t){We(this,e,t)},rt.prototype.removeEventListener=rt.prototype.off,rt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Xe(this,e,t),this.addEventListener=i},rt.prototype.trigger=function(e){var t=e.type||e;"string"===typeof e&&(e={type:t}),e=qe(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ge(this,e)},rt.prototype.dispatchEvent=rt.prototype.trigger;var at=function(e){return e instanceof rt||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"===typeof e[t]}))},st=function(e){return"string"===typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},ot=function(e){if(!e.nodeName&&!at(e))throw new Error("Invalid target; must be a DOM node or evented object.")},ut=function(e){if(!st(e))throw new Error("Invalid event type; must be a non-empty string or array.")},lt=function(e){if("function"!==typeof e)throw new Error("Invalid listener; must be a function.")},ct=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n=void 0,r=void 0,a=void 0;return i?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),ot(n),ut(r),lt(a),a=tt(e,a),{isTargetingSelf:i,target:n,type:r,listener:a}},dt=function(e,t,i,n){ot(e),e.nodeName?Ye[t](e,i,n):e[t](i,n)},ht={on:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(dt(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,dt(this,"on","dispose",l),dt(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ct(this,i),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)dt(s,"one",o,u);else{var l=function t(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];e.off(s,o,t),u.apply(null,n)};l.guid=u.guid,dt(s,"one",o,l)}},off:function(e,t,i){if(!e||st(e))We(this.eventBusEl_,e,t);else{var n=e,r=t;ot(n),ut(r),lt(i),i=tt(this,i),this.off("dispose",i),n.nodeName?(We(n,r,i),We(n,"dispose",i)):at(n)&&(n.off(r,i),n.off("dispose",i))}},trigger:function(e,t){return Ge(this.eventBusEl_,e,t)}};function pt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.eventBusKey;if(i){if(!e[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');e.eventBusEl_=e[i]}else e.eventBusEl_=se("span",{className:"vjs-event-bus"});return V(e,ht),e.on("dispose",(function(){e.off(),r.setTimeout((function(){e.eventBusEl_=null}),0)})),e}var ft={state:{},setState:function(e){var t=this;"function"===typeof e&&(e=e());var i=void 0;return q(e,(function(e,n){t.state[n]!==e&&(i=i||{},i[n]={from:t.state[n],to:e}),t.state[n]=e})),i&&at(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function mt(e,t){return V(e,ft),e.state=V({},e.state,t),"function"===typeof e.handleStateChanged&&at(e)&&e.on("statechanged",e.handleStateChanged),e}function gt(e){return"string"!==typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function yt(e,t){return gt(e)===gt(t)}function vt(){for(var e={},t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach((function(t){t&&q(t,(function(t,i){W(t)?(W(e[i])||(e[i]={}),e[i]=vt(e[i],t)):e[i]=t}))})),e}var _t=function(){function e(t,i,n){if(M(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.options_=vt({},this.options_),i=this.options_=vt(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var r=t&&t.id&&t.id()||"no_player";this.id_=r+"_component_"+De()}this.name_=i.name||null,i.el?this.el_=i.el:!1!==i.createEl&&(this.el_=this.createEl()),!1!==i.evented&&pt(this,{eventBusKey:this.el_?"el_":null}),mt(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},!1!==i.initChildren&&this.initChildren(),this.ready(n),!1!==i.reportTouchActivity&&this.enableTouchActivity()}return e.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),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.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),je(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return $.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=vt(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return se(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return"undefined"===typeof n&&(r=e),r}))),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=gt(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,r=void 0,a=void 0;if("string"===typeof t){a=gt(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!==typeof o)return null;r=new o(this.player_||this,i)}else r=t;if(this.children_.splice(n,0,r),"function"===typeof r.id&&(this.childIndex_[r.id()]=r),a=a||r.name&>(r.name()),a&&(this.childNameIndex_[a]=r),"function"===typeof r.el&&r.el()){var u=this.contentEl().children,l=u[n]||null;this.contentEl().insertBefore(r.el(),l)}return r},e.prototype.removeChild=function(e){if("string"===typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var n=this.options_,r=function(e){var i=e.name,r=e.opts;if(void 0!==n[i]&&(r=n[i]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var a=t.addChild(i,r);a&&(t[i]=a)}},a=void 0,s=e.getComponent("Tech");a=Array.isArray(i)?i:Object.keys(i),a.concat(Object.keys(this.options_).filter((function(e){return!a.some((function(t){return"string"===typeof t?e===t:e===t.name}))}))).map((function(e){var n=void 0,r=void 0;return"string"===typeof e?(n=e,r=i[n]||t.options_[n]||{}):(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||gt(t.name));return i&&!s.isTech(i)})).forEach(r)}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},e.prototype.$=function(e,t){return xe(e,t||this.contentEl())},e.prototype.$$=function(e,t){return Ie(e,t||this.contentEl())},e.prototype.hasClass=function(e){return le(this.el_,e)},e.prototype.addClass=function(e){ce(this.el_,e)},e.prototype.removeClass=function(e){de(this.el_,e)},e.prototype.toggleClass=function(e,t){he(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return me(this.el_,e)},e.prototype.setAttribute=function(e,t){ge(this.el_,e,t)},e.prototype.removeAttribute=function(e){ye(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t===t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+gt(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"===typeof r.getComputedStyle){var i=r.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(t=parseFloat(t),0===t){var n="offset"+gt(e);t=this.el_[n]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=10,n=200,r=void 0;this.on("touchstart",(function(i){1===i.touches.length&&(t={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},e=(new Date).getTime(),r=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)r=!1;else if(t){var n=e.touches[0].pageX-t.pageX,a=e.touches[0].pageY-t.pageY,s=Math.sqrt(n*n+a*a);s>i&&(r=!1)}}));var a=function(){r=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",(function(i){if(t=null,!0===r){var a=(new Date).getTime()-e;a<n&&(i.preventDefault(),this.trigger("tap"))}}))},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=tt(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,n,a=this;return e=tt(this,e),i=r.setTimeout((function(){a.off("dispose",n),e()}),t),n=function(){return a.clearTimeout(i)},n.guid="vjs-timeout-"+i,this.on("dispose",n),i},e.prototype.clearTimeout=function(e){r.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=tt(this,e);var n=r.setInterval(e,t),a=function(){return i.clearInterval(n)};return a.guid="vjs-interval-"+n,this.on("dispose",a),n},e.prototype.clearInterval=function(e){r.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,n=this;return this.supportsRaf_?(e=tt(this,e),t=r.requestAnimationFrame((function(){n.off("dispose",i),e()})),i=function(){return n.cancelAnimationFrame(t)},i.guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){r.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!==typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!a){var s=void 0;throw s=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+s+".")}t=gt(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=gt(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();function bt(e,t,i){if("number"!==typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}function Tt(e,t,i,n){return bt(e,n,i.length-1),i[n][t]}function St(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tt.bind(null,"start",0,e),end:Tt.bind(null,"end",1,e)}}function wt(e,t){return Array.isArray(e)?St(e):void 0===e||void 0===t?St():St([[e,t]])}function Et(e,t){var i=0,n=void 0,r=void 0;if(!t)return 0;e&&e.length||(e=wt(0,0));for(var a=0;a<e.length;a++)n=e.start(a),r=e.end(a),r>t&&(r=t),i+=r-n;return i/t}_t.prototype.supportsRaf_="function"===typeof r.requestAnimationFrame&&"function"===typeof r.cancelAnimationFrame,_t.registerComponent("Component",_t);for(var kt={},Ct=[["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"]],Ot=Ct[0],At=void 0,xt=0;xt<Ct.length;xt++)if(Ct[xt][1]in a){At=Ct[xt];break}if(At)for(var It=0;It<At.length;It++)kt[Ot[It]]=At[It];function Lt(e){if(e instanceof Lt)return e;"number"===typeof e?this.code=e:"string"===typeof e?this.message=e:z(e)&&("number"===typeof e.code&&(this.code=e.code),V(this,e)),this.message||(this.message=Lt.defaultMessages[this.code]||"")}Lt.prototype.code=0,Lt.prototype.message="",Lt.prototype.status=null,Lt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Lt.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 Pt=0;Pt<Lt.errorTypes.length;Pt++)Lt[Lt.errorTypes[Pt]]=Pt,Lt.prototype[Lt.errorTypes[Pt]]=Pt;function Dt(e){return void 0!==e&&null!==e&&"function"===typeof e.then}function Rt(e){Dt(e)&&e.then(null,(function(e){}))}var Mt=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i,n){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))});return t},Ut=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,(function(e){return e.track})),n=Array.prototype.map.call(t,(function(e){var t=Mt(e.track);return e.src&&(t.src=e.src),t}));return n.concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Mt))},Nt=function(e,t){return e.forEach((function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return i.addCue(e)}))})),t.textTracks()},jt={textTracksToJson:Ut,jsonToTextTracks:Nt,trackToJson_:Mt},Bt="vjs-modal-dialog",Ft=27,qt=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=se("div",{className:Bt+"-content"},{role:"document"}),r.descEl_=se("p",{className:Bt+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),oe(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return Bt+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},t.prototype.handleKeyPress=function(e){e.which===Ft&&this.closeable()&&this.close()},t.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},t.prototype.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},t.prototype.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.prototype.opened=function(e){return"boolean"===typeof e&&this[e?"open":"close"](),this.opened_},t.prototype.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",tt(this,this.handleKeyPress)),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.prototype.closeable=function(e){if("boolean"===typeof e){var t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){var n=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=n,this.on(i,"close",this.close)}!t&&i&&(this.off(i,"close",this.close),this.removeChild(i),i.dispose())}return this.closeable_},t.prototype.fill=function(){this.fillWith(this.content())},t.prototype.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Oe(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);var r=this.getChild("closeButton");r&&i.appendChild(r.el_)},t.prototype.empty=function(){this.trigger("beforemodalempty"),Ee(this.contentEl()),this.trigger("modalempty")},t.prototype.content=function(e){return"undefined"!==typeof e&&(this.content_=e),this.content_},t.prototype.conditionalFocus_=function(){var e=a.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus(),this.on(a,"keydown",this.handleKeyDown))},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(a,"keydown",this.handleKeyDown)},t.prototype.handleKeyDown=function(e){if(9===e.which){for(var t=this.focusableEls_(),i=this.el_.querySelector(":focus"),n=void 0,r=0;r<t.length;r++)if(i===t[r]){n=r;break}a.activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}},t.prototype.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof r.HTMLAnchorElement||e instanceof r.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof r.HTMLInputElement||e instanceof r.HTMLSelectElement||e instanceof r.HTMLTextAreaElement||e instanceof r.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof r.HTMLIFrameElement||e instanceof r.HTMLObjectElement||e instanceof r.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(_t);qt.prototype.options_={pauseOnOpen:!0,temporary:!0},_t.registerComponent("ModalDialog",qt);var Ht=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;M(this,t);var s=N(this,e.call(this));if(!r&&(r=s,O))for(var o in r=a.createElement("custom"),t.prototype)"constructor"!==o&&(r[o]=t.prototype[o]);r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var u=0;u<n.length;u++)r.addTrack(n[u]);return i=r,N(s,i)}return U(t,e),t.prototype.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack"}))},t.prototype.removeTrack=function(e){for(var t=void 0,i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack"})},t.prototype.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(rt);for(var Vt in Ht.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Ht.prototype.allowedEvents_)Ht.prototype["on"+Vt]=null;var zt=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Wt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);for(var s=void 0,o=r.length-1;o>=0;o--)if(r[o].enabled){zt(r,r[o]);break}if(O){for(var u in s=a.createElement("custom"),Ht.prototype)"constructor"!==u&&(s[u]=Ht.prototype[u]);for(var l in t.prototype)"constructor"!==l&&(s[l]=t.prototype[l])}return i=N(this,e.call(this,r,s)),s=i,s.changing_=!1,n=s,N(i,n)}return U(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&zt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",(function(){i.changing_||(i.changing_=!0,zt(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),Gt=function(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)},Xt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);for(var s=void 0,o=r.length-1;o>=0;o--)if(r[o].selected){Gt(r,r[o]);break}if(O){for(var u in s=a.createElement("custom"),Ht.prototype)"constructor"!==u&&(s[u]=Ht.prototype[u]);for(var l in t.prototype)"constructor"!==l&&(s[l]=t.prototype[l])}return i=N(this,e.call(this,r,s)),s=i,s.changing_=!1,Object.defineProperty(s,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n=s,N(i,n)}return U(t,e),t.prototype.addTrack=function(t){var i=this;t.selected&&Gt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("selectedchange",(function(){i.changing_||(i.changing_=!0,Gt(i,t),i.changing_=!1,i.trigger("change"))}))},t}(Ht),Yt=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];M(this,t);var s=void 0;if(O){for(var o in s=a.createElement("custom"),Ht.prototype)"constructor"!==o&&(s[o]=Ht.prototype[o]);for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u])}return i=N(this,e.call(this,r,s)),s=i,n=s,N(i,n)}return U(t,e),t.prototype.addTrack=function(t){e.prototype.addTrack.call(this,t),t.addEventListener("modechange",tt(this,(function(){this.trigger("change")})));var i=["metadata","chapters"];-1===i.indexOf(t.kind)&&t.addEventListener("modechange",tt(this,(function(){this.trigger("selectedlanguagechange")})))},t}(Ht),$t=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];M(this,e);var i=this;if(O)for(var n in i=a.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);i.trackElements_=[],Object.defineProperty(i,"length",{get:function(){return this.trackElements_.length}});for(var r=0,s=t.length;r<s;r++)i.addTrackElement_(t[r]);if(O)return i}return e.prototype.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},e.prototype.getTrackElementByTrack_=function(e){for(var t=void 0,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},e.prototype.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_.splice(t,1);break}},e}(),Kt=function(){function e(t){M(this,e);var i=this;if(O)for(var n in i=a.createElement("custom"),e.prototype)"constructor"!==n&&(i[n]=e.prototype[n]);if(e.prototype.setCues_.call(i,t),Object.defineProperty(i,"length",{get:function(){return this.length_}}),O)return i}return e.prototype.setCues_=function(e){var t=this.length||0,i=0,n=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)r.call(this,i)},e.prototype.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),Qt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Jt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Zt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ei={disabled:"disabled",hidden:"hidden",showing:"showing"},ti=function(e){function t(){var i,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var r=N(this,e.call(this)),s=r;if(O)for(var o in s=a.createElement("custom"),t.prototype)"constructor"!==o&&(s[o]=t.prototype[o]);var u={id:n.id||"vjs_track_"+De(),kind:n.kind||"",label:n.label||"",language:n.language||""},l=function(e){Object.defineProperty(s,e,{get:function(){return u[e]},set:function(){}})};for(var c in u)l(c);return i=s,N(r,i)}return U(t,e),t}(rt),ii=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=a.createElement("a");i.href=e;var n=""===i.host&&"file:"!==i.protocol,s=void 0;n&&(s=a.createElement("div"),s.innerHTML='<a href="'+e+'"></a>',i=s.firstChild,s.setAttribute("style","display:none; position:absolute;"),a.body.appendChild(s));for(var o={},u=0;u<t.length;u++)o[t[u]]=i[t[u]];return"http:"===o.protocol&&(o.host=o.host.replace(/:80$/,"")),"https:"===o.protocol&&(o.host=o.host.replace(/:443$/,"")),o.protocol||(o.protocol=r.location.protocol),n&&a.body.removeChild(s),o},ni=function(e){if(!e.match(/^https?:\/\//)){var t=a.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},ri=function(e){if("string"===typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},ai=function(e){var t=r.location,i=ii(e),n=":"===i.protocol?t.protocol:i.protocol,a=n+i.host!==t.protocol+t.host;return a},si=(Object.freeze||Object)({parseUrl:ii,getAbsoluteURL:ni,getFileExtension:ri,isCrossOrigin:ai}),oi=function(e,t){var i=new r.WebVTT.Parser(r,r.vttjs,r.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(r.console&&r.console.groupCollapsed&&r.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach((function(e){return $.error(e)})),r.console&&r.console.groupEnd&&r.console.groupEnd()),i.flush()},ui=function(e,t){var i={uri:e},n=ai(e);n&&(i.cors=n),u(i,tt(this,(function(e,i,n){if(e)return $.error(e,i);if(t.loaded_=!0,"function"!==typeof r.WebVTT){if(t.tech_){var a=function(){return oi(n,t)};t.tech_.on("vttjsloaded",a),t.tech_.on("vttjserror",(function(){$.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",a)}))}}else oi(n,t)})))},li=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(M(this,t),!r.tech)throw new Error("A tech was not provided.");var a=vt(r,{kind:Zt[r.kind]||"subtitles",language:r.language||r.srclang||""}),s=ei[a.mode]||"disabled",o=a["default"];"metadata"!==a.kind&&"chapters"!==a.kind||(s="hidden");var u=(i=N(this,e.call(this,a)),i);if(u.tech_=a.tech,O)for(var l in t.prototype)"constructor"!==l&&(u[l]=t.prototype[l]);u.cues_=[],u.activeCues_=[];var c=new Kt(u.cues_),d=new Kt(u.activeCues_),h=!1,p=tt(u,(function(){this.activeCues=this.activeCues,h&&(this.trigger("cuechange"),h=!1)}));return"disabled"!==s&&u.tech_.ready((function(){u.tech_.on("timeupdate",p)}),!0),Object.defineProperty(u,"default",{get:function(){return o},set:function(){}}),Object.defineProperty(u,"mode",{get:function(){return s},set:function(e){var t=this;ei[e]&&(s=e,"disabled"!==s?this.tech_.ready((function(){t.tech_.on("timeupdate",p)}),!0):this.tech_.off("timeupdate",p),this.trigger("modechange"))}}),Object.defineProperty(u,"cues",{get:function(){return this.loaded_?c:null},set:function(){}}),Object.defineProperty(u,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return d;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(h=!1,t.length!==this.activeCues_.length)h=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(h=!0);return this.activeCues_=t,d.setCues_(this.activeCues_),d},set:function(){}}),a.src?(u.src=a.src,ui(a.src,u)):u.loaded_=!0,n=u,N(i,n)}return U(t,e),t.prototype.addCue=function(e){var t=e;if(r.vttjs&&!(e instanceof r.vttjs.VTTCue)){for(var i in t=new r.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),a=0;a<n.length;a++)n[a]!==this&&n[a].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.prototype.removeCue=function(e){var t=this.cues_.length;while(t--){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(ti);li.prototype.allowedEvents_={cuechange:"cuechange"};var ci=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var a=vt(r,{kind:Jt[r.kind]||""}),s=(i=N(this,e.call(this,a)),i),o=!1;if(O)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"enabled",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("enabledchange"))}}),a.enabled&&(s.enabled=a.enabled),s.loaded_=!0,n=s,N(i,n)}return U(t,e),t}(ti),di=function(e){function t(){var i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var a=vt(r,{kind:Qt[r.kind]||""}),s=(i=N(this,e.call(this,a)),i),o=!1;if(O)for(var u in t.prototype)"constructor"!==u&&(s[u]=t.prototype[u]);return Object.defineProperty(s,"selected",{get:function(){return o},set:function(e){"boolean"===typeof e&&e!==o&&(o=e,this.trigger("selectedchange"))}}),a.selected&&(s.selected=a.selected),n=s,N(i,n)}return U(t,e),t}(ti),hi=0,pi=1,fi=2,mi=3,gi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(this,t);var n=N(this,e.call(this)),r=void 0,s=n;if(O)for(var o in s=a.createElement("custom"),t.prototype)"constructor"!==o&&(s[o]=t.prototype[o]);var u,l=new li(i);return s.kind=l.kind,s.src=l.src,s.srclang=l.language,s.label=l.label,s["default"]=l["default"],Object.defineProperty(s,"readyState",{get:function(){return r}}),Object.defineProperty(s,"track",{get:function(){return l}}),r=hi,l.addEventListener("loadeddata",(function(){r=fi,s.trigger({type:"load",target:s})})),O?(u=s,N(n,u)):n}return U(t,e),t}(rt);gi.prototype.allowedEvents_={load:"load"},gi.NONE=hi,gi.LOADING=pi,gi.LOADED=fi,gi.ERROR=mi;var yi={audio:{ListClass:Wt,TrackClass:ci,capitalName:"Audio"},video:{ListClass:Xt,TrackClass:di,capitalName:"Video"},text:{ListClass:Yt,TrackClass:li,capitalName:"Text"}};Object.keys(yi).forEach((function(e){yi[e].getterName=e+"Tracks",yi[e].privateName=e+"Tracks_"}));var vi={remoteText:{ListClass:Yt,TrackClass:li,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:$t,TrackClass:gi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_i=vt(yi,vi);function bi(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.textTracks();r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e;var s=new _i.text.TrackClass(r);return a.addTrack(s),s}vi.names=Object.keys(vi),yi.names=Object.keys(yi),_i.names=[].concat(vi.names).concat(yi.names);var Ti=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};M(this,t),i.reportTouchActivity=!1;var r=N(this,e.call(this,null,i,n));return r.hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),_i.names.forEach((function(e){var t=_i[e];i&&i[t.getterName]&&(r[t.privateName]=i[t.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===i["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)})),!1===i.nativeCaptions||!1===i.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.autoRemoteTextTracks_=new _i.text.ListClass,r.initTrackListeners(),i.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}return U(t,e),t.prototype.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"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(tt(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return wt(0,0)},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(yi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;e=[].concat(e),e.forEach((function(e){var i=t[e+"Tracks"]()||[],n=i.length;while(n--){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}}))},t.prototype.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new Lt(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?wt(0,0):wt()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",(function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))},t.prototype.addWebVttScript_=function(){var e=this;if(!r.WebVTT)if(a.body.contains(this.el())){if(!this.options_["vtt.js"]&&W(l)&&Object.keys(l).length>0)return void this.trigger("vttjsloaded");var t=a.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/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})),r.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var i=t[e];i.removeEventListener("cuechange",a),"showing"===i.mode&&i.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){i.off("addtrack",n),i.off("removetrack",r),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++){var o=t[e];o.removeEventListener("cuechange",a)}}))},t.prototype.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return bi(this,e,t,i)},t.prototype.createRemoteTextTrack=function(e){var t=vt(e,{tech:this});return new vi.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],n=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&($.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==i&&this.ready((function(){return e.autoRemoteTextTracks_.addTrack(n.track)})),n},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=gt(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=gt(e),t.techs_&&t.techs_[e]?t.techs_[e]:r&&r.videojs&&r.videojs[e]?($.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),r.videojs[e]):void 0},t}(_t);_i.names.forEach((function(e){var t=_i[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],n=void 0,r=0;r<i.length;r++)if(n=i[r].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=void 0,a=0;a<n.length;a++)if(r=n[a].canHandleSource(t,i),r)return n[a];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""};var t=["seekable","seeking","duration"];t.forEach((function(e){var t=this[e];"function"===typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:$.error("No source hander found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.on("dispose",this.disposeSourceHandler)},e.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)}},_t.registerComponent("Tech",Ti),Ti.registerTech("Tech",Ti),Ti.defaultTechOrder_=[];var Si={},wi={},Ei={};function ki(e,t){Si[e]=Si[e]||[],Si[e].push(t)}function Ci(e,t,i){e.setTimeout((function(){return ji(t,Si[t.type],i,e)}),1)}function Oi(e,t){e.forEach((function(e){return e.setTech&&e.setTech(t)}))}function Ai(e,t,i){return e.reduceRight(Ri(i),t[i]())}function xi(e,t,i,n){return t[i](e.reduce(Ri(i),n))}function Ii(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+gt(i),a=e.reduce(Ri(r),n),s=a===Ei,o=s?null:t[i](a);return Mi(e,i,o,s),o}var Li={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Pi={setCurrentTime:1},Di={play:1,pause:1};function Ri(e){return function(t,i){return t===Ei?Ei:i[e]?i[e](t):t}}function Mi(e,t,i,n){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](n,i)}}function Ui(e){wi[e.id()]=null}function Ni(e,t){var i=wi[e.id()],n=null;if(void 0===i||null===i)return n=t(e),wi[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var a=i[r],s=a[0],o=a[1];s===t&&(n=o)}return null===n&&(n=t(e),i.push([t,n])),n}function ji(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments[2],n=arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=t[0],o=t.slice(1);if("string"===typeof s)ji(e,Si[s],i,n,r,a);else if(s){var u=Ni(n,s);if(!u.setSource)return r.push(u),ji(e,o,i,n,r,a);u.setSource(V({},e),(function(t,s){if(t)return ji(e,o,i,n,r,a);r.push(u),ji(s,e.type===s.type?o:Si[s.type],i,n,r,a)}))}else o.length?ji(e,o,i,n,r,a):a?i(e,r):ji(e,Si["*"],i,n,r,!0)}var Bi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Fi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=ri(e),i=Bi[t.toLowerCase()];return i||""},qi=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter((function(e){return e.src===t}));if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return Fi(t)},Hi=function e(t){if(Array.isArray(t)){var i=[];t.forEach((function(t){t=e(t),Array.isArray(t)?i=i.concat(t):z(t)&&i.push(t)})),t=i}else t="string"===typeof t&&t.trim()?[Vi({src:t})]:z(t)&&"string"===typeof t.src&&t.src&&t.src.trim()?[Vi(t)]:[];return t};function Vi(e){var t=Fi(e.src);return!e.type&&t&&(e.type=t),e}var zi=function(e){function t(i,n,r){M(this,t);var a=vt({createEl:!1},n),s=N(this,e.call(this,i,a,r));if(n.playerOptions.sources&&0!==n.playerOptions.sources.length)i.src(n.playerOptions.sources);else for(var o=0,u=n.playerOptions.techOrder;o<u.length;o++){var l=gt(u[o]),c=Ti.getTech(l);if(l||(c=_t.getComponent(l)),c&&c.isSupported()){i.loadTech_(l);break}}return s}return U(t,e),t}(_t);_t.registerComponent("MediaLoader",zi);var Wi=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.emitTapEvents(),r.enable(),r}return U(t,e),t.prototype.createEl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&$.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),n=V({role:"button"},n),this.tabIndex_=i.tabIndex;var r=e.prototype.createEl.call(this,t,i,n);return this.createControlTextEl(r),r},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=se("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,oe(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!==typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!==typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){ze(a,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){We(a,"keydown",tt(this,this.handleKeyPress))},t}(_t);_t.registerComponent("ClickableComponent",Wi);var Gi=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.update(),i.on("posterchange",tt(r,r.update)),r}return U(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var e=se("div",{className:"vjs-poster",tabIndex:-1});return P||(this.fallbackImg_=se("img"),e.appendChild(this.fallbackImg_)),e},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){if(this.fallbackImg_)this.fallbackImg_.src=e;else{var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t}},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Rt(this.player_.play()):this.player_.pause())},t}(Wi);_t.registerComponent("PosterImage",Gi);var Xi="#222",Yi="#ccc",$i={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 Ki(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Qi(e,t,i){try{e.style[t]=i}catch(n){return}}var Ji=function(e){function t(i,n,a){M(this,t);var s=N(this,e.call(this,i,n,a)),o=tt(s,s.updateDisplay);return i.on("loadstart",tt(s,s.toggleDisplay)),i.on("texttrackchange",o),i.on("loadstart",tt(s,s.preselectTrack)),i.ready(tt(s,(function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),r.addEventListener&&r.addEventListener("orientationchange",o),i.on("dispose",(function(){return r.removeEventListener("orientationchange",o)}));for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}}))),s}return U(t,e),t.prototype.preselectTrack=function(){for(var e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage,n=void 0,r=void 0,a=void 0,s=0;s<t.length;s++){var o=t[s];i&&i.enabled&&i.language===o.language?o.kind===i.kind?a=o:a||(a=o):i&&!i.enabled?(a=null,n=null,r=null):o["default"]&&("descriptions"!==o.kind||n?o.kind in e&&!r&&(r=o):n=o)}a?a.mode="showing":r?r.mode="showing":n&&(n.mode="showing")},t.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.prototype.clearDisplay=function(){"function"===typeof r.WebVTT&&r.WebVTT.processCues(r,[],this.el_)},t.prototype.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();var t=null,i=null,n=e.length;while(n--){var r=e[n];"showing"===r.mode&&("descriptions"===r.kind?t=r:i=r)}i?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(i)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.prototype.updateForTrack=function(e){if("function"===typeof r.WebVTT&&e.activeCues){for(var t=[],i=0;i<e.activeCues.length;i++)t.push(e.activeCues[i]);if(r.WebVTT.processCues(r,t,this.el_),this.player_.textTrackSettings){var n=this.player_.textTrackSettings.getValues(),a=t.length;while(a--){var s=t[a];if(s){var o=s.displayState;if(n.color&&(o.firstChild.style.color=n.color),n.textOpacity&&Qi(o.firstChild,"color",Ki(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(o.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Qi(o.firstChild,"backgroundColor",Ki(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Qi(o,"backgroundColor",Ki(n.windowColor,n.windowOpacity)):o.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?o.firstChild.style.textShadow="2px 2px 3px "+Xi+", 2px 2px 4px "+Xi+", 2px 2px 5px "+Xi:"raised"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Xi+", 2px 2px "+Xi+", 3px 3px "+Xi:"depressed"===n.edgeStyle?o.firstChild.style.textShadow="1px 1px "+Yi+", 0 1px "+Yi+", -1px -1px "+Xi+", 0 -1px "+Xi:"uniform"===n.edgeStyle&&(o.firstChild.style.textShadow="0 0 4px "+Xi+", 0 0 4px "+Xi+", 0 0 4px "+Xi+", 0 0 4px "+Xi)),n.fontPercent&&1!==n.fontPercent){var u=r.parseFloat(o.style.fontSize);o.style.fontSize=u*n.fontPercent+"px",o.style.height="auto",o.style.top="auto",o.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=$i[n.fontFamily])}}}}},t}(_t);_t.registerComponent("TextTrackDisplay",Ji);var Zi=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),n=se("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),r=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r},t}(_t);_t.registerComponent("LoadingSpinner",Zi);var en=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e="button",t=V({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),i=V({type:"button"},i);var n=_t.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(n),n},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return $.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),_t.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Wi);_t.registerComponent("Button",en);var tn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.mouseused_=!1,r.on("mousedown",r.handleMouseDown),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Rt(t);else{var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(n){var r=function(){return n.focus()};Dt(t)?t.then(r,(function(){})):this.setTimeout(r,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(en);tn.prototype.controlText_="Play Video",_t.registerComponent("BigPlayButton",tn);var nn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.controlText(n&&n.controlText||r.localize("Close")),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(en);_t.registerComponent("CloseButton",nn);var rn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"play",r.handlePlay),r.on(i,"pause",r.handlePause),r.on(i,"ended",r.handleEnded),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(en);rn.prototype.controlText_="Play",_t.registerComponent("PlayToggle",rn);var an=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),r=r>0||s>0?r+":":"",n=((r||a>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i},sn=an;function on(e){sn=e}function un(){sn=an}var ln=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return sn(e,t)},cn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.throttledUpdateContent=it(tt(r,r.updateContent),25),r.on(i,"timeupdate",r.throttledUpdateContent),r}return U(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=se("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),n.appendChild(this.contentEl_),n},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){while(this.contentEl_.firstChild)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=a.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return ln(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(_t);cn.prototype.labelText_="Time",cn.prototype.controlText_="Time",_t.registerComponent("TimeDisplay",cn);var dn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"ended",r.handleEnded),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(cn);dn.prototype.labelText_="Current Time",dn.prototype.controlText_="Current Time",_t.registerComponent("CurrentTimeDisplay",dn);var hn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"durationchange",r.updateContent),r.on(i,"loadedmetadata",r.throttledUpdateContent),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(cn);hn.prototype.labelText_="Duration",hn.prototype.controlText_="Duration",_t.registerComponent("DurationDisplay",hn);var pn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},t}(_t);_t.registerComponent("TimeDivider",pn);var fn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"durationchange",r.throttledUpdateContent),r.on(i,"ended",r.handleEnded),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(cn);fn.prototype.labelText_="Remaining Time",fn.prototype.controlText_="Remaining Time",_t.registerComponent("RemainingTimeDisplay",fn);var mn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.updateShowing(),r.on(r.player(),"durationchange",r.updateShowing),r}return U(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=se("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(_t);_t.registerComponent("LiveDisplay",mn);var gn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}return U(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),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)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),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}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=V({tabIndex:0},i),n=V({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||k||e.preventDefault(),ve(),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)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;_e(),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()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!==typeof e||e!==e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",n=t.el().style;return this.vertical()?n.height=i:n.width=i,e}}},t.prototype.calculateDistance=function(e){var t=Se(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(_t);_t.registerComponent("Slider",gn);var yn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.partEls_=[],r.on(i,"progress",r.update),r}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),n=this.player_.bufferedEnd(),r=this.partEls_,a=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=a(n,i);for(var s=0;s<t.length;s++){var o=t.start(s),u=t.end(s),l=r[s];l||(l=this.el_.appendChild(se()),r[s]=l),l.style.left=a(o,n),l.style.width=a(u-o,n)}for(var c=r.length;c>t.length;c--)this.el_.removeChild(r[c-1]);r.length=t.length},t}(_t);_t.registerComponent("LoadProgressBar",yn);var vn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var n=be(this.el_),r=be(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>n.width&&(u=n.width),this.el_.style.right="-"+u+"px",oe(this.el_,i)}},t}(_t);_t.registerComponent("TimeTooltip",vn);var _n=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),r=ln(n,i.player_.duration()),a=i.getChild("timeTooltip");a&&a.update(e,t,r)}))},t}(_t);_n.prototype.options_={children:[]},A&&!(A>8)||y||_||_n.prototype.options_.children.push("timeTooltip"),_t.registerComponent("PlayProgressBar",_n);var bn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.update=it(tt(r,r.update),25),r}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame((function(){var n=i.player_.duration(),r=ln(t*n,n);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,r)}))},t}(_t);bn.prototype.options_={children:["timeTooltip"]},_t.registerComponent("MouseTimeDisplay",bn);var Tn=5,Sn=30,wn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.setEventHandlers_(),r}return U(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=it(tt(this,this.update),Sn),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],(function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval((function(){e.requestAnimationFrame((function(){e.update()}))}),Sn)})),this.on(this.player_,["ended","pause","waiting"],(function(){e.clearInterval(e.updateInterval)})),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ln(e,i),ln(i,i)],"{1} of {2}")),this.bar.update(be(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e},t.prototype.handleMouseDown=function(t){Ae(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(Ae(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Rt(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+Tn)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-Tn)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}(gn);wn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},A&&!(A>8)||y||_||wn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),wn.prototype.playerEvent="timeupdate",_t.registerComponent("SeekBar",wn);var En=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.handleMouseMove=it(tt(r,r.handleMouseMove),25),r.throttledHandleMouseSeek=it(tt(r,r.handleMouseSeek),25),r.enable(),r}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),n=t.el(),r=be(n),a=Se(n,e).x;a>1?a=1:a<0&&(a=0),i&&i.update(r,a)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(_t);En.prototype.options_={children:["seekBar"]},_t.registerComponent("ProgressControl",En);var kn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"fullscreenchange",r.handleFullscreenChange),!1===a[kt.fullscreenEnabled]&&r.disable(),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(en);kn.prototype.controlText_="Fullscreen",_t.registerComponent("FullscreenToggle",kn);var Cn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},On=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(_t);_t.registerComponent("VolumeLevel",On);var An=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on("slideractive",r.updateLastVolume_),r.on(i,"volumechange",r.updateARIAAttributes),i.ready((function(){return r.updateARIAAttributes()})),r}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){Ae(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){Ae(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(gn);An.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},An.prototype.playerEvent="volumechange",_t.registerComponent("VolumeBar",An);var xn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t),n.vertical=n.vertical||!1,("undefined"===typeof n.volumeBar||W(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical);var r=N(this,e.call(this,i,n));return Cn(r,i),r.throttledHandleMouseMove=it(tt(r,r.handleMouseMove),25),r.on("mousedown",r.handleMouseDown),r.on("touchstart",r.handleMouseDown),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}return U(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.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.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.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.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(_t);xn.prototype.options_={children:["volumeBar"]},_t.registerComponent("VolumeControl",xn);var In=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))},Ln=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return In(r,i),r.on(i,["loadstart","volumechange"],r.update),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;y&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)de(this.el_,"vjs-vol-"+i);ce(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)},t}(en);Ln.prototype.controlText_="Mute",_t.registerComponent("MuteToggle",Ln);var Pn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t),"undefined"!==typeof n.inline?n.inline=n.inline:n.inline=!0,("undefined"===typeof n.volumeControl||W(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline);var r=N(this,e.call(this,i,n));return r.on(i,["loadstart"],r.volumePanelState_),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}return U(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.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")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(_t);Pn.prototype.options_={children:["muteToggle","volumeControl"]},_t.registerComponent("VolumePanel",Pn);var Dn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",r.handleKeyPress),r}return U(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",tt(this,(function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())})))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=se(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),ze(i,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice(),i=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);i&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(_t);_t.registerComponent("Menu",Dn);var Rn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t);var r=N(this,e.call(this,i,n));r.menuButton_=new en(i,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var a=en.prototype.buildCSSClass();return r.menuButton_.el_.className=r.buildCSSClass()+" "+a,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0,r.on(r.menuButton_,"tap",r.handleClick),r.on(r.menuButton_,"click",r.handleClick),r.on(r.menuButton_,"focus",r.handleFocus),r.on(r.menuButton_,"blur",r.handleBlur),r.on("keydown",r.handleSubmenuKeyPress),r}return U(t,e),t.prototype.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.show()},t.prototype.createMenu=function(){var e=new Dn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=se("li",{className:"vjs-menu-title",innerHTML:gt(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),ue(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},t.prototype.createItems=function(){},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.prototype.buildWrapperCSSClass=function(){var t="vjs-menu-button";!0===this.options_.inline?t+="-inline":t+="-popup";var i=en.prototype.buildCSSClass();return"vjs-menu-button "+t+" "+i+" "+e.prototype.buildCSSClass.call(this)},t.prototype.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",tt(this,(function(e){this.unpressButton(),this.el_.blur()}))),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){ze(a,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleBlur=function(){We(a,"keydown",tt(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),y&&re())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(_t);_t.registerComponent("MenuButton",Rn);var Mn=function(e){function t(i,n){M(this,t);var r=n.tracks,a=N(this,e.call(this,i,n));if(a.items.length<=1&&a.hide(),!r)return N(a);var s=tt(a,a.update);return r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),a.player_.on("ready",s),a.player_.on("dispose",(function(){r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})),a}return U(t,e),t}(Rn);_t.registerComponent("TrackButton",Mn);var Un=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}return U(t,e),t.prototype.createEl=function(t,i,n){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",V({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},i),n)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Wi);_t.registerComponent("MenuItem",Un);var Nn=function(e){function t(i,n){M(this,t);var s=n.track,o=i.textTracks();n.label=s.label||s.language||"Unknown",n.selected="showing"===s.mode;var u=N(this,e.call(this,i,n));u.track=s;var l=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];u.handleTracksChange.apply(u,t)},c=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];u.handleSelectedLanguageChange.apply(u,t)};if(i.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",c),u.on("dispose",(function(){i.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",c)})),void 0===o.onchange){var d=void 0;u.on(["tap","click"],(function(){if("object"!==R(r.Event))try{d=new r.Event("change")}catch(e){}d||(d=a.createEvent("Event"),d.initEvent("change",!0,!0)),o.dispatchEvent(d)}))}return u.handleTracksChange(),u}return U(t,e),t.prototype.handleClick=function(t){var i=this.track.kind,n=this.track.kinds,r=this.player_.textTracks();if(n||(n=[i]),e.prototype.handleClick.call(this,t),r)for(var a=0;a<r.length;a++){var s=r[a];s===this.track&&n.indexOf(s.kind)>-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){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}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Un);_t.registerComponent("TextTrackMenuItem",Nn);var jn=function(e){function t(i,n){return M(this,t),n.track={player:i,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,N(this,e.call(this,i,n))}return U(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Nn);_t.registerComponent("OffTextTrackMenuItem",jn);var Bn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return M(this,t),n.tracks=i.textTracks(),N(this,e.call(this,i,n))}return U(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nn,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new jn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a=n[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(Mn);_t.registerComponent("TextTrackButton",Bn);var Fn=function(e){function t(i,n){M(this,t);var r=n.track,a=n.cue,s=i.currentTime();n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime;var o=N(this,e.call(this,i,n));return o.track=r,o.cue=a,r.addEventListener("cuechange",tt(o,o.update)),o}return U(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.prototype.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Un);_t.registerComponent("ChaptersTrackMenuItem",Fn);var qn=function(e){function t(i,n,r){return M(this,t),N(this,e.call(this,i,n,r))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},t.prototype.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_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_)}}},t.prototype.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(gt(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],a=new Fn(this.player_,{track:this.track_,cue:r});e.push(a)}return e},t}(Bn);qn.prototype.kind_="chapters",qn.prototype.controlText_="Chapters",_t.registerComponent("ChaptersButton",qn);var Hn=function(e){function t(i,n,r){M(this,t);var a=N(this,e.call(this,i,n,r)),s=i.textTracks(),o=tt(a,a.handleTracksChange);return s.addEventListener("change",o),a.on("dispose",(function(){s.removeEventListener("change",o)})),a}return U(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},t.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Bn);Hn.prototype.kind_="descriptions",Hn.prototype.controlText_="Descriptions",_t.registerComponent("DescriptionsButton",Hn);var Vn=function(e){function t(i,n,r){return M(this,t),N(this,e.call(this,i,n,r))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Bn);Vn.prototype.kind_="subtitles",Vn.prototype.controlText_="Subtitles",_t.registerComponent("SubtitlesButton",Vn);var zn=function(e){function t(i,n){M(this,t),n.track={player:i,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem";var r=N(this,e.call(this,i,n));return r.addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return U(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Nn);_t.registerComponent("CaptionSettingsMenuItem",zn);var Wn=function(e){function t(i,n,r){return M(this,t),N(this,e.call(this,i,n,r))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Bn);Wn.prototype.kind_="captions",Wn.prototype.controlText_="Captions",_t.registerComponent("CaptionsButton",Wn);var Gn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"captions"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),r+="</span>";var a=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return a},t}(Nn);_t.registerComponent("SubsCapsMenuItem",Gn);var Xn=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M(this,t);var r=N(this,e.call(this,i,n));return r.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(gt(r.label_)),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new zn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Gn),t},t}(Bn);Xn.prototype.kinds_=["captions","subtitles"],Xn.prototype.controlText_="Subtitles",_t.registerComponent("SubsCapsButton",Xn);var Yn=function(e){function t(i,n){M(this,t);var r=n.track,a=i.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled;var s=N(this,e.call(this,i,n));s.track=r,s.addClass("vjs-"+r.kind+"-menu-item");var o=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];s.handleTracksChange.apply(s,t)};return a.addEventListener("change",o),s.on("dispose",(function(){a.removeEventListener("change",o)})),s}return U(t,e),t.prototype.createEl=function(t,i,n){var r='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"main-desc"===this.options_.track.kind&&(r+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),r+="</span>";var a=e.prototype.createEl.call(this,t,V({innerHTML:r},i),n);return a},t.prototype.handleClick=function(t){var i=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0;n<i.length;n++){var r=i[n];r.enabled=r===this.track}},t.prototype.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Un);_t.registerComponent("AudioTrackMenuItem",Yn);var $n=function(e){function t(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return M(this,t),n.tracks=i.audioTracks(),N(this,e.call(this,i,n))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new Yn(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(Mn);$n.prototype.controlText_="Audio Track",_t.registerComponent("AudioTrackButton",$n);var Kn=function(e){function t(i,n){M(this,t);var r=n.rate,a=parseFloat(r,10);n.label=r,n.selected=1===a,n.selectable=!0,n.multiSelectable=!1;var s=N(this,e.call(this,i,n));return s.label=r,s.rate=a,s.on(i,"ratechange",s.update),s}return U(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.prototype.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Un);Kn.prototype.contentElType="button",_t.registerComponent("PlaybackRateMenuItem",Kn);var Qn=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.updateVisibility(),r.updateLabel(),r.on(i,"loadstart",r.updateVisibility),r.on(i,"ratechange",r.updateLabel),r}return U(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelEl_=se("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),t.appendChild(this.labelEl_),t},t.prototype.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},t.prototype.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},t.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},t.prototype.createMenu=function(){var e=new Dn(this.player()),t=this.playbackRates();if(t)for(var i=t.length-1;i>=0;i--)e.addChild(new Kn(this.player(),{rate:t[i]+"x"}));return e},t.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.prototype.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},t.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.prototype.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.prototype.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Rn);Qn.prototype.controlText_="Playback Rate",_t.registerComponent("PlaybackRateMenuButton",Qn);var Jn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(_t);_t.registerComponent("Spacer",Jn);var Zn=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Jn);_t.registerComponent("CustomControlSpacer",Zn);var er=function(e){function t(){return M(this,t),N(this,e.apply(this,arguments))}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(_t);er.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},_t.registerComponent("ControlBar",er);var tr=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n));return r.on(i,"error",r.open),r}return U(t,e),t.prototype.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},t.prototype.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(qt);tr.prototype.options_=vt(qt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),_t.registerComponent("ErrorDisplay",tr);var ir="vjs-text-track-settings",nr=["#000","Black"],rr=["#00F","Blue"],ar=["#0FF","Cyan"],sr=["#0F0","Green"],or=["#F0F","Magenta"],ur=["#F00","Red"],lr=["#FFF","White"],cr=["#FF0","Yellow"],dr=["1","Opaque"],hr=["0.5","Semi-Transparent"],pr=["0","Transparent"],fr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[nr,lr,ur,sr,rr,cr,or,ar]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[dr,hr,pr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[lr,nr,ur,sr,rr,cr,or,ar]},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(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[dr,hr]},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:[pr,hr,dr]}};function mr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function gr(e,t){var i=e.options[e.options.selectedIndex].value;return mr(i,t)}function yr(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(mr(e.options[n].value,i)===t){e.selectedIndex=n;break}}fr.windowColor.options=fr.backgroundColor.options;var vr=function(e){function t(i,n){M(this,t),n.temporary=!1;var r=N(this,e.call(this,i,n));return r.updateDisplay=tt(r,r.updateDisplay),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=se("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),q(fr,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}return U(t,e),t.prototype.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},t.prototype.createElSelect_=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",r=fr[e],a=r.id.replace("%s",this.id_),s=[i,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"</"+n+">",'<select aria-labelledby="'+s+'">'].concat(r.options.map((function(e){var i=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+i+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+i+'">',t.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},t.prototype.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("")},t.prototype.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("")},t.prototype.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("")},t.prototype.createElColors_=function(){return se("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.prototype.createElFont_=function(){return se("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("")})},t.prototype.createElControls_=function(){var e=this.localize("restore all settings to the default values");return se("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("")})},t.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.prototype.label=function(){return this.localize("Caption Settings Dialog")},t.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.prototype.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.prototype.getValues=function(){var e=this;return H(fr,(function(t,i,n){var r=gr(e.$(i.selector),i.parser);return void 0!==r&&(t[n]=r),t}),{})},t.prototype.setValues=function(e){var t=this;q(fr,(function(i,n){yr(t.$(i.selector),e[n],i.parser)}))},t.prototype.setDefaults=function(){var e=this;q(fr,(function(t){var i=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=i}))},t.prototype.restoreSettings=function(){var e=void 0;try{e=JSON.parse(r.localStorage.getItem(ir))}catch(t){$.warn(t)}e&&this.setValues(e)},t.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?r.localStorage.setItem(ir,JSON.stringify(e)):r.localStorage.removeItem(ir)}catch(t){$.warn(t)}}},t.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(a,"keydown",this.handleKeyDown);var e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()},t}(qt);_t.registerComponent("TextTrackSettings",vr);var _r=function(e){function t(i,n){M(this,t);var a=n.ResizeObserver||r.ResizeObserver;null===n.ResizeObserver&&(a=!1);var s=vt({createEl:!a},n),o=N(this,e.call(this,i,s));return o.ResizeObserver=n.ResizeObserver||r.ResizeObserver,o.loadListener_=null,o.resizeObserver_=null,o.debouncedHandler_=nt((function(){o.resizeHandler()}),100,!1,o),a?(o.resizeObserver_=new o.ResizeObserver(o.debouncedHandler_),o.resizeObserver_.observe(i.el())):(o.loadListener_=function(){o.el_&&o.el_.contentWindow&&ze(o.el_.contentWindow,"resize",o.debouncedHandler_)},o.one("load",o.loadListener_)),o}return U(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},t.prototype.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.prototype.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&We(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},t}(_t);_t.registerComponent("ResizeManager",_r);var br=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var s=i[a].src;s&&-1===n.indexOf(s)&&n.push(s)}return!!n.length&&(1===n.length&&(r=n[0]),e.triggerSourceset(r),!0)},Tr={};O||(Tr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=a.createElement(this.nodeName.toLowerCase());t.innerHTML=e;var i=a.createDocumentFragment();while(t.childNodes.length)i.appendChild(t.childNodes[0]);return this.innerText="",r.Element.prototype.appendChild.call(this,i),this.innerHTML}}));var Sr=function(e,t){for(var i={},n=0;n<e.length;n++)if(i=Object.getOwnPropertyDescriptor(e[n],t),i&&i.set&&i.get)break;return i.enumerable=!0,i.configurable=!0,i},wr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,r.Element.prototype,Tr],"innerHTML")},Er=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},n=wr(e),r=function(i){return function(){for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var s=i.apply(t,r);return br(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",vt(n,{set:r(n.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach((function(e){t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)}},kr={};O||(kr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ni(r.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return r.Element.prototype.setAttribute.call(this,"src",e),e}}));var Cr=function(e){return Sr([e.el(),r.HTMLMediaElement.prototype,kr],"src")},Or=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=Cr(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",vt(i,{set:function(n){var r=i.set.call(t,n);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(i,r){var a=n.call(t,i,r);return/src/i.test(i)&&e.triggerSourceset(t.src),a},t.load=function(){var i=r.call(t);return br(e)||(e.triggerSourceset(""),Er(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):br(e)||Er(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Ar=j(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),xr=function(e){function t(i,n){M(this,t);var r=N(this,e.call(this,i,n)),a=i.source,o=!1;if(a&&(r.el_.currentSrc!==a.src||i.tag&&3===i.tag.initNetworkState_)?r.setSource(a):r.handleLateInit_(r.el_),i.enableSourceset&&r.setupSourcesetHandling_(),r.el_.hasChildNodes()){var u=r.el_.childNodes,l=u.length,c=[];while(l--){var d=u[l],h=d.nodeName.toLowerCase();"track"===h&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(d),r.remoteTextTracks().addTrack(d.track),r.textTracks().addTrack(d.track),o||r.el_.hasAttribute("crossorigin")||!ai(d.src)||(o=!0)):c.push(d))}for(var p=0;p<c.length;p++)r.el_.removeChild(c[p])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&o&&$.warn(s(Ar)),r.restoreMetadataTracksInIOSNativePlayer_(),(L||m||S)&&!0===i.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}return U(t,e),t.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},t.prototype.setupSourcesetHandling_=function(){Or(this)},t.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var e=this.textTracks(),t=void 0,i=function(){t=[];for(var i=0;i<e.length;i++){var n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(function(){return e.removeEventListener("change",i)}));var n=function i(){for(var n=0;n<t.length;n++){var r=t[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}e.removeEventListener("change",i)};this.on("webkitbeginfullscreen",(function(){e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(function(){e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))},t.prototype.proxyNativeTracks_=function(){var e=this;yi.names.forEach((function(t){var i=yi[t],n=e.el()[i.getterName],r=e[i.getterName]();if(e["featuresNative"+i.capitalName+"Tracks"]&&n&&n.addEventListener){var a={change:function(e){r.trigger({type:"change",target:r,currentTarget:r,srcElement:r})},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var i=!1,a=0;a<n.length;a++)if(n[a]===r[t]){i=!0;break}i||e.push(r[t])}while(e.length)r.removeTrack(e.shift())};Object.keys(a).forEach((function(t){var i=a[t];n.addEventListener(t,i),e.on("dispose",(function(e){return n.removeEventListener(t,i)}))})),e.on("loadstart",s),e.on("dispose",(function(t){return e.off("loadstart",s)}))}}))},t.prototype.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),t.disposeMediaElement(e),e=i}else{e=a.createElement("video");var n=this.options_.tag&&fe(this.options_.tag),r=vt({},n);L&&!0===this.options_.nativeControlsForTouch||delete r.controls,pe(e,V(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&ge(e,"preload",this.options_.preload);for(var s=["loop","muted","playsinline","autoplay"],o=0;o<s.length;o++){var u=s[o],l=this.options_[u];"undefined"!==typeof l&&(l?ge(e,u,u):ye(e,u),e[u]=l)}return e},t.prototype.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")}))}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready((function(){r.forEach((function(e){this.trigger(e)}),this)}))}},t.prototype.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(t){$(t,"Video is not ready. (Video.js)")}},t.prototype.duration=function(){var e=this;if(this.el_.duration===1/0&&_&&k&&0===this.el_.currentTime){var t=function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN},t.prototype.width=function(){return this.el_.offsetWidth},t.prototype.height=function(){return this.el_.offsetHeight},t.prototype.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",(function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)}))}},t.prototype.supportsFullScreen=function(){if("function"===typeof this.el_.webkitEnterFullScreen){var e=r.navigator&&r.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},t.prototype.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},t.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},t.prototype.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},t.prototype.reset=function(){t.resetMediaElement(this.el_)},t.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.prototype.setControls=function(e){this.el_.controls=!!e},t.prototype.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},t.prototype.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=a.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},t.prototype.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},t.prototype.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks){var i=this.$$("track"),n=i.length;while(n--)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])}},t.prototype.getVideoPlaybackQuality=function(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),r.performance&&"function"===typeof r.performance.now?e.creationTime=r.performance.now():r.performance&&r.performance.timing&&"number"===typeof r.performance.timing.navigationStart&&(e.creationTime=r.Date.now()-r.performance.timing.navigationStart),e},t}(Ti);if(ie()){xr.TEST_VID=a.createElement("video");var Ir=a.createElement("track");Ir.kind="captions",Ir.srclang="en",Ir.label="English",xr.TEST_VID.appendChild(Ir)}xr.isSupported=function(){try{xr.TEST_VID.volume=.5}catch(e){return!1}return!(!xr.TEST_VID||!xr.TEST_VID.canPlayType)},xr.canPlayType=function(e){return xr.TEST_VID.canPlayType(e)},xr.canPlaySource=function(e,t){return xr.canPlayType(e.type)},xr.canControlVolume=function(){try{var e=xr.TEST_VID.volume;return xr.TEST_VID.volume=e/2+.1,e!==xr.TEST_VID.volume}catch(t){return!1}},xr.canMuteVolume=function(){try{var e=xr.TEST_VID.muted;return xr.TEST_VID.muted=!e,xr.TEST_VID.muted?ge(xr.TEST_VID,"muted","muted"):ye(xr.TEST_VID,"muted","muted"),e!==xr.TEST_VID.muted}catch(t){return!1}},xr.canControlPlaybackRate=function(){if(_&&k&&C<58)return!1;try{var e=xr.TEST_VID.playbackRate;return xr.TEST_VID.playbackRate=e/2+.1,e!==xr.TEST_VID.playbackRate}catch(t){return!1}},xr.canOverrideAttributes=function(){if(O)return!1;try{var e=function(){};Object.defineProperty(a.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0},xr.supportsNativeTextTracks=function(){return I||y&&k},xr.supportsNativeVideoTracks=function(){return!(!xr.TEST_VID||!xr.TEST_VID.videoTracks)},xr.supportsNativeAudioTracks=function(){return!(!xr.TEST_VID||!xr.TEST_VID.audioTracks)},xr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],xr.prototype.featuresVolumeControl=xr.canControlVolume(),xr.prototype.featuresMuteControl=xr.canMuteVolume(),xr.prototype.featuresPlaybackRate=xr.canControlPlaybackRate(),xr.prototype.featuresSourceset=xr.canOverrideAttributes(),xr.prototype.movingMediaElementInDOM=!y,xr.prototype.featuresFullscreenResize=!0,xr.prototype.featuresProgressEvents=!0,xr.prototype.featuresTimeupdateEvents=!0,xr.prototype.featuresNativeTextTracks=xr.supportsNativeTextTracks(),xr.prototype.featuresNativeVideoTracks=xr.supportsNativeVideoTracks(),xr.prototype.featuresNativeAudioTracks=xr.supportsNativeAudioTracks();var Lr=xr.TEST_VID&&xr.TEST_VID.constructor.prototype.canPlayType,Pr=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,Dr=/^video\/mp4/i;xr.patchCanPlayType=function(){b>=4&&!w&&!k?xr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Pr.test(e)?"maybe":Lr.call(this,e)}:T&&(xr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&Dr.test(e)?"maybe":Lr.call(this,e)})},xr.unpatchCanPlayType=function(){var e=xr.TEST_VID.constructor.prototype.canPlayType;return xr.TEST_VID.constructor.prototype.canPlayType=Lr,e},xr.patchCanPlayType(),xr.disposeMediaElement=function(e){if(e){e.parentNode&&e.parentNode.removeChild(e);while(e.hasChildNodes())e.removeChild(e.firstChild);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},xr.resetMediaElement=function(e){if(e){var t=e.querySelectorAll("source"),i=t.length;while(i--)e.removeChild(t[i]);e.removeAttribute("src"),"function"===typeof e.load&&function(){try{e.load()}catch(t){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){xr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){xr.prototype["set"+gt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach((function(e){xr.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach((function(e){xr.prototype["set"+gt(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){xr.prototype[e]=function(){return this.el_[e]()}})),Ti.withSourceHandlers(xr),xr.nativeSourceHandler={},xr.nativeSourceHandler.canPlayType=function(e){try{return xr.TEST_VID.canPlayType(e)}catch(t){return""}},xr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return xr.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=ri(e.src);return xr.nativeSourceHandler.canPlayType("video/"+i)}return""},xr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},xr.nativeSourceHandler.dispose=function(){},xr.registerSourceHandler(xr.nativeSourceHandler),Ti.registerTech("Html5",xr);var Rr=j(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),Mr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ur={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Nr=["tiny","xsmall","small","medium","large","xlarge","huge"],jr={};Nr.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;jr[e]="vjs-layout-"+t}));var Br={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Fr=function(e){function t(i,n,r){if(M(this,t),i.id=i.id||n.id||"vjs_video_"+De(),n=V(t.getTagSettings(i),n),n.initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"===typeof i.closest){var a=i.closest("[lang]");a&&a.getAttribute&&(n.language=a.getAttribute("lang"))}else{var s=i;while(s&&1===s.nodeType){if(fe(s).hasOwnProperty("lang")){n.language=s.getAttribute("lang");break}s=s.parentNode}}var o=N(this,e.call(this,null,n,r));if(o.log=K(o.id_),o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,!o.options_||!o.options_.techOrder||!o.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(o.tag=i,o.tagAttributes=i&&fe(i),o.language(o.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach((function(e){u[e.toLowerCase()]=n.languages[e]})),o.languages_=u}else o.languages_=t.prototype.options_.languages;o.cache_={},o.poster_=n.poster||"",o.controls_=!!n.controls,o.cache_.lastVolume=1,i.controls=!1,i.removeAttribute("controls"),i.hasAttribute("autoplay")?o.options_.autoplay=!0:o.autoplay(o.options_.autoplay),o.scrubbing_=!1,o.el_=o.createEl(),o.cache_.lastPlaybackRate=o.defaultPlaybackRate(),pt(o,{eventBusKey:"el_"});var l=vt(o.options_);if(n.plugins){var d=n.plugins;Object.keys(d).forEach((function(e){if("function"!==typeof this[e])throw new Error('plugin "'+e+'" does not exist');this[e](d[e])}),o)}o.options_.playerOptions=l,o.middleware_=[],o.initChildren(),o.isAudio("audio"===i.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),y||o.addClass("vjs-workinghover"),t.players[o.id_]=o;var h=c.split(".")[0];return o.addClass("vjs-v"+h),o.userActive(!0),o.reportUserActivity(),o.one("play",o.listenForUserActivity_),o.on("fullscreenchange",o.handleFullscreenChange_),o.on("stageclick",o.handleStageClick_),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.changingSrc_=!1,o.playWaitingForReady_=!1,o.playOnLoadstart_=null,o}return U(t,e),t.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Ui(this),e.prototype.dispose.call(this)},t.prototype.createEl=function(){var t=this.tag,i=void 0,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),s="video-js"===this.tag.tagName.toLowerCase();n?i=this.el_=t.parentNode:s||(i=this.el_=e.prototype.createEl.call(this,"div"));var o=fe(t);if(s){i=this.el_=t,t=this.tag=a.createElement("video");while(i.children.length)t.appendChild(i.firstChild);le(i,"video-js")||ce(i,"video-js"),i.appendChild(t),n=this.playerElIngest_=i,["autoplay","controls","crossOrigin","defaultMuted","defaultPlaybackRate","loop","muted","playbackRate","src","volume"].forEach((function(e){"undefined"!==typeof i[e]&&(t[e]=i[e])}))}if(t.setAttribute("tabindex","-1"),o.tabindex="-1",A&&(t.setAttribute("role","application"),o.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach((function(e){"class"===e?(i.className+=" "+o[e],s&&(t.className+=" "+o[e])):(i.setAttribute(e,o[e]),s&&t.setAttribute(e,o[e]))})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=i.player=this,this.addClass("vjs-paused"),!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ze("vjs-styles-dimensions");var u=xe(".vjs-styles-defaults"),l=xe("head");l.insertBefore(this.styleEl_,u?u.nextSibling:l.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);for(var c=t.getElementsByTagName("a"),d=0;d<c.length;d++){var h=c.item(d);ce(h,"vjs-hidden"),h.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(i,t),ue(t,i),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_=i,i},t.prototype.width=function(e){return this.dimension("width",e)},t.prototype.height=function(e){return this.dimension("height",e)},t.prototype.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?$.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},t.prototype.fluid=function(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,e?(this.addClass("vjs-fluid"),this.fill(!1)):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.prototype.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.prototype.aspectRatio=function(e){if(void 0===e)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_()},t.prototype.updateStyleEl_=function(){if(!0!==r.VIDEOJS_NO_DYNAMIC_STYLE){var e=void 0,t=void 0,i=void 0,n=void 0;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var a=i.split(":"),s=a[1]/a[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),et(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*s+"%;\n }\n ")}else{var o="number"===typeof this.width_?this.width_:this.options_.width,u="number"===typeof this.height_?this.height_:this.options_.height,l=this.tech_&&this.tech_.el();l&&(o>=0&&(l.width=o),u>=0&&(l.height=u))}},t.prototype.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=gt(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Ti.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a="string"!==typeof this.autoplay()&&this.autoplay(),s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,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};_i.names.forEach((function(e){var t=_i[e];s[t.getterName]=i[t.privateName]})),V(s,this.options_[n]),V(s,this.options_[r]),V(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=Ti.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(tt(this,this.handleTechReady_),!0),jt.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Mr.forEach((function(e){i.on(i.tech_,e,i["handleTech"+gt(e)+"_"])})),Object.keys(Ur).forEach((function(e){i.on(i.tech_,e,(function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Ur[e]+"_"].bind(i),event:t}):i["handleTech"+Ur[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||ue(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.prototype.unloadTech_=function(){var e=this;_i.names.forEach((function(t){var i=_i[t];e[i.privateName]=e[i.getterName]()})),this.textTracksJson_=jt.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.prototype.tech=function(e){return void 0===e&&$.warn(s(Rr)),this.tech_},t.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},t.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},t.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(e){$("deleting tag.poster throws in some browsers",e)}},t.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},t.prototype.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"===typeof e){var i=function(){var e=t.muted();t.muted(!0);var i=t.play();if(i&&i.then&&i["catch"])return i["catch"]((function(i){t.muted(e)}))},n=void 0;if("any"===e?(n=this.play(),n&&n.then&&n["catch"]&&n["catch"]((function(){return i()}))):n="muted"===e?i():this.play(),n&&n.then&&n["catch"])return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})}))["catch"]((function(i){t.trigger({type:"autoplay-failure",autoplay:e})}))}},t.prototype.updateSourceCaches_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e,i="";"string"!==typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=qi(this,t)),this.cache_.source=vt({},e,{src:t,type:i});for(var n=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=fe(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!n.length?this.cache_.sources=r:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},t.prototype.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var i=function(e){return t.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=function(){}),i(r),!e.src){var a=function e(i){if("sourceset"!==i.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}t.tech_.off(["sourceset","loadstart"],e)};this.tech_.one(["sourceset","loadstart"],a)}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},t.prototype.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.prototype.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",(function(){return e.removeClass("vjs-waiting")}))},t.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},t.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&($.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.prototype.handleTechClick_=function(e){Ae(e)&&this.controls_&&(this.paused()?Rt(this.play()):this.pause())},t.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},t.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.prototype.handleTechTouchEnd_=function(e){e.preventDefault()},t.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.prototype.handleStageClick_=function(){this.reportUserActivity()},t.prototype.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},t.prototype.handleTechError_=function(){var e=this.tech_.error();this.error(e)},t.prototype.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},t.prototype.getCache=function(){return this.cache_},t.prototype.techCall_=function(e,t){this.ready((function(){if(e in Pi)return xi(this.middleware_,this.tech_,e,t);if(e in Di)return Ii(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw $(i),i}}),!0)},t.prototype.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Li)return Ai(this.middleware_,this.tech_,e);if(e in Di)return Ii(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw $("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw $("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw $(t),t}}},t.prototype.play=function(){var e=this,t=this.options_.Promise||r.Promise;return t?new t((function(t){e.play_(t)})):this.play_()},t.prototype.play_=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rt;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return void t(this.techGet_("play"));this.playOnLoadstart_=function(){e.playOnLoadstart_=null,t(e.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready((function(){e.playWaitingForReady_=!1,t(e.play())}))}},t.prototype.pause=function(){this.techCall_("pause")},t.prototype.paused=function(){return!1!==this.techGet_("paused")},t.prototype.played=function(){return this.techGet_("played")||wt(0,0)},t.prototype.scrubbing=function(e){if("undefined"===typeof e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.prototype.currentTime=function(e){return"undefined"!==typeof e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},t.prototype.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?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"),this.trigger("durationchange"))},t.prototype.remainingTime=function(){return this.duration()-this.currentTime()},t.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.prototype.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=wt(0,0)),e},t.prototype.bufferedPercent=function(){return Et(this.buffered(),this.duration())},t.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},t.prototype.volume=function(e){var t=void 0;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},t.prototype.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},t.prototype.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},t.prototype.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},t.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.prototype.isFullscreen=function(e){if(void 0===e)return!!this.isFullscreen_;this.isFullscreen_=!!e},t.prototype.requestFullscreen=function(){var e=kt;this.isFullscreen(!0),e.requestFullscreen?(ze(a,e.fullscreenchange,tt(this,(function t(i){this.isFullscreen(a[e.fullscreenElement]),!1===this.isFullscreen()&&We(a,e.fullscreenchange,t),this.trigger("fullscreenchange")}))),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},t.prototype.exitFullscreen=function(){var e=kt;this.isFullscreen(!1),e.requestFullscreen?a[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},t.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=a.documentElement.style.overflow,ze(a,"keydown",tt(this,this.fullWindowOnEscKey)),a.documentElement.style.overflow="hidden",ce(a.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},t.prototype.exitFullWindow=function(){this.isFullWindow=!1,We(a,"keydown",this.fullWindowOnEscKey),a.documentElement.style.overflow=this.docOrigOverflow,de(a.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.prototype.canPlayType=function(e){for(var t=void 0,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=Ti.getTech(r);if(a||(a=_t.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e),t))return t}else $.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},t.prototype.selectSource=function(e){var t=this,i=this.options_.techOrder.map((function(e){return[e,Ti.getTech(e)]})).filter((function(e){var t=e[0],i=e[1];return i?i.isSupported():($.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),n=function(e,t,i){var n=void 0;return e.some((function(e){return t.some((function(t){if(n=i(e,t),n)return!0}))})),n},r=void 0,a=function(e){return function(t,i){return e(i,t)}},s=function(e,i){var n=e[0],r=e[1];if(r.canPlaySource(i,t.options_[n.toLowerCase()]))return{source:i,tech:n}};return r=this.options_.sourceOrder?n(e,i,a(s)):n(i,e,s),r||!1},t.prototype.src=function(e){var t=this;if("undefined"===typeof e)return this.cache_.src||"";var i=Hi(e);i.length?(this.changingSrc_=!0,this.cache_.sources=i,this.updateSourceCaches_(i[0]),Ci(this,i[0],(function(e,n){t.middleware_=n,t.cache_.sources=i,t.updateSourceCaches_(e);var r=t.src_(e);if(r)return i.length>1?t.src(i.slice(1)):(t.changingSrc_=!1,t.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0),void t.triggerReady());Oi(n,t.tech_)}))):this.setTimeout((function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})}),0)},t.prototype.src_=function(e){var t=this,i=this.selectSource([e]);return!i||(yt(i.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_(i.tech,i.source),this.tech_.ready((function(){t.changingSrc_=!1})),!1))},t.prototype.load=function(){this.techCall_("load")},t.prototype.reset=function(){this.tech_&&this.tech_.clearTracks("text"),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},t.prototype.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},t.prototype.currentSource=function(){return this.cache_.source||{}},t.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.prototype.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},t.prototype.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t=void 0;"string"===typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t=t||this.options_.autoplay,this.tech_&&this.techCall_("setAutoplay",t)},t.prototype.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},t.prototype.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},t.prototype.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.prototype.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"))}},t.prototype.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.prototype.usingNativeControls=function(e){if(void 0===e)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")))},t.prototype.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Lt(e),this.addClass("vjs-error"),$.error("(CODE:"+this.error_.code+" "+Lt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},t.prototype.reportUserActivity=function(e){this.userActivity_=!0},t.prototype.userActive=function(e){if(void 0===e)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.prototype.listenForUserActivity_=function(){var e=void 0,t=void 0,i=void 0,n=tt(this,this.reportUserActivity),r=function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())},a=function(){n(),this.clearInterval(e),e=this.setInterval(n,250)},s=function(t){n(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",r),this.on("mouseup",s),this.on("keydown",n),this.on("keyup",n);var o=void 0;this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options_.inactivityTimeout;e<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},t.prototype.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},t.prototype.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.prototype.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},t.prototype.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},t.prototype.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},t.prototype.removeRemoteTextTrack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track,i=void 0===t?arguments[0]:t;if(this.tech_)return this.tech_.removeRemoteTextTrack(i)},t.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.prototype.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},t.prototype.languages=function(){return vt(t.prototype.options_.languages,this.languages_)},t.prototype.toJSON=function(){var e=vt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];n=vt(n),n.player=void 0,e.tracks[i]=n}return e},t.prototype.createModal=function(e,t){var i=this;t=t||{},t.content=e||"";var n=new qt(this,t);return this.addChild(n),n.on("dispose",(function(){i.removeChild(n)})),n.open(),n},t.prototype.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<Nr.length;i++){var n=Nr[i],r=this.breakpoints_[n];if(t<=r){if(e===n)return;e&&this.removeClass(jr[e]),this.addClass(jr[n]),this.breakpoint_=n;break}}},t.prototype.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},t.prototype.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=V({},Br,e),this.updateCurrentBreakpoint_()),V(this.breakpoints_)},t.prototype.responsive=function(e){if(void 0===e)return this.responsive_;e=Boolean(e);var t=this.responsive_;return e!==t?(this.responsive_=e,e?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},t.prototype.currentBreakpoint=function(){return this.breakpoint_},t.prototype.currentBreakpointClass=function(){return jr[this.breakpoint_]||""},t.getTagSettings=function(e){var t={sources:[],tracks:[]},i=fe(e),n=i["data-setup"];if(le(e,"vjs-fill")&&(i.fill=!0),le(e,"vjs-fluid")&&(i.fluid=!0),null!==n){var r=o(n||"{}"),a=r[0],s=r[1];a&&$.error(a),V(i,s)}if(V(t,i),e.hasChildNodes())for(var u=e.childNodes,l=0,c=u.length;l<c;l++){var d=u[l],h=d.nodeName.toLowerCase();"source"===h?t.sources.push(fe(d)):"track"===h&&t.tracks.push(fe(d))}return t},t.prototype.flexNotSupported_=function(){var e=a.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},t}(_t);_i.names.forEach((function(e){var t=_i[e];Fr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Fr.players={};var qr=r.navigator;Fr.prototype.options_={techOrder:Ti.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings"],language:qr&&(qr.languages&&qr.languages[0]||qr.userLanguage||qr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},O||Fr.prototype.options_.children.push("resizeManager"),["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Fr.prototype[e]=function(){return this.techGet_(e)}})),Mr.forEach((function(e){Fr.prototype["handleTech"+gt(e)+"_"]=function(){return this.trigger(e)}})),_t.registerComponent("Player",Fr);var Hr="plugin",Vr="activePlugins_",zr={},Wr=function(e){return zr.hasOwnProperty(e)},Gr=function(e){return Wr(e)?zr[e]:void 0},Xr=function(e,t){e[Vr]=e[Vr]||{},e[Vr][t]=!0},Yr=function(e,t,i){var n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},$r=function(e,t){var i=function(){Yr(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Xr(this,e),Yr(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i},Kr=function(e,t){return t.prototype.name=e,function(){Yr(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=new(Function.prototype.bind.apply(t,[null].concat([this].concat(n))));return this[e]=function(){return a},Yr(this,a.getEventHash()),a}},Qr=function(){function e(t){if(M(this,e),this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,pt(this),delete this.trigger,mt(this,this.constructor.defaultState),Xr(t,this.name),this.dispose=tt(this,this.dispose),t.on("dispose",this.dispose)}return e.prototype.version=function(){return this.constructor.VERSION},e.prototype.getEventHash=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.prototype.trigger=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ge(this.eventBusEl_,e,this.getEventHash(t))},e.prototype.handleStateChanged=function(e){},e.prototype.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Vr][e]=!1,this.player=this.state=null,t[e]=Kr(e,zr[e])},e.isBasic=function(t){var i="string"===typeof t?Gr(t):t;return"function"===typeof i&&!e.prototype.isPrototypeOf(i.prototype)},e.registerPlugin=function(t,i){if("string"!==typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+("undefined"===typeof t?"undefined":R(t))+".");if(Wr(t))$.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Fr.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!==typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+("undefined"===typeof i?"undefined":R(i))+".");return zr[t]=i,t!==Hr&&(e.isBasic(i)?Fr.prototype[t]=$r(t,i):Fr.prototype[t]=Kr(t,i)),i},e.deregisterPlugin=function(e){if(e===Hr)throw new Error("Cannot de-register base plugin.");Wr(e)&&(delete zr[e],delete Fr.prototype[e])},e.getPlugins=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(zr),t=void 0;return e.forEach((function(e){var i=Gr(e);i&&(t=t||{},t[e]=i)})),t},e.getPluginVersion=function(e){var t=Gr(e);return t&&t.VERSION||""},e}();Qr.getPlugin=Gr,Qr.BASE_PLUGIN_NAME=Hr,Qr.registerPlugin(Hr,Qr),Fr.prototype.usingPlugin=function(e){return!!this[Vr]&&!0===this[Vr][e]},Fr.prototype.hasPlugin=function(e){return!!Wr(e)};var Jr=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof t?"undefined":R(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)},Zr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(){e.apply(this,arguments)},n={};for(var r in"object"===("undefined"===typeof t?"undefined":R(t))?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),n=t):"function"===typeof t&&(i=t),Jr(i,e),n)n.hasOwnProperty(r)&&(i.prototype[r]=n[r]);return i};"undefined"===typeof HTMLVideoElement&&ie()&&(a.createElement("video"),a.createElement("audio"),a.createElement("track"),a.createElement("video-js"));var ea=function(e){return 0===e.indexOf("#")?e.slice(1):e};function ta(e,t,i){var n=ta.getPlayer(e);if(n)return t&&$.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&n.ready(i),n;var r="string"===typeof e?xe("#"+ea(e)):e;if(!ne(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");a.body.contains(r)||$.warn("The element supplied is not included in the DOM"),t=t||{},ta.hooks("beforesetup").forEach((function(e){var i=e(r,vt(t));z(i)&&!Array.isArray(i)?t=vt(t,i):$.error("please return an object in beforesetup hooks")}));var s=_t.getComponent("Player");return n=new s(r,t,i),ta.hooks("setup").forEach((function(e){return e(n)})),n}if(ta.hooks_={},ta.hooks=function(e,t){return ta.hooks_[e]=ta.hooks_[e]||[],t&&(ta.hooks_[e]=ta.hooks_[e].concat(t)),ta.hooks_[e]},ta.hook=function(e,t){ta.hooks(e,t)},ta.hookOnce=function(e,t){ta.hooks(e,[].concat(t).map((function(t){var i=function i(){return ta.removeHook(e,i),t.apply(void 0,arguments)};return i})))},ta.removeHook=function(e,t){var i=ta.hooks(e).indexOf(t);return!(i<=-1)&&(ta.hooks_[e]=ta.hooks_[e].slice(),ta.hooks_[e].splice(i,1),!0)},!0!==r.VIDEOJS_NO_DYNAMIC_STYLE&&ie()){var ia=xe(".vjs-styles-defaults");if(!ia){ia=Ze("vjs-styles-defaults");var na=xe("head");na&&na.insertBefore(ia,na.firstChild),et(ia,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}Je(1,ta),ta.VERSION=c,ta.options=Fr.prototype.options_,ta.getPlayers=function(){return Fr.players},ta.getPlayer=function(e){var t=Fr.players,i=void 0;if("string"===typeof e){var n=ea(e),r=t[n];if(r)return r;i=xe("#"+n)}else i=e;if(ne(i)){var a=i,s=a.player,o=a.playerId;if(s||t[o])return s||t[o]}},ta.getAllPlayers=function(){return Object.keys(Fr.players).map((function(e){return Fr.players[e]})).filter(Boolean)},ta.players=Fr.players,ta.getComponent=_t.getComponent,ta.registerComponent=function(e,t){Ti.isTech(t)&&$.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),_t.registerComponent.call(_t,e,t)},ta.getTech=Ti.getTech,ta.registerTech=Ti.registerTech,ta.use=ki,!O&&Object.defineProperty?(Object.defineProperty(ta,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ta.middleware,"TERMINATOR",{value:Ei,writeable:!1,enumerable:!0})):ta.middleware={TERMINATOR:Ei},ta.browser=D,ta.TOUCH_ENABLED=L,ta.extend=Zr,ta.mergeOptions=vt,ta.bind=tt,ta.registerPlugin=Qr.registerPlugin,ta.deregisterPlugin=Qr.deregisterPlugin,ta.plugin=function(e,t){return $.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qr.registerPlugin(e,t)},ta.getPlugins=Qr.getPlugins,ta.getPlugin=Qr.getPlugin,ta.getPluginVersion=Qr.getPluginVersion,ta.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),ta.options.languages=vt(ta.options.languages,(i={},i[e]=t,i)),ta.options.languages[e]},ta.log=$,ta.createLogger=K,ta.createTimeRange=ta.createTimeRanges=wt,ta.formatTime=ln,ta.setFormatTime=on,ta.resetFormatTime=un,ta.parseUrl=ii,ta.isCrossOrigin=ai,ta.EventTarget=rt,ta.on=ze,ta.one=Xe,ta.off=We,ta.trigger=Ge,ta.xhr=u,ta.TextTrack=li,ta.AudioTrack=ci,ta.VideoTrack=di,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){ta[e]=function(){return $.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Le[e].apply(null,arguments)}})),ta.computedStyle=Q,ta.dom=Le,ta.url=si,e.exports=ta},"408a":function(e,t,i){var n=i("c6b6");e.exports=function(e){if("number"!=typeof e&&"Number"!=n(e))throw TypeError("Incorrect invocation");return+e}},"41e6":function(e,t,i){"use strict";i.r(t);i("7db0"),i("b680"),i("b0c0"),i("fb6a"),i("ac1f"),i("5319"),i("4d63"),i("25f0");var n=i("7a23"),r=i("c6c2"),a=i.n(r),s=Object(n["gb"])("data-v-7a7b8b74");Object(n["H"])("data-v-7a7b8b74");var o=Object(n["n"])("h4",null,"警情时段分布",-1),u=Object(n["n"])("h4",null,"历史警情趋势图",-1),l=Object(n["m"])("近一年"),c=Object(n["m"])("近三年"),d=Object(n["m"])("近五年"),h=Object(n["n"])("h4",null,"警情处置情况",-1),p={class:"rightBoxCon"},f=Object(n["n"])("span",null,"火灾",-1),m=Object(n["n"])("span",null,"社会救助",-1),g=Object(n["n"])("span",null,"抢险救援",-1),y=Object(n["n"])("h4",null,"实时警情处理",-1),v={class:"tableTooltip",ref:"ff"},_=Object(n["n"])("div",{class:"tableTitle"},[Object(n["n"])("div",null,"案件详情")],-1),b={key:1,class:"name-wrapper"},T={class:"card-header"},S={class:"top"},w=Object(n["n"])("span",null,"实时视频",-1),E={class:"iframe2"},k=Object(n["n"])("h4",null,"历史案件",-1),C={key:1,class:"name-wrapper"},O=Object(n["n"])("div",{class:"tableTitle"},[Object(n["n"])("div",null,"案件详情")],-1),A={class:"tableTooltip anxqtk2"},x=Object(n["n"])("div",{class:"tableTitle"},[Object(n["n"])("div",null,"案件详情")],-1);Object(n["F"])();var I=s((function(e,t,i,r,I,L){var P=Object(n["N"])("line-smooth"),D=Object(n["N"])("el-row"),R=Object(n["N"])("el-col"),M=Object(n["N"])("el-button"),U=Object(n["N"])("bar-chart"),N=Object(n["N"])("gauge"),j=Object(n["N"])("el-tooltip"),B=Object(n["N"])("el-table-column"),F=Object(n["N"])("el-table"),q=Object(n["N"])("el-card");return Object(n["E"])(),Object(n["j"])(D,{class:"contentBox"},{default:s((function(){return[Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["db"])(Object(n["n"])(R,{class:"leftBox"},{default:s((function(){return[Object(n["n"])(R,{class:"flexJ leftTop"},{default:s((function(){return[o,Object(n["n"])(D,{class:"leftTopContent"},{default:s((function(){return[Object(n["n"])(D,{class:"fireBar"},{default:s((function(){return[Object(n["n"])(P,{ref:"lineSmooth",dataMap:I.houseList},null,8,["dataMap"])]})),_:1})]})),_:1})]})),_:1}),Object(n["n"])(R,{class:"flexJ leftBot"},{default:s((function(){return[u,Object(n["n"])(D,{class:"leftBotContent"},{default:s((function(){return[Object(n["n"])(D,{class:"selectBar"},{default:s((function(){return[Object(n["n"])(D,null,{default:s((function(){return[Object(n["n"])(M,{size:"mini",onClick:t[1]||(t[1]=function(e){return L.searchTime(1)}),class:{btnClick:1===I.timeArea}},{default:s((function(){return[l]})),_:1},8,["class"]),Object(n["n"])(M,{size:"mini",onClick:t[2]||(t[2]=function(e){return L.searchTime(3)}),class:{btnClick:3===I.timeArea}},{default:s((function(){return[c]})),_:1},8,["class"]),Object(n["n"])(M,{size:"mini",onClick:t[3]||(t[3]=function(e){return L.searchTime(5)}),class:{btnClick:5===I.timeArea}},{default:s((function(){return[d]})),_:1},8,["class"])]})),_:1})]})),_:1}),Object(n["n"])(D,{class:"fireBar"},{default:s((function(){return[Object(n["n"])(U,{ref:"barChart",dataMap:I.monthList},null,8,["dataMap"])]})),_:1})]})),_:1})]})),_:1})]})),_:1},512),[[n["Z"],e.leftBtn]])]})),_:1}),Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["n"])(R,{class:"centerBox",style:{"max-width":e.leftBtn&&e.rightBtn?"8rem":e.leftBtn||e.rightBtn?e.leftBtn||e.rightBtn?"16rem":"8rem":"100%"}},{default:s((function(){return[Object(n["n"])(D,{class:"leftBtn btnW",onClick:t[4]||(t[4]=function(t){return e.leftBtnClick()})},{default:s((function(){return[Object(n["n"])("i",{class:e.leftBtn?"el-icon-arrow-left":"el-icon-arrow-right"},null,2)]})),_:1}),Object(n["n"])(D,{class:"centerContent",id:"mapF"}),Object(n["n"])(D,{class:"rightBtn btnW",onClick:t[5]||(t[5]=function(t){return e.rightBtnClick()})},{default:s((function(){return[Object(n["n"])("i",{class:e.rightBtn?"el-icon-arrow-right":"el-icon-arrow-left"},null,2)]})),_:1})]})),_:1},8,["style"])]})),_:1}),Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["db"])(Object(n["n"])(R,{class:"rightBox"},{default:s((function(){return[Object(n["n"])(R,{class:"flexJ rightTop"},{default:s((function(){return[h,Object(n["n"])("div",p,[Object(n["n"])(D,null,{default:s((function(){return[Object(n["n"])(D,{class:"rightTopTitle"},{default:s((function(){return[f]})),_:1}),Object(n["n"])(D,{class:"rightTopChart"},{default:s((function(){return[Object(n["n"])(N,{ref:"gauge1",dataMap:I.proptionList.find((function(e){return"火灾"===e.type}))&&I.proptionList.find((function(e){return"火灾"===e.type})).number/(I.proptionList.find((function(e){return"火灾"===e.type})).number+I.proptionList.find((function(e){return"社会救助"===e.type})).number+I.proptionList.find((function(e){return"抢险救援"===e.type})).number)||0,dataNumber:I.proptionList.find((function(e){return"火灾"===e.type}))&&I.proptionList.find((function(e){return"火灾"===e.type})).number||0,color:"#468EFD"},null,8,["dataMap","dataNumber"])]})),_:1}),Object(n["n"])(D,{class:"rightTopNumber"},{default:s((function(){return[Object(n["n"])("span",null,[Object(n["m"])(" 同比:"+Object(n["R"])(I.proptionList.find((function(e){return"火灾"===e.type}))&&(100*I.proptionList.find((function(e){return"火灾"===e.type})).radio).toFixed(1)||0)+"% ",1),Object(n["n"])("span",{style:{color:I.proptionList.find((function(e){return"火灾"===e.type}))&&2===I.proptionList.find((function(e){return"火灾"===e.type})).sameStatus?"green":"red"}},[I.proptionList.find((function(e){return"火灾"===e.type}))?(Object(n["E"])(),Object(n["j"])("i",{key:0,class:["iconfont",1===I.proptionList.find((function(e){return"火灾"===e.type})).sameStatus?"icon-arrowTop-fill":2===I.proptionList.find((function(e){return"火灾"===e.type})).sameStatus?"icon-xiajiantou-":""]},null,2)):Object(n["k"])("",!0)],4)])]})),_:1})]})),_:1}),Object(n["n"])(D,null,{default:s((function(){return[Object(n["n"])(D,{class:"rightTopTitle"},{default:s((function(){return[m]})),_:1}),Object(n["n"])(D,{class:"rightTopChart"},{default:s((function(){return[Object(n["n"])(N,{ref:"gauge2",dataMap:I.proptionList.find((function(e){return"社会救助"===e.type}))&&I.proptionList.find((function(e){return"社会救助"===e.type})).number/(I.proptionList.find((function(e){return"火灾"===e.type})).number+I.proptionList.find((function(e){return"社会救助"===e.type})).number+I.proptionList.find((function(e){return"抢险救援"===e.type})).number)||0,dataNumber:I.proptionList.find((function(e){return"社会救助"===e.type}))&&I.proptionList.find((function(e){return"社会救助"===e.type})).number||0,color:"#06B1B9"},null,8,["dataMap","dataNumber"])]})),_:1}),Object(n["n"])(D,{class:"rightTopNumber"},{default:s((function(){return[Object(n["n"])("span",null,[Object(n["m"])(" 同比:"+Object(n["R"])(I.proptionList.find((function(e){return"社会救助"===e.type}))&&(100*I.proptionList.find((function(e){return"社会救助"===e.type})).radio).toFixed(1)||0)+"% ",1),Object(n["n"])("span",{style:{color:I.proptionList.find((function(e){return"社会救助"===e.type}))&&2===I.proptionList.find((function(e){return"社会救助"===e.type})).sameStatus?"green":"red"}},[I.proptionList.find((function(e){return"社会救助"===e.type}))?(Object(n["E"])(),Object(n["j"])("i",{key:0,class:["iconfont",1===I.proptionList.find((function(e){return"社会救助"===e.type})).sameStatus?"icon-arrowTop-fill":2===I.proptionList.find((function(e){return"社会救助"===e.type})).sameStatus?"icon-xiajiantou-":""]},null,2)):Object(n["k"])("",!0)],4)])]})),_:1})]})),_:1}),Object(n["n"])(D,null,{default:s((function(){return[Object(n["n"])(D,{class:"rightTopTitle"},{default:s((function(){return[g]})),_:1}),Object(n["n"])(D,{class:"rightTopChart"},{default:s((function(){return[Object(n["n"])(N,{ref:"gauge3",dataMap:I.proptionList.find((function(e){return"抢险救援"===e.type}))&&I.proptionList.find((function(e){return"抢险救援"===e.type})).number/(I.proptionList.find((function(e){return"火灾"===e.type})).number+I.proptionList.find((function(e){return"社会救助"===e.type})).number+I.proptionList.find((function(e){return"抢险救援"===e.type})).number)||0,dataNumber:I.proptionList.find((function(e){return"抢险救援"===e.type}))&&I.proptionList.find((function(e){return"抢险救援"===e.type})).number||0,color:"#E4951E"},null,8,["dataMap","dataNumber"])]})),_:1}),Object(n["n"])(D,{class:"rightTopNumber"},{default:s((function(){return[Object(n["n"])("span",null,[Object(n["m"])(" 同比:"+Object(n["R"])(I.proptionList.find((function(e){return"抢险救援"===e.type}))&&(100*I.proptionList.find((function(e){return"抢险救援"===e.type})).radio).toFixed(1)||0)+"% ",1),Object(n["n"])("span",{style:{color:I.proptionList.find((function(e){return"抢险救援"===e.type}))&&2===I.proptionList.find((function(e){return"抢险救援"===e.type})).sameStatus?"green":"red"}},[I.proptionList.find((function(e){return"抢险救援"===e.type}))?(Object(n["E"])(),Object(n["j"])("i",{key:0,class:["iconfont",1===I.proptionList.find((function(e){return"抢险救援"===e.type})).sameStatus?"icon-arrowTop-fill":2===I.proptionList.find((function(e){return"抢险救援"===e.type})).sameStatus?"icon-xiajiantou-":""]},null,2)):Object(n["k"])("",!0)],4)])]})),_:1})]})),_:1})])]})),_:1}),Object(n["n"])(R,{class:"flexJ rightBot"},{default:s((function(){return[y,Object(n["n"])("p",{class:"sp",onClick:t[6]||(t[6]=function(){return L.cellHandleclick&&L.cellHandleclick.apply(L,arguments)})},"视频"),Object(n["n"])(F,{"header-cell-style":I.height1,data:I.tableData,class:"transparentTableRow table1",height:"100%","row-style":I.height2,onCellClick:L.cellHandleclick,style:{width:"100%",margin:"0 auto"},"cell-style":L.cellStyle},{default:s((function(){return[(Object(n["E"])(!0),Object(n["j"])(n["b"],null,Object(n["L"])(I.headerData,(function(e){return Object(n["E"])(),Object(n["j"])(B,{key:e.prop,prop:e.prop,align:"center","min-width":"11%",label:e.name},Object(n["l"])({_:2},["type"===e.prop||"lasj"===e.prop||"ajdj"===e.prop||"afdz"===e.prop||"cdcl"===e.prop||"bcxx"===e.prop||"czdx"===e.prop||"zhongdui"===e.prop?{name:"default",fn:s((function(i){return[Object(n["n"])(j,{placement:"left"},{content:s((function(){return[Object(n["n"])("div",v,[_,Object(n["n"])("img",{src:a.a,alt:"",class:"close",onClick:t[7]||(t[7]=function(){return L.closeIsTooltip&&L.closeIsTooltip.apply(L,arguments)})}),Object(n["n"])(D,{class:"tableContent"},{default:s((function(){return[Object(n["n"])(R,{span:20},{default:s((function(){return[Object(n["m"])("案件编号:"+Object(n["R"])(i.row.ajbh?i.row.ajbh:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件描述:"+Object(n["R"])(i.row.bcxx?i.row.bcxx:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("报警时间:"+Object(n["R"])(i.row.tzsj?i.row.tzsj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件类型:"+Object(n["R"])(i.row.ajlx?i.row.ajlx:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("发生地址:"+Object(n["R"])(i.row.afdz?i.row.afdz:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("主责中队:"+Object(n["R"])(i.row.zhongdui?i.row.zhongdui:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("案件状态:"+Object(n["R"])(i.row.ajzt?i.row.ajzt:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("到场时间:"+Object(n["R"])(i.row.dcsj?i.row.dcsj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("出水时间:"+Object(n["R"])(i.row.cssj?i.row.cssj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("控制时间:"+Object(n["R"])(i.row.kzsj?i.row.kzsj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("熄灭时间:"+Object(n["R"])(i.row.xmsj?i.row.xmsj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("返队时间:"+Object(n["R"])(i.row.fdsj?i.row.fdsj:"--"),1)]})),_:2},1024),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("所属街道:"+Object(n["R"])(i.row.streettown?i.row.streettown:"--"),1)]})),_:2},1024)]})),_:2},1024),Object(n["n"])(D,{class:"tablePersonnel"},{default:s((function(){return[Object(n["n"])(R,{span:7})]})),_:1})],512)]})),default:s((function(){return[Object(n["n"])("template",null,["type"===e.prop?(Object(n["E"])(),Object(n["j"])("i",{key:0,class:["iconfont",{"icon-icon-test":1==i.row["ajlxdm"],"icon-jiuyuan":2==i.row["ajlxdm"],"icon-minzhengtubiao1-08":3==i.row["ajlxdm"]}],style:{color:"零级"==i.row["ajdj"]?"green":"一级"==i.row["ajdj"]?"#eec10d":"二级"==i.row["ajdj"]?"#ff730c":"三级"==i.row["ajdj"]?"#ff0012":"#2e98f2"}},null,6)):(Object(n["E"])(),Object(n["j"])("div",b,Object(n["R"])(i.row[e.prop]),1))])]})),_:2},1024)]}))}:{name:"default",fn:s((function(t){return[Object(n["m"])(Object(n["R"])("type"===e.prop?"":"lasj"===e.prop?t.row[e.prop]&&t.row[e.prop].slice(5):"afdz"===e.prop?t.row[e.prop].replace(new RegExp("闵行区 ",""),""):"status"===e.prop?1==t.row[e.prop]?"可用":"不可用":t.row[e.prop]),1)]}))}]),1032,["prop","label"])})),128))]})),_:1},8,["header-cell-style","data","row-style","onCellClick","cell-style"]),I.isVideo?(Object(n["E"])(),Object(n["j"])(q,{key:0,class:"box-card"},{header:s((function(){return[Object(n["n"])("div",T,[Object(n["n"])("div",S,[w,Object(n["n"])("i",{class:"el-icon-close",onClick:t[8]||(t[8]=function(e){return I.isVideo=!1})})]),Object(n["n"])("div",E,[Object(n["n"])("video",{id:I.video.videoId,class:" video-js vjs-default-skin videoPaly",preload:"auto",autoplay:"autoplay",src:"http://32.0.15.107:80/mhvi",type:"application/x-mpegURL"},null,8,["id"])])])]})),_:1})):Object(n["k"])("",!0)]})),_:1}),Object(n["n"])(R,{class:"flexJ rightBot2"},{default:s((function(){return[k,Object(n["n"])(F,{"header-cell-style":I.height1,data:I.tableData2,class:"transparentTableRow table2",height:"120%","row-style":I.height2,"cell-style":I.cell1,style:{width:"100%",margin:"0 auto"},onRowClick:L.rowClickMap},{default:s((function(){return[(Object(n["E"])(!0),Object(n["j"])(n["b"],null,Object(n["L"])(I.headerData2,(function(e){return Object(n["E"])(),Object(n["j"])(B,{key:e.prop,prop:e.prop,align:"center",label:e.name},{default:s((function(t){return[Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["n"])(j,{placement:"top",disabled:I.disabled},{default:s((function(){return[Object(n["n"])("template",null,["type"===e.prop?(Object(n["E"])(),Object(n["j"])("i",{key:0,class:["iconfont",{"icon-icon-test":1==t.row["ajlxdm"],"icon-jiuyuan":2==t.row["ajlxdm"],"icon-minzhengtubiao1-08":3==t.row["ajlxdm"]}],style:{color:"零级"==t.row["ajdj"]?"green":"一级"==t.row["ajdj"]?"#eec10d":"二级"==t.row["ajdj"]?"#ff730c":"三级"==t.row["ajdj"]?"#ff0012":"#2e98f2"}},null,6)):(Object(n["E"])(),Object(n["j"])("div",C,Object(n["R"])(t.row[e.prop]),1))])]})),_:2},1032,["disabled"])]})),_:2},1024)]})),_:2},1032,["prop","label"])})),128))]})),_:1},8,["header-cell-style","data","row-style","cell-style","onRowClick"]),I.isVideo?(Object(n["E"])(),Object(n["j"])(q,{key:0,class:"box-card"})):Object(n["k"])("",!0)]})),_:1})]})),_:1},512),[[n["Z"],e.rightBtn]])]})),_:1}),Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["db"])(Object(n["n"])("div",{class:"tableTooltip anxqtk",onMousedown:t[10]||(t[10]=function(){return L.move&&L.move.apply(L,arguments)})},[O,Object(n["n"])("img",{src:a.a,alt:"",class:"close2",onClick:t[9]||(t[9]=function(){return L.closeIsTooltip2&&L.closeIsTooltip2.apply(L,arguments)})}),Object(n["n"])(D,{class:"tableContent"},{default:s((function(){return[Object(n["n"])(R,{span:20,id:"cc"},{default:s((function(){return[Object(n["m"])("案件编号:"+Object(n["R"])(I.ajxqnr.ajbh?I.ajxqnr.ajbh:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件描述:"+Object(n["R"])(I.ajxqnr.bcxx?I.ajxqnr.bcxx:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("报警时间:"+Object(n["R"])(I.ajxqnr.tzsj?I.ajxqnr.tzsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件类型:"+Object(n["R"])(I.ajxqnr.ajlx?I.ajxqnr.ajlx:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("发生地址:"+Object(n["R"])(I.ajxqnr.afdz?I.ajxqnr.afdz:"--"),1)]})),_:1}),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("主责中队:"+Object(n["R"])(I.ajxqnr.zhongdui?I.ajxqnr.zhongdui:"--"),1)]})),_:1}),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("案件状态:"+Object(n["R"])(I.ajxqnr.ajzt?I.ajxqnr.ajzt:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("到场时间:"+Object(n["R"])(I.ajxqnr.dcsj?I.ajxqnr.dcsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("出水时间:"+Object(n["R"])(I.ajxqnr.cssj?I.ajxqnr.cssj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("控制时间:"+Object(n["R"])(I.ajxqnr.kzsj?I.ajxqnr.kzsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("熄灭时间:"+Object(n["R"])(I.ajxqnr.xmsj?I.ajxqnr.xmsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("返队时间:"+Object(n["R"])(I.ajxqnr.fdsj?I.ajxqnr.fdsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("所属街道:"+Object(n["R"])(I.ajxqnr.streettown?I.ajxqnr.streettown:"--"),1)]})),_:1})]})),_:1})],544),[[n["Z"],I.ajxq]])]})),_:1}),Object(n["n"])(n["e"],{name:"el-fade-in-linear"},{default:s((function(){return[Object(n["db"])(Object(n["n"])("div",A,[x,Object(n["n"])("img",{src:a.a,alt:"",class:"close2",onClick:t[11]||(t[11]=function(){return L.closeIsTooltip3&&L.closeIsTooltip3.apply(L,arguments)})}),Object(n["n"])(D,{class:"tableContent"},{default:s((function(){return[Object(n["n"])(R,{span:20,id:"cc"},{default:s((function(){return[Object(n["m"])("案件编号:"+Object(n["R"])(I.ajxq2nr.ajbh?I.ajxq2nr.ajbh:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件描述:"+Object(n["R"])(I.ajxq2nr.bcxx?I.ajxq2nr.bcxx:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("报警时间:"+Object(n["R"])(I.ajxq2nr.tzsj?I.ajxq2nr.tzsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("案件类型:"+Object(n["R"])(I.ajxq2nr.ajlx?I.ajxq2nr.ajlx:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("发生地址:"+Object(n["R"])(I.ajxq2nr.afdz?I.ajxq2nr.afdz:"--"),1)]})),_:1}),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("主责中队:"+Object(n["R"])(I.ajxq2nr.zhongdui?I.ajxq2nr.zhongdui:"--"),1)]})),_:1}),Object(n["n"])(R,{span:12},{default:s((function(){return[Object(n["m"])("案件状态:"+Object(n["R"])(I.ajxq2nr.ajzt?I.ajxq2nr.ajzt:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("到场时间:"+Object(n["R"])(I.ajxq2nr.dcsj?I.ajxq2nr.dcsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("出水时间:"+Object(n["R"])(I.ajxq2nr.cssj?I.ajxq2nr.cssj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("控制时间:"+Object(n["R"])(I.ajxq2nr.kzsj?I.ajxq2nr.kzsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("熄灭时间:"+Object(n["R"])(I.ajxq2nr.xmsj?I.ajxq2nr.xmsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("返队时间:"+Object(n["R"])(I.ajxq2nr.fdsj?I.ajxq2nr.fdsj:"--"),1)]})),_:1}),Object(n["n"])(R,{span:24},{default:s((function(){return[Object(n["m"])("所属街道:"+Object(n["R"])(I.ajxq2nr.streettown?I.ajxq2nr.streettown:"--"),1)]})),_:1})]})),_:1})],512),[[n["Z"],I.ajxq2]])]})),_:1})]})),_:1})})),L=i("1da1"),P=(i("96cf"),Object(n["gb"])("data-v-1ba57a70"));Object(n["H"])("data-v-1ba57a70");var D={ref:"echartD",style:{width:"100%",height:"100%"}};Object(n["F"])();var R=P((function(e,t,i,r,a,s){return Object(n["E"])(),Object(n["j"])("div",D,null,512)})),M=(i("d81d"),i("313e")),U={props:{dataMap:{type:Array,default:function(){return[]}}},data:function(){return{}},mounted:function(){},watch:{dataMap:function(e){this.getData(e)}},methods:{getData:function(){var e=this.dataMap,t=M["b"](this.$refs.echartD);2500<document.body.clientWidth&&document.body.clientWidth<3999?t.setOption({color:["#14E1EA","#14E1EA","#EF6B3D","#EF6B3D","#FADF2B","#FADF2B"],tooltip:{trigger:"axis",textStyle:{color:"#FFF"},confine:!0,backgroundColor:"rgba(11, 12, 72, 0.8)",borderColor:"rgba(11, 12, 72, 0.4)",position:"bottom"},title:{show:!0,text:"总数(起)",textStyle:{fontSize:12,fontWeight:"normal",color:"#fff"}},grid:{top:40,left:0,right:0,bottom:50,containLabel:!0},legend:{data:["社会救助","火灾","抢险救援"],selected:{"社会救助":!0,"火灾":!0,"抢险救援":!0,"救助月平均值":!0,"火灾月平均值":!0,"救援月平均值":!0},bottom:10,itemGap:20,textStyle:{color:"#FFF",fontSize:"20"}},xAxis:{type:"category",data:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],axisLabel:{color:"#FFFFFF",textStyle:{color:"#FFF",fontSize:"16"}},axisTick:{show:!1}},yAxis:{axisTick:{show:!1},type:"value",axisLabel:{color:"#FFFFFF",textStyle:{color:"#FFF",fontSize:"16"}},splitLine:{lineStyle:{color:"rgba(255,255,255,.4)"}}},series:[{name:"社会救助",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["社会救助"]&&e["社会救助"].map((function(e){return e.number}))||[]},{name:"救助月平均值",type:"line",stack:"totalLine",data:e["社会救助"]&&e["社会救助"].map((function(e){return e.avg}))||[]},{name:"火灾",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["火灾"]&&e["火灾"].map((function(e){return e.number}))||[]},{name:"火灾月平均值",type:"line",stack:"totalLine",data:e["火灾"]&&e["火灾"].map((function(e){return e.avg}))||[]},{name:"抢险救援",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.number}))||[]},{name:"救援月平均值",type:"line",stack:"totalLine",data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.avg}))||[]}]}):t.setOption({color:["#14E1EA","#14E1EA","#EF6B3D","#EF6B3D","#FADF2B","#FADF2B"],tooltip:{trigger:"axis",textStyle:{color:"#FFF"},confine:!0,backgroundColor:"rgba(11, 12, 72, 0.8)",borderColor:"rgba(11, 12, 72, 0.4)",position:"bottom"},title:{show:!0,text:"总数(起)",textStyle:{fontSize:12,fontWeight:"normal",color:"#fff"}},grid:{top:40,left:0,right:0,bottom:50,containLabel:!0},legend:{data:["社会救助","火灾","抢险救援"],selected:{"社会救助":!0,"火灾":!0,"抢险救援":!0,"救助月平均值":!0,"火灾月平均值":!0,"救援月平均值":!0},bottom:10,itemGap:20,textStyle:{color:"#FFF",fontSize:"12"}},xAxis:{type:"category",data:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],axisLabel:{color:"#FFFFFF",textStyle:{color:"#FFF",fontSize:"12"}},axisTick:{show:!1}},yAxis:{axisTick:{show:!1},type:"value",axisLabel:{color:"#FFFFFF",textStyle:{color:"#FFF",fontSize:"12"}},splitLine:{lineStyle:{color:"rgba(255,255,255,.4)"}}},series:[{name:"社会救助",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["社会救助"]&&e["社会救助"].map((function(e){return e.number}))||[]},{name:"救助月平均值",type:"line",stack:"totalLine",data:e["社会救助"]&&e["社会救助"].map((function(e){return e.avg}))||[]},{name:"火灾",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["火灾"]&&e["火灾"].map((function(e){return e.number}))||[]},{name:"火灾月平均值",type:"line",stack:"totalLine",data:e["火灾"]&&e["火灾"].map((function(e){return e.avg}))||[]},{name:"抢险救援",type:"bar",stack:"totalBar",emphasis:{focus:"series"},barWidth:"50%",data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.number}))||[]},{name:"救援月平均值",type:"line",stack:"totalLine",data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.avg}))||[]}]}),t.on("legendselectchanged",(function(e){var i=e.selected[e.name];t.dispatchAction({type:i?"legendSelect":"legendUnSelect",name:"社会救助"===e.name?"救助月平均值":"火灾"===e.name?"火灾月平均值":"抢险救援"===e.name?"救援月平均值":""})}))},resize:function(){M["b"](this.$refs.echartD).resize()}}},N=i("6b0d"),j=i.n(N);const B=j()(U,[["render",R],["__scopeId","data-v-1ba57a70"]]);var F=B,q=Object(n["gb"])("data-v-162d9adc");Object(n["H"])("data-v-162d9adc");var H={ref:"echartD",style:{width:"100%",height:"100%"}};Object(n["F"])();var V=q((function(e,t,i,r,a,s){return Object(n["E"])(),Object(n["j"])("div",H,null,512)})),z={props:{dataMap:{type:Array,default:function(){return[]}}},data:function(){return{echartsMap:null}},watch:{dataMap:function(e){this.getData(e)}},mounted:function(){},methods:{getData:function(){var e=this.dataMap,t=M["b"](this.$refs.echartD);document.body.clientWidth>4e3?(t.setOption({color:["rgba(79, 255, 70,.8)","rgba(62,175,64,.8)","rgba(239,107,61,.8)","rgba(250, 223, 43,.8)","rgba(20, 225, 234,.8)","rgba(55, 155, 249,.8)"],title:{show:!1,text:"渐变堆叠面积图"},tooltip:{trigger:"axis",textStyle:{color:"#FFF"},confine:!0,backgroundColor:"rgba(11, 12, 72, 0.8)",borderColor:"rgba(11, 12, 72, 0.4)",position:"bottom"},legend:{show:!0,data:["社会救助","火灾","抢险救援"],selected:{"社会救助":!0,"火灾":!0,"抢险救援":!0,"救助月平均值":!0,"火灾月平均值":!0,"救援月平均值":!0},bottom:10,itemGap:20,textStyle:{color:"#FFF"}},grid:{top:30,left:0,right:15,bottom:40,containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:["0-3","3-6","6-9","9-12","12-15","15-18","18-21","21-0"],axisLabel:{color:"#FFFFFF",rotate:50},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"#FFFFFF"},splitLine:{lineStyle:{color:"#ccc"}}},series:[{name:"社会救助",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(79, 255, 70,1)"},{offset:1,color:"rgba(79, 255, 70,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.number}))||[]},{name:"救助月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(62,175,64)"},{offset:1,color:"rgba(62,175,64,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.avg}))||[]},{name:"火灾",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(239,107,61,1)"},{offset:1,color:"rgba(239,107,61,.1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.number}))||[]},{name:"火灾月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(250, 223, 43,.5)"},{offset:1,color:"rgba(250, 223, 43, .1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.avg}))||[]},{name:"抢险救援",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(20, 225, 234)"},{offset:1,color:"rgba(20, 225, 234, .1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.number}))||[]},{name:"救援月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(55, 155, 249,1)"},{offset:1,color:"rgba(55, 155, 249,.1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.avg}))||[]}]}),t.on("legendselectchanged",(function(e){var i=e.selected[e.name];t.dispatchAction({type:i?"legendSelect":"legendUnSelect",name:"社会救助"===e.name?"救助月平均值":"火灾"===e.name?"火灾月平均值":"抢险救援"===e.name?"救援月平均值":""})}))):2500<document.body.clientWidth&&document.body.clientWidth<3999?(t.setOption({color:["rgba(79, 255, 70,.8)","rgba(62,175,64,.8)","rgba(239,107,61,.8)","rgba(250, 223, 43,.8)","rgba(20, 225, 234,.8)","rgba(55, 155, 249,.8)"],title:{show:!0,text:"总数(起)",textStyle:{fontSize:12,fontWeight:"normal",color:"#fff"}},tooltip:{trigger:"axis",textStyle:{color:"#FFF"},confine:!0,backgroundColor:"rgba(11, 12, 72, 0.8)",borderColor:"rgba(11, 12, 72, 0.4)",position:"bottom"},legend:{show:!0,data:["社会救助","火灾","抢险救援"],selected:{"社会救助":!0,"火灾":!0,"抢险救援":!0,"救助月平均值":!0,"火灾月平均值":!0,"救援月平均值":!0},bottom:10,itemGap:20,textStyle:{color:"#FFF",fontSize:"20"}},grid:{top:30,left:0,right:15,bottom:40,containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:["0-3","3-6","6-9","9-12","12-15","15-18","18-21","21-0"],axisLabel:{color:"#FFFFFF",rotate:50,textStyle:{color:"#FFFFFF",fontSize:"16"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"#FFFFFF",textStyle:{color:"#FFFFFF",fontSize:"16"}},splitLine:{lineStyle:{color:"#ccc"}}},series:[{name:"社会救助",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(79, 255, 70,1)"},{offset:1,color:"rgba(79, 255, 70,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.number}))||[]},{name:"救助月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(62,175,64)"},{offset:1,color:"rgba(62,175,64,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.avg}))||[]},{name:"火灾",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(239,107,61,1)"},{offset:1,color:"rgba(239,107,61,.1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.number}))||[]},{name:"火灾月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(250, 223, 43,.5)"},{offset:1,color:"rgba(250, 223, 43, .1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.avg}))||[]},{name:"抢险救援",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(20, 225, 234)"},{offset:1,color:"rgba(20, 225, 234, .1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.number}))||[]},{name:"救援月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(55, 155, 249,1)"},{offset:1,color:"rgba(55, 155, 249,.1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.avg}))||[]}]}),t.on("legendselectchanged",(function(e){var i=e.selected[e.name];t.dispatchAction({type:i?"legendSelect":"legendUnSelect",name:"社会救助"===e.name?"救助月平均值":"火灾"===e.name?"火灾月平均值":"抢险救援"===e.name?"救援月平均值":""})}))):(t.setOption({color:["rgba(79, 255, 70,.8)","rgba(62,175,64,.8)","rgba(239,107,61,.8)","rgba(250, 223, 43,.8)","rgba(20, 225, 234,.8)","rgba(55, 155, 249,.8)"],title:{show:!0,text:"总数(起)",textStyle:{fontSize:12,fontWeight:"normal",color:"#fff"}},tooltip:{trigger:"axis",textStyle:{fontSize:12,color:"#FFF"},confine:!0,backgroundColor:"rgba(11, 12, 72, 0.8)",borderColor:"rgba(11, 12, 72, 0.4)",position:"bottom"},legend:{show:!0,data:["社会救助","火灾","抢险救援"],selected:{"社会救助":!0,"火灾":!0,"抢险救援":!0,"救助月平均值":!0,"火灾月平均值":!0,"救援月平均值":!0},bottom:10,itemGap:20,textStyle:{fontSize:12,color:"#FFF"}},grid:{top:30,left:0,right:15,bottom:40,containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:["0-3","3-6","6-9","9-12","12-15","15-18","18-21","21-0"],axisLabel:{color:"#FFFFFF",rotate:50,textStyle:{fontSize:12,color:"#FFF"}},axisTick:{show:!1}},yAxis:{type:"value",axisLabel:{color:"#FFFFFF",textStyle:{fontSize:12,color:"#FFF"}},splitLine:{lineStyle:{color:"#ccc"}}},series:[{name:"社会救助",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(79, 255, 70,1)"},{offset:1,color:"rgba(79, 255, 70,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.number}))||[]},{name:"救助月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(62,175,64)"},{offset:1,color:"rgba(62,175,64,.1)"}])},data:e["社会救助"]&&e["社会救助"].map((function(e){return e.avg}))||[]},{name:"火灾",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(239,107,61,1)"},{offset:1,color:"rgba(239,107,61,.1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.number}))||[]},{name:"火灾月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(250, 223, 43,.5)"},{offset:1,color:"rgba(250, 223, 43, .1)"}])},data:e["火灾"]&&e["火灾"].map((function(e){return e.avg}))||[]},{name:"抢险救援",type:"line",stack:"lineFire",smooth:!0,showSymbol:!1,areaStyle:{opacity:.8,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(20, 225, 234)"},{offset:1,color:"rgba(20, 225, 234, .1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.number}))||[]},{name:"救援月平均值",type:"line",stack:"totalLine",smooth:!0,showSymbol:!1,areaStyle:{opacity:.9,color:new M["a"].LinearGradient(0,0,0,1,[{offset:0,color:"rgba(55, 155, 249,1)"},{offset:1,color:"rgba(55, 155, 249,.1)"}])},data:e["抢险救援"]&&e["抢险救援"].map((function(e){return e.avg}))||[]}]}),t.on("legendselectchanged",(function(e){var i=e.selected[e.name];t.dispatchAction({type:i?"legendSelect":"legendUnSelect",name:"社会救助"===e.name?"救助月平均值":"火灾"===e.name?"火灾月平均值":"抢险救援"===e.name?"救援月平均值":""})})))},resize:function(){M["b"](this.$refs.echartD).resize()}}};const W=j()(z,[["render",V],["__scopeId","data-v-162d9adc"]]);var G=W,X=Object(n["gb"])("data-v-54e7881c");Object(n["H"])("data-v-54e7881c");var Y={ref:"echartD",style:{width:"100%",height:"100%",display:"flex","justify-content":"center"}};Object(n["F"])();var $=X((function(e,t,i,r,a,s){return Object(n["E"])(),Object(n["j"])("div",Y,null,512)})),K=(i("a9e3"),{props:{dataMap:{type:Number,default:function(){return 0}},dataNumber:{type:Number,default:function(){return 0}},color:{type:String,default:function(){return"#468EFD"}},size:{type:Number,default:function(){return 20}},tick:{type:Boolean,default:function(){return!0}},with:{type:Number,default:function(){return 20}}},data:function(){return{}},watch:{dataMap:function(e){this.getData(e)},dataNumber:function(e){this.getData(e)}},mounted:function(){this.getData()},methods:{getData:function(){var e=this;document.body.clientWidth>1940?M["b"](this.$refs.echartD).setOption({grid:{},series:[{name:"仪表盘",type:"gauge",radius:"80%",startAngle:220,endAngle:-40,splitNumber:6,axisLine:{lineStyle:{color:[[this.dataMap,this.color],[1,"#111F42"]],width:8}},axisLabel:{show:!1},axisTick:{show:!1},splitLine:{show:!1},itemStyle:{show:!1},detail:{formatter:function(t){return e.dataNumber?e.dataNumber:"".concat((100*t).toFixed(0),"%")},offsetCenter:[0,"0%"],textStyle:{fontSize:30,fontWeight:"400",color:this.color,fontFamily:'"DS", "DS-B", "DS-BB", "DS-BS"'}},title:{offsetCenter:[0,"10%"]},pointer:{show:!1},data:[this.dataNumber||this.dataMap]},{type:"gauge",name:"仪表盘",radius:"130%",startAngle:220,endAngle:-40,splitNumber:5,z:2,axisTick:{show:this.tick,lineStyle:{color:"#6B9DD7",width:3},length:-1},splitLine:{show:this.tick,lineStyle:{color:"#6B9DD7",width:3},length:-1},axisLabel:{color:"rgba(255,255,255,0)",fontSize:16},pointer:{show:!1},axisLine:{show:!1},label:{show:!1},detail:{show:!1,offsetCenter:["0","0%"],color:"#A2C7F3",formatter:function(e){return e},textStyle:{fontSize:80}}}]}):M["b"](this.$refs.echartD).setOption({grid:{},series:[{name:"仪表盘",type:"gauge",radius:"90%",startAngle:220,endAngle:-40,splitNumber:10,axisLine:{lineStyle:{color:[[this.dataMap,this.color],[1,"#111F42"]],width:this.with}},axisLabel:{show:!1},axisTick:{show:!1},splitLine:{show:!1},itemStyle:{show:!1},detail:{formatter:function(t){return e.dataNumber?e.dataNumber:"".concat((100*t).toFixed(0),"%")},offsetCenter:[0,"0%"],textStyle:{fontSize:25,fontWeight:"700",color:this.color,fontFamily:'"DS", "DS-B", "DS-BB", "DS-BS"'}},title:{offsetCenter:[0,"10%"]},pointer:{show:!1},data:[this.dataNumber||this.dataMap]},{type:"gauge",name:"仪表盘",radius:"140%",startAngle:220,endAngle:-40,splitNumber:5,z:2,axisTick:{show:this.tick,lineStyle:{color:"#6B9DD7",width:3},length:-1},splitLine:{show:this.tick,lineStyle:{color:"#6B9DD7",width:3},length:-1},axisLabel:{color:"rgba(255,255,255,0)",fontSize:12},pointer:{show:!1},axisLine:{show:!1},label:{show:!1},detail:{show:!1,offsetCenter:["0","0%"],color:"#A2C7F3",formatter:function(e){return e},textStyle:{fontSize:20,fontFamily:'"DS", "DS-B", "DS-BB", "DS-BS"'}}}]})},resize:function(){M["b"](this.$refs.echartD).resize()}}});const Q=j()(K,[["render",$],["__scopeId","data-v-54e7881c"]]);var J,Z=Q,ee=i("a344"),te=i("311d"),ie=(i("fda2"),i("3d33")),ne=i.n(ie),re=(i("a151"),i("3c96")),ae=i.n(re),se=i("55b5"),oe=i.n(se),ue=i("ef34"),le=i.n(ue),ce=i("be09"),de=i.n(ce),he=i("d136"),pe=i.n(he),fe="http://example.com",me=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=de.a.location&&de.a.location.href||"");var i="function"===typeof de.a.URL,n=/^\/\//.test(e),r=!de.a.location&&!/\/\//i.test(e);if(i?e=new de.a.URL(e,de.a.location||fe):/\/\//i.test(e)||(e=pe.a.buildAbsoluteURL(de.a.location&&de.a.location.href||"",e)),i){var a=new URL(t,e);return r?a.href.slice(fe.length):n?a.href.slice(a.protocol.length):a.href}return pe.a.buildAbsoluteURL(e,t)},ge=me,ye=i("a559"),ve=i.n(ye),_e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),be=i("ffdf"),Te=function(e){function t(){var t;return t=e.call(this)||this,t.buffer="",t}oe()(t,e);var i=t.prototype;return i.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(_e),Se=String.fromCharCode(9),we=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},Ee=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},ke=function(e){var t,i=e.split(Ee()),n={},r=i.length;while(r--)""!==i[r]&&(t=/([^=]*)=(.*)/.exec(i[r]).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"),n[t[0]]=t[1]);return n},Ce=function(e){function t(){var t;return t=e.call(this)||this,t.customParsers=[],t.tagMappers=[],t}oe()(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;if(e=e.trim(),0!==e.length)if("#"===e[0]){var r=this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]);r.forEach((function(e){for(var r=0;r<n.customParsers.length;r++)if(n.customParsers[r].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e),t)return i=ve()(we(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){var a=ke(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=we(a.BYTERANGE))}n.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=ke(t[1]),i.attributes.RESOLUTION){var s=i.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),i.attributes.RESOLUTION=o}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}n.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=ke(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)n.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)n.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=ke(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void n.trigger("data",i);if(t=/^#EXT-X-START:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=ke(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void n.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=ke(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(Se)),void n.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=ke(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=we(i.attributes.BYTERANGE)),void n.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=ke(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void n.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=ke(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void n.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=ke(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void n.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=ke(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void n.trigger("data",i);n.trigger("data",{type:"tag",data:e.slice(4)})}}}else n.trigger("data",{type:"comment",text:e.slice(1)})}))}else this.trigger("data",{type:"uri",uri:e})},i.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!==typeof r&&(r=function(e){return e}),this.customParsers.push((function(e){var s=i.exec(e);if(s)return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0}))},i.addTagMapper=function(e){var t=e.expression,i=e.map,n=function(e){return t.test(e)?i(e):e};this.tagMappers.push(n)},t}(_e),Oe=function(e){return e.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()}))},Ae=function(e){var t={};return Object.keys(e).forEach((function(i){t[Oe(i)]=e[i]})),t},xe=function(e){var t=e.serverControl,i=e.targetDuration,n=e.partTargetDuration;if(t){var r="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=i&&3*i,u=n&&2*n;i&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:r+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:r+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),n&&!t.hasOwnProperty(s)&&(t[s]=3*n,this.trigger("info",{message:r+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),n&&t[s]<u&&(this.trigger("warn",{message:r+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+u+")."}),t[s]=u)}},Ie=function(e){function t(){var t;t=e.call(this)||this,t.lineStream=new Te,t.parseStream=new Ce,t.lineStream.pipe(t.parseStream);var i,n,r=ae()(t),a=[],s={},o=!1,u=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var h=0,p=0;return t.on("end",(function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&i&&(s.map=i),!s.key&&n&&(s.key=n),s.timeline||"number"!==typeof d||(s.timeline=d),t.manifest.preloadSegment=s)})),t.parseStream.on("data",(function(e){var t,f;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=h)),"offset"in e&&(s.byterange=t,t.offset=e.offset),h=t.offset+t.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"})),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if(e.attributes.KEYFORMAT===c){var t=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];return-1===t.indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Object(be["a"])(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},"undefined"!==typeof e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,d=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),n&&(i.key=n)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(s.attributes||(s.attributes={}),ve()(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],f={default:/yes/i.test(e.attributes.DEFAULT)},f.default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=f}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,xe.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=Ae(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;o=!0;var i=this.manifest.segments.length,n=Ae(e.attributes);s.parts=s.parts||[],s.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=p),p=n.byterange.offset+n.byterange.length);var r=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+i,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=Ae(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),xe.call(this,this.manifest),t.canSkipDateranges&&!t.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 t=this.manifest.segments.length,i=Ae(e.attributes),n=i.type&&"PART"===i.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?p:0,n&&(p=i.byterange.offset+i.byterange.length)));var r=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),i.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&(o.type===i.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+i.type+" as preload hint #"+a}))}},"rendition-report":function(){var t=Ae(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var i=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];o&&n.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+i,e.attributes,n)},"part-inf":function(){this.manifest.partInf=Ae(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),xe.call(this,this.manifest)}}[e.tagType]||u).call(r)},uri:function(){s.uri=e.uri,a.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=d,i&&(s.map=i),p=0,s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})),t}oe()(t,e);var i=t.prototype;return i.warnOnMissingAttributes_=function(e,t,i){var n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})},i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n"),this.trigger("end")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(_e),Le={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^/},Pe=["video","audio","text"],De=["Video","Audio","Text"],Re=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2),r=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+r})):e},Me=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),Pe.forEach((function(n){var r=Le[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var a=e.substring(0,r[1].length),s=e.replace(a,"");i.push({type:a,details:s,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},Ue=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return Me(r.playlists[0].attributes.CODECS)}return null},Ne=function(e){return void 0===e&&(e=""),Le.audio.test(e.trim().toLowerCase())},je=function(e){return void 0===e&&(e=""),Le.text.test(e.trim().toLowerCase())},Be=function(e){if(e&&"string"===typeof e){var t=e.toLowerCase().split(",").map((function(e){return Re(e.trim())})),i="video";1===t.length&&Ne(t[0])?i="audio":1===t.length&&je(t[0])&&(i="application");var n="mp4";return t.every((function(e){return Le.mp4.test(e)}))?n="mp4":t.every((function(e){return Le.webm.test(e)}))?n="webm":t.every((function(e){return Le.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},Fe=function(e){return void 0===e&&(e=""),de.a.MediaSource&&de.a.MediaSource.isTypeSupported&&de.a.MediaSource.isTypeSupported(Be(e))||!1},qe=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<De.length;t++){var i=De[t];if(Le["muxer"+i].test(e))return!0}return!1}))},He="mp4a.40.2",Ve="avc1.4d400d",ze=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,We=/^application\/dash\+xml/i,Ge=function(e){return ze.test(e)?"hls":We.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Xe=i("210b"),Ye=function(e){return!!e&&"object"===typeof e},$e=function e(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.reduce((function(t,i){return"object"!==typeof i||Object.keys(i).forEach((function(n){Array.isArray(t[n])&&Array.isArray(i[n])?t[n]=t[n].concat(i[n]):Ye(t[n])&&Ye(i[n])?t[n]=e(t[n],i[n]):t[n]=i[n]})),t}),{})},Ke=function(e){return Object.keys(e).map((function(t){return e[t]}))},Qe=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i},Je=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},Ze=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},et=function(e,t){return e.reduce((function(e,i,n){return i[t]&&e.push(n),e}),[])},tt={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},it=function(e){var t=e.baseUrl,i=void 0===t?"":t,n=e.source,r=void 0===n?"":n,a=e.range,s=void 0===a?"":a,o=e.indexRange,u=void 0===o?"":o,l={uri:r,resolvedUri:ge(i||"",r)};if(s||u){var c=s||u,d=c.split("-"),h=parseInt(d[0],10),p=parseInt(d[1],10);l.byterange={length:p-h+1,offset:h}}return l},nt=function(e){var t=e.offset+e.length-1;return e.offset+"-"+t},rt=function(e){return e&&"number"!==typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},at={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,r=e.sourceDuration,a=e.periodDuration,s=rt(e.endNumber),o=t/n;return"number"===typeof s?{start:0,end:s}:"number"===typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.start,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,p=rt(e.endNumber),f=(t+i)/1e3,m=n+u,g=f+c,y=g-m,v=Math.ceil(y*a/s),_=Math.floor((f-m-h)*a/s),b=Math.floor((f-m)*a/s);return{start:Math.max(0,_),end:"number"===typeof p?p:Math.min(v,b)}}},st=function(e){return function(t,i){var n=e.duration,r=e.timescale,a=void 0===r?1:r,s=e.periodIndex,o=e.startNumber,u=void 0===o?1:o;return{number:u+t,duration:n/a,timeline:s,time:i*n}}},ot=function(e){var t=e.type,i=e.duration,n=e.timescale,r=void 0===n?1:n,a=e.periodDuration,s=e.sourceDuration,o=at[t](e),u=o.start,l=o.end,c=Qe(u,l).map(st(e));if("static"===t){var d=c.length-1,h="number"===typeof a?a:s;c[d].duration=h-i/r*d}return c},ut=function(e){var t=e.baseUrl,i=e.initialization,n=void 0===i?{}:i,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.duration;if(!t)throw new Error(tt.NO_BASE_URL);var u=it({baseUrl:t,source:n.sourceURL,range:n.range}),l=it({baseUrl:t,source:t,indexRange:s});if(l.map=u,o){var c=ot(e);c.length&&(l.duration=c[0].duration,l.timeline=c[0].timeline)}else r&&(l.duration=r,l.timeline=0);return l.number=0,[l]},lt=function(e,t,i){for(var n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,s=e.sidx.byterange,o=s.offset+s.length,u=t.timescale,l=t.references.filter((function(e){return 1!==e.referenceType})),c=[],d=e.endList?"static":"dynamic",h=o+t.firstOffset,p=0;p<l.length;p++){var f=t.references[p],m=f.referencedSize,g=f.subsegmentDuration,y=h+m-1,v=h+"-"+y,_={baseUrl:i,timescale:u,timeline:a,periodIndex:a,duration:g,sourceDuration:r,indexRange:v,type:d},b=ut(_)[0];n&&(b.map=n),c.push(b),h+=m}return e.segments=c,e},ct=function(e){return e&&e.uri+"-"+nt(e.byterange)},dt=function(e){var t=Ke(e.reduce((function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t;return e}),{}));return t.map((function(e){return e.discontinuityStarts=et(e.segments,"discontinuity"),e}))},ht=function(e,t){var i=ct(e.sidx),n=i&&t[i]&&t[i].sidx;return n&<(e,n,e.sidx.resolvedUri),e},pt=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=ht(e[i],t);return e},ft=function(e,t){var i,n=e.attributes,r=e.segments,a=e.sidx,s={attributes:(i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===n.type,timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:r,mediaSequence:r.length?r[0].number:1};return n.contentProtection&&(s.contentProtection=n.contentProtection),a&&(s.sidx=a),t&&(s.attributes.AUDIO="audio",s.attributes.SUBTITLES="subs"),s},mt=function(e){var t,i=e.attributes,n=e.segments;"undefined"===typeof n&&(n=[{uri:i.baseUrl,timeline:i.periodIndex,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var r=(t={NAME:i.id,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t);return i.codecs&&(r.CODECS=i.codecs),{attributes:r,uri:"",endList:"static"===i.type,timeline:i.periodIndex,resolvedUri:i.baseUrl||"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1}},gt=function(e,t,i){var n;void 0===t&&(t={}),void 0===i&&(i=!1);var r=e.reduce((function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=ht(ft(r,i),t);return e[o].playlists.push(l),"undefined"===typeof n&&"main"===a&&(n=r,n.default=!0),e}),{});if(!n){var a=Object.keys(r)[0];r[a].default=!0}return r},yt=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(ht(mt(i),t)),e}),{})},vt=function(e){return e.reduce((function(e,t){return t?(t.forEach((function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e}),{})},_t=function(e){var t,i=e.attributes,n=e.segments,r=e.sidx,a={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodIndex,resolvedUri:"",targetDuration:i.duration,segments:n,mediaSequence:n.length?n[0].number:1};return i.contentProtection&&(a.contentProtection=i.contentProtection),r&&(a.sidx=r),a},bt=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},Tt=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},St=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},wt=function(e,t,i){var n;if(void 0===i&&(i={}),!e.length)return{};var r=e[0].attributes,a=r.sourceDuration,s=r.type,o=r.suggestedPresentationDelay,u=r.minimumUpdatePeriod,l=dt(e.filter(bt)).map(_t),c=dt(e.filter(Tt)),d=e.filter(St),h=e.map((function(e){return e.attributes.captionServices})).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:a,playlists:pt(l,i)};u>=0&&(p.minimumUpdatePeriod=1e3*u),t&&(p.locations=t),"dynamic"===s&&(p.suggestedPresentationDelay=o);var f=0===p.playlists.length;return c.length&&(p.mediaGroups.AUDIO.audio=gt(c,i,f)),d.length&&(p.mediaGroups.SUBTITLES.subs=yt(d,i)),h.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=vt(h)),p},Et=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=void 0===c?0:c,h=(n+r)/1e3,p=a+l,f=h+d,m=f-p;return Math.ceil((m*o-t)/i)},kt=function(e,t){for(var i=e.type,n=e.minimumUpdatePeriod,r=void 0===n?0:n,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodIndex,p=[],f=-1,m=0;m<t.length;m++){var g=t[m],y=g.d,v=g.r||0,_=g.t||0;f<0&&(f=_),_&&_>f&&(f=_);var b=void 0;if(v<0){var T=m+1;b=T===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?Et(e,f,y):(o*l-f)/y:(t[T].t-f)/y}else b=v+1;var S=d+p.length+b,w=d+p.length;while(w<S)p.push({number:w,duration:y/l,time:f,timeline:h}),f+=y,w++}return p},Ct=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Ot=function(e){return function(t,i,n,r){if("$$"===t)return"$";if("undefined"===typeof e[i])return t;var a=""+e[i];return"RepresentationID"===i?a:(r=n?parseInt(r,10):1,a.length>=r?a:""+new Array(r-a.length+1).join("0")+a)}},At=function(e,t){return e.replace(Ct,Ot(t))},xt=function(e,t){return e.duration||t?e.duration?ot(e):kt(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]},It=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=it({baseUrl:e.baseUrl,source:At(r.sourceURL,i),range:r.range}),s=xt(e,t);return s.map((function(t){i.Number=t.number,i.Time=t.time;var n=At(e.media||"",i),r=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/r,u={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:ge(e.baseUrl||"",n),map:a,number:t.number,presentationTime:o};return u}))},Lt=function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=it({baseUrl:i,source:r.sourceURL,range:r.range}),s=it({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s},Pt=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n,a=e.periodStart;if(!i&&!t||i&&t)throw new Error(tt.SEGMENT_TIME_UNSPECIFIED);var s,o=r.map((function(t){return Lt(e,t)}));i&&(s=ot(e)),t&&(s=kt(e,t));var u=s.map((function(t,i){if(o[i]){var n=o[i],r=e.timescale||1,s=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=a+(t.time-s)/r,n}})).filter((function(e){return e}));return u},Dt=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=It,t=$e(n,r.template)):r.base?(i=ut,t=$e(n,r.base)):r.list&&(i=Pt,t=$e(n,r.list));var a={attributes:n};if(!i)return a;var s=i(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},Rt=function(e){return e.map(Dt)},Mt=function(e,t){return Ze(e.childNodes).filter((function(e){var i=e.tagName;return i===t}))},Ut=function(e){return e.textContent.trim()},Nt=function(e){var t=31536e3,i=2592e3,n=86400,r=3600,a=60,s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,o=s.exec(e);if(!o)return 0;var u=o.slice(1),l=u[0],c=u[1],d=u[2],h=u[3],p=u[4],f=u[5];return parseFloat(l||0)*t+parseFloat(c||0)*i+parseFloat(d||0)*n+parseFloat(h||0)*r+parseFloat(p||0)*a+parseFloat(f||0)},jt=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},Bt={mediaPresentationDuration:function(e){return Nt(e)},availabilityStartTime:function(e){return jt(e)/1e3},minimumUpdatePeriod:function(e){return Nt(e)},suggestedPresentationDelay:function(e){return Nt(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Nt(e)},start:function(e){return Nt(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Nt(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Ft=function(e){return e&&e.attributes?Ze(e.attributes).reduce((function(e,t){var i=Bt[t.name]||Bt.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},qt={"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"},Ht=function(e,t){return t.length?Je(e.map((function(e){return t.map((function(t){return ge(e,Ut(t))}))}))):e},Vt=function(e){var t=Mt(e,"SegmentTemplate")[0],i=Mt(e,"SegmentList")[0],n=i&&Mt(i,"SegmentURL").map((function(e){return $e({tag:"SegmentURL"},Ft(e))})),r=Mt(e,"SegmentBase")[0],a=i||t,s=a&&Mt(a,"SegmentTimeline")[0],o=i||r||t,u=o&&Mt(o,"Initialization")[0],l=t&&Ft(t);l&&u?l.initialization=u&&Ft(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&Mt(s,"S").map((function(e){return Ft(e)})),list:i&&$e(Ft(i),{segmentUrls:n,initialization:Ft(u)}),base:r&&$e(Ft(r),{initialization:Ft(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},zt=function(e,t,i){return function(n){var r=Mt(n,"BaseURL"),a=Ht(t,r),s=$e(e,Ft(n)),o=Vt(n);return a.map((function(e){return{segmentInfo:$e(i,o),attributes:$e(s,{baseUrl:e})}}))}},Wt=function(e){return e.reduce((function(e,t){var i=Ft(t),n=qt[i.schemeIdUri];if(n){e[n]={attributes:i};var r=Mt(t,"cenc:pssh")[0];if(r){var a=Ut(r),s=a&&Object(be["a"])(a);e[n].pssh=s}}return e}),{})},Gt=function(e){if("urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri){var t="string"!==typeof e.value?[]:e.value.split(";");return t.map((function(e){var t,i;if(i=e,/^CC\d=/.test(e)){var n=e.split("=");t=n[0],i=n[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:i}}))}if("urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri){var i="string"!==typeof e.value?[]:e.value.split(";");return i.map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var i=e.split("="),n=i[0],r=i[1],a=void 0===r?"":r;t.channel=n,t.language=e,a.split(",").forEach((function(e){var i=e.split(":"),n=i[0],r=i[1];"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}))}},Xt=function(e,t,i){return function(n){var r=Ft(n),a=Ht(t,Mt(n,"BaseURL")),s=Mt(n,"Role")[0],o={role:Ft(s)},u=$e(e,r,o),l=Mt(n,"Accessibility")[0],c=Gt(Ft(l));c&&(u=$e(u,{captionServices:c}));var d=Mt(n,"Label")[0];if(d&&d.childNodes.length){var h=d.childNodes[0].nodeValue.trim();u=$e(u,{label:h})}var p=Wt(Mt(n,"ContentProtection"));Object.keys(p).length&&(u=$e(u,{contentProtection:p}));var f=Vt(n),m=Mt(n,"Representation"),g=$e(i,f);return Je(m.map(zt(u,a,g)))}},Yt=function(e,t){return function(i,n){var r=Ht(t,Mt(i.node,"BaseURL")),a=parseInt(i.attributes.id,10),s=de.a.isNaN(a)?n:a,o=$e(e,{periodIndex:s,periodStart:i.attributes.start});"number"===typeof i.attributes.duration&&(o.periodDuration=i.attributes.duration);var u=Mt(i.node,"AdaptationSet"),l=Vt(i.node);return Je(u.map(Xt(o,r,l)))}},$t=function(e){var t=e.attributes,i=e.priorPeriodAttributes,n=e.mpdType;return"number"===typeof t.start?t.start:i&&"number"===typeof i.start&&"number"===typeof i.duration?i.start+i.duration:i||"static"!==n?null:0},Kt=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=Mt(e,"Period");if(!l.length)throw new Error(tt.INVALID_NUMBER_OF_PERIOD);var c=Mt(e,"Location"),d=Ft(e),h=Ht([r],Mt(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(Ut));var p=[];return l.forEach((function(e,t){var i=Ft(e),n=p[t-1];i.start=$t({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:d.type}),p.push({node:e,attributes:i})})),{locations:d.locations,representationInfo:Je(p.map(Yt(d,h)))}},Qt=function(e){if(""===e)throw new Error(tt.DASH_EMPTY_MANIFEST);var t,i,n=new Xe["DOMParser"];try{t=n.parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(r){}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(tt.DASH_INVALID_XML);return i},Jt=function(e){var t=Mt(e,"UTCTiming")[0];if(!t)return null;var i=Ft(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.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(tt.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},Zt=function(e,t){void 0===t&&(t={});var i=Kt(Qt(e),t),n=Rt(i.representationInfo);return wt(n,i.locations,t.sidxMapping)},ei=function(e){return Jt(Qt(e))},ti=i("6438"),ii=i.n(ti),ni=function(e){return e.toString(2).length},ri=function(e){return Math.ceil(ni(e)/8)},ai=function(e){return ArrayBuffer.isView(e)},si=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||ai(e)||e instanceof ArrayBuffer||(e="number"!==typeof e||"number"===typeof e&&e!==e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},oi=de.a.BigInt||Number,ui=[oi("0x1"),oi("0x100"),oi("0x10000"),oi("0x1000000"),oi("0x100000000"),oi("0x10000000000"),oi("0x1000000000000"),oi("0x100000000000000"),oi("0x10000000000000000")],li=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var i=void 0===t?{}:t,n=i.signed,r=void 0!==n&&n,a=i.le,s=void 0!==a&&a;e=si(e);var o=s?"reduce":"reduceRight",u=e[o]?e[o]:Array.prototype[o],l=u.call(e,(function(t,i,n){var r=s?n:Math.abs(n+1-e.length);return t+oi(i)*ui[r]}),oi(0));if(r){var c=ui[e.length]/oi(2)-oi(1);l=oi(l),l>c&&(l-=c,l-=c,l-=oi(2))}return Number(l)}),ci=function(e,t){var i=void 0===t?{}:t,n=i.le,r=void 0!==n&&n;("bigint"!==typeof e&&"number"!==typeof e||"number"===typeof e&&e!==e)&&(e=0),e=oi(e);for(var a=ri(e),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var u=r?o:Math.abs(o+1-s.length);s[u]=Number(e/ui[o]&oi(255)),e<0&&(s[u]=Math.abs(~s[u]),s[u]-=0===o?1:2)}return s},di=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,si(e));try{return decodeURIComponent(escape(t))}catch(i){}return t},hi=function(e,t){if("string"!==typeof e&&e&&"function"===typeof e.toString&&(e=e.toString()),"string"!==typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},pi=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!==typeof e})),t.length<=1)return si(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),r=new Uint8Array(n),a=0;return t.forEach((function(e){e=si(e),r.set(e,a),a+=e.byteLength})),r},fi=function(e,t,i){var n=void 0===i?{}:i,r=n.offset,a=void 0===r?0:r,s=n.mask,o=void 0===s?[]:s;e=si(e),t=si(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,(function(t,i){var n=o[i]?o[i]&e[a+i]:e[a+i];return t===n}))},mi=si([73,68,51]),gi=function(e,t){void 0===t&&(t=0),e=si(e);var i=e[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],r=(16&i)>>4;return r?n+20:n+10},yi=function e(t,i){return void 0===i&&(i=0),t=si(t),t.length-i<10||!fi(t,mi,{offset:i})?i:(i+=gi(t,i),e(t,i))},vi=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"===typeof e?hi(e):e}),_i=function(e){return Array.isArray(e)?e.map((function(e){return vi(e)})):[vi(e)]},bi=function(e){e=si(e);var t=[],i=0;while(e.length>i){var n=e[i],r=0,a=0;a++;var s=e[a];a++;while(128&s)r=(127&s)<<7,s=e[a],a++;r+=127&s;for(var o=0;o<J.length;o++){var u=J[o],l=u.id,c=u.parser;if(n===l){t.push(c(e.subarray(a,a+r)));break}}i+=r+a}return t};J=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var i=e[t.size];t.url=di(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=bi(e.subarray(t.size))||[],t}},{id:4,parser:function(e){var t={tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:bi(e.subarray(13))};return t}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Ti=function e(t,i,n){void 0===n&&(n=!1),i=_i(i),t=si(t);var r=[];if(!i.length)return r;var a=0;while(a<t.length){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(a+8,u);fi(o,i[0])&&(1===i.length?r.push(l):r.push.apply(r,e(l,i.slice(1),n))),a=u}return r},Si={EBML:si([26,69,223,163]),DocType:si([66,130]),Segment:si([24,83,128,103]),SegmentInfo:si([21,73,169,102]),Tracks:si([22,84,174,107]),Track:si([174]),TrackNumber:si([215]),DefaultDuration:si([35,227,131]),TrackEntry:si([174]),TrackType:si([131]),FlagDefault:si([136]),CodecID:si([134]),CodecPrivate:si([99,162]),VideoTrack:si([224]),AudioTrack:si([225]),Cluster:si([31,67,182,117]),Timestamp:si([231]),TimestampScale:si([42,215,177]),BlockGroup:si([160]),BlockDuration:si([155]),Block:si([161]),SimpleBlock:si([163])},wi=[128,64,32,16,8,4,2,1],Ei=function(e){for(var t=1,i=0;i<wi.length;i++){if(e&wi[i])break;t++}return t},ki=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=Ei(e[t]),a=e.subarray(t,t+r);return i&&(a=Array.prototype.slice.call(e,t,t+r),a[0]^=wi[r-1]),{length:r,value:li(a,{signed:n}),bytes:a}},Ci=function e(t){return"string"===typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"===typeof t?ci(t):t},Oi=function(e){return Array.isArray(e)?e.map((function(e){return Ci(e)})):[Ci(e)]},Ai=function e(t,i,n){if(n>=i.length)return i.length;var r=ki(i,n,!1);if(fi(t.bytes,r.bytes))return n;var a=ki(i,n+r.length);return e(t,i,n+a.length+a.value+r.length)},xi=function e(t,i){i=Oi(i),t=si(t);var n=[];if(!i.length)return n;var r=0;while(r<t.length){var a=ki(t,r,!1),s=ki(t,r+a.length),o=r+a.length+s.length;127===s.value&&(s.value=Ai(a,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);fi(i[0],a.bytes)&&(1===i.length?n.push(l):n=n.concat(e(l,i.slice(1))));var c=a.length+s.length+l.length;r+=c}return n},Ii=si([0,0,0,1]),Li=si([0,0,1]),Pi=si([0,0,3]),Di=function(e){var t=[],i=1;while(i<e.length-2)fi(e.subarray(i,i+3),Pi)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,r=new Uint8Array(n),a=0;for(i=0;i<n;a++,i++)a===t[0]&&(a++,t.shift()),r[i]=e[a];return r},Ri=function(e,t,i,n){void 0===n&&(n=1/0),e=si(e),i=[].concat(i);var r,a=0,s=0;while(a<e.length&&(s<n||r)){var o=void 0;if(fi(e.subarray(a),Ii)?o=4:fi(e.subarray(a),Li)&&(o=3),o){if(s++,r)return Di(e.subarray(r,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==i.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},Mi=function(e,t,i){return Ri(e,"h264",t,i)},Ui=function(e,t,i){return Ri(e,"h265",t,i)},Ni={webm:si([119,101,98,109]),matroska:si([109,97,116,114,111,115,107,97]),flac:si([102,76,97,67]),ogg:si([79,103,103,83]),ac3:si([11,119]),riff:si([82,73,70,70]),avi:si([65,86,73]),wav:si([87,65,86,69]),"3gp":si([102,116,121,112,51,103]),mp4:si([102,116,121,112]),fmp4:si([115,116,121,112]),mov:si([102,116,121,112,113,116]),moov:si([109,111,111,118]),moof:si([109,111,111,102])},ji={aac:function(e){var t=yi(e);return fi(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=yi(e);return fi(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=xi(e,[Si.EBML,Si.DocType])[0];return fi(t,Ni.webm)},mkv:function(e){var t=xi(e,[Si.EBML,Si.DocType])[0];return fi(t,Ni.matroska)},mp4:function(e){return!ji["3gp"](e)&&!ji.mov(e)&&(!(!fi(e,Ni.mp4,{offset:4})&&!fi(e,Ni.fmp4,{offset:4}))||(!(!fi(e,Ni.moof,{offset:4})&&!fi(e,Ni.moov,{offset:4}))||void 0))},mov:function(e){return fi(e,Ni.mov,{offset:4})},"3gp":function(e){return fi(e,Ni["3gp"],{offset:4})},ac3:function(e){var t=yi(e);return fi(e,Ni.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];var t=0;while(t+188<e.length&&t<188){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=yi(e);return fi(e,Ni.flac,{offset:t})},ogg:function(e){return fi(e,Ni.ogg)},avi:function(e){return fi(e,Ni.riff)&&fi(e,Ni.avi,{offset:8})},wav:function(e){return fi(e,Ni.riff)&&fi(e,Ni.wav,{offset:8})},h264:function(e){return Mi(e,7,3).length},h265:function(e){return Ui(e,[32,33],3).length}},Bi=Object.keys(ji).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);Bi.forEach((function(e){var t=ji[e];ji[e]=function(e){return t(si(e))}}));var Fi=ji,qi=function(e){e=si(e);for(var t=0;t<Bi.length;t++){var i=Bi[t];if(Fi[i](e))return i}return""},Hi=function(e){return Ti(e,["moof"]).length>0},Vi=i("4bef"),zi=ge,Wi=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Gi=function(e){return ne.a.log.debug?ne.a.log.debug.bind(ne.a,"VHS:",e+" >"):function(){}},Xi=1/30,Yi=3*Xi,$i=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return ne.a.createTimeRanges(n)},Ki=function(e,t){return $i(e,(function(e,i){return e-Yi<=t&&i+Yi>=t}))},Qi=function(e,t){return $i(e,(function(e){return e-Xi>=t}))},Ji=function(e){if(e.length<2)return ne.a.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return ne.a.createTimeRanges(t)},Zi=function(e,t){var i=null,n=null,r=0,a=[],s=[];if(!e||!e.length||!t||!t.length)return ne.a.createTimeRange();var o=e.length;while(o--)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});o=t.length;while(o--)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?(r++,2===r&&(i=a[o].time)):"end"===a[o].type&&(r--,1===r&&(n=a[o].time)),null!==i&&null!==n&&(s.push([i,n]),i=null,n=null);return ne.a.createTimeRanges(s)},en=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},tn=function(e,t,i){void 0===i&&(i=1);var n=e.length?e.end(e.length-1):0;return(n-t)/i},nn=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},rn=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},an=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},sn=function(e,t){var i=0;if(!e||!e.length)return i;for(var n=0;n<e.length;n++){var r=e.start(n),a=e.end(n);t>a||(i+=t>r&&t<=a?a-t:a-r)}return i},on=ne.a.createTimeRange,un=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},ln=function(e){return(e.segments||[]).reduce((function(e,t,i){return t.parts?t.parts.forEach((function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e}),[])},cn=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},dn=function(e){var t=e.preloadSegment;if(t){var i=t.parts,n=t.preloadHints,r=(n||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0);return r+=i&&i.length?i.length:0,r}},hn=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=cn(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},pn=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}while(n--){if(r=e.segments[n],"undefined"!==typeof r.end)return{result:i+r.end,precise:!0};if(i+=un(e,r),"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},fn=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(i=e.segments[r],"undefined"!==typeof i.start)return{result:i.start-n,precise:!0};if(n+=un(e,i),"undefined"!==typeof i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}},mn=function(e,t,i){if("undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var n=pn(e,t);if(n.precise)return n.result;var r=fn(e,t);return r.precise?r.result:n.result+i},gn=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return de.a.Infinity}return mn(e,t,i)},yn=function(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,a=0;if(n>r){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;o<Math.min(0,r);o++)a+=t;n=0}for(var u=n;u<r;u++)a+=i[u].duration;return a},vn=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return gn(e);if(null===t)return null;t=t||0;var r=mn(e,e.mediaSequence+e.segments.length,t);return i&&(n="number"===typeof n?n:hn(null,e),r-=n),Math.max(0,r)},_n=function(e,t,i){var n=!0,r=t||0,a=vn(e,t,n,i);return null===a?on():on(r,a)},bn=function(e){for(var t=e.playlist,i=e.currentTime,n=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=i-a,u=ln(t),l=0,c=0;c<u.length;c++){var d=u[c];if(n===d.segmentIndex&&("number"!==typeof r||"number"!==typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+Xi<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-yn({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(l<0){for(var f=l;f<0;f++)if(o-=t.targetDuration,o<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};l=0}for(var m=l;m<u.length;m++){var g=u[m];if(o-=g.duration,s){if(o>0)continue}else if(o-Xi>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+yn({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},Tn=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Sn=function(e){return e.excludeUntil&&e.excludeUntil===1/0},wn=function(e){var t=Tn(e);return!e.disabled&&!t},En=function(e){return e.disabled},kn=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},Cn=function(e,t){return t.attributes&&t.attributes[e]},On=function(e,t,i,n){if(void 0===n&&(n=0),!Cn("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t},An=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!wn(e)&&(e.attributes.BANDWIDTH||0)<i})).length},xn=function(e,t){return!(!e&&!t||!e&&t||e&&!t)&&(e===t||(!(!e.id||!t.id||e.id!==t.id)||(!(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)||!(!e.uri||!t.uri||e.uri!==t.uri))))},In=function(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},n=!1;for(var r in i){for(var a in i[r])if(n=t(i[r][a]),n)break;if(n)break}return!!n},Ln=function(e){if(!e||!e.playlists||!e.playlists.length){var t=In(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));return t}for(var i=function(t){var i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if(n&&n.split(",").every((function(e){return Ne(e)})))return"continue";var r=In(e,(function(e){return xn(i,e)}));return r?"continue":{v:!1}},n=0;n<e.playlists.length;n++){var r=i(n);if("continue"!==r&&"object"===typeof r)return r.v}return!0},Pn={liveEdgeDelay:hn,duration:gn,seekable:_n,getMediaInfoForTime:bn,isEnabled:wn,isDisabled:En,isBlacklisted:Tn,isIncompatible:Sn,playlistEnd:vn,isAes:kn,hasAttribute:Cn,estimateSegmentRequestTime:On,isLowestEnabledRendition:An,isAudioOnly:Ln,playlistMatch:xn,segmentDurationWithParts:un},Dn=ne.a.log,Rn=function(e,t){return e+"-"+t},Mn=function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new Ie;t&&l.on("warn",t),i&&l.on("info",i),a.forEach((function(e){return l.addParser(e)})),o.forEach((function(e){return l.addTagMapper(e)})),l.push(n),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){c.hasOwnProperty(e)&&delete c[e]})),c.segments&&c.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var h=cn(c);if(h.length&&!c.partTargetDuration){var p=h.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+p),Dn.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.")),c.partTargetDuration=p}return c},Un=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(i){if(e.mediaGroups[i])for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var a=e.mediaGroups[i][n][r];t(a,i,n,r)}}))},Nn=function(e){var t=e.playlist,i=e.uri,n=e.id;t.id=n,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}},jn=function(e){var t=e.playlists.length;while(t--){var i=e.playlists[t];Nn({playlist:i,id:Rn(t,i.uri)}),i.resolvedUri=zi(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||Dn.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Bn=function(e){Un(e,(function(t){t.uri&&(t.resolvedUri=zi(e.uri,t.uri))}))},Fn=function(e,t){var i=Rn(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:de.a.location.href,resolvedUri:de.a.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n},qn=function(e,t){e.uri=t;for(var i=0;i<e.playlists.length;i++)if(!e.playlists[i].uri){var n="placeholder-uri-"+i;e.playlists[i].uri=n}var r=Ln(e);Un(e,(function(t,i,n,a){var s="placeholder-uri-"+i+"-"+n+"-"+a;if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===i&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===n)return}t.playlists=[ve()({},t)]}t.playlists.forEach((function(t,i){var n=Rn(i,s);t.uri?t.resolvedUri=t.resolvedUri||zi(e.uri,t.uri):(t.uri=0===i?s:n,t.resolvedUri=t.uri),t.id=t.id||n,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),jn(e),Bn(e)},Hn=ne.a.mergeOptions,Vn=ne.a.EventTarget,zn=function(e,t){if(t.endList||!t.serverControl)return e;var i={};if(t.serverControl.canBlockReload){var n=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(n){var a=n.parts||[],s=dn(t)-1;s>-1&&s!==a.length-1&&(i._HLS_part=s),(s>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var o=new de.a.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&o.searchParams.set(e,i[e])})),e=o.toString()}return e},Wn=function(e,t){if(!e)return t;var i=Hn(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Hn(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},Gn=function(e,t,i){var n=e.slice(),r=t.slice();i=i||0;for(var a,s=[],o=0;o<r.length;o++){var u=n[o+i],l=r[o];u?(a=u.map||a,s.push(Wn(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s},Xn=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=zi(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=zi(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=zi(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=zi(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=zi(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=zi(t,e.uri))}))},Yn=function(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(var n=0;n<i.preloadHints.length;n++)if("MAP"===i.preloadHints[n].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},$n=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Kn=function(e,t,i){void 0===i&&(i=$n);var n=Hn(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=Yn(t);var a=Hn(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=Gn(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach((function(e){Xn(e,a.resolvedUri)}));for(var o=0;o<n.playlists.length;o++)n.playlists[o].id===t.id&&(n.playlists[o]=a);return n.playlists[t.id]=a,n.playlists[t.uri]=a,Un(e,(function(e,i,n,r){if(e.playlists)for(var a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=t)})),n},Qn=function(e,t){var i=e.segments||[],n=i[i.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],a=r&&r.duration||n&&n.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},Jn=function(e){function t(t,i,n){var r;if(void 0===n&&(n={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=Gi("PlaylistLoader");var a=n,s=a.withCredentials,o=void 0!==s&&s,u=a.handleManifestRedirects,l=void 0!==u&&u;r.src=t,r.vhs_=i,r.withCredentials=o,r.handleManifestRedirects=l;var c=i.options_;return r.customTagParsers=c&&c.customTagParsers||[],r.customTagMappers=c&&c.customTagMappers||[],r.experimentalLLHLS=c&&c.experimentalLLHLS||!1,ne.a.browser.IE_VERSION&&(r.experimentalLLHLS=!1),r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind(ae()(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}oe()(t,e);var i=t.prototype;return i.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),i=zi(this.master.uri,t.uri);this.experimentalLLHLS&&(i=zn(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},(function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url,n=e.manifestString;return Mn({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:n,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),Nn({playlist:a,uri:n,id:r});var s=Kn(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Qn(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),de.a.clearTimeout(this.mediaUpdateTimeout),de.a.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"===typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(de.a.clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=de.a.setTimeout(this.media.bind(this,e,!1),n)}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Qn(e,!0)),a){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(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Wi(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}}))}}},i.pause=function(){this.mediaUpdateTimeout&&(de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=de.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=de.a.setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},i.start=function(){var e=this;if(this.started=!0,"object"===typeof this.src)return this.src.uri||(this.src.uri=de.a.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Wi(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}}))},i.srcUri=function(){return"string"===typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,qn(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Yn(e),e.segments.forEach((function(t){Xn(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||de.a.location.href;this.master=Fn(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Vn),Zn=ne.a.xhr,er=ne.a.mergeOptions,tr=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},ir=function(){var e=function e(t,i){t=er({timeout:45e3},t);var n=e.beforeRequest||ne.a.Vhs.xhr.beforeRequest;if(n&&"function"===typeof n){var r=n(t);r&&(t=r)}var a=!0===ne.a.Vhs.xhr.original?Zn:ne.a.Vhs.xhr,s=a(t,(function(e,t){return tr(s,e,t,i)})),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=t.uri,s.requestTime=Date.now(),s};return e.original=!0,e},nr=function(e){var t=e.offset+e.length-1,i=e.offset;return"bytes="+i+"-"+t},rr=function(e){var t={};return e.byterange&&(t.Range=nr(e.byterange)),t},ar=function(e,t){return e.start(t)+"-"+e.end(t)},sr=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},or=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},ur=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},lr=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},cr=function(e){return e.resolvedUri},dr=function(e){for(var t,i,n=Array.prototype.slice.call(e),r=16,a="",s=0;s<n.length/r;s++)t=n.slice(s*r,s*r+r).map(sr).join(""),i=n.slice(s*r,s*r+r).map(or).join(""),a+=t+" "+i+"\n";return a},hr=function(e){var t=e.bytes;return dr(t)},pr=function(e){var t,i="";for(t=0;t<e.length;t++)i+=ar(e,t)+" ";return i},fr=Object.freeze({__proto__:null,createTransferableMessage:ur,initSegmentId:lr,segmentKeyId:cr,hexDump:dr,tagDump:hr,textRanges:pr}),mr=.25,gr=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=t.videoTimingInfo.transmuxedPresentationStart,r=n+i,a=e-r;return new Date(t.dateTimeObject.getTime()+1e3*a)},yr=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},vr=function(e,t){var i;try{i=new Date(e)}catch(c){return null}if(!t||!t.segments||0===t.segments.length)return null;var n=t.segments[0];if(i<n.dateTimeObject)return null;for(var r=0;r<t.segments.length-1;r++){n=t.segments[r];var a=t.segments[r+1].dateTimeObject;if(i<a)break}var s=t.segments[t.segments.length-1],o=s.dateTimeObject,u=s.videoTimingInfo?yr(s.videoTimingInfo):s.duration+s.duration*mr,l=new Date(o.getTime()+1e3*u);return i>l?null:(i>o&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Pn.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},_r=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;r<t.segments.length;r++)if(i=t.segments[r],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,e<=n)break;var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+a.duration*mr)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},br=function(e,t){var i,n;try{i=new Date(e),n=new Date(t)}catch(s){}var r=i.getTime(),a=n.getTime();return(a-r)/1e3},Tr=function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++){var i=e.segments[t];if(!i.dateTimeObject)return!1}return!0},Sr=function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===n)return r({message:"getProgramTime: playlist and time must be provided"});var a=_r(n,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n},o=gr(n,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)},wr=function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if("undefined"===typeof i||!n||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!Tr(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var d=vr(i,n);if(!d)return c({message:i+" was not found in the stream"});var h=d.segment,p=br(h.dateTimeObject,i);if("estimate"===d.type)return 0===a?c({message:i+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",(function(){e({programTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})})));var f=h.start+p,m=function(){return c(null,l.currentTime())};l.one("seeked",m),u&&l.pause(),s(f)},Er=function(e,t){if(4===e.readyState)return t()},kr=function(e,t,i){var n,r=[],a=!1,s=function(e,t,n,r){return t.abort(),a=!0,i(e,t,n,r)},o=function(e,t){if(!a){if(e)return s(e,t,"",r);var i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=pi(r,hi(i,!0)),n=n||yi(r),r.length<10||n&&r.length<n+2)return Er(t,(function(){return s(e,t,"",r)}));var o=qi(r);return"ts"===o&&r.length<188||!o&&r.length<376?Er(t,(function(){return s(e,t,"",r)})):s(null,t,o,r)}},u={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,tr(e,null,{statusCode:e.status},o)}))}},l=t(u,(function(e,t){return tr(l,e,t,o)}));return l},Cr=ne.a.EventTarget,Or=ne.a.mergeOptions,Ar=function(e,t){if(!$n(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(n.byterange||r.byterange){var a=n.byterange,s=r.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},xr=function(e){var t=e.masterXml,i=e.srcUrl,n=e.clientOffset,r=e.sidxMapping,a=Zt(t,{manifestUri:i,clientOffset:n,sidxMapping:r});return qn(a,i),a},Ir=function(e,t,i){for(var n=!0,r=Or(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=ct(s.sidx);i&&i[o]&&i[o].sidx&<(s,i[o].sidx,s.sidx.resolvedUri)}var u=Kn(r,s,Ar);u&&(r=u,n=!1)}return Un(t,(function(e,t,i,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=Kn(r,e.playlists[0],Ar);o&&(r=o,r.mediaGroups[t][i][a].playlists[0]=r.playlists[s],n=!1)}})),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:r},Lr=function(e,t){var i=Boolean(!e.map&&!t.map),n=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return n&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Pr=function(e,t){var i={};for(var n in e){var r=e[n],a=r.sidx;if(a){var s=ct(a);if(!t[s])break;var o=t[s].sidxInfo;Lr(o,a)&&(i[s]=t[s])}}return i},Dr=function(e,t){var i=Pr(e.playlists,t),n=i;return Un(e,(function(e,i,r,a){if(e.playlists&&e.playlists.length){var s=e.playlists;n=Or(n,Pr(s,t))}})),n},Rr=function(e){function t(t,i,n,r){var a;void 0===n&&(n={}),a=e.call(this)||this,a.masterPlaylistLoader_=r||ae()(a),r||(a.isMaster_=!0);var s=n,o=s.withCredentials,u=void 0!==o&&o,l=s.handleManifestRedirects,c=void 0!==l&&l;if(a.vhs_=i,a.withCredentials=u,a.handleManifestRedirects=c,!t)throw new Error("A non-empty playlist URL or object is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_(a.media().id)})),a.state="HAVE_NOTHING",a.loadedPlaylists_={},a.logger_=Gi("DashPlaylistLoader"),a.isMaster_?(a.masterPlaylistLoader_.srcUrl=t,a.masterPlaylistLoader_.sidxMapping_={}):a.childPlaylist_=t,a}oe()(t,e);var i=t.prototype;return i.requestErrored_=function(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!==typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)},i.addSidxSegments_=function(e,t,i){var n=this,r=e.sidx&&ct(e.sidx);if(e.sidx&&r&&!this.masterPlaylistLoader_.sidxMapping_[r]){var a=Wi(this.handleManifestRedirects,e.sidx.resolvedUri),s=function(a,s){if(!n.requestErrored_(a,s,t)){var o,u=n.masterPlaylistLoader_.sidxMapping_;try{o=ii()(si(s.response).subarray(8))}catch(l){return void n.requestErrored_(l,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},lt(e,o,e.sidx.resolvedUri),i(!0)}};this.request=kr(a,this.vhs_.xhr,(function(t,i,r,o){if(t)return s(t,i);if(!r||"mp4"!==r)return s({status:i.status,message:"Unsupported "+(r||"unknown")+" container type for sidx segment at URL: "+a,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},i);var u=e.sidx.byterange,l=u.offset,c=u.length;if(o.length>=c+l)return s(t,{response:o.subarray(l,l+c),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:rr({byterange:e.sidx.byterange})},s)}))}else this.mediaRequest_=de.a.setTimeout((function(){return i(!1)}),0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},de.a.clearTimeout(this.minimumUpdatePeriodTimeout_),de.a.clearTimeout(this.mediaRequest_),de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"===typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,(function(n){t.haveMetadata({startingState:i,playlist:e})})))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(de.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;de.a.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=de.a.setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=de.a.setTimeout((function(){return e.haveMaster_()}),0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Wi(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(n,r)}))):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},i.syncClientServerClock_=function(e){var t=this,i=ei(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:zi(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}})))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e=xr({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_}),t=this.masterPlaylistLoader_.master;t&&(e=Ir(t,e,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=e||t;var i=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return i&&i!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=i),(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(e)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(de.a.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!==typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=de.a.setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},i.refreshXml_=function(){var e=this;this.requestMaster_((function(t,i){i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=Dr(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},i.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];if(n?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var r=function e(){t.media().endList||(t.mediaUpdateTimeout=de.a.setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),Qn(t.media(),Boolean(n))))};r()}this.trigger("loadedplaylist")},t}(Cr),Mr={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},Ur=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer},Nr=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},jr=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},Br=function(e){return function(){var t=jr(e),i=Nr(new Worker(t));i.objURL=t;var n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},Fr=function(e){return"var browserWorkerPolyFill = "+Nr.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},qr=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Hr=Fr(qr((function(){var e=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var t,i,n,r,a,s,o,u,l,c,d,h,p,f,m,g,y,v,_,b,T,S,w,E,k,C,O,A,x,I,L,P,D,R,M,U,N=e,j=Math.pow(2,32)-1;(function(){var e;if(w={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:[]},"undefined"!==typeof Uint8Array){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);E=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),k=new Uint8Array([0,0,0,1]),O=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]),A=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]),x={video:O,audio:A},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),D=new Uint8Array([0,0,0,0,0,0,0,0]),R=D,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U=D,I=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),t=function(e){var t,i,n,r=[],a=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);t=r.length;while(t--)a+=r[t].byteLength;for(i=new Uint8Array(a+8),n=new DataView(i.buffer,i.byteOffset,i.byteLength),n.setUint32(0,i.byteLength),i.set(e,4),t=0,a=8;t<r.length;t++)i.set(r[t],a),a+=r[t].byteLength;return i},i=function(){return t(w.dinf,t(w.dref,P))},n=function(e){return t(w.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,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},r=function(){return t(w.ftyp,E,k,E,C)},g=function(e){return t(w.hdlr,x[e])},a=function(e){return t(w.mdat,e)},m=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(w.mdhd,i)},f=function(e){return t(w.mdia,m(e),g(e.type),o(e))},s=function(e){return t(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(w.minf,"video"===e.type?t(w.vmhd,I):t(w.smhd,L),i(),v(e))},u=function(e,i){var n=[],r=i.length;while(r--)n[r]=b(i[r]);return t.apply(null,[w.moof,s(e)].concat(n))},l=function(e){var i=e.length,n=[];while(i--)n[i]=h(e[i]);return t.apply(null,[w.moov,d(4294967295)].concat(n).concat(c(e)))},c=function(e){var i=e.length,n=[];while(i--)n[i]=T(e[i]);return t.apply(null,[w.mvex].concat(n))},d=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(w.mvhd,i)},y=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,a[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t(w.sdtp,a)},v=function(e){return t(w.stbl,_(e),t(w.stts,U),t(w.stsc,R),t(w.stsz,M),t(w.stco,D))},function(){var e,i;_=function(n){return t(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===n.type?e(n):i(n))},e=function(e){var i,n,r=e.sps||[],a=e.pps||[],s=[],o=[];for(i=0;i<r.length;i++)s.push((65280&r[i].byteLength)>>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));for(i=0;i<a.length;i++)o.push((65280&a[i].byteLength)>>>8),o.push(255&a[i].byteLength),o=o.concat(Array.prototype.slice.call(a[i]));if(n=[w.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,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]),t(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),t(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(t(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return t.apply(null,n)},i=function(e){return t(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))}}(),p=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,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,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(w.tkhd,i)},b=function(e){var i,n,r,a,s,o,u;return i=t(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(e.baseMediaDecodeTime/(j+1)),u=Math.floor(e.baseMediaDecodeTime%(j+1)),n=t(w.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,u>>>24&255,u>>>16&255,u>>>8&255,255&u])),s=92,"audio"===e.type?(r=S(e,s),t(w.traf,i,n,r)):(a=y(e),r=S(e,a.length+s),t(w.traf,i,n,r,a))},h=function(e){return e.duration=e.duration||4294967295,t(w.trak,p(e),f(e))},T=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(w.trex,i)},function(){var e,i,n;n=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},i=function(e,i){var r,a,s,o,u,l;for(o=e.samples||[],i+=20+16*o.length,s=n(o,i),a=new Uint8Array(s.length+16*o.length),a.set(s),r=s.length,l=0;l<o.length;l++)u=o[l],a[r++]=(4278190080&u.duration)>>>24,a[r++]=(16711680&u.duration)>>>16,a[r++]=(65280&u.duration)>>>8,a[r++]=255&u.duration,a[r++]=(4278190080&u.size)>>>24,a[r++]=(16711680&u.size)>>>16,a[r++]=(65280&u.size)>>>8,a[r++]=255&u.size,a[r++]=u.flags.isLeading<<2|u.flags.dependsOn,a[r++]=u.flags.isDependedOn<<6|u.flags.hasRedundancy<<4|u.flags.paddingValue<<1|u.flags.isNonSyncSample,a[r++]=61440&u.flags.degradationPriority,a[r++]=15&u.flags.degradationPriority,a[r++]=(4278190080&u.compositionTimeOffset)>>>24,a[r++]=(16711680&u.compositionTimeOffset)>>>16,a[r++]=(65280&u.compositionTimeOffset)>>>8,a[r++]=255&u.compositionTimeOffset;return t(w.trun,a)},e=function(e,i){var r,a,s,o,u,l;for(o=e.samples||[],i+=20+8*o.length,s=n(o,i),r=new Uint8Array(s.length+8*o.length),r.set(s),a=s.length,l=0;l<o.length;l++)u=o[l],r[a++]=(4278190080&u.duration)>>>24,r[a++]=(16711680&u.duration)>>>16,r[a++]=(65280&u.duration)>>>8,r[a++]=255&u.duration,r[a++]=(4278190080&u.size)>>>24,r[a++]=(16711680&u.size)>>>16,r[a++]=(65280&u.size)>>>8,r[a++]=255&u.size;return t(w.trun,r)},S=function(t,n){return"audio"===t.type?e(t,n):i(t,n)}}();var B,F,q,H,V,z,W,G,X={ftyp:r,mdat:a,moof:u,moov:l,initSegment:function(e){var t,i=r(),n=l(e);return t=new Uint8Array(i.byteLength+n.byteLength),t.set(i),t.set(n,i.byteLength),t}},Y=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t<e.length;t++)i=e[t],"access_unit_delimiter_rbsp"===i.nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),n=[i],n.byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},$=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)i=e[t],i.keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),n=[i],n.nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},K=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},Q=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},J=function(e,t){var i=Q();return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},Z=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;i<e.length;i++)for(a=e[i],n=0;n<a.length;n++)s=a[n],r=J(s,o),o+=r.size,u.push(r);return u},ee=function(e){var t,i,n,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=u+4*l,d=new Uint8Array(c),h=new DataView(d.buffer);for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for(a=r[i],n=0;n<a.length;n++)s=a[n],h.setUint32(o,s.data.byteLength),o+=4,d.set(s.data,o),o+=s.data.byteLength;return d},te=function(e,t){var i,n=t||0,r=[];return i=J(e,n),r.push(i),r},ie=function(e){var t,i,n=0,r=e.byteLength,a=e.length,s=r+4*a,o=new Uint8Array(s),u=new DataView(o.buffer);for(t=0;t<e.length;t++)i=e[t],u.setUint32(n,i.data.byteLength),n+=4,o.set(i.data,n),n+=i.data.byteLength;return o},ne={groupNalsIntoFrames:Y,groupFramesIntoGops:$,extendFirstKeyFrame:K,generateSampleTable:Z,concatenateNalData:ee,generateSampleTableForFrame:te,concatenateNalDataForFrame:ie},re=[33,16,5,32,164,27],ae=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){var t=[];while(e--)t.push(0);return t},oe=function(e){return Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})},ue=function(){if(!B){var e={96e3:[re,[227,64],se(154),[56]],88200:[re,[231],se(170),[56]],64e3:[re,[248,192],se(240),[56]],48e3:[re,[255,192],se(268),[55,148,128],se(54),[112]],44100:[re,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[re,[255,192],se(268),[55,234],se(226),[112]],24e3:[re,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[re,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[ae,se(268),[3,121,16],se(47),[7]]};B=oe(e)}return B},le=9e4;F=function(e){return e*le},q=function(e,t){return e*t},H=function(e){return e/le},V=function(e,t){return e/t},z=function(e,t){return F(V(e,t))},W=function(e,t){return q(H(e),t)},G=function(e,t,i){return H(i?e:e-t)};var ce={ONE_SECOND_IN_TS:le,secondsToVideoTs:F,secondsToAudioTs:q,videoTsToSeconds:H,audioTsToSeconds:V,audioTsToVideoTs:z,videoTsToAudioTs:W,metadataTsToSeconds:G},de=function(e){var t,i,n=0;for(t=0;t<e.length;t++)i=e[t],n+=i.data.byteLength;return n},he=function(e,t,i,n){var r,a,s,o,u=0,l=0,c=0,d=0;if(t.length&&(r=ce.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),u=Math.ceil(ce.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(l=r-Math.max(i,n),c=Math.floor(l/u),d=c*u),!(c<1||d>ce.ONE_SECOND_IN_TS/2))){for(a=ue()[e.samplerate],a||(a=t[0].data),s=0;s<c;s++)o=t[0],t.splice(0,0,{data:a,dts:o.dts-u,pts:o.pts-u});return e.baseMediaDecodeTime-=Math.floor(ce.videoTsToAudioTs(d,e.samplerate)),d}},pe=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},fe=function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},me=function(e){var t,i,n=0,r=new Uint8Array(de(e));for(t=0;t<e.length;t++)i=e[t],r.set(i.data,n),n+=i.data.byteLength;return r},ge={prefixWithSilence:he,trimAdtsFramesByEarliestDts:pe,generateSampleTable:fe,concatenateFrameData:me},ye=ce.ONE_SECOND_IN_TS,ve=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},_e=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},be=function(e,t){var i,n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=r,i=Math.max(0,i),"audio"===e.type&&(n=e.samplerate/ye,i*=n,i=Math.floor(i)),i},Te={clearDtsInfo:_e,calculateTrackBaseMediaDecodeTime:be,collectDtsInfo:ve},Se=4,we=128,Ee=function(e){var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;while(t<e.byteLength){if(e[t]===we)break;while(255===e[t])n+=255,t++;n+=e[t++];while(255===e[t])r+=255,t++;if(r+=e[t++],!i.payload&&n===Se){var a=String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6]);if("GA94"===a){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,n=0,r=0}return i},ke=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ce=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)r=3*i,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},Oe=function(e){var t,i,n=e.byteLength,r=[],a=1;while(a<n-2)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},Ae={parseSei:Ee,parseUserData:ke,parseCaptionPackets:Ce,discardEmulationPreventionBytes:Oe,USER_DATA_REGISTERED_ITU_T_T35:Se},xe=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!==typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new qe(0,0),new qe(0,1),new qe(1,0),new qe(1,1)],this.parse708captions_&&(this.cc708Stream_=new Me({captionServices:t.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.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")))};xe.prototype=new N,xe.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=Ae.parseSei(e.escapedRBSP),t.payload&&t.payloadType===Ae.USER_DATA_REGISTERED_ITU_T_T35&&(i=Ae.parseUserData(t),i)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=Ae.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},xe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},xe.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},xe.prototype.flush=function(){return this.flushStream("flush")},xe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},xe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},xe.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},xe.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},xe.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)},xe.prototype.setsTextOrXDSActive=function(e){return 256===(28928&e.ccData)||4138===(30974&e.ccData)||6186===(30974&e.ccData)},xe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var Ie={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},Le=function(e){var t=Ie[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)},Pe=function(e){return 32<=e&&e<=127||160<=e&&e<=255},De=function(e){this.windowNum=e,this.reset()};De.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},De.prototype.getText=function(){return this.rows.join("\n")},De.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},De.prototype.newLine=function(e){this.rows.length>=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);while(this.rows.length>this.virtualRowCount)this.rows.shift(),this.rowIdx--},De.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},De.prototype.addText=function(e){this.rows[this.rowIdx]+=e},De.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Re=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new De(-1),this.windows=[],this.stream=i,"string"===typeof t&&this.createTextDecoder(t)};Re.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new De(i),"function"===typeof t&&(this.windows[i].beforeRowOverflow=t)},Re.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Re.prototype.createTextDecoder=function(e){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Me=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},a={};Object.keys(r).forEach((function(e){i=r[e],/^SERVICE/.test(e)&&(a[e]=i.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};Me.prototype=new N,Me.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Me.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Me.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r<t.length;r++)a=t[r++],i=a>>5,n=31&a,7===i&&n>0&&(a=t[r++],i=a),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},Me.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r<t+i&&r<a.length;r++)n=a[r],Pe(n)?r=this.handleText(r,s):24===n?r=this.multiByteCharacter(r,s):16===n?r=this.extendedCommands(r,s):128<=n&&n<=135?r=this.setCurrentWindow(r,s):152<=n&&n<=159?r=this.defineWindow(r,s):136===n?r=this.clearWindows(r,s):140===n?r=this.deleteWindows(r,s):137===n?r=this.displayWindows(r,s):138===n?r=this.hideWindows(r,s):139===n?r=this.toggleWindows(r,s):151===n?r=this.setWindowAttributes(r,s):144===n?r=this.setPenAttributes(r,s):145===n?r=this.setPenColor(r,s):146===n?r=this.setPenLocation(r,s):143===n?s=this.reset(r,s):8===n?s.currentWindow.backspace():12===n?s.currentWindow.clearText():13===n?s.currentWindow.pendingNewLine=!0:14===n?s.currentWindow.clearText():141===n&&r++},Me.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data,n=i[++e];return Pe(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},Me.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Me.prototype.initService=function(e,t){var i,n="SERVICE"+e,r=this;return n in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Re(e,i,r),this.services[e].init(this.getPts(t),(function(t){r.flushDisplayed(t,r.services[e])})),this.services[e]},Me.prototype.handleText=function(e,t,i){var n,r,a=i&&i.isExtended,s=i&&i.isMultiByte,o=this.current708Packet.data,u=a?4096:0,l=o[e],c=o[e+1],d=t.currentWindow;return t.textDecoder_&&!a?(s?(r=[l,c],e++):r=[l],n=t.textDecoder_.decode(new Uint8Array(r))):n=Le(u|l),d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(n),e},Me.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],r=i[e+2];return Pe(n)&&Pe(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Me.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;return t.setCurrentWindow(r),e},Me.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],r=7&n;t.setCurrentWindow(r);var a=t.currentWindow;return n=i[++e],a.visible=(32&n)>>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e},Me.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},Me.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Me.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Me.prototype.displayWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<<a&&(t.windows[a].visible=1);return e},Me.prototype.hideWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<<a&&(t.windows[a].visible=0);return e},Me.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<<a&&(t.windows[a].visible^=1);return e},Me.prototype.clearWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<<a&&t.windows[a].clearText();return e},Me.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data,n=i[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var a=0;a<8;a++)n&1<<a&&t.windows[a].reset();return e},Me.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penAttr;return n=i[++e],r.textTag=(240&n)>>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},Me.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},Me.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},Me.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ue={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},Ne=function(e){return null===e?"":(e=Ue[e]||e,String.fromCharCode(e))},je=14,Be=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Fe=function(){var e=[],t=je+1;while(t--)e.push("");return e},qe=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Fe();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Fe();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Fe()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))n=(3&n)<<8,a=Ne(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=(3&n)<<8,a=Ne(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=Be.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=Ne(n),a+=Ne(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};qe.prototype=new N,qe.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(i){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},qe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Fe(),this.nonDisplayed_=Fe(),this.lastControlCode_=null,this.column_=0,this.row_=je,this.rollUpRows_=2,this.formatting_=[]},qe.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},qe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},qe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},qe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},qe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},qe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},qe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},qe.prototype.isNormalChar=function(e){return e>=32&&e<=127},qe.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=je,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Fe(),this.displayed_=Fe()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},qe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},qe.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},qe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},qe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},qe.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<je+1;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},qe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i};var He={CaptionStream:xe,Cea608Stream:qe,Cea708Stream:Me},Ve={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},ze=8589934592,We=4294967296,Ge="shared",Xe=function(e,t){var i=1;e>t&&(i=-1);while(Math.abs(t-e)>We)e+=i*ze;return e},Ye=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||Ge,this.push=function(e){this.type_!==Ge&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Xe(e.dts,n),e.pts=Xe(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ye.prototype=new N;var $e,Ke={TimestampRolloverStream:Ye,handleRollover:Xe},Qe=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},Je=function(e,t,i){return decodeURIComponent(Qe(e,t,i))},Ze=function(e,t,i){return unescape(Qe(e,t,i))},et=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},tt={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Je(e.data,1,t),e.value=Je(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Je(e.data,1,t),e.url=Je(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ze(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};$e=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],a=0;if($e.prototype.init.call(this),this.dispatchType=Ve.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,s,o,u,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),a+=e.data.byteLength,1===r.length&&(n=et(e.data.subarray(6,10)),n+=10),!(a<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},u=0;u<n;)t.data.set(r[0].data.subarray(0,n-u),u),u+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i+=4,i+=et(t.data.subarray(10,14)),n-=et(t.data.subarray(16,20)));do{if(s=et(t.data.subarray(i+4,i+8)),s<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if(l=String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),o={id:l,data:t.data.subarray(i+10,i+s+10)},o.key=o.id,tt[o.id]&&(tt[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var c=o.data,d=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;d*=4,d+=3&c[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=s}while(i<n);this.trigger("data",t)}}},$e.prototype=new N;var it,nt,rt,at=$e,st=Ke.TimestampRolloverStream,ot=188,ut=71;it=function(){var e=new Uint8Array(ot),t=0;it.prototype.init.call(this),this.push=function(i){var n,r=0,a=ot;t?(n=new Uint8Array(i.byteLength+t),n.set(e.subarray(0,t)),n.set(i,t),t=0):n=i;while(a<n.byteLength)n[r]!==ut||n[a]!==ut?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=ot,a+=ot);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){t===ot&&e[0]===ut&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}},it.prototype=new N,nt=function(){var e,t,i,n;nt.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===n.type?t(e.subarray(r),n):i(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r,a,s;if(1&e[5]){n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&e[1])<<8|e[2],r=3+i-4,a=(15&e[10])<<8|e[11],s=12+a;while(s<r){var o=e[s],u=(31&e[s+1])<<8|e[s+2];o===Ve.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=u:o===Ve.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=u:o===Ve.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][u]=o),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid){i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);while(this.packetsWaitingForPmt.length)this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ve.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ve.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},nt.prototype=new N,nt.STREAM_TYPES={h264:27,adts:15},rt=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,t){var i,n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!==(4&e[6]),i=e[7],192&i&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))},o=function(e,i,n){var r,a=new Uint8Array(e.size),o={type:i},u=0,l=0,c=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)r=e.data[u],a.set(r.data,l),l+=r.data.byteLength;s(a,o),c="video"===i||o.packetLength<=e.size,(n||c)&&(e.size=0,e.data.length=0),c&&t.trigger("data",o)}};rt.prototype.init.call(this),this.push=function(s){({pat:function(){},pes:function(){var e,t;switch(s.streamType){case Ve.H264_STREAM_TYPE:e=n,t="video";break;case Ve.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}s.payloadUnitStartIndicator&&o(e,t,!0),e.data.push(s),e.size+=s.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};e=s.programMapTable,null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[s.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(n,"video"),o(r,"audio"),o(a,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},rt.prototype=new N;var lt={PAT_PID:0,MP2T_PACKET_LENGTH:ot,TransportPacketStream:it,TransportParseStream:nt,ElementaryStream:rt,TimestampRolloverStream:st,CaptionStream:He.CaptionStream,Cea608Stream:He.Cea608Stream,Cea708Stream:He.Cea708Stream,MetadataStream:at};for(var ct in Ve)Ve.hasOwnProperty(ct)&&(lt[ct]=Ve[ct]);var dt,ht=lt,pt=ce.ONE_SECOND_IN_TS,ft=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];dt=function(e){var t,i=0;dt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"})},this.push=function(n){var r,a,s,o,u,l=0;if(e||(i=0),"audio"===n.type){var c;t&&t.length?(s=t,t=new Uint8Array(s.byteLength+n.data.byteLength),t.set(s),t.set(n.data,s.byteLength)):t=n.data;while(l+7<t.length)if(255===t[l]&&240===(246&t[l+1])){if("number"===typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),r=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,o=1024*(1+(3&t[l+6])),u=o*pt/ft[(60&t[l+2])>>>2],t.byteLength-l<r)break;this.trigger("data",{pts:n.pts+i*u,dts:n.dts+i*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:ft[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),i++,l+=r}else"number"!==typeof c&&(c=l),l++;"number"===typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},dt.prototype=new N;var mt,gt=dt;mt=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,r=Math.floor(e/8),e-=8*r,t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return n-=r,n>0?i<<=r:t>0&&this.loadWord(),r=e-r,r>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(0!==(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var yt,vt,_t,bt=mt;vt=function(){var e,t,i=0;vt.prototype.init.call(this),this.push=function(n){var r;t?(r=new Uint8Array(t.byteLength+n.data.byteLength),r.set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var a=t.byteLength;i<a-3;i++)if(1===t[i+2]){e=i+5;break}while(e<a)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<a);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;break}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},vt.prototype=new N,_t={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},yt=function(){var e,t,i,n,r,a,s,o=new vt;yt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var i,n,r=8,a=8;for(i=0;i<e;i++)0!==a&&(n=t.readExpGolomb(),a=(r+n+256)%256),r=0===a?r:a},r=function(e){var t,i,n=e.byteLength,r=[],a=1;while(a<n-2)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},a=function(e){var t,i,n,r,a,o,u,l,c,d,h,p,f,m=0,g=0,y=0,v=0,_=[1,1];if(t=new bt(e),i=t.readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),_t[i]&&(a=t.readUnsignedExpGolomb(),3===a&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,f=0;f<h;f++)t.readBoolean()&&s(f<6?16:64,t);if(t.skipUnsignedExpGolomb(),o=t.readUnsignedExpGolomb(),0===o)t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),u=t.readUnsignedExpGolomb(),f=0;f<u;f++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),d=t.readBits(1),0===d&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(p=t.readUnsignedByte(),p){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];break}_&&(_[0],_[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:16*(l+1)-2*m-2*g,height:(2-d)*(c+1)*16-2*y-2*v,sarRatio:_}}},yt.prototype=new N;var Tt,St={H264Stream:yt,NalByteStream:vt},wt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Et=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return i=i>=0?i:0,r?i+20:i+10},kt=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:(i+=Et(t,i),e(t,i))},Ct=function(e){var t=kt(e,0);return e.length>=t+2&&255===(255&e[t])&&240===(240&e[t+1])&&16===(22&e[t+1])},Ot=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},At=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},xt=function(e,t,i){return unescape(At(e,t,i))},It=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},Lt=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},Pt=function(e){var t=0;while(t+5<e.length){if(255===e[t]&&240===(246&e[t+1]))return wt[(60&e[t+2])>>>2];t++}return null},Dt=function(e){var t,i,n,r;t=10,64&e[5]&&(t+=4,t+=Ot(e.subarray(10,14)));do{if(i=Ot(e.subarray(t+4,t+8)),i<1)return null;if(r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===r){n=e.subarray(t+10,t+i+10);for(var a=0;a<n.byteLength;a++)if(0===n[a]){var s=xt(n,0,a);if("com.apple.streaming.transportStreamTimestamp"===s){var o=n.subarray(a+1),u=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return u*=4,u+=3&o[7],u}break}}t+=10,t+=i}while(t<e.byteLength);return null},Rt={isLikelyAacData:Ct,parseId3TagSize:Et,parseAdtsSize:It,parseType:Lt,parseSampleRate:Pt,parseAacTimestamp:Dt};Tt=function(){var e=new Uint8Array,t=0;Tt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,a,s,o=0,u=0;e.length?(s=e.length,e=new Uint8Array(i.byteLength+s),e.set(e.subarray(0,s)),e.set(i,s)):e=i;while(e.length-u>=3)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!==(255&e[u])||240!==(240&e[u+1]))u++;else{if(e.length-u<7)break;if(o=Rt.parseAdtsSize(e,u),u+o>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(o=Rt.parseId3TagSize(e,u),u+o>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}},Tt.prototype=new N;var Mt,Ut,Nt,jt,Bt=Tt,Ft=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qt=Ft,Ht=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Vt=Ht,zt=St.H264Stream,Wt=Rt.isLikelyAacData,Gt=ce.ONE_SECOND_IN_TS,Xt=function(e,t){t.stream=e,this.trigger("log",t)},Yt=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var r=i[n];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",Xt.bind(e,r))}},$t=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Kt=function(e,t,i,n,r,a){var s=i-t,o=n-t,u=r-i;return{start:{dts:e,pts:e+s},end:{dts:e+o,pts:e+u},prependedContentDuration:a,baseMediaDecodeTime:e}};Ut=function(e,t){var i,n=[],r=0,a=0,s=1/0;t=t||{},i=t.firstSequenceNumber||0,Ut.prototype.init.call(this),this.push=function(t){Te.collectDtsInfo(e,t),e&&qt.forEach((function(i){e[i]=t[i]})),n.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,h,p;0!==n.length?(o=ge.trimAdtsFramesByEarliestDts(n,e,r),e.baseMediaDecodeTime=Te.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=ge.prefixWithSilence(e,o,a,s),e.samples=ge.generateSampleTable(o),l=X.mdat(ge.concatenateFrameData(o)),n=[],u=X.moof(i,[e]),c=new Uint8Array(u.byteLength+l.byteLength),i++,c.set(u),c.set(l,u.byteLength),Te.clearDtsInfo(e),d=Math.ceil(1024*Gt/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",Kt(ce.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Te.clearDtsInfo(e),n=[],this.trigger("reset")}},Ut.prototype=new N,Mt=function(e,t){var i,n,r,a=[],s=[];t=t||{},i=t.firstSequenceNumber||0,Mt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Te.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],Vt.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){var n,r,o,u,l,c,d,h,p=0;while(a.length){if("access_unit_delimiter_rbsp"===a[0].nalUnitType)break;a.shift()}if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=ne.groupNalsIntoFrames(a),o=ne.groupFramesIntoGops(n),o[0][0].keyFrame||(r=this.getGopForFusion_(a[0],e),r?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=ne.extendFirstKeyFrame(o)),s.length){var f;if(f=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o),!f)return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Te.clearDtsInfo(e),o=f}Te.collectDtsInfo(e,o),e.samples=ne.generateSampleTable(o),l=X.mdat(ne.concatenateNalData(o)),e.baseMediaDecodeTime=Te.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",Kt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),u=X.moof(i,[e]),c=new Uint8Array(u.byteLength+l.byteLength),i++,c.set(u),c.set(l,u.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){Te.clearDtsInfo(e),n=void 0,r=void 0},this.getGopForFusion_=function(t){var i,n,r,a,s,o=45e3,u=1e4,l=1/0;for(s=0;s<this.gopCache_.length;s++)a=this.gopCache_[s],r=a.gop,e.pps&&$t(e.pps[0],a.pps[0])&&e.sps&&$t(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(i=t.dts-r.dts-r.duration,i>=-u&&i<=o&&(!n||l>i)&&(n=a,l=i)));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;while(t<s.length&&i<e.length){if(n=s[t],r=e[i],n.pts===r.pts)break;r.pts>n.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration)}return 0===i?e:i===e.length?null:(l=e.slice(i),l.byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;t=s.length-1,i=e.length-1,a=null,o=!1;while(t>=0&&i>=0){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(u=o?i:a,0===u)return e;var l=e.slice(u),c=l.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},Mt.prototype=new N,jt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e=e||{},"undefined"!==typeof e.remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"===typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.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(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},jt.prototype=new N,jt.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Vt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,qt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=X.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)t=this.pendingCaptions[r],t.startTime=ce.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=ce.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)i=this.pendingMetadata[r],i.cueTime=ce.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),s.metadata.push(i);for(s.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",s),r=0;r<s.captions.length;r++)t=s.captions[r],this.trigger("caption",t);for(r=0;r<s.metadata.length;r++)i=s.metadata[r],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},jt.prototype.setRemux=function(e){this.remuxTracks=e},Nt=function(e){var t,i,n=this,r=!0;Nt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new ht.MetadataStream,r.aacStream=new Bt,r.audioTimestampRolloverStream=new ht.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new ht.TimestampRolloverStream("timed-metadata"),r.adtsStream=new gt,r.coalesceStream=new jt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",(function(e){r.aacStream.setTimestamp(e.timeStamp)})),r.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ut(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Yt(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new ht.MetadataStream,r.packetStream=new ht.TransportPacketStream,r.parseStream=new ht.TransportParseStream,r.elementaryStream=new ht.ElementaryStream,r.timestampRolloverStream=new ht.TimestampRolloverStream,r.adtsStream=new gt,r.h264Stream=new zt,r.captionStream=new ht.CaptionStream(e),r.coalesceStream=new jt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){s=a.tracks.length;while(s--)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||(i=a.tracks[s],i.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s],t.timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime);t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new Mt(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ut(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",(function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)})),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Yt(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Te.clearDtsInfo(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Te.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=Wt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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()}},Nt.prototype=new N;var Qt,Jt,Zt,ei,ti,ii,ni={Transmuxer:Nt,VideoSegmentStream:Mt,AudioSegmentStream:Ut,AUDIO_PROPERTIES:qt,VIDEO_PROPERTIES:Vt,generateSegmentTimingInfo:Kt},ri=function(e){return e>>>0},ai=function(e){return("00"+e.toString(16)).slice(-2)},si={toUnsigned:ri,toHexString:ai},oi=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]),t},ui=oi,li=si.toUnsigned,ci=function e(t,i){var n,r,a,s,o,u=[];if(!i.length)return null;for(n=0;n<t.byteLength;)r=li(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),a=ui(t.subarray(n+4,n+8)),s=r>1?n+r:t.byteLength,a===i[0]&&(1===i.length?u.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1)),o.length&&(u=u.concat(o)))),n=s;return u},di=ci,hi=si.toUnsigned,pi=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:hi(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=hi(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},fi=pi,mi=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},gi=mi,yi=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),d=8;r&&(i.dataOffset=n.getInt32(d),d+=4),a&&c&&(t={flags:gi(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),c--);while(c--)t={},s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(t.flags=gi(e.subarray(d,d+4)),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},vi=yi,_i=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},bi=_i,Ti=Ae.discardEmulationPreventionBytes,Si=He.CaptionStream,wi=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null},Ei=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=wi(r,t);if(n={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Ti(l),trackId:i},c)n.pts=c.pts,n.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+i+". See mux.js#223."});break}n.pts=s.pts,n.dts=s.dts}u.seiNals.push(n);break}return u},ki=function(e,t,i){var n=t,r=i.defaultSampleDuration||0,a=i.defaultSampleSize||0,s=i.trackId,o=[];return e.forEach((function(e){var t=vi(e),i=t.samples;i.forEach((function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=n+e.compositionTimeOffset,n+=e.duration})),o=o.concat(i)})),o},Ci=function(e,t){var i=di(e,["moof","traf"]),n=di(e,["mdat"]),r={},a=[];return n.forEach((function(e,t){var n=i[t];a.push({mdat:e,traf:n})})),a.forEach((function(e){var i,n,a=e.mdat,s=e.traf,o=di(s,["tfhd"]),u=bi(o[0]),l=u.trackId,c=di(s,["tfdt"]),d=c.length>0?fi(c[0]).baseMediaDecodeTime:0,h=di(s,["trun"]);t===l&&h.length>0&&(i=ki(h,d,u),n=Ei(a,i,l),r[l]||(r[l]={seiNals:[],logs:[]}),r[l].seiNals=r[l].seiNals.concat(n.seiNals),r[l].logs=r[l].logs.concat(n.logs))})),r},Oi=function(e,t,i){var n;if(null===t)return null;n=Ci(e,t);var r=n[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}},Ai=function(){var e,t,i,n,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Si,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0})),e.on("log",(function(e){r.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===typeof t&&0===Object.keys(t).length)&&(i!==e[0]||n!==t[i])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(null===i||!n)return t.push(e),null;while(t.length>0){var u=t.shift();this.parse(u,a,s)}return o=Oi(e,i,n),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},xi=Ai,Ii=si.toUnsigned,Li=si.toHexString;Qt=function(e){var t={},i=di(e,["moov","trak"]);return i.reduce((function(e,t){var i,n,r,a,s;return i=di(t,["tkhd"])[0],i?(n=i[0],r=0===n?12:20,a=Ii(i[r]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3]),s=di(t,["mdia","mdhd"])[0],s?(n=s[0],r=0===n?12:20,e[a]=Ii(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null}),t)},Jt=function(e,t){var i,n,r;return i=di(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return di(t,["tfhd"]).map((function(i){var n,r,a;return n=Ii(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,a=di(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=Ii(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Ii(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],a="number"!==typeof a||isNaN(a)?1/0:a,a/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},Zt=function(e,t){var i,n=di(t,["moof","traf"]),r=0,a=0;if(n&&n.length){var s=di(n[0],["tfhd"])[0],o=di(n[0],["trun"])[0],u=di(n[0],["tfdt"])[0];if(s){var l=bi(s);i=l.trackId}if(u){var c=fi(u);r=c.baseMediaDecodeTime}if(o){var d=vi(o);d.samples&&d.samples.length&&(a=d.samples[0].compositionTimeOffset||0)}}var h=e[i]||9e4;return(r+a)/h},ei=function(e){var t=di(e,["moov","trak"]),i=[];return t.forEach((function(e){var t=di(e,["mdia","hdlr"]),n=di(e,["tkhd"]);t.forEach((function(e,t){var r,a,s,o=ui(e.subarray(8,12)),u=n[t];"vide"===o&&(r=new DataView(u.buffer,u.byteOffset,u.byteLength),a=r.getUint8(0),s=0===a?r.getUint32(12):r.getUint32(20),i.push(s))}))})),i},ii=function(e){var t=e[0],i=0===t?12:20;return Ii(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3])},ti=function(e){var t=di(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},a=di(e,["tkhd"])[0];a&&(t=new DataView(a.buffer,a.byteOffset,a.byteLength),n=t.getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var s=di(e,["mdia","hdlr"])[0];if(s){var o=ui(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=di(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=ui(l.subarray(4,8));var c,d,h=di(l,[r.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=h.subarray(78),d=ui(c.subarray(4,8)),"avcC"===d&&c.length>11?(r.codec+=".",r.codec+=Li(c[9]),r.codec+=Li(c[10]),r.codec+=Li(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=h.subarray(28),d=ui(c.subarray(4,8)),"esds"===d&&c.length>20&&0!==c[19]?(r.codec+="."+Li(c[19]),r.codec+="."+Li(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var p=di(e,["mdia","mdhd"])[0];p&&(r.timescale=ii(p)),i.push(r)})),i};var Pi={findBox:di,parseType:ui,timescale:Qt,startTime:Jt,compositionStartTime:Zt,videoTrackIds:ei,tracks:ti,getTimescaleFromMediaHeader:ii},Di=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},Ri=function(e){return!!(64&e[1])},Mi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Ui=function(e,t){var i=Di(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},Ni=function(e){var t=Ri(e),i=4+Mi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},ji=function(e){var t={},i=Ri(e),n=4+Mi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r,a,s;r=(15&e[n+1])<<8|e[n+2],a=3+r-4,s=(15&e[n+10])<<8|e[n+11];var o=12+s;while(o<a){var u=n+o;t[(31&e[u+1])<<8|e[u+2]]=e[u],o+=5+((15&e[u+3])<<8|e[u+4])}return t}},Bi=function(e,t){var i=Di(e),n=t[i];switch(n){case Ve.H264_STREAM_TYPE:return"video";case Ve.ADTS_STREAM_TYPE:return"audio";case Ve.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Fi=function(e){var t=Ri(e);if(!t)return null;var i=4+Mi(e);if(i>=e.byteLength)return null;var n,r=null;return n=e[i+7],192&n&&(r={},r.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},qi=function(e){switch(e){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}},Hi=function(e){for(var t,i=4+Mi(e),n=e.subarray(i),r=0,a=0,s=!1;a<n.byteLength-3;a++)if(1===n[a+2]){r=a+5;break}while(r<n.byteLength)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}a+3!==r-2&&(t=qi(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0));do{r++}while(1!==n[r]&&r<n.length);a=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}t=qi(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0),a=r-2,r+=3;break;default:r+=3;break}return n=n.subarray(a),r-=a,a=0,n&&n.byteLength>3&&(t=qi(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(s=!0)),s},Vi={parseType:Ui,parsePat:Ni,parsePmt:ji,parsePayloadUnitStartIndicator:Ri,parsePesType:Bi,parsePesTime:Fi,videoPacketContainsKeyFrame:Hi},zi=Ke.handleRollover,Wi={};Wi.ts=Vi,Wi.aac=Rt;var Gi=ce.ONE_SECOND_IN_TS,Xi=188,Yi=71,$i=function(e,t){var i,n,r=0,a=Xi;while(a<e.byteLength)if(e[r]!==Yi||e[a]!==Yi)r++,a++;else{switch(i=e.subarray(r,a),n=Wi.ts.parseType(i,t.pid),n){case"pat":t.pid=Wi.ts.parsePat(i);break;case"pmt":var s=Wi.ts.parsePmt(i);t.table=t.table||{},Object.keys(s).forEach((function(e){t.table[e]=s[e]}));break}r+=Xi,a+=Xi}},Ki=function(e,t,i){var n,r,a,s,o,u=0,l=Xi,c=!1;while(l<=e.byteLength)if(e[u]!==Yi||e[l]!==Yi&&l!==e.byteLength)u++,l++;else{switch(n=e.subarray(u,l),r=Wi.ts.parseType(n,t.pid),r){case"pes":a=Wi.ts.parsePesType(n,t.table),s=Wi.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&s&&(o=Wi.ts.parsePesTime(n),o&&(o.type="audio",i.audio.push(o),c=!0));break}if(c)break;u+=Xi,l+=Xi}l=e.byteLength,u=l-Xi,c=!1;while(u>=0)if(e[u]!==Yi||e[l]!==Yi&&l!==e.byteLength)u--,l--;else{switch(n=e.subarray(u,l),r=Wi.ts.parseType(n,t.pid),r){case"pes":a=Wi.ts.parsePesType(n,t.table),s=Wi.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&s&&(o=Wi.ts.parsePesTime(n),o&&(o.type="audio",i.audio.push(o),c=!0));break}if(c)break;u-=Xi,l-=Xi}},Qi=function(e,t,i){var n,r,a,s,o,u,l,c,d=0,h=Xi,p=!1,f={data:[],size:0};while(h<e.byteLength)if(e[d]!==Yi||e[h]!==Yi)d++,h++;else{switch(n=e.subarray(d,h),r=Wi.ts.parseType(n,t.pid),r){case"pes":if(a=Wi.ts.parsePesType(n,t.table),s=Wi.ts.parsePayloadUnitStartIndicator(n),"video"===a&&(s&&!p&&(o=Wi.ts.parsePesTime(n),o&&(o.type="video",i.video.push(o),p=!0)),!i.firstKeyFrame)){if(s&&0!==f.size){u=new Uint8Array(f.size),l=0;while(f.data.length)c=f.data.shift(),u.set(c,l),l+=c.byteLength;if(Wi.ts.videoPacketContainsKeyFrame(u)){var m=Wi.ts.parsePesTime(u);m&&(i.firstKeyFrame=m,i.firstKeyFrame.type="video")}f.size=0}f.data.push(n),f.size+=n.byteLength}break}if(p&&i.firstKeyFrame)break;d+=Xi,h+=Xi}h=e.byteLength,d=h-Xi,p=!1;while(d>=0)if(e[d]!==Yi||e[h]!==Yi)d--,h--;else{switch(n=e.subarray(d,h),r=Wi.ts.parseType(n,t.pid),r){case"pes":a=Wi.ts.parsePesType(n,t.table),s=Wi.ts.parsePayloadUnitStartIndicator(n),"video"===a&&s&&(o=Wi.ts.parsePesTime(n),o&&(o.type="video",i.video.push(o),p=!0));break}if(p)break;d-=Xi,h-=Xi}},Ji=function(e,t){if(e.audio&&e.audio.length){var i=t;("undefined"===typeof i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=zi(e.dts,i),e.pts=zi(e.pts,i),e.dtsTime=e.dts/Gi,e.ptsTime=e.pts/Gi}))}if(e.video&&e.video.length){var n=t;if(("undefined"===typeof n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=zi(e.dts,n),e.pts=zi(e.pts,n),e.dtsTime=e.dts/Gi,e.ptsTime=e.pts/Gi})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=zi(r.dts,n),r.pts=zi(r.pts,n),r.dtsTime=r.dts/Gi,r.ptsTime=r.pts/Gi}}},Zi=function(e){var t,i=!1,n=0,r=null,a=null,s=0,o=0;while(e.length-o>=3){var u=Wi.aac.parseType(e,o);switch(u){case"timed-metadata":if(e.length-o<10){i=!0;break}if(s=Wi.aac.parseId3TagSize(e,o),s>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=Wi.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break}if(s=Wi.aac.parseAdtsSize(e,o),s>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=Wi.aac.parseSampleRate(t)),n++,o+=s;break;default:o++;break}if(i)return null}if(null===r||null===a)return null;var l=Gi/r,c={audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*l,pts:a+1024*n*l}]};return c},en=function(e){var t={pid:null,table:null},i={};for(var n in $i(e,t),t.table)if(t.table.hasOwnProperty(n)){var r=t.table[n];switch(r){case Ve.H264_STREAM_TYPE:i.video=[],Qi(e,t,i),0===i.video.length&&delete i.video;break;case Ve.ADTS_STREAM_TYPE:i.audio=[],Ki(e,t,i),0===i.audio.length&&delete i.audio;break}}return i},tn=function(e,t){var i,n=Wi.aac.isLikelyAacData(e);return i=n?Zi(e):en(e),i&&(i.audio||i.video)?(Ji(i,t),i):null},nn={inspect:tn,parseAudioPes_:Ki},rn=function(e,t){t.on("data",(function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var i={start:{decode:ce.videoTsToSeconds(t.start.dts),presentation:ce.videoTsToSeconds(t.start.pts)},end:{decode:ce.videoTsToSeconds(t.end.dts),presentation:ce.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ce.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){var i={start:{decode:ce.videoTsToSeconds(t.start.dts),presentation:ce.videoTsToSeconds(t.start.pts)},end:{decode:ce.videoTsToSeconds(t.end.dts),presentation:ce.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ce.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ce.videoTsToSeconds(t.start),end:ce.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ce.videoTsToSeconds(t.start),end:ce.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))},an=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new ni.Transmuxer(this.options),rn(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new xi,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=Pi.startTime(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer])},t.probeMp4Tracks=function(e){var t=e.data,i=Pi.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!==typeof i||isNaN(i)?void 0:i*ce.ONE_SECOND_IN_TS,r=nn.inspect(t,n),a=null;r&&(a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},a.hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ce.secondsToVideoTs(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(ce.secondsToVideoTs(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new an(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new an(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),Vr=Br(Hr),zr=function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,c=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};"undefined"!==typeof l&&(h.videoFrameDtsTime=l),"undefined"!==typeof c&&(h.videoFramePtsTime=c),i(h)},Wr=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},Gr=function(e,t){t.gopInfo=e.data.gopInfo},Xr=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,y=e.isEndOfTimeline,v={buffer:[]},_=y,b=function(i){t.currentTransmux===e&&("data"===i.data.action&&zr(i,v,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&Gr(i,v),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,Wr({transmuxedData:v,callback:f}),Yr(t))))};if(t.onmessage=b,n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),"undefined"!==typeof a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var T=i instanceof ArrayBuffer?i:i.buffer,S=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:T,byteOffset:S,byteLength:i.byteLength},[T])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Yr=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"===typeof e.currentTransmux?e.currentTransmux():Xr(e.currentTransmux))},$r=function(e,t){e.postMessage({action:t}),Yr(e)},Kr=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void $r(t,e);t.transmuxQueue.push($r.bind(null,t,e))},Qr=function(e){Kr("reset",e)},Jr=function(e){Kr("endTimeline",e)},Zr=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Xr(e);e.transmuxer.transmuxQueue.push(e)},ea=function(e){var t=new Vr;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},ta={reset:Qr,endTimeline:Jr,transmux:Zr,createTransmuxer:ea},ia=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=ve()({},e,{endAction:null,transmuxer:null,callback:null}),a=function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data))};if(t.addEventListener("message",a),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var o=[s?e.data:e.data.buffer];t.postMessage(r,o)}else t.postMessage(r)},na={FAILURE:2,TIMEOUT:-101,ABORTED:-102},ra=function(e){e.forEach((function(e){e.abort()}))},aa=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},sa=function(e){var t=e.target,i=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},oa=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:na.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:na.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:na.FAILURE,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:na.FAILURE,xhr:t}:null},ua=function(e,t,i){return function(n,r){var a=r.response,s=oa(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:na.FAILURE,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l<t.length;l++)t[l].bytes=u;return i(null,e)}},la=function(e,t){var i=qi(e.map.bytes);if("mp4"!==i){var n=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(i||"unknown")+" container for initialization segment at URL: "+n,code:na.FAILURE})}ia({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(i){var n=i.tracks,r=i.data;return e.map.bytes=r,n.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"===typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null)}})},ca=function(e){var t=e.segment,i=e.finishProcessingFn;return function(e,n){var r=oa(e,n);if(r)return i(r,t);var a=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=a,i(null,t);t.map.bytes=a,la(t,(function(e){if(e)return e.xhr=n,e.status=n.status,i(e,t);i(null,t)}))}},da=function(e){var t=e.segment,i=e.finishProcessingFn,n=e.responseType;return function(e,r){var a=oa(e,r);if(a)return i(a,t);var s="arraybuffer"!==n&&r.responseText?Ur(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=aa(r),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),i(null,t)}},ha=function(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=t.map&&t.map.tracks||{},m=Boolean(f.audio&&f.video),g=r.bind(null,t,"audio","start"),y=r.bind(null,t,"audio","end"),v=r.bind(null,t,"video","start"),_=r.bind(null,t,"video","end"),b=function(){return Zr({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:m,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){n&&(m&&(e.isMuxed=!0),n(t,e))},onAudioTimingInfo:function(e){g&&"undefined"!==typeof e.start&&(g(e.start),g=null),y&&"undefined"!==typeof e.end&&y(e.end)},onVideoTimingInfo:function(e){v&&"undefined"!==typeof e.start&&(v(e.start),v=null),_&&"undefined"!==typeof e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,i){o(t,e,i)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})};ia({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=i=e.data;var r=e.result;r&&(n(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:m}),n=null,r.hasAudio&&!m&&g(r.audioStart),r.hasVideo&&v(r.videoStart),g=null,v=null),b()}})},pa=function(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=new Uint8Array(i);if(Hi(f)){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),n(t,g);var y=function(e){d(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};ia({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var n=e.data,a=e.startTime;i=n.buffer,t.bytes=f=n,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",a),g.hasVideo&&r(t,"video","start",a),m.video&&n.byteLength&&t.transmuxer?ia({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){i=e.data.buffer,t.bytes=f=e.data,e.logs.forEach((function(e){p(ne.a.mergeOptions(e,{stream:"mp4CaptionParser"}))})),y(e.captions)}}):y()}})}else if(t.transmuxer){if("undefined"===typeof t.container&&(t.container=qi(f)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});ha({segment:t,bytes:i,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,t,{})},fa=function(e,t){var i,n=e.id,r=e.key,a=e.encryptedBytes,s=e.decryptionWorker,o=function e(i){if(i.data.source===n){s.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}};s.addEventListener("message",o),i=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(ur({source:n,encrypted:a,key:i,iv:r.iv}),[a.buffer,i.buffer])},ma=function(e){var t=e.decryptionWorker,i=e.segment,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;fa({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},(function(e){i.bytes=e,pa({segment:i,bytes:i.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}))},ga=function(e){var t=e.activeXhrs,i=e.decryptionWorker,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,ra(t),h(e,g);if(f+=1,f===t.length){var y=function(){if(g.encryptedBytes)return ma({decryptionWorker:i,segment:g,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});pa({segment:g,bytes:g.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return fa({decryptionWorker:i,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(function(e){g.map.bytes=e,la(g,(function(e){if(e)return ra(t),h(e,g);y()}))}));y()}}}},ya=function(e){var t=e.loadendState,i=e.abortFn;return function(e){var n=e.target;n.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}},va=function(e){var t=e.segment,i=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){var n=e.target;if(!n.aborted)return t.stats=ne.a.mergeOptions(t.stats,sa(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(e,t)}},_a=function(e){var t=e.xhr,i=e.xhrOptions,n=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,y=e.onTransmuxerLog,v=[],_=ga({activeXhrs:v,decryptionWorker:n,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:y});if(r.key&&!r.key.bytes){var b=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&b.push(r.map.key);var T=ne.a.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),S=ua(r,b,_),w=t(T,S);v.push(w)}if(r.map&&!r.map.bytes){var E=r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri);if(E){var k=ne.a.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),C=ua(r,[r.map.key],_),O=t(k,C);v.push(O)}var A=ne.a.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:rr(r.map)}),x=ca({segment:r,finishProcessingFn:_}),I=t(A,x);v.push(I)}var L=ne.a.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:rr(r)}),P=da({segment:r,finishProcessingFn:_,responseType:L.responseType}),D=t(L,P);D.addEventListener("progress",va({segment:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m})),v.push(D);var R={};return v.forEach((function(e){e.addEventListener("loadend",ya({loadendState:R,abortFn:a}))})),function(){return ra(v)}},ba=Gi("CodecUtils"),Ta=function(e){var t=e.attributes||{};if(t.CODECS)return Me(t.CODECS)},Sa=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},wa=function(e,t){if(!Sa(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1},Ea=function(e){var t={};return e.forEach((function(e){var i=e.mediaType,n=e.type,r=e.details;t[i]=t[i]||[],t[i].push(Re(""+n+r))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return ba("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},ka=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Ca=function(e,t){var i=t.attributes||{},n=Ea(Ta(t)||[]);if(Sa(e,t)&&!n.audio&&!wa(e,t)){var r=Ea(Ue(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},Oa=Gi("PlaylistSelector"),Aa=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},xa=function(e,t){if(!e)return"";var i=de.a.getComputedStyle(e);return i?i[t]:""},Ia=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},La=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||de.a.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||de.a.Number.MAX_VALUE,i-n},Pa=function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||de.a.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||de.a.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},Da=function(e,t,i,n,r,a){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},o=e.playlists;Pn.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map((function(e){var t,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||de.a.Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));Ia(u,(function(e,t){return e.bandwidth-t.bandwidth})),u=u.filter((function(e){return!Pn.isIncompatible(e.playlist)}));var l=u.filter((function(e){return Pn.isEnabled(e.playlist)}));l.length||(l=u.filter((function(e){return!Pn.isDisabled(e.playlist)})));var c=l.filter((function(e){return e.bandwidth*Mr.BANDWIDTH_VARIANCE<t})),d=c[c.length-1],h=c.filter((function(e){return e.bandwidth===d.bandwidth}))[0];if(!1===r){var p=h||l[0]||u[0];if(p&&p.playlist){var f="sortedPlaylistReps";return h&&(f="bandwidthBestRep"),l[0]&&(f="enabledPlaylistReps"),Oa("choosing "+Aa(p)+" using "+f+" with options",s),p.playlist}return Oa("could not choose a playlist with options",s),null}var m=c.filter((function(e){return e.width&&e.height}));Ia(m,(function(e,t){return e.width-t.width}));var g=m.filter((function(e){return e.width===i&&e.height===n}));d=g[g.length-1];var y,v,_,b,T=g.filter((function(e){return e.bandwidth===d.bandwidth}))[0];if(T||(y=m.filter((function(e){return e.width>i||e.height>n})),v=y.filter((function(e){return e.width===y[0].width&&e.height===y[0].height})),d=v[v.length-1],_=v.filter((function(e){return e.bandwidth===d.bandwidth}))[0]),a.experimentalLeastPixelDiffSelector){var S=m.map((function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e}));Ia(S,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),b=S[0]}var w=b||_||T||h||l[0]||u[0];if(w&&w.playlist){var E="sortedPlaylistReps";return b?E="leastPixelDiffRep":_?E="resolutionPlusOneRep":T?E="resolutionBestRep":h?E="bandwidthBestRep":l[0]&&(E="enabledPlaylistReps"),Oa("choosing "+Aa(w)+" using "+E+" with options",s),w.playlist}return Oa("could not choose a playlist with options",s),null}},Ra=function(){var e=this.useDevicePixelRatio&&de.a.devicePixelRatio||1;return Da(this.playlists.master,this.systemBandwidth,parseInt(xa(this.tech_.el(),"width"),10)*e,parseInt(xa(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},Ma=function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&de.a.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Da(this.playlists.master,t,parseInt(xa(this.tech_.el(),"width"),10)*n,parseInt(xa(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},Ua=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter((function(e){return!Pn.isIncompatible(e)})),c=l.filter(Pn.isEnabled);c.length||(c=l.filter((function(e){return!Pn.isDisabled(e)})));var d=c.filter(Pn.hasAttribute.bind(null,"BANDWIDTH")),h=d.map((function(e){var t=u.getSyncPoint(e,r,o,i),l=t?1:2,c=Pn.estimateSegmentRequestTime(a,n,e),d=c*l-s;return{playlist:e,rebufferingImpact:d}})),p=h.filter((function(e){return e.rebufferingImpact<=0}));return Ia(p,(function(e,t){return La(t.playlist,e.playlist)})),p.length?p[0]:(Ia(h,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),h[0]||null)},Na=function(){var e=this,t=this.playlists.master.playlists.filter(Pn.isEnabled);Ia(t,(function(e,t){return La(e,t)}));var i=t.filter((function(t){return!!Ca(e.playlists.master,t).video}));return i[0]||null},ja=function(e){var t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((function(e){t.set(e,i),i+=e.byteLength}))),t},Ba=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},s=i,o=i,u=!1,l=a[n];l&&(s=l.label,o=l.language,u=l.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:u,label:s,language:o},!1).track}}},Fa=function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=de.a.WebKitDataCue||de.a.VTTCue;i.forEach((function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text))}))}},qa=function(e){Object.defineProperties(e.frame,{id:{get:function(){return ne.a.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ne.a.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ne.a.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},Ha=function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=de.a.WebKitDataCue||de.a.VTTCue,s=t.metadataTrack_;if(s&&(i.forEach((function(e){var t=e.cueTime+n;!("number"!==typeof t||de.a.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,qa(i),s.addCue(i)}))})),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l<o.length;l++)o[l]&&u.push(o[l]);var c=u.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),d=Object.keys(c).sort((function(e,t){return Number(e)-Number(t)}));d.forEach((function(e,t){var i=c[e],n=Number(d[t+1])||r;i.forEach((function(e){e.endTime=n}))}))}}},Va=function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},za=function(e,t,i){var n,r;if(i&&i.cues){n=i.cues.length;while(n--)r=i.cues[n],r.startTime>=e&&r.endTime<=t&&i.removeCue(r)}},Wa=function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){for(var n=[],r=0,a=0;a<t.length;a++)t[i].startTime===t[a].startTime&&t[i].endTime===t[a].endTime&&t[i].text===t[a].text&&(r++,r>1&&n.push(t[a]));n.length&&n.forEach((function(t){return e.removeCue(t)}))}},Ga=function(e,t,i){if("undefined"===typeof t||null===t||!e.length)return[];var n,r=Math.ceil((t-i+3)*Vi["ONE_SECOND_IN_TS"]);for(n=0;n<e.length;n++)if(e[n].pts>r)break;return e.slice(n)},Xa=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var n=t[0].pts,r=0;for(r;r<e.length;r++)if(e[r].pts>=n)break;return e.slice(0,r).concat(t)},Ya=function(e,t,i,n){var r=Math.ceil((t-n)*Vi["ONE_SECOND_IN_TS"]),a=Math.ceil((i-n)*Vi["ONE_SECOND_IN_TS"]),s=e.slice(),o=e.length;while(o--)if(e[o].pts<=a)break;if(-1===o)return s;var u=o+1;while(u--)if(e[u].pts<=r)break;return u=Math.max(u,0),s.splice(u,o-u+1),s},$a=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;r<i.length;r++){var a=i[r];if(a!==n[r])return!1;if(e[a]!==t[a])return!1}return!0},Ka=22,Qa=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(n.push(a),r+=s.duration,r>i))return a}return 0===n.length?0:n[n.length-1]},Ja=1,Za=500,es=function(e){return"number"===typeof e&&isFinite(e)},ts=1/60,is=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.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.":!t.hasVideo&&i.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:"Neither audio nor video found in segment.":null},ns=function(e,t,i){var n=t-Mr.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n)},rs=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"===typeof d,g=e.segment.uri?"segment":"pre-segment",y=m?dn({preloadSegment:n})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+y+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},as=function(e){return e+"TimingInfo"},ss=function(e){var t=e.segmentTimeline,i=e.currentTimeline,n=e.startOfSegment,r=e.buffered,a=e.overrideCheck;return a||t!==i?t<i?n:r.length?r.end(r.length-1):n:null},os=function(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(i===n)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==n}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==n}return!1},us=function(e,t){var i=e&&"number"===typeof e.start&&"number"===typeof e.end?e.end-e.start:0,n=t&&"number"===typeof t.start&&"number"===typeof t.end?t.end-t.start:0;return Math.max(i,n)},ls=function(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+Xi},cs=function(e,t){if("hls"!==t)return null;var i=us(e.audioTimingInfo,e.videoTimingInfo);if(!i)return null;var n=e.playlist.targetDuration,r=ls({segmentDuration:i,maxDuration:2*n}),a=ls({segmentDuration:i,maxDuration:n}),s="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+i+" when the reported duration is "+e.duration+" and the target duration is "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||a?{severity:r?"warn":"info",message:s}:null},ds=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!==typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.captionServices_=t.captionServices,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=ne.a.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",(function(){n.isEndOfStream_()||(n.ended_=!1)})),n.fetchAtBuffer_=!1,n.logger_=Gi("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(ae()(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",(function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",(function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()})),n}oe()(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return ta.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&de.a.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,de.a.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return"undefined"!==typeof e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&ta.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ne.a.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=lr(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=cr(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(de.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&ta.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function(){r--,0===r&&i()};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=Ya(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)za(e,t,this.inbandTextTracks_[s]);za(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&de.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=de.a.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&de.a.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=de.a.setTimeout(this.monitorBufferTick_.bind(this),Za)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"===typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"===typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},i.chooseNextRequest_=function(){var e=this.buffered_(),t=an(e)||0,i=sn(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=Qa(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"===typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=Pn.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}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"===typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"===typeof s.partIndex&&!f)return null;if("number"!==typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var y=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=i.segments[n],c="number"===typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:n,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h="undefined"!==typeof o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=an(this.sourceUpdater_.audioBuffered());return"number"===typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=Ga(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},i.timestampOffsetForSegment_=function(e){return ss(e)},i.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=Pn.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=tn(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=Ua({master:this.vhs_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a,u=o-s.rebufferingImpact,l=.5;a<=Xi&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||u<l||(this.bandwidth=s.playlist.attributes.BANDWIDTH*Mr.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},i.handleAbort_=function(e){this.logger_("Aborting "+rs(e)),this.mediaRequestsAborted+=1},i.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},i.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},$a(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_()))},i.handleTimingInfo_=function(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,a=as(t);r[a]=r[a]||{},r[a][i]=n,this.logger_("timinginfo: "+t+" - "+i+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},i.handleCaptions_=function(e,t){var i=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length){var n=this.pendingSegment_;if(n.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),a={};t.forEach((function(e){a[e.stream]=a[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r),t.endTime=Math.max(t.endTime,e.endTime+r),t.captions.push(e)})),Object.keys(a).forEach((function(e){var t=a[e],n=t.startTime,s=t.endTime,o=t.captions,u=i.inbandTextTracks_;i.logger_("adding cues from "+n+" -> "+s+" for "+e),Ba(u,i.vhs_.tech_,e),za(n,s,u[e]),Fa({captionArray:o,inbandTextTracks:u,timestampOffset:r})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t))}else this.logger_("SegmentLoader received no captions from a caption event")},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var n=this.pendingSegment_;if(n.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();Va(this.inbandTextTracks_,i,this.vhs_.tech_),Ha({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i))}},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!os({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&(!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!os({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[as(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!==typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=lr(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+nn(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+nn(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,d=o.length?o.end(o.length-1):0;if(l-u<=Ja&&d-c<=Ja)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+nn(s).join(", ")+", video buffer: "+nn(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var h=this.currentTime_(),p=h-Ja;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+p),this.remove(0,p,(function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+Ja+"s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=de.a.setTimeout((function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()}),1e3*Ja)}),!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(t.code!==Ka?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}))},i.appendToSourceBuffer_=function(e){var t=e.segmentInfo,i=e.type,n=e.initSegment,r=e.data,a=e.bytes;if(!a){var s=[r],o=r.byteLength;n&&(s.unshift(n),o+=n.byteLength),a=ja({bytes:o,segments:s})}this.sourceUpdater_.appendBuffer({segmentInfo:t,type:i,bytes:a},this.handleAppendError_.bind(this,{segmentInfo:t,type:i,bytes:a}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"===typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var i=ve()({},e,{forceTimestampOffset:!0});ve()(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},i.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}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&a;this.logger_("Requesting "+rs(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=_a({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,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:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,a=i.stream;t.logger_(rs(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=ns(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<ts?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+ts):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===na.ABORTED)return;return this.pause(),e.code===na.TIMEOUT?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=Xa(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},i.updateMediaSecondsLoaded_=function(e){"number"===typeof e.start&&"number"===typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if("undefined"!==typeof t)return t;if(!s)return u.start;var l=i.segments[n-1];return 0!==n&&l&&"undefined"!==typeof l.start&&l.end===r+a?o.start:r},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!==typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var t=is(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"===typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,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")}},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo,n=i&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"===typeof n.end?n.end:n.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=cs(e,this.sourceType_);if(t&&("warn"===t.severity?ne.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_("Appended "+rs(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+rs(e)),void this.resetEverything();var s=null!==this.mediaIndex;s&&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_()}else this.logger_("Throwing away un-appended sync request "+rs(e))},i.recordThroughput_=function(e){if(e.duration<ts)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+ts);else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(es(i)&&es(n)){za(i,n,this.segmentMetadataTrack_);var r=de.a.WebKitDataCue||de.a.VTTCue,a={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:i,end:n},s=JSON.stringify(a),o=new r(i,n,s);o.value=a,this.segmentMetadataTrack_.addCue(o)}}},t}(ne.a.EventTarget);function hs(){}var ps,fs=function(e){return"string"!==typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},ms=["video","audio"],gs=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},ys=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null},vs=function e(t,i){if(0!==i.queue.length){var n=0,r=i.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==t&&i.ready()&&"closed"!==i.mediaSource.readyState&&!gs(t,i)){if(r.type!==t){if(n=ys(t,i.queue),null===n)return;r=i.queue[n]}return i.queue.splice(n,1),i.queuePending[t]=r,r.action(t,i),r.doneFn?void 0:(i.queuePending[t]=null,void e(t,i))}}else i.updating()||"closed"===i.mediaSource.readyState||(i.queue.shift(),r.action(i),r.doneFn&&r.doneFn(),e("audio",i),e("video",i))}},_s=function(e,t){var i=t[e+"Buffer"],n=fs(e);i&&(i.removeEventListener("updateend",t["on"+n+"UpdateEnd_"]),i.removeEventListener("error",t["on"+n+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},bs=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Ts={appendBuffer:function(e,t,i){return function(n,r){var a=r[n+"Buffer"];if(bs(r.mediaSource,a)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+n+"Buffer");try{a.appendBuffer(e)}catch(s){r.logger_("Error with code "+s.code+" "+(s.code===Ka?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+n+"Buffer"),r.queuePending[n]=null,i(s)}}}},remove:function(e,t){return function(i,n){var r=n[i+"Buffer"];if(bs(n.mediaSource,r)){n.logger_("Removing "+e+" to "+t+" from "+i+"Buffer");try{r.remove(e,t)}catch(a){n.logger_("Remove "+e+" to "+t+" from "+i+"Buffer failed")}}}},timestampOffset:function(e){return function(t,i){var n=i[t+"Buffer"];bs(i.mediaSource,n)&&(i.logger_("Setting "+t+"timestampOffset to "+e),n.timestampOffset=e)}},callback:function(e){return function(t,i){e()}},endOfStream:function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(i){ne.a.log.warn("Failed to call media source endOfStream",i)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){ne.a.log.warn("Failed to set media source duration",i)}}},abort:function(){return function(e,t){if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(bs(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(n){ne.a.log.warn("Failed to abort on "+e+"Buffer",n)}}}}},addSourceBuffer:function(e,t){return function(i){var n=fs(e),r=Be(t);i.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=i.mediaSource.addSourceBuffer(r);a.addEventListener("updateend",i["on"+n+"UpdateEnd_"]),a.addEventListener("error",i["on"+n+"Error_"]),i.codecs[e]=t,i[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var i=t[e+"Buffer"];if(_s(e,t),bs(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(n){ne.a.log.warn("Failed to removeSourceBuffer "+e+"Buffer",n)}}}},changeType:function(e){return function(t,i){var n=i[t+"Buffer"],r=Be(e);bs(i.mediaSource,n)&&i.codecs[t]!==e&&(i.logger_("changing "+t+"Buffer codec from "+i.codecs[t]+" to "+e),n.changeType(r),i.codecs[t]=e)}}},Ss=function(e){var t=e.type,i=e.sourceUpdater,n=e.action,r=e.doneFn,a=e.name;i.queue.push({type:t,action:n,doneFn:r,name:a}),vs(t,i)},ws=function(e,t){return function(i){if(t.queuePending[e]){var n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[e+"Error_"])}vs(e,t)}},Es=function(e){function t(t){var i;return i=e.call(this)||this,i.mediaSource=t,i.sourceopenListener_=function(){return vs("mediaSource",ae()(i))},i.mediaSource.addEventListener("sourceopen",i.sourceopenListener_),i.logger_=Gi("SourceUpdater"),i.audioTimestampOffset_=0,i.videoTimestampOffset_=0,i.queue=[],i.queuePending={audio:null,video:null},i.delayedAudioAppendQueue_=[],i.videoAppendQueued_=!1,i.codecs={},i.onVideoUpdateEnd_=ws("video",ae()(i)),i.onAudioUpdateEnd_=ws("audio",ae()(i)),i.onVideoError_=function(e){i.videoError_=e},i.onAudioError_=function(e){i.audioError_=e},i.createdSourceBuffers_=!1,i.initializedEme_=!1,i.triggeredReady_=!1,i}oe()(t,e);var i=t.prototype;return i.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},i.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},i.hasInitializedAnyEme=function(){return this.initializedEme_},i.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},i.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},i.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},i.addSourceBuffer=function(e,t){Ss({type:"mediaSource",sourceUpdater:this,action:Ts.addSourceBuffer(e,t),name:"addSourceBuffer"})},i.abort=function(e){Ss({type:e,sourceUpdater:this,action:Ts.abort(e),name:"abort"})},i.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?Ss({type:"mediaSource",sourceUpdater:this,action:Ts.removeSourceBuffer(e),name:"removeSourceBuffer"}):ne.a.log.error("removeSourceBuffer is not supported!")},i.canRemoveSourceBuffer=function(){return!ne.a.browser.IE_VERSION&&!ne.a.browser.IS_FIREFOX&&de.a.MediaSource&&de.a.MediaSource.prototype&&"function"===typeof de.a.MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return de.a.SourceBuffer&&de.a.SourceBuffer.prototype&&"function"===typeof de.a.SourceBuffer.prototype.changeType},i.canChangeType=function(){return this.constructor.canChangeType()},i.changeType=function(e,t){this.canChangeType()?Ss({type:e,sourceUpdater:this,action:Ts.changeType(t),name:"changeType"}):ne.a.log.error("changeType is not supported!")},i.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!==typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(i){var n=e[i];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(i,n);t.canChangeType()&&t.changeType(i,n)}))},i.appendBuffer=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");var s=t;if(Ss({type:r,sourceUpdater:this,action:Ts.appendBuffer(a,n||{mediaIndex:-1},s),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var o=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+o.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,o.forEach((function(e){i.appendBuffer.apply(i,e)}))}},i.audioBuffered=function(){return bs(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ne.a.createTimeRange()},i.videoBuffered=function(){return bs(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ne.a.createTimeRange()},i.buffered=function(){var e=bs(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=bs(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():Zi(this.audioBuffered(),this.videoBuffered())},i.setDuration=function(e,t){void 0===t&&(t=hs),Ss({type:"mediaSource",sourceUpdater:this,action:Ts.duration(e),name:"duration",doneFn:t})},i.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=hs),"string"!==typeof e&&(e=void 0),Ss({type:"mediaSource",sourceUpdater:this,action:Ts.endOfStream(e),name:"endOfStream",doneFn:t})},i.removeAudio=function(e,t,i){void 0===i&&(i=hs),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Ss({type:"audio",sourceUpdater:this,action:Ts.remove(e,t),doneFn:i,name:"remove"}):i()},i.removeVideo=function(e,t,i){void 0===i&&(i=hs),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Ss({type:"video",sourceUpdater:this,action:Ts.remove(e,t),doneFn:i,name:"remove"}):i()},i.updating=function(){return!(!gs("audio",this)&&!gs("video",this))},i.audioTimestampOffset=function(e){return"undefined"!==typeof e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Ss({type:"audio",sourceUpdater:this,action:Ts.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},i.videoTimestampOffset=function(e){return"undefined"!==typeof e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Ss({type:"video",sourceUpdater:this,action:Ts.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},i.audioQueueCallback=function(e){this.audioBuffer&&Ss({type:"audio",sourceUpdater:this,action:Ts.callback(e),name:"callback"})},i.videoQueueCallback=function(e){this.videoBuffer&&Ss({type:"video",sourceUpdater:this,action:Ts.callback(e),name:"callback"})},i.dispose=function(){var e=this;this.trigger("dispose"),ms.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return _s(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(ne.a.EventTarget),ks=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Cs=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),Os=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,n.mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=t.featuresNativeTextTracks,n.shouldSaveSegmentTimingInfo_=!1,n}oe()(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return null},i.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ne.a.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return ne.a.createTimeRanges([[t,i]])},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=lr(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=Cs.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(Cs,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return n||e},i.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.track=function(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},i.remove=function(e,t){za(e,t,this.subtitlesTrack_)},i.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var i=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",i),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}},i.timestampOffsetForSegment_=function(){return null},i.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},i.skipEmptySegments_=function(e){while(e&&e.segment.empty){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===na.TIMEOUT&&this.handleTimeout_(),e.code===na.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!==typeof de.a.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})};return s=function(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(u){return void this.stopForError({message:u.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach((function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new de.a.VTTCue(e.startTime,e.endTime,e.text):e)})),Wa(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"===typeof de.a.TextDecoder?t=new de.a.TextDecoder("utf8"):(t=de.a.WebVTT.StringDecoder(),i=!0);var n=new de.a.WebVTT.Parser(de.a,de.a.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){ne.a.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=ks(r)),n.parse(r)}var a=e.bytes;i&&(a=ks(a)),n.parse(a),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/Vi["ONE_SECOND_IN_TS"]-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0},t}(ds),As=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},xs=function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a<e.segments.length;a++){var s=e.segments[a];if(n||(n=As(t,r+s.duration/2)),n){if("cueIn"in s){n.endTime=r,n.adEndTime=r,r+=s.duration,n=null;continue}if(r<n.endTime){r+=s.duration;continue}n.endTime+=s.duration}else if("cueOut"in s&&(n=new de.a.VTTCue(r,r+s.duration,s.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(s.cueOut),t.addCue(n)),"cueOutCont"in s){var o=s.cueOutCont.split("/").map(parseFloat),u=o[0],l=o[1];n=new de.a.VTTCue(r,r+s.duration,""),n.adStartTime=r-u,n.adEndTime=n.adStartTime+l,t.addCue(n)}r+=s.duration}},Is=86400,Ls=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=ln(t);r=r||0;for(var u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=e.timelineToDatetimeMappings[d.timeline];if(h&&d.dateTimeObject){var p=d.dateTimeObject.getTime()/1e3,f=p+h;if(d.parts&&"number"===typeof c.partIndex)for(var m=0;m<c.partIndex;m++)f+=d.parts[m].duration;var g=Math.abs(r-f);if(null!==s&&(0===g||s<g))break;s=g,a={time:f,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}}return a}},{name:"Segment",run:function(e,t,i,n,r){var a=null,s=null;r=r||0;for(var o=ln(t),u=0;u<o.length;u++){var l=t.endList||0===r?u:o.length-(u+1),c=o[l],d=c.segment,h=c.part&&c.part.start||d&&d.start;if(d.timeline===n&&"undefined"!==typeof h){var p=Math.abs(r-h);if(null!==s&&s<p)break;(!a||null===s||s>=p)&&(s=p,a={time:h,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],Ps=function(e){function t(t){var i;return i=e.call(this)||this,i.timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=Gi("SyncController"),i}oe()(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+yn({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a<Ls.length;a++){var s=Ls[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}))}return r},i.selectSyncPoint_=function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+("number"===typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i},i.saveExpiredSegmentInfo=function(e,t){var i=t.mediaSequence-e.mediaSequence;if(i>Is)ne.a.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");else for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&"undefined"!==typeof r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"===typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||n<a.start)&&(a.start=n),a.end=r,!0},i.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-yn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+yn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(ne.a.EventTarget),Ds=function(e){function t(){var t;return t=e.call(this)||this,t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}oe()(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"===typeof i&&"number"===typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(ne.a.EventTarget),Rs=Fr(qr((function(){function e(e,i,n){return n={path:i,exports:{},require:function(e,i){return t(e,void 0===i||null===i?n.path:i)}},e(n,n.exports),n.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e((function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}e.exports=i,e.exports["default"]=e.exports,e.exports.__esModule=!0})),n=e((function(e){function t(i,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports["default"]=e.exports,e.exports.__esModule=!0,t(i,n)}e.exports=t,e.exports["default"]=e.exports,e.exports.__esModule=!0})),r=e((function(e){function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}e.exports=t,e.exports["default"]=e.exports,e.exports.__esModule=!0})),a=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();
- /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
- function s(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}
- /*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */var o=function(){var e,t,i,n,r,a,s,o,u,l=[[[],[],[],[],[]],[[],[],[],[],[]]],c=l[0],d=l[1],h=c[4],p=d[4],f=[],m=[];for(e=0;e<256;e++)m[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=m[i]||1)for(s=i^i<<1^i<<2^i<<3^i<<4,s=s>>8^255&s^99,h[t]=s,p[s]=t,a=f[r=f[n=f[t]]],u=16843009*a^65537*r^257*n^16843008*t,o=257*f[s]^16843008*s,e=0;e<4;e++)c[e][t]=o=o<<24^o>>>8,d[e][s]=u=u<<24^u>>>8;for(e=0;e<5;e++)c[e]=c[e].slice(0),d[e]=d[e].slice(0);return l},u=null,l=function(){function e(e){var t,i,n;u||(u=o()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var r=this._tables[0][4],a=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var c=e.slice(0),d=[];for(this._key=[c,d],t=s;t<4*s+28;t++)n=c[t-1],(t%s===0||8===s&&t%s===4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s===0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[t]=c[t-s]^n;for(i=0;t;i++,t--)n=c[3&i?t:t-4],d[i]=t<=4||i<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}var t=e.prototype;return t.decrypt=function(e,t,i,n,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=n^c[1],p=i^c[2],f=t^c[3],m=c.length/4-2,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(l=0;l<m;l++)s=v[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=v[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=v[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=v[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[d>>>24]<<24^S[h>>16&255]<<16^S[p>>8&255]<<8^S[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),c=function(e){function t(){var t;return t=e.call(this,a)||this,t.jobs=[],t.delay=1,t.timeout_=null,t}r(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(a),d=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},h=function(e,t,i){var n,r,a,s,o,u,c,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new l(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),y=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],s=i[3],p=0;p<f.length;p+=4)o=d(f[p]),u=d(f[p+1]),c=d(f[p+2]),h=d(f[p+3]),m.decrypt(o,u,c,h,y,p),y[p]=d(y[p]^n),y[p+1]=d(y[p+1]^r),y[p+2]=d(y[p+2]^a),y[p+3]=d(y[p+3]^s),n=o,r=u,a=c,s=h;return g},p=function(){function e(t,i,n,r){var a=e.STEP,o=new Int32Array(t.buffer),u=new Uint8Array(t.byteLength),l=0;for(this.asyncStream_=new c,this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+a),i,n,u)),l=a;l<o.length;l+=a)n=new Uint32Array([d(o[l-4]),d(o[l-3]),d(o[l-2]),d(o[l-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(l,l+a),i,n,u));this.asyncStream_.push((function(){r(null,s(u))}))}var t=e.prototype;return t.decryptChunk_=function(e,t,i,n){return function(){var r=h(e,t,i);n.set(r,e.byteOffset)}},i(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),f=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t};self.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new p(i,n,r,(function(e,i){self.postMessage(f({source:t.source,decrypted:i}),[i.buffer])}))}}))),Ms=Br(Rs),Us=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Ns=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},js=function(e,t){t.activePlaylistLoader=e,e.load()},Bs=function(e,t){return function(){var i=t.segmentLoaders,n=i[e],r=i.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;o&&l&&o.id===l.id||(a.lastGroup_=o,a.lastTrack_=s,Ns(n,a),o&&!o.isMasterPlaylist&&(o.playlistLoader?(n.resyncLoader(),js(o.playlistLoader,a)):u&&r.resetEverything()))}},Fs=function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];n.lastGroup_=null,i.abort(),i.pause()}},qs=function(e,t){return function(){var i=t.masterPlaylistLoader,n=t.segmentLoaders,r=n[e],a=n.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,Ns(r,s),u)){if(u.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),i.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}l!==u.playlistLoader?(r.track&&r.track(o),r.resetEverything(),js(u.playlistLoader,s)):js(u.playlistLoader,s)}}},Hs={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Ns(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in ne.a.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];ne.a.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Ns(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Vs={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Hs[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Hs[e](e,i))}},zs={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=Ln(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Jn(m.playlists[0],i,a):m.resolvedUri?new Jn(m.resolvedUri,i,a):m.playlists&&"dash"===n?new Rr(m.playlists[0],i,a,d):null,m=ne.a.mergeOptions({id:f,playlistLoader:g},m),Vs[e](e,m.playlistLoader,t),u[p].push(m),"undefined"===typeof l[f]){var y=new ne.a.AudioTrack({id:f,kind:Us(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=y}}r.on("error",Hs[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new Jn(f.resolvedUri,n,s);else if("dash"===r){var g=f.playlists.filter((function(e){return e.excludeUntil!==1/0}));if(!g.length)return;m=new Rr(f.playlists[0],n,s,d)}else"vhs-json"===r&&(m=new Jn(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=ne.a.mergeOptions({id:p,playlistLoader:m},f),Vs[e](e,f.playlistLoader,t),l[h].push(f),"undefined"===typeof c[p]){var y=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=y}}a.on("error",Hs[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=ne.a.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(ne.a.mergeOptions({id:u},l)),"undefined"===typeof s[u]){var h=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}},Ws=function e(t,i){for(var n=0;n<t.length;n++){if(xn(i,t[n]))return!0;if(t[n].playlists&&e(t[n].playlists,i))return!0}return!1},Gs=function(e,t){return function(i){var n=t.masterPlaylistLoader,r=t.mediaTypes[e].groups,a=n.media();if(!a)return null;var s=null;a.attributes[e]&&(s=r[a.attributes[e]]);var o=Object.keys(r);if(!s)if("AUDIO"===e&&o.length>1&&Ln(t.master))for(var u=0;u<o.length;u++){var l=r[o[u]];if(Ws(l,a)){s=l;break}}else r.main?s=r.main:1===o.length&&(s=r[o[0]]);return"undefined"===typeof i?s:null!==i&&s&&s.filter((function(e){return e.id===i.id}))[0]||null}},Xs={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if(i[n].enabled)return i[n];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var n in i)if("showing"===i[n].mode||"hidden"===i[n].mode)return i[n];return null}}},Ys=function(e,t){var i=t.mediaTypes;return function(){var t=i[e].activeTrack();return t?i[e].activeGroup(t):null}},$s=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){zs[t](t,e)}));var t=e.mediaTypes,i=e.masterPlaylistLoader,n=e.tech,r=e.vhs,a=e.segmentLoaders,s=a["AUDIO"],o=a.main;["AUDIO","SUBTITLES"].forEach((function(i){t[i].activeGroup=Gs(i,e),t[i].activeTrack=Xs[i](i,e),t[i].onGroupChanged=Bs(i,e),t[i].onGroupChanging=Fs(i,e),t[i].onTrackChanged=qs(i,e),t[i].getActiveGroup=Ys(i,e)}));var u=t.AUDIO.activeGroup();if(u){var l=(u.filter((function(e){return e.default}))[0]||u[0]).id;t.AUDIO.tracks[l].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var c=t.AUDIO.getActiveGroup();c.playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}i.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),i.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var d=function(){t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"}),n.trigger({type:"usage",name:"hls-audio-change"})};for(var h in n.audioTracks().addEventListener("change",d),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",(function(){n.audioTracks().removeEventListener("change",d),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio"),t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[h])},Ks=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:hs,activeTrack:hs,getActiveGroup:hs,onGroupChanged:hs,onTrackChanged:hs,lastTrack_:null,logger_:Gi("MediaGroups["+t+"]")}})),e},Qs=120,Js=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Zs=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},eo=function(e){var t=e.currentPlaylist,i=e.buffered,n=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return ne.a.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(Ki(i,n).length);if(!t.endList)return d||"number"!==typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=sn(i,n),p=u?Mr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Mr.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return l(c+" as duration < max low water line ("+o+" < "+p+")"),!0;var f=r.attributes.BANDWIDTH,m=t.attributes.BANDWIDTH;if(f<m&&(!u||h<s)){var g=c+" as next bandwidth < current bandwidth ("+f+" < "+m+")";return u&&(g+=" and forwardBuffer < bufferHighWaterLine ("+h+" < "+s+")"),l(g),!0}if((!u||f>m)&&h>=a){var y=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(y+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),l(y),!0}return l("not "+c+" as no switching criteria met"),!1},to=function(e){function t(t){var i;i=e.call(this)||this;var n=t.src,r=t.handleManifestRedirects,a=t.withCredentials,s=t.tech,o=t.bandwidth,u=t.externVhs,l=t.useCueTags,c=t.blacklistDuration,d=t.enableLowInitialPlaylist,h=t.sourceType,p=t.cacheEncryptionKeys,f=t.experimentalBufferBasedABR,m=t.experimentalLeastPixelDiffSelector,g=t.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var y=t.maxPlaylistRetries;null!==y&&"undefined"!==typeof y||(y=1/0),ps=u,i.experimentalBufferBasedABR=Boolean(f),i.experimentalLeastPixelDiffSelector=Boolean(m),i.withCredentials=a,i.tech_=s,i.vhs_=s.vhs,i.sourceType_=h,i.useCueTags_=l,i.blacklistDuration=c,i.maxPlaylistRetries=y,i.enableLowInitialPlaylist=d,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:a,handleManifestRedirects:r,maxPlaylistRetries:y,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=Ks(),i.mediaSource=new de.a.MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind(ae()(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind(ae()(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind(ae()(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=ne.a.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new Ps(t),i.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new Ms,i.sourceUpdater_=new Es(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new Ds;var v={vhs:i.vhs_,parse708captions:t.parse708captions,captionServices:g,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:o,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};i.masterPlaylistLoader_="dash"===i.sourceType_?new Rr(n,i.vhs_,i.requestOptions_):new Jn(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new ds(ne.a.mergeOptions(v,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new ds(ne.a.mergeOptions(v,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new Os(ne.a.mergeOptions(v,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",(function(){return i.startABRTimer_()})),i.tech_.on("pause",(function(){return i.stopABRTimer_()})),i.tech_.on("play",(function(){return i.startABRTimer_()}))),Js.forEach((function(e){i[e+"_"]=Zs.bind(ae()(i),e)})),i.logger_=Gi("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1;var _="none"===i.tech_.preload()?"play":"loadstart";return i.tech_.one(_,(function(){var e=Date.now();i.tech_.one("loadeddata",(function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends}))})),i}oe()(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),a=e.id||e.uri;r&&r!==a&&(this.logger_("switch media "+r+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=de.a.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(de.a.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u&&o.push(d)}}return o.length?o:t},i.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*t.targetDuration*1e3;An(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),$s({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){var i;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),!i||!e.shouldSwitchToMedia_(i))return;e.initialMedia_=i,e.switchMedia_(e.initialMedia_,"initial");var n="vhs-json"===e.sourceType_&&e.initialMedia_.segments;if(!n)return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)})),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(),i=1.5*t.targetDuration*1e3;An(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,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("playlist-unchanged"!==t.lastExcludeReason_){var i=e.stuckAtPlaylistEnd_(t);i&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},i.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},i.triggerPresenceUsage_=function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){var o=i.AUDIO[a][s];o.uri||(n=!1)}n&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(i.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),ps.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine(),a=this.tech_.buffered();return eo({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},Qs))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};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()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){ne.a.browser.IE_VERSION||ne.a.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},i.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(ne.a.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(i.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(i.end(0))}return this.hasPlayed_=!0,this.load(),!0},i.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")},i.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}}},i.handleDurationChange_=function(){this.tech_.trigger("durationchange")},i.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},i.stuckAtPlaylistEnd_=function(e){var t=this.seekable();if(!t.length)return!1;var i=this.syncController_.getExpiredTime(e,this.duration());if(null===i)return!1;var n=ps.Playlist.playlistEnd(e,i),r=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return n-r<=Yi;var s=a.end(a.length-1);return s-r<=Yi&&n-s<=Yi},i.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var i=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!i)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));i.playlistErrors_++;var n,r=this.masterPlaylistLoader_.master.playlists,a=r.filter(wn),s=1===a.length&&a[0]===i;if(1===r.length&&t!==1/0)return ne.a.log.warn("Problem encountered with playlist "+i.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s);if(s){var o=!1;r.forEach((function(e){if(e!==i){var t=e.excludeUntil;"undefined"!==typeof t&&t!==1/0&&(o=!0,delete e.excludeUntil)}})),o&&(ne.a.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}n=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.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 u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:ne.a.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"===typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||h)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"===typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Ki(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?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()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ps.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_&&!this.sourceUpdater_.hasCreatedSourceBuffers()){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=ps.Playlist.seekable(t,i,ps.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=ps.Playlist.seekable(t,i,ps.Playlist.liveEdgeDelay(n,t)),0===e.length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=ne.a.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)<r.end(0)?e.end(0):r.end(0)]]):this.seekable_=r,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+en(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},i.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);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))}else{var i=this.tech_.buffered(),n=ps.Playlist.duration(this.masterPlaylistLoader_.media());i.length>0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Ca(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||Ve),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||He)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||He,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s=function(e,t){return e?Fe(t):qe(t)},o={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&!s(t[e].isFmp4,n[e])){var i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[],o[i].push(n[e]),"audio"===e&&(a=i)}})),r&&a&&this.media().attributes.AUDIO){var u=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){var i=t.attributes&&t.attributes.AUDIO;i===u&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+u+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach((function(t){var i=(Me(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(Me(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&l.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),l.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+l.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var c=Object.keys(o).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+o[t].join(",")+'"',e}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:c,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!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)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Ca(e.master,r),s=[];!a.audio||qe(a.audio)||Fe(a.audio)||s.push("audio codec "+a.audio),!a.video||qe(a.video)||Fe(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Ea(Me(e)),a=ka(r),s=r.video&&Me(r.video)[0]||null,o=r.audio&&Me(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Ca(t.masterPlaylistLoader_.master,r),c=ka(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&Me(l.video)[0]||null,h=l.audio&&Me(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),xs(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=Mr.GOAL_BUFFER_LENGTH,i=Mr.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Mr.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=Mr.BUFFER_LOW_WATER_LINE,i=Mr.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Mr.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Mr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return Mr.BUFFER_HIGH_WATER_LINE},t}(ne.a.EventTarget),io=function(e,t,i){return function(n){var r=e.master.playlists[t],a=Sn(r),s=wn(r);return"undefined"===typeof n?s:(n?delete r.disabled:r.disabled=!0,n===s||a||(i(),n?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),n)}},no=function(e,t,i){var n=e.masterPlaylistController_,r=e.options_.smoothQualityChange,a=r?"smooth":"fast",s=n[a+"QualityChange_"].bind(n);if(t.attributes){var o=t.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=Ca(n.master(),t),this.playlist=t,this.id=i,this.enabled=io(e.playlists,t.id,s)},ro=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=Ln(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!Sn(e)})).map((function(t,i){return new no(e,t,t.id)})):[]}},ao=["seeking","seeked","pause","playing","error"],so=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Gi("PlaybackWatcher"),this.logger_("initialize");var i=function(){return t.monitorCurrentTime_()},n=function(){return t.monitorCurrentTime_()},r=function(){return t.techWaiting_()},a=function(){return t.cancelTimer_()},s=this.masterPlaylistController_,o=["main","subtitle","audio"],u={};o.forEach((function(e){u[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",u[e].reset),t.tech_.on(["seeked","seeking"],u[e].reset)}));var l=function(e){["main","audio"].forEach((function(i){s[i+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=function(){return l("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(ao,a),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",r),t.tech_.off(ao,a),t.tech_.off("canplay",n),t.tech_.off("play",i),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),o.forEach((function(e){s[e+"SegmentLoader_"].off("appendsdone",u[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",u[e].reset),t.tech_.off(["seeked","seeking"],u[e].reset)})),t.checkCurrentTimeTimeout_&&de.a.clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&de.a.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=de.a.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=rn(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:nn(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Yi>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){var e=this.tech_.seeking();if(!e)return!1;var t,i=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);if(r){var a=i.end(i.length-1);t=a}if(this.beforeSeekableWindow_(i,n)){var s=i.start(0);t=s+(s===i.end(0)?0:Yi)}if("undefined"!==typeof t)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+en(i)+". Seeking to "+t+"."),this.tech_.setCurrentTime(t),!0;for(var o=this.masterPlaylistController_.sourceUpdater_,u=this.tech_.buffered(),l=o.audioBuffer?o.audioBuffered():null,c=o.videoBuffer?o.videoBuffered():null,d=this.media(),h=d.partTargetDuration?d.partTargetDuration:2*(d.targetDuration-Xi),p=[l,c],f=0;f<p.length;f++)if(p[f]){var m=sn(p[f],n);if(m<h)return!1}var g=Qi(u,n);return 0!==g.length&&(t=g.start(0)+Yi,this.logger_("Buffered region starts ("+g.start(0)+") just beyond seek point ("+n+"). Seeking to "+t+"."),this.tech_.setCurrentTime(t),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ki(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered(),a=this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t});if(a)return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var s=Qi(r,t);if(s.length>0){var o=s.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+o+", seeking to "+s.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*o,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+Yi,a=!i.endList;return a&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,i=e.audioBuffered,n=e.currentTime;if(t){var r;if(t.length&&i.length){var a=Ki(t,n-3),s=Ki(t,n),o=Ki(i,n);o.length&&!s.length&&a.length&&(r={start:a.end(0),end:o.end(0)})}else{var u=Qi(t,n);u.length||(r=this.gapFromVideoUnderflow_(t,n))}return!!r&&(this.logger_("Encountered a gap in video from "+r.start+" to "+r.end+". Seeking to current time "+n),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=Qi(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Xi),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var i=Ji(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:a}}return null},e}(),oo={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},uo=function e(t,i){var n=0,r=0,a=ne.a.mergeOptions(oo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!==e&&void 0!==e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"===typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void ne.a.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)},c=function(i){l(),e(t,i)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=c},lo=function(e){uo(this,e)},co="2.12.0",ho="5.14.1",po="0.19.2",fo="4.7.0",mo="3.1.2",go={PlaylistLoader:Jn,Playlist:Pn,utils:fr,STANDARD_PLAYLIST_SELECTOR:Ra,INITIAL_PLAYLIST_SELECTOR:Na,lastBandwidthSelector:Ra,movingAverageBandwidthSelector:Ma,comparePlaylistBandwidth:La,comparePlaylistResolution:Pa,xhr:ir()};Object.keys(Mr).forEach((function(e){Object.defineProperty(go,e,{get:function(){return ne.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),Mr[e]},set:function(t){ne.a.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!==typeof t||t<0?ne.a.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):Mr[e]=t}})}));var yo="videojs-vhs",vo=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},_o=function(e,t){t.representations().forEach((function(t){e.addQualityLevel(t)})),vo(e,t.playlists)};go.canPlaySource=function(){return ne.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var bo=function(e,t,i){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=Ea(Me(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r=Be(n.video),a=Be(n.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"===typeof e[o]&&(s[o].url=e[o]);return ne.a.mergeOptions(e,s)},To=function(e,t){return e.reduce((function(e,i){if(!i.contentProtection)return e;var n=t.reduce((function(e,t){var n=i.contentProtection[t];return n&&n.pssh&&(e[t]={pssh:n.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])},So=function(e){var t=e.player,i=e.sourceKeySystems,n=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=n?r.concat([n]):r,s=To(a,Object.keys(i)),o=[],u=[];return s.forEach((function(e){u.push(new Promise((function(e,i){t.tech_.one("keysessioncreated",e)}))),o.push(new Promise((function(i,n){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?n(e):i()}))})))})),Promise.race([Promise.all(o),Promise.race(u)])},wo=function(e){var t=e.player,i=e.sourceKeySystems,n=e.media,r=e.audioMedia,a=bo(i,n,r);return!!a&&(t.currentSource().keySystems=a,!(a&&!t.eme)||(ne.a.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Eo=function(){if(!de.a.localStorage)return null;var e=de.a.localStorage.getItem(yo);if(!e)return null;try{return JSON.parse(e)}catch(t){return null}},ko=function(e){if(!de.a.localStorage)return!1;var t=Eo();t=t?ne.a.mergeOptions(t,e):e;try{de.a.localStorage.setItem(yo,JSON.stringify(t))}catch(i){return!1}return t},Co=function(e){return 0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e};go.supportsNativeHls=function(){if(!le.a||!le.a.createElement)return!1;var e=le.a.createElement("video");if(!ne.a.getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),go.supportsNativeDash=function(){return!!(le.a&&le.a.createElement&&ne.a.getTech("Html5").isSupported())&&/maybe|probably/i.test(le.a.createElement("video").canPlayType("application/dash+xml"))}(),go.supportsTypeNatively=function(e){return"hls"===e?go.supportsNativeHls:"dash"===e&&go.supportsNativeDash},go.isSupported=function(){return ne.a.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Oo=ne.a.getComponent("Component"),Ao=function(e){function t(t,i,n){var r;if(r=e.call(this,i,ne.a.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&ne.a.log.warn("Using hls options is deprecated. Use vhs instead."),"number"===typeof n.initialBandwidth&&(r.options_.bandwidth=n.initialBandwidth),r.logger_=Gi("VhsHandler"),i.options_&&i.options_.playerId){var a=ne()(i.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return ne.a.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"hls-player-access"}),ae()(r)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return ne.a.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"vhs-player-access"}),ae()(r)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return ne.a.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),ae()(r)},configurable:!0}),r.player_=a}if(r.tech_=i,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(le.a,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=le.a.fullscreenElement||le.a.webkitFullscreenElement||le.a.mozFullScreenElement||le.a.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()})),r.on(r.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),r.on(r.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),r.on(r.tech_,"play",r.play),r}oe()(t,e);var i=t.prototype;return i.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!==typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Eo();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"}))}"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=Mr.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Mr.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach((function(t){"undefined"!==typeof e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},i.src=function(e,t){var i=this;if(e){this.setOptions_(),this.options_.src=Co(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=go,this.options_.sourceType=Ge(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&ne.a.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new to(this.options_);var n=ne.a.mergeOptions({liveRangeSafeTimeDelta:Yi},this.options_,{seekable:function(){return i.seekable()},media:function(){return i.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new so(n),this.masterPlaylistController_.on("error",(function(){var e=ne.a.players[i.tech_.options_.playerId],t=i.masterPlaylistController_.error;"object"!==typeof t||t.code?"string"===typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var r=this.options_.experimentalBufferBasedABR?go.movingAverageBandwidthSelector(.55):go.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.masterPlaylistController_.selectInitialPlaylist=go.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(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=de.a.navigator.connection||de.a.navigator.mozConnection||de.a.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){var n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);e=this.throughput>0?1/this.throughput:0;var i=Math.floor(1/(t+e));return i},set:function(){ne.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 i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return nn(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return nn(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&ko({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){ro(i)})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.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_=de.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=wo({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==ne.a.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),So({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(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=ne.a.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){_o(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){vo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":co,"mux.js":ho,"mpd-parser":po,"m3u8-parser":fo,"aes-decrypter":mo}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return Es.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&de.a.URL.revokeObjectURL&&(de.a.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Sr({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),wr({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Oo),xo={name:"videojs-http-streaming",VERSION:co,canHandleSource:function(e,t){void 0===t&&(t={});var i=ne.a.mergeOptions(ne.a.options,t);return xo.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=ne.a.mergeOptions(ne.a.options,i);return t.vhs=new Ao(e,t,n),ne.a.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ne.a.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=ir(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=ne.a.mergeOptions(ne.a.options,t),n=i.vhs.overrideNative,r=void 0===n?!ne.a.browser.IS_ANY_SAFARI:n,a=Ge(e),s=a&&(!go.supportsTypeNatively(a)||r);return s?"maybe":""}},Io=function(){return Fe("avc1.4d400d,mp4a.40.2")};if(Io()&&ne.a.getTech("Html5").registerSourceHandler(xo,0),ne.a.VhsHandler=Ao,Object.defineProperty(ne.a,"HlsHandler",{get:function(){return ne.a.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ao},configurable:!0}),ne.a.VhsSourceHandler=xo,Object.defineProperty(ne.a,"HlsSourceHandler",{get:function(){return ne.a.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),xo},configurable:!0}),ne.a.Vhs=go,Object.defineProperty(ne.a,"Hls",{get:function(){return ne.a.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),go},configurable:!0}),ne.a.use||(ne.a.registerComponent("Hls",go),ne.a.registerComponent("Vhs",go)),ne.a.options.vhs=ne.a.options.vhs||{},ne.a.options.hls=ne.a.options.hls||{},!ne.a.getPlugin||!ne.a.getPlugin("reloadSourceOnError")){var Lo=ne.a.registerPlugin||ne.a.plugin;Lo("reloadSourceOnError",lo)}var Po={data:function(){return{cell1:{height:".25rem"},height1:{height:"0.2rem"},height2:{height:"0.25rem"},disabled:!0,ajxqnr:{},ajxq2nr:{},ajxq:!1,ajxq2:!1,video:{videoId:void 0,videoUrl:void 0},checkList:[],tableData:[],headerData:[{prop:"type",name:"警情类别"},{prop:"lasj",name:"立案时间"},{prop:"ajdj",name:"警情等级"},{prop:"afdz",name:"案发地址"},{prop:"cdcl",name:"调动车辆"},{prop:"bcxx",name:"原因"},{prop:"czdx",name:"处置对象"},{prop:"zhongdui",name:"所属中队"},{prop:"sp",name:""}],tableData2:[],headerData2:[{prop:"type",name:"警情类别"},{prop:"lasj",name:"立案时间"},{prop:"ajdj",name:"警情等级"},{prop:"afdz",name:"案发地址"},{prop:"cdcl",name:"调动车辆"},{prop:"bcxx",name:"原因"},{prop:"czdx",name:"处置对象"},{prop:"zhongdui",name:"所属中队"}],isVideo:!1,barForm:{fireType:"",address:""},monthList:[],houseList:[],proptionList:[],proptionMapList:[],timeArea:1,isTooltip:!1}},computed:{isFollow:function(){return this.$store.state.ajxq2nr}},watch:{isFollow:function(e){this.ajxq2nrData(e)}},mixins:[ee["a"],te["a"]],components:{barChart:F,lineSmooth:G,gauge:Z},created:function(){this.getData(),setInterval(this.getPage2,1e4)},mounted:function(){var e=this;window.addEventListener("resize",(function(){return e.resizeTimeActions([e.$refs.gauge1,e.$refs.gauge2,e.$refs.gauge3,e.$refs.lineSmooth,e.$refs.barChart])}),!0),this.initMap()},methods:{move:function(e){var t=this,i=document.getElementsByClassName("anxqtk")[0],n=e.clientX-i.offsetLeft,r=e.clientY-i.offsetTop;document.onmousemove=function(e){var a=e.clientX-n,s=e.clientY-r;t.positionX=s,t.positionY=a,i.style.left=a+"px",i.style.top=s+"px"},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}},mousedown:function(e){this.selectElement=document.getElementById("qw");var t=this.selectElement;this.selectElement.style.cursor="move",this.isDowm=!0;var i=e.clientX-this.selectElement.offsetLeft,n=e.clientY-this.selectElement.offsetTop;document.onmousemove=function(r){var a=r||e;t.style.left=a.clientX-i+"px",t.style.top=a.clientY-n+"px"},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,t.style.cursor="default"}},removePopup:function(){document.getElementsByClassName("ys-css3-container")[0].remove()},closeIsTooltip:function(){for(var e=document.getElementsByClassName("el-popper"),t=0;t<e.length;t++)e[t].style.display="none",e[t].ariaHidden=!0},closeIsTooltip2:function(){this.ajxq=!1},closeIsTooltip3:function(){this.ajxq2=!1,this.ajxq2nr={}},ajxq2nrData:function(e){this.ajxq2=!0,this.ajxq2nr=e.ajxq2nr},cellClsNm:function(e){var t=e.column;if("sp"===t.property)return"sp"},rowClass:function(e){e.row,e.rowIndex;return"sp"},videoPlay:function(){var e=this;this.video.videoId="video"+Date.now(),this.$nextTick((function(){ne()(e.video.videoId,{events:[],autoplay:"true",controls:!0,preload:"auto",muted:!0,loop:!1,language:"zh-CN",controlBar:{timeDivider:!0,durationDisplay:!0},aspectRatio:"16:9",fluid:!0,sources:[{type:"application/x-mpegURL",src:"http://32.0.15.107:8080/mhvi/mh.m3u8"}],hls:!0,poster:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F945cad7c7105d352aa3c513c94846bb0c2f1a61342067-OWFZcE_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638947006&t=9cd1ab4df990ba151fcd5f0378f6e8cf",width:document.documentElement.clientWidth,notSupportedMessage:"此视频暂无法播放,请稍后再试"},(function(){this.play()}))}))},cellStyle:function(e,t,i,n){if("视频"===e.column.label)return"color:#2280D9"},cellHandleclick:function(e,t,i,n){"sp"==e.path[0].className&&(this.isVideo=!0,this.videoPlay())},getData:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.all([e.$axios.get(e.$api.fire.fireType)]);case 2:i=t.sent,i[0]&&(e.fireTypeList=i[0].data),e.getPage(),e.getPageMap(),e.getHouse(),e.getMonth(),e.getZhanbi(),e.getXiangqingPage(),e.getXiangqingOne();case 11:case"end":return t.stop()}}),t)})))()},getPage2:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i,n,r,a,s,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=new Date,n=i.getFullYear(),r=i.getMonth()+1,a=i.getDate(),r<10&&(r="0"+r),a<10&&(a="0"+a),s=n+"-"+r+"-"+a+" 00:00:00",o=n+"-"+r+"-"+a+" 23:59:59",t.next=10,e.$axios.get(e.$api.jqzhcz.page+"?"+e.$qs.stringify({current:1,size:150,startTime:s,endTime:o})).then((function(t){if(t){var i=t.data.records;if(i.length>0){for(var n=0;n<i.length;n++)i[n].lasj=i[n].lasj.slice(11,20);for(var r=[],a=0;a<i.length;a++)i[a].fdsj||r.push(i[a]);e.tableData=r}}}));case 10:t.sent;case 11:case"end":return t.stop()}}),t)})))()},getPage:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i,n,r,a,s,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=new Date,n=i.getFullYear(),r=i.getMonth()+1,a=i.getDate(),r<10&&(r="0"+r),a<10&&(a="0"+a),s=n+"-"+r+"-"+a+" 00:00:00",o=n+"-"+r+"-"+a+" 23:59:59",t.next=10,e.$axios.get(e.$api.jqzhcz.page+"?"+e.$qs.stringify({current:1,size:150,startTime:s,endTime:o})).then((function(t){if(t){var i=t.data.records;if(i.length>0){for(var n=0;n<i.length;n++)i[n].lasj=i[n].lasj.slice(11,20);for(var r=[],a=0;a<i.length;a++)i[a].fdsj||r.push(i[a]);e.tableData=r}}}));case 10:return t.sent,t.next=13,e.$axios.get(e.$api.jqzhcz.page+"?"+e.$qs.stringify({current:1,size:150,startTime:e.$store.state.timeList[0]||"",endTime:e.$store.state.timeList[1]||""})).then((function(t){if(t){for(var i=t.data.records,n=0;n<i.length;n++)i[n].lasj=i[n].lasj.slice(11,20);for(var r=[],a=0;a<i.length;a++)i[a].fdsj&&(r[a]=i[a]);e.tableData2=r}}));case 13:case"end":return t.stop()}}),t)})))()},getPageMap:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.pageMap+"?"+e.$qs.stringify({startTime:"2020-11-01 00:00:00",endTime:"2021-12-31 23:59:59"}));case 2:i=t.sent,i&&(e.proptionMapList=i.data.records.slice(0,30),n=[],n.push(i.data.records.slice(0,30)),e.addMarker(n,"selfManagement"));case 4:case"end":return t.stop()}}),t)})))()},rowClickMap:function(e){var t=this;return Object(L["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.closeIsTooltip(),t.ajxq=!0,t.ajxqnr=e;case 3:case"end":return i.stop()}}),i)})))()},getHouse:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.house+"?"+e.$qs.stringify({startTime:e.$store.state.timeList[0]||"",endTime:e.$store.state.timeList[1]||""}));case 2:i=t.sent,null!==i&&void 0!==i&&i.data&&(e.houseList=i.data,e.$refs.lineSmooth.getData());case 4:case"end":return t.stop()}}),t)})))()},getProption:function(){return Object(L["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})))()},getMonth:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.month+"?"+e.$qs.stringify({startTime:(new Date).getFullYear()-e.timeArea+"-"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" 00:00:00",endTime:(new Date).getFullYear()+"-"+((new Date).getMonth()+1)+"-"+(new Date).getDate()+" 00:00:00"}));case 2:i=t.sent,i&&(e.monthList=i.data,e.$refs.barChart.getData());case 4:case"end":return t.stop()}}),t)})))()},searchTime:function(e){this.timeArea=e,this.getMonth()},getZhanbi:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.alertStatistics+"?"+e.$qs.stringify({startTime:e.$store.state.timeList[0]||"",endTime:e.$store.state.timeList[1]||""}));case 2:i=t.sent,e.proptionList=i.data;case 4:case"end":return t.stop()}}),t)})))()},getXiangqingPage:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.page+"?"+e.$qs.stringify({current:1,size:10}));case 2:t.sent;case 3:case"end":return t.stop()}}),t)})))()},getXiangqingOne:function(){var e=this;return Object(L["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.$api.jqzhcz.one+"?"+e.$qs.stringify({id:"00021f6556c34d44a75ea287f40bed42"}));case 2:t.sent;case 3:case"end":return t.stop()}}),t)})))()}}};i("18cc"),i("a542"),i("e507");const Do=j()(Po,[["render",I],["__scopeId","data-v-7a7b8b74"]]);t["default"]=Do},"423e":function(e,t,i){"use strict";var n=i("ae75"),r=function(e){var t=31&e[1];return t<<=8,t|=e[2],t},a=function(e){return!!(64&e[1])},s=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},o=function(e,t){var i=r(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},u=function(e){var t=a(e),i=4+s(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},l=function(e){var t={},i=a(e),n=4+s(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r,o,u;r=(15&e[n+1])<<8|e[n+2],o=3+r-4,u=(15&e[n+10])<<8|e[n+11];var l=12+u;while(l<o){var c=n+l;t[(31&e[c+1])<<8|e[c+2]]=e[c],l+=5+((15&e[c+3])<<8|e[c+4])}return t}},c=function(e,t){var i=r(e),a=t[i];switch(a){case n.H264_STREAM_TYPE:return"video";case n.ADTS_STREAM_TYPE:return"audio";case n.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},d=function(e){var t=a(e);if(!t)return null;var i=4+s(e);if(i>=e.byteLength)return null;var n,r=null;return n=e[i+7],192&n&&(r={},r.pts=(14&e[i+9])<<27|(255&e[i+10])<<20|(254&e[i+11])<<12|(255&e[i+12])<<5|(254&e[i+13])>>>3,r.pts*=4,r.pts+=(6&e[i+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[i+14])<<27|(255&e[i+15])<<20|(254&e[i+16])<<12|(255&e[i+17])<<5|(254&e[i+18])>>>3,r.dts*=4,r.dts+=(6&e[i+18])>>>1)),r},h=function(e){switch(e){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}},p=function(e){for(var t,i=4+s(e),n=e.subarray(i),r=0,a=0,o=!1;a<n.byteLength-3;a++)if(1===n[a+2]){r=a+5;break}while(r<n.byteLength)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}a+3!==r-2&&(t=h(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0));do{r++}while(1!==n[r]&&r<n.length);a=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}t=h(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0),a=r-2,r+=3;break;default:r+=3;break}return n=n.subarray(a),r-=a,a=0,n&&n.byteLength>3&&(t=h(31&n[a+3]),"slice_layer_without_partitioning_rbsp_idr"===t&&(o=!0)),o};e.exports={parseType:o,parsePat:u,parsePmt:l,parsePayloadUnitStartIndicator:a,parsePesType:c,parsePesTime:d,videoPacketContainsKeyFrame:p}},4329:function(e,t,i){"use strict";var n=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t],i)if(2===arguments.length)for(r=i.length,n=0;n<r;++n)i[n].call(this,arguments[1]);else{for(a=[],n=arguments.length,n=1;n<arguments.length;++n)a.push(arguments[n]);for(r=i.length,n=0;n<r;++n)i[n].apply(this,a)}},this.dispose=function(){e={}}}};n.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),e},n.prototype.push=function(e){this.trigger("data",e)},n.prototype.flush=function(e){this.trigger("done",e)},e.exports=n},4491:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(){r(this,e),this.listeners={}}return n(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"off",value:function(e,t){var i=void 0;return!!this.listeners[e]&&(i=this.listeners[e].indexOf(t),this.listeners[e].splice(i,1),i>-1)}},{key:"trigger",value:function(e){var t=void 0,i=void 0,n=void 0,r=void 0;if(t=this.listeners[e],t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(e){this.on("data",(function(t){e.push(t)}))}}]),e}();t["default"]=a,e.exports=t["default"]},"466b":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i("fc85"),s=d(a),o=i("ddac"),u=d(o),l=i("59a0"),c=d(l);function d(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function f(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var m=function(e){function t(){h(this,t);var e=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.lineStream=new u["default"],e.parseStream=new c["default"],e.lineStream.pipe(e.parseStream);var i=e,r=[],a={},s=void 0,o=void 0,l=function(){},d={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},f=0;return e.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},e.parseStream.on("data",(function(e){var t=void 0,u=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(a.byterange=t,t.length=e.length,"offset"in e||(this.trigger("info",{message:"defaulting offset to zero"}),e.offset=0)),"offset"in e&&(a.byterange=t,t.offset=e.offset)},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"})),e.duration>0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},"undefined"!==typeof e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,f=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||d,e.attributes?(a.attributes||(a.attributes={}),n(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||d,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],u={default:/yes/i.test(e.attributes.DEFAULT)},u["default"]?u.autoselect=!0:u.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(u.language=e.attributes.LANGUAGE),e.attributes.URI&&(u.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(u.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(u.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(u.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=u}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){f+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||l).call(i)},uri:function(){a.uri=e.uri,r.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),o&&(a.key=o),a.timeline=f,s&&(a.map=s),a={}},comment:function(){}})[e.type].call(i)})),e}return f(t,e),r(t,[{key:"push",value:function(e){this.lineStream.push(e)}},{key:"end",value:function(){this.lineStream.push("\n")}}]),t}(s["default"]);t["default"]=m},"46af":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("3d33"),a=n(r),s=function(){var e=function e(t,i){t=(0,r.mergeOptions)({timeout:45e3},t);var n=e.beforeRequest||a["default"].Hls.xhr.beforeRequest;if(n&&"function"===typeof n){var s=n(t);s&&(t=s)}var o=(0,r.xhr)(t,(function(e,t){var n=o.response;!e&&n&&(o.responseTime=Date.now(),o.roundTripTime=o.responseTime-o.requestTime,o.bytesReceived=n.byteLength||n.length,o.bandwidth||(o.bandwidth=Math.floor(o.bytesReceived/o.roundTripTime*8*1e3))),e&&"ETIMEDOUT"===e.code&&(o.timedout=!0),e||o.aborted||200===t.statusCode||206===t.statusCode||0===t.statusCode||(e=new Error("XHR Failed with a response of: "+(o&&(n||o.responseText)))),i(e,o)})),u=o.abort;return o.abort=function(){return o.aborted=!0,u.apply(o,arguments)},o.uri=t.uri,o.requestTime=Date.now(),o};return e};t["default"]=s,e.exports=t["default"]},"4a4b":function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports["default"]=e.exports,e.exports.__esModule=!0,i(t,n)}e.exports=i,e.exports["default"]=e.exports,e.exports.__esModule=!0},"4bef":function(e,t){var i,n,r,a,s,o,u,l=9e4;i=function(e){return e*l},n=function(e,t){return e*t},r=function(e){return e/l},a=function(e,t){return e/t},s=function(e,t){return i(a(e,t))},o=function(e,t){return n(r(e),t)},u=function(e,t,i){return r(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:i,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:a,audioTsToVideoTs:s,videoTsToAudioTs:o,metadataTsToSeconds:u}},"4e69":function(e,t,i){"use strict";var n=4,r=128,a=i("4329"),s=function(e){var t=0,i={payloadType:-1,payloadSize:0},a=0,s=0;while(t<e.byteLength){if(e[t]===r)break;while(255===e[t])a+=255,t++;a+=e[t++];while(255===e[t])s+=255,t++;if(s+=e[t++],!i.payload&&a===n){i.payloadType=a,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}t+=s,a=0,s=0}return i},o=function(e){return 181!==e.payload[0]||49!==(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},u=function(e,t){var i,n,r,a,s=[];if(!(64&t[0]))return s;for(n=31&t[0],i=0;i<n;i++)r=3*i,a={type:3&t[r+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},l=function(){l.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new m(0,0),new m(0,1),new m(1,0),new m(1,1)],this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("done",this.trigger.bind(this,"done"))}),this)};l.prototype=new a,l.prototype.push=function(e){var t,i;"sei_rbsp"===e.nalUnitType&&(t=s(e.escapedRBSP),t.payloadType===n&&(i=o(t),i&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?this.ignoreNextEqualDts_=!1:(this.captionPackets_=this.captionPackets_.concat(u(e.pts,i)),this.latestDts_=e.dts))))},l.prototype.flush=function(){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2&&this.dispatchCea608Packet(e)}),this),this.captionPackets_.length=0,this.ccStreams_.forEach((function(e){e.flush()}),this)):this.ccStreams_.forEach((function(e){e.flush()}),this)},l.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},l.prototype.dispatchCea608Packet=function(e){this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},l.prototype.setsChannel1Active=function(e){return 4096===(30720&e.ccData)},l.prototype.setsChannel2Active=function(e){return 6144===(30720&e.ccData)};var c={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},d=function(e){return null===e?"":(e=c[e]||e,String.fromCharCode(e))},h=14,p=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],f=function(){var e=[],t=h+1;while(t--)e.push("");return e},m=function(e,t){m.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if(t=32639&e.ccData,t!==this.lastControlCode_){if(4096===(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.topRow_=h-1,this.mode_="rollUp";else if(t===this.ROLL_UP_3_ROWS_)this.topRow_=h-2,this.mode_="rollUp";else if(t===this.ROLL_UP_4_ROWS_)this.topRow_=h-3,this.mode_="rollUp";else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[h]=this.nonDisplayed_[h].slice(0,-1):this.displayed_[h]=this.displayed_[h].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=f();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=f();else if(t===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(n,r))n=(3&n)<<8,a=d(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[h]=this.displayed_[h].slice(0,-1),n=(3&n)<<8,a=d(n|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14===(14&r)&&this.addFormatting(e.pts,["i"]),1===(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=p.indexOf(7968&t);s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16===(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14===(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=d(n),a+=d(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};m.prototype=new a,m.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e){return e.trim()})).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},m.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=f(),this.nonDisplayed_=f(),this.lastControlCode_=null,this.column_=0,this.row_=h,this.formatting_=[]},m.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},m.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},m.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},m.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},m.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},m.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},m.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},m.prototype.isNormalChar=function(e){return e>=32&&e<=127},m.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},m.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},m.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},m.prototype.rollUp=function(e,t){var i=this.displayed_[h];i+=t,this.displayed_[h]=i},m.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.topRow_;e<h;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[h]=""},m.prototype.paintOn=function(){},e.exports={CaptionStream:l,Cea608Stream:m}},"4ea2":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i){var n=void 0,r=void 0;if(i&&i.cues){n=i.cues.length;while(n--)r=i.cues[n],r.startTime<=t&&r.endTime>=e&&i.removeCue(r)}};t["default"]=n,e.exports=t["default"]},"4fcf":function(e,t,i){"use strict";var n,r=i("4329"),a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];n=function(){var e;n.prototype.init.call(this),this.push=function(t){var i,n,r,s,o,u,l=0,c=0;if("audio"===t.type){e?(s=e,e=new Uint8Array(s.byteLength+t.data.byteLength),e.set(s),e.set(t.data,s.byteLength)):e=t.data;while(l+5<e.length)if(255===e[l]&&240===(246&e[l+1])){if(n=2*(1&~e[l+1]),i=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5,o=1024*(1+(3&e[l+6])),u=9e4*o/a[(60&e[l+2])>>>2],r=l+i,e.byteLength<r)return;if(this.trigger("data",{pts:t.pts+c*u,dts:t.dts+c*u,sampleCount:o,audioobjecttype:1+(e[l+2]>>>6&3),channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:a[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+n,r)}),e.byteLength===r)return void(e=void 0);c++,e=e.subarray(r)}else l++}},this.flush=function(){this.trigger("done")}},n.prototype=new r,e.exports=n},"53a8":function(e,t){e.exports=n;var i=Object.prototype.hasOwnProperty;function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}},5496:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("f7fd"),l=a(u),c=i("3d33"),d=a(c),h=i("be09"),p=a(h),f=i("4ea2"),m=a(f),g=i("f24e"),y=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),v=function(e){return String.fromCharCode.apply(null,e)},_=function(e){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,i),this.mediaSource_=null,this.subtitlesTrack_=null}return o(t,e),n(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return d["default"].createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return d["default"].createTimeRanges([[t,i]])}},{key:"initSegment",value:function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];if(!e)return null;var i=(0,g.initSegmentId)(e),n=this.initSegments_[i];if(t&&!n&&e.bytes){var r=y.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set(y,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return"undefined"===typeof e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){(0,m["default"])(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var e=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var t=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(t=this.skipEmptySegments_(t),t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline)){var i=function(){e.state="READY",e.paused()||e.monitorBuffer_()};return this.syncController_.one("timestampoffset",i),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(t)}}},{key:"skipEmptySegments_",value:function(e){while(e&&e.segment.empty)e=this.generateSegmentInfo_(e.playlist,e.mediaIndex+1,e.startOfSegment+e.duration,e.isSyncRequest);return e}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var t=this.pendingSegment_,i=t.segment;if("function"!==typeof p["default"].WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var n=function(){var t=function(){e.handleSegment_()};return e.state="WAITING_ON_VTTJS",e.subtitlesTrack_.tech_.one("vttjsloaded",t),e.subtitlesTrack_.tech_.one("vttjserror",(function(){e.subtitlesTrack_.tech_.off("vttjsloaded",t),e.error({message:"Error loading vtt.js"}),e.state="READY",e.pause(),e.trigger("error")})),{v:void 0}}();if("object"===typeof n)return n.v}i.requested=!0;try{this.parseVTTCues_(t)}catch(r){return this.error({message:r.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(t,this.syncController_.timelines[t.timeline],this.playlist_),t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");t.byteLength=t.bytes.byteLength,this.mediaSecondsLoaded+=i.duration,t.cues.length&&this.remove(t.cues[0].endTime,t.cues[t.cues.length-1].endTime),t.cues.forEach((function(t){e.subtitlesTrack_.addCue(t)})),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(e){var t=void 0,i=!1;"function"===typeof p["default"].TextDecoder?t=new p["default"].TextDecoder("utf8"):(t=p["default"].WebVTT.StringDecoder(),i=!0);var n=new p["default"].WebVTT.Parser(p["default"],p["default"].vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){return e.timestampmap=t},n.onparsingerror=function(e){d["default"].log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=v(r)),n.parse(r)}var a=e.bytes;i&&(a=v(a)),n.parse(a),n.flush()}},{key:"updateTimeMapping_",value:function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0}}]),t}(l["default"]);t["default"]=_,e.exports=t["default"]},"55b5":function(e,t,i){var n=i("4a4b");function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,n(e,t)}e.exports=r,e.exports["default"]=e.exports,e.exports.__esModule=!0},"56c8":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},e.exports=t["default"]},"57db":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("56c8"),a=n(r),s=i("d61a"),o=n(s),u=i("6066"),l=function(e,t){var i=void 0;return e?(i=window.getComputedStyle(e),i?i[t]:""):""},c=function(e,t){var i=e.slice();e.sort((function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r}))},d=function(e,t){var i=void 0,n=void 0;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||window.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||window.Number.MAX_VALUE,i-n};t.comparePlaylistBandwidth=d;var h=function(e,t){var i=void 0,n=void 0;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||window.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||window.Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n};t.comparePlaylistResolution=h;var p=function(e,t,i,n){var r=e.playlists.map((function(e){var t=void 0,i=void 0,n=void 0;return t=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height,n=e.attributes.BANDWIDTH,n=n||window.Number.MAX_VALUE,{bandwidth:n,width:t,height:i,playlist:e}}));c(r,(function(e,t){return e.bandwidth-t.bandwidth})),r=r.filter((function(e){return!o["default"].isIncompatible(e.playlist)}));var s=r.filter((function(e){return o["default"].isEnabled(e.playlist)}));s.length||(s=r.filter((function(e){return!o["default"].isDisabled(e.playlist)})));var u=s.filter((function(e){return e.bandwidth*a["default"].BANDWIDTH_VARIANCE<t})),l=u[u.length-1],d=u.filter((function(e){return e.bandwidth===l.bandwidth}))[0],h=u.filter((function(e){return e.width&&e.height}));c(h,(function(e,t){return e.width-t.width}));var p=h.filter((function(e){return e.width===i&&e.height===n}));l=p[p.length-1];var f=p.filter((function(e){return e.bandwidth===l.bandwidth}))[0],m=void 0,g=void 0,y=void 0;f||(m=h.filter((function(e){return e.width>i||e.height>n})),g=m.filter((function(e){return e.width===m[0].width&&e.height===m[0].height})),l=g[g.length-1],y=g.filter((function(e){return e.bandwidth===l.bandwidth}))[0]);var v=y||f||d||s[0]||r[0];return v?v.playlist:null};t.simpleSelector=p;var f=function(){return p(this.playlists.master,this.systemBandwidth,parseInt(l(this.tech_.el(),"width"),10),parseInt(l(this.tech_.el(),"height"),10))};t.lastBandwidthSelector=f;var m=function(e){var t=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){return t<0&&(t=this.systemBandwidth),t=e*this.systemBandwidth+(1-e)*t,p(this.playlists.master,t,parseInt(l(this.tech_.el(),"width"),10),parseInt(l(this.tech_.el(),"height"),10))}};t.movingAverageBandwidthSelector=m;var g=function(e){var t=e.master,i=e.currentTime,n=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,u=e.currentTimeline,l=e.syncController,h=t.playlists.filter((function(e){return!o["default"].isIncompatible(e)})),p=h.filter(o["default"].isEnabled);p.length||(p=h.filter((function(e){return!o["default"].isDisabled(e)})));var f=p.filter(o["default"].hasAttribute.bind(null,"BANDWIDTH")),m=f.map((function(e){var t=l.getSyncPoint(e,r,u,i),c=t?1:2,d=o["default"].estimateSegmentRequestTime(a,n,e),h=d*c-s;return{playlist:e,rebufferingImpact:h}})),g=m.filter((function(e){return e.rebufferingImpact<=0}));return c(g,(function(e,t){return d(t.playlist,e.playlist)})),g.length?g[0]:(c(m,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),m[0]||null)};t.minRebufferMaxBandwidthSelector=g;var y=function(){var e=this.playlists.master.playlists.filter(o["default"].isEnabled);c(e,(function(e,t){return d(e,t)}));var t=e.filter((function(e){return(0,u.parseCodecs)(e.attributes.CODECS).videoCodec}));return t[0]||null};t.lowestBitrateCompatibleVariantSelector=y},"59a0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done);n=!0)if(i.push(s.value),t&&i.length===t)break}catch(u){r=!0,a=u}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw a}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=i("fc85"),s=o(a);function o(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},h=function(e){var t=e.split(d()),i={},n=t.length,r=void 0;while(n--)""!==t[n]&&(r=/([^=]*)=(.*)/.exec(t[n]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),i[r[0]]=r[1]);return i},p=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this))}return c(t,e),r(t,[{key:"push",value:function(e){var t=void 0,i=void 0;if(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,""),0!==e.length)if("#"===e[0])if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"totalduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"byterange"},t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){var r=h(t[1]);if(r.URI&&(i.uri=r.URI),r.BYTERANGE){var a=r.BYTERANGE.split("@"),s=n(a,2),o=s[0],u=s[1];i.byterange={},o&&(i.byterange.length=parseInt(o,10)),u&&(i.byterange.offset=parseInt(u,10))}}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=h(t[1]),i.attributes.RESOLUTION){var l=i.attributes.RESOLUTION.split("x"),c={};l[0]&&(c.width=parseInt(l[0],10)),l[1]&&(c.height=parseInt(l[1],10)),i.attributes.RESOLUTION=c}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=h(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=h(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}else this.trigger("data",{type:"comment",text:e.slice(1)});else this.trigger("data",{type:"uri",uri:e})}}]),t}(s["default"]);t["default"]=p},"5bc0":function(e,t,i){"use strict";var n,r=i("4329"),a=i("ae75"),s=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},o=function(e,t,i){return decodeURIComponent(s(e,t,i))},u=function(e,t,i){return unescape(s(e,t,i))},l=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},c={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=o(e.data,1,t),e.value=o(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=o(e.data,1,t),e.url=o(e.data,t+1,e.data.length);break}},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=u(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};n=function(e){var t,i={debug:!(!e||!e.debug),descriptor:e&&e.descriptor},r=0,s=[],o=0;if(n.prototype.init.call(this),this.dispatchType=a.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,a,u,d,h;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(o=0,s.length=0),0===s.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))i.debug;else if(s.push(e),o+=e.data.byteLength,1===s.length&&(r=l(e.data.subarray(6,10)),r+=10),!(o<r)){for(t={data:new Uint8Array(r),frames:[],pts:s[0].pts,dts:s[0].dts},d=0;d<r;)t.data.set(s[0].data.subarray(0,r-d),d),d+=s[0].data.byteLength,o-=s[0].data.byteLength,s.shift();n=10,64&t.data[5]&&(n+=4,n+=l(t.data.subarray(10,14)),r-=l(t.data.subarray(16,20)));do{if(a=l(t.data.subarray(n+4,n+8)),a<1)return;if(h=String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),u={id:h,data:t.data.subarray(n+10,n+a+10)},u.key=u.id,c[u.id]&&(c[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner)){var p=u.data,f=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;f*=4,f+=3&p[7],u.timeStamp=f,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u)}t.frames.push(u),n+=10,n+=a}while(n<r);this.trigger("data",t)}}},n.prototype=new r,e.exports=n},"5c9d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i("be09"),o=r(s),u=i("28e5"),l=r(u),c=function(e){e.on("data",(function(e){var t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};var i=e.data;e.data=i.buffer,o["default"].postMessage({action:"data",segment:e,byteOffset:i.byteOffset,byteLength:i.byteLength},[e.data])})),e.captionStream&&e.captionStream.on("data",(function(e){o["default"].postMessage({action:"caption",data:e})})),e.on("done",(function(e){o["default"].postMessage({action:"done"})})),e.on("gopInfo",(function(e){o["default"].postMessage({action:"gopInfo",gopInfo:e})}))},d=function(){function e(t){a(this,e),this.options=t||{},this.init()}return n(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new l["default"].Transmuxer(this.options),c(this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*t))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*e.appendStart))}},{key:"flush",value:function(e){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}]),e}(),h=function(e){e.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new d(e.data.options):(this.messageHandlers||(this.messageHandlers=new d),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}};t["default"]=function(e){return new h(e)},e.exports=t["default"]},"5f65":function(e,t,i){},6066:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t={codecCount:0},i=void 0;return t.codecCount=e.split(",").length,t.codecCount=t.codecCount||2,i=/(^|\s|,)+(avc1)([^ ,]*)/i.exec(e),i&&(t.videoCodec=i[2],t.videoObjectTypeIndicator=i[3]),t.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(e),t.audioProfile=t.audioProfile&&t.audioProfile[2],t};t.parseCodecs=n},"631a":function(e,t,i){"use strict";var n,r,a,s=i("4329"),o=i("3240");r=function(){var e,t,i=0;r.prototype.init.call(this),this.push=function(n){var r;for(t?(r=new Uint8Array(t.byteLength+n.data.byteLength),r.set(t),r.set(n.data,t.byteLength),t=r):t=n.data;i<t.byteLength-3;i++)if(1===t[i+2]){e=i+5;break}while(e<t.byteLength)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<t.length);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3;break}t=t.subarray(i),e-=i,i=0},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")}},r.prototype=new s,a={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},n=function(){var e,t,i,s,u,l,c,d=new r;n.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,d.push(e))},d.on("data",(function(n){var r={trackId:t,pts:i,dts:s,data:n};switch(31&n[0]){case 5:r.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:r.nalUnitType="sei_rbsp",r.escapedRBSP=u(n.subarray(1));break;case 7:r.nalUnitType="seq_parameter_set_rbsp",r.escapedRBSP=u(n.subarray(1)),r.config=l(r.escapedRBSP);break;case 8:r.nalUnitType="pic_parameter_set_rbsp";break;case 9:r.nalUnitType="access_unit_delimiter_rbsp";break;default:break}e.trigger("data",r)})),d.on("done",(function(){e.trigger("done")})),this.flush=function(){d.flush()},c=function(e,t){var i,n,r=8,a=8;for(i=0;i<e;i++)0!==a&&(n=t.readExpGolomb(),a=(r+n+256)%256),r=0===a?r:a},u=function(e){var t,i,n=e.byteLength,r=[],a=1;while(a<n-2)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=n-r.length,i=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),i[a]=e[s];return i},l=function(e){var t,i,n,r,s,u,l,d,h,p,f,m,g,y,v=0,_=0,b=0,T=0,S=1;if(t=new o(e),i=t.readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),a[i]&&(s=t.readUnsignedExpGolomb(),3===s&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==s?8:12,y=0;y<f;y++)t.readBoolean()&&c(y<6?16:64,t);if(t.skipUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),0===u)t.readUnsignedExpGolomb();else if(1===u)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),y=0;y<l;y++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),d=t.readUnsignedExpGolomb(),h=t.readUnsignedExpGolomb(),p=t.readBits(1),0===p&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(v=t.readUnsignedExpGolomb(),_=t.readUnsignedExpGolomb(),b=t.readUnsignedExpGolomb(),T=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(g=t.readUnsignedByte(),g){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()];break}m&&(S=m[0]/m[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:r,width:Math.ceil((16*(d+1)-2*v-2*_)*S),height:(2-p)*(h+1)*16-2*b-2*T}}},n.prototype=new s,e.exports={H264Stream:n,NalByteStream:r}},6438:function(e,t){var i=Math.pow(2,32),n=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},r=12;0===n.version?(n.earliestPresentationTime=t.getUint32(r),n.firstOffset=t.getUint32(r+4),r+=8):(n.earliestPresentationTime=t.getUint32(r)*i+t.getUint32(r+4),n.firstOffset=t.getUint32(r+8)*i+t.getUint32(r+12),r+=16),r+=2;var a=t.getUint16(r);for(r+=2;a>0;r+=12,a--)n.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return n};e.exports=n},6444:function(e,t){var i=function(e){return e.replace(/^\s+|\s+$/g,"")},n=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var t={},r=i(e).split("\n"),a=0;a<r.length;a++){var s=r[a],o=s.indexOf(":"),u=i(s.slice(0,o)).toLowerCase(),l=i(s.slice(o+1));"undefined"===typeof t[u]?t[u]=l:n(t[u])?t[u].push(l):t[u]=[t[u],l]}return t}},"672b":function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},"672d":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("be09"),l=a(u),c=i("3d33"),d=a(c),h=i("6d5a"),p=a(h),f=i("4ea2"),m=a(f),g=i("9417"),y=a(g),v=i("ba2d"),_=i("a64c"),b=a(_),T=i("78d8"),S=a(T),w=i("e206"),E=a(w),k=function(){var e=void 0;try{e="a64c"}catch(t){}return e},C=function(e){l["default"].setTimeout(e,E["default"].TIME_BETWEEN_CHUNKS)},O=function(){return Math.random().toString(36).slice(2,8)},A=function(e,t){("number"!==typeof t||t<0)&&(t=0);var i=Math.pow(10,t);return Math.round(e*i)/i},x=function(e){function t(e){var i=this;s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n=void 0;this.chunkSize_=E["default"].BYTES_PER_CHUNK,this.buffer_=[],this.bufferSize_=0,this.basePtsOffset_=NaN,this.mediaSource_=e,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.updating=!1,this.timestampOffset_=0,n=l["default"].btoa(String.fromCharCode.apply(null,Array.prototype.slice.call(p["default"].getFlvHeader())));var a=this.mediaSource_.player_.id().replace(/[^a-zA-Z0-9]/g,"_");this.flashEncodedHeaderName_="vjs_flashEncodedHeader_"+a+O(),this.flashEncodedDataName_="vjs_flashEncodedData_"+a+O(),l["default"][this.flashEncodedHeaderName_]=function(){return delete l["default"][i.flashEncodedHeaderName_],n},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedHeaderName_),this.transmuxer_=(0,S["default"])(b["default"],k()),this.transmuxer_.postMessage({action:"init",options:{}}),this.transmuxer_.onmessage=function(e){"data"===e.data.action&&i.receiveBuffer_(e.data.segment)},this.one("updateend",(function(){i.mediaSource_.tech_.trigger("loadedmetadata")})),Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(e){"number"===typeof e&&e>=0&&(this.timestampOffset_=e,this.mediaSource_.swfObj.vjs_discontinuity(),this.basePtsOffset_=NaN,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.transmuxer_.postMessage({action:"reset"}))}}),Object.defineProperty(this,"buffered",{get:function(){if(!this.mediaSource_||!this.mediaSource_.swfObj||!("vjs_getProperty"in this.mediaSource_.swfObj))return d["default"].createTimeRange();var e=this.mediaSource_.swfObj.vjs_getProperty("buffered");return e&&e.length&&(e[0][0]=A(e[0][0],3),e[0][1]=A(e[0][1],3)),d["default"].createTimeRanges(e)}}),this.mediaSource_.player_.on("seeked",(function(){if((0,m["default"])(0,1/0,i.metadataTrack_),i.inbandTextTracks_)for(var e in i.inbandTextTracks_)(0,m["default"])(0,1/0,i.inbandTextTracks_[e])}));var o=this.onHlsReset_.bind(this);this.mediaSource_.player_.tech_.on("hls-reset",o),this.mediaSource_.player_.tech_.hls.on("dispose",(function(){i.transmuxer_.terminate(),i.mediaSource_.player_.tech_.off("hls-reset",o)}))}return o(t,e),n(t,[{key:"appendBuffer",value:function(e){var t=void 0;if(this.updating)throw t=new Error("SourceBuffer.append() cannot be called while an update is in progress"),t.name="InvalidStateError",t.code=11,t;this.updating=!0,this.mediaSource_.readyState="open",this.trigger({type:"update"}),this.transmuxer_.postMessage({action:"push",data:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength},[e.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"abort",value:function(){this.buffer_=[],this.bufferSize_=0,this.mediaSource_.swfObj.vjs_abort(),this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))}},{key:"remove",value:function(e,t){if((0,m["default"])(e,t,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)(0,m["default"])(e,t,this.inbandTextTracks_[i]);this.trigger({type:"update"}),this.trigger({type:"updateend"})}},{key:"receiveBuffer_",value:function(e){var t=this;(0,y["default"])(this,this.mediaSource_,e),(0,v.addTextTrackData)(this,e.captions,e.metadata),C((function(){var i=t.convertTagsToData_(e);0===t.buffer_.length&&C(t.processBuffer_.bind(t)),i&&(t.buffer_.push(i),t.bufferSize_+=i.byteLength)}))}},{key:"processBuffer_",value:function(){var e=this,t=E["default"].BYTES_PER_CHUNK;if(this.buffer_.length){var i=this.buffer_[0].subarray(0,t);i.byteLength<t||this.buffer_[0].byteLength===t?this.buffer_.shift():this.buffer_[0]=this.buffer_[0].subarray(t),this.bufferSize_-=i.byteLength;for(var n=[],r=i.byteLength,a=0;a<r;a++)n.push(String.fromCharCode(i[a]));var s=l["default"].btoa(n.join(""));l["default"][this.flashEncodedDataName_]=function(){return C(e.processBuffer_.bind(e)),delete l["default"][e.flashEncodedDataName_],s},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedDataName_)}else!1!==this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))}},{key:"convertTagsToData_",value:function(e){var t=0,i=this.mediaSource_.tech_,n=0,r=void 0,a=e.tags.videoTags,s=e.tags.audioTags;if(isNaN(this.basePtsOffset_)&&(a.length||s.length)){var o=a[0]||{pts:1/0},u=s[0]||{pts:1/0};this.basePtsOffset_=Math.min(u.pts,o.pts)}i.seeking()&&(this.videoBufferEnd_=NaN,this.audioBufferEnd_=NaN),isNaN(this.videoBufferEnd_)?(i.buffered().length&&(n=i.buffered().end(0)-this.timestampOffset),i.seeking()&&(n=Math.max(n,i.currentTime()-this.timestampOffset)),n*=1e3,n+=this.basePtsOffset_):n=this.videoBufferEnd_+.1;var l=a.length;if(l&&a[l-1].pts>=n){while(--l){var c=a[l];if(!(c.pts>n)&&(c.keyFrame||c.metaDataTag))break}while(l){var d=a[l-1];if(!d.metaDataTag)break;l--}}var h=a.slice(l),p=void 0;p=isNaN(this.audioBufferEnd_)?n:this.audioBufferEnd_+.1,h.length&&(p=Math.min(p,h[0].pts)),l=0;while(l<s.length){if(s[l].pts>=p)break;l++}var f=s.slice(l);f.length&&(this.audioBufferEnd_=f[f.length-1].pts),h.length&&(this.videoBufferEnd_=h[h.length-1].pts);var m=this.getOrderedTags_(h,f);if(0!==m.length){if(m[0].pts<n&&i.seeking()){var g=1/30,y=i.currentTime(),v=(n-m[0].pts)/1e3,_=y-v;_<g&&(_=0);try{this.mediaSource_.swfObj.vjs_adjustCurrentTime(_)}catch(S){}}for(var b=0;b<m.length;b++)t+=m[b].bytes.byteLength;r=new Uint8Array(t);b=0;for(var T=0;b<m.length;b++)r.set(m[b].bytes,T),T+=m[b].bytes.byteLength;return r}}},{key:"getOrderedTags_",value:function(e,t){var i=void 0,n=[];while(e.length||t.length)i=e.length?t.length&&t[0].dts<e[0].dts?t.shift():e.shift():t.shift(),n.push(i);return n}},{key:"onHlsReset_",value:function(){this.transmuxer_.postMessage({action:"resetCaptions"})}}]),t}(d["default"].EventTarget);t["default"]=x,e.exports=t["default"]},"6be2":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("d136"),a=n(r),s=i("be09"),o=n(s),u=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=a["default"].buildAbsoluteURL(o["default"].location.href,e)),a["default"].buildAbsoluteURL(e,t))};t["default"]=u,e.exports=t["default"]},"6d5a":function(e,t,i){e.exports={tag:i("d7ba"),Transmuxer:i("847a"),getFlvHeader:i("b046")}},"6e1b":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i("3d33"),o=r(s),u=function(){},l=function(){function e(t,i){var n=this;a(this,e);var r=function(){n.sourceBuffer_=t.addSourceBuffer(i),n.onUpdateendCallback_=function(){var e=n.pendingCallback_;n.pendingCallback_=null,e&&e(),n.runCallback_()},n.sourceBuffer_.addEventListener("updateend",n.onUpdateendCallback_),n.runCallback_()};this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=t,this.processedAppend_=!1,"closed"===t.readyState?t.addEventListener("sourceopen",r):r()}return n(e,[{key:"abort",value:function(e){var t=this;this.processedAppend_&&this.queueCallback_((function(){t.sourceBuffer_.abort()}),e)}},{key:"appendBuffer",value:function(e,t){var i=this;this.processedAppend_=!0,this.queueCallback_((function(){i.sourceBuffer_.appendBuffer(e)}),t)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:o["default"].createTimeRanges()}},{key:"remove",value:function(e,t){var i=this;this.processedAppend_&&this.queueCallback_((function(){i.sourceBuffer_.remove(e,t)}),u)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(e){var t=this;return"undefined"!==typeof e&&(this.queueCallback_((function(){t.sourceBuffer_.timestampOffset=e})),this.timestampOffset_=e),this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]),this.runCallback_()}},{key:"runCallback_",value:function(){var e=void 0;!this.updating()&&this.callbacks_.length&&(e=this.callbacks_.shift(),this.pendingCallback_=e[1],e[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()}}]),e}();t["default"]=l,e.exports=t["default"]},"72a5":function(e,t,i){"use strict";var n;e.exports=function(e){var t=n[e.byteLength%16||0],i=new Uint8Array(e.byteLength+t.length);return i.set(e),i.set(t,e.byteLength),i},n=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]]},"78d8":function(e,t,i){var n=arguments[3],r=arguments[4],a=arguments[5],s=JSON.stringify,o=!1,u=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=entryModule)};"undefined"===typeof n&&(o=!0,n=u,r=i.m);var l=function(e){for(var t,i=Object.keys(a),o=0;o<i.length;o++){var u=i[o],l=a[u].exports;if(l===e||l&&l.default===e){t=u;break}}if(!t){t=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(o=0;o<i.length;o++){u=i[o];c[u]=u}r[t]=["function(require,module,exports){"+e+"(self); }",c]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),h={};return h[t]=t,r[d]=["function(require,module,exports){var f = require("+s(t)+");(f.default ? f.default : f)(self);}",h],"("+n+")({"+Object.keys(r).map((function(e){return s(e)+":["+r[e][0]+","+s(r[e][1])+"]"})).join(",")+"},{},["+s(d)+"])"},c=function(e,t){var a,o="string"===typeof t;a=o?{}:[],Object.keys(r).forEach((function(e){r[e]&&(a[e]=r[e].toString())}));var u,l=i(t);if(!l||l!==e&&l.default!==e){var c=a[t];a[t]=c.substring(0,c.length-1)+"\n"+e.name+"();\n}"}if(o){t=s(t);var d=Object.keys(a).map((function(e){return s(e)+":"+a[e]}));u="{"+d.join(",")+"}"}else u="["+a.join(",")+"]";return"var fn = ("+n.toString().replace("entryModule",t)+")("+u+');\n(typeof fn === "function") && fn(self);'};e.exports=function(e,t){var i;i=o?c(e,t):l(e);var n=new Blob([i],{type:"text/javascript"}),r=window.URL||window.webkitURL||window.mozURL||window.msURL,a=r.createObjectURL(n),s=new Worker(a);return s.objectURL=a,s}},"7db0":function(e,t,i){"use strict";var n=i("23e7"),r=i("b727").find,a=i("44d2"),s="find",o=!0;s in[]&&Array(1)[s]((function(){o=!1})),n({target:"Array",proto:!0,forced:o},{find:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),a(s)},"7e10":function(e,t){var i=[33,16,5,32,164,27],n=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],r=function(e){var t=[];while(e--)t.push(0);return t},a=function(e){return Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(e,t){return e.concat(t)}),[])),t}),{})},s={96e3:[i,[227,64],r(154),[56]],88200:[i,[231],r(170),[56]],64e3:[i,[248,192],r(240),[56]],48e3:[i,[255,192],r(268),[55,148,128],r(54),[112]],44100:[i,[255,192],r(268),[55,163,128],r(84),[112]],32e3:[i,[255,192],r(268),[55,234],r(226),[112]],24e3:[i,[255,192],r(268),[55,255,128],r(268),[111,112],r(126),[224]],16e3:[i,[255,192],r(268),[55,255,128],r(268),[111,255],r(269),[223,108],r(195),[1,192]],12e3:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,253,128],r(259),[56]],11025:[n,r(268),[3,127,248],r(268),[6,255,240],r(268),[13,255,224],r(268),[27,255,192],r(268),[55,175,128],r(108),[112]],8e3:[n,r(268),[3,121,16],r(47),[7]]};e.exports=a(s)},"7e5c":function(e,t,i){},"80eb":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),a=n(r),s=i("92b0"),o=n(s),u=i("9f7a"),l=n(u),c=i("3d33"),d=n(c),h=0,p={mode:"auto"};d["default"].mediaSources={};var f=function(e,t){var i=d["default"].mediaSources[e];if(!i)throw new Error("Media Source not found (Video.js)");i.trigger({type:"sourceopen",swfId:t})},m=function(){return!!a["default"].MediaSource&&!!a["default"].MediaSource.isTypeSupported&&a["default"].MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},g=function(e){var t=d["default"].mergeOptions(p,e);if(this.MediaSource={open:f,supportsNativeMediaSources:m},"html5"===t.mode||"auto"===t.mode&&m())return new l["default"];if(d["default"].getTech("Flash"))return new o["default"];throw new Error("Cannot use Flash or Html5 to create a MediaSource for this video")};t.MediaSource=g,g.open=f,g.supportsNativeMediaSources=m;var y={createObjectURL:function(e){var t="blob:vjs-media-source/",i=void 0;return e instanceof l["default"]?(i=a["default"].URL.createObjectURL(e.nativeMediaSource_),e.url_=i,i):e instanceof o["default"]?(i=t+h,h++,d["default"].mediaSources[i]=e,i):(i=a["default"].URL.createObjectURL(e),e.url_=i,i)}};t.URL=y,d["default"].MediaSource=g,d["default"].URL=y},"818b":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){var e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],r=i[4],a=void 0,s=void 0,o=void 0,u=[],l=[],c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,m=void 0;for(a=0;a<256;a++)l[(u[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!n[s];s^=c||1,o=l[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[s]=p,r[p]=s,h=u[d=u[c=u[s]]],m=16843009*h^65537*d^257*c^16843008*s,f=257*u[p]^16843008*p,a=0;a<4;a++)t[a][s]=f=f<<24^f>>>8,i[a][p]=m=m<<24^m>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),i[a]=i[a].slice(0);return e},s=null,o=function(){function e(t){r(this,e),s||(s=a()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];var i=void 0,n=void 0,o=void 0,u=void 0,l=void 0,c=this._tables[0][4],d=this._tables[1],h=t.length,p=1;if(4!==h&&6!==h&&8!==h)throw new Error("Invalid aes key size");for(u=t.slice(0),l=[],this._key=[u,l],i=h;i<4*h+28;i++)o=u[i-1],(i%h===0||8===h&&i%h===4)&&(o=c[o>>>24]<<24^c[o>>16&255]<<16^c[o>>8&255]<<8^c[255&o],i%h===0&&(o=o<<8^o>>>24^p<<24,p=p<<1^283*(p>>7))),u[i]=u[i-h]^o;for(n=0;i;n++,i--)o=u[3&n?i:i-4],l[n]=i<=4||n<4?o:d[0][c[o>>>24]]^d[1][c[o>>16&255]]^d[2][c[o>>8&255]]^d[3][c[255&o]]}return n(e,[{key:"decrypt",value:function(e,t,i,n,r,a){var s=this._key[1],o=e^s[0],u=n^s[1],l=i^s[2],c=t^s[3],d=void 0,h=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)d=v[o>>>24]^_[u>>16&255]^b[l>>8&255]^T[255&c]^s[g],h=v[u>>>24]^_[l>>16&255]^b[c>>8&255]^T[255&o]^s[g+1],p=v[l>>>24]^_[c>>16&255]^b[o>>8&255]^T[255&u]^s[g+2],c=v[c>>>24]^_[o>>16&255]^b[u>>8&255]^T[255&l]^s[g+3],g+=4,o=d,u=h,l=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[u>>16&255]<<16^S[l>>8&255]<<8^S[255&c]^s[g++],d=o,o=u,u=l,l=c,c=d}}]),e}();t["default"]=o,e.exports=t["default"]},"81bc":function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("3d33"),a=n(r),s=i("f24e"),o={FAILURE:2,TIMEOUT:-101,ABORTED:-102};t.REQUEST_ERRORS=o;var u=function(e){var t=void 0,i=void 0;return i=e.offset+e.length-1,t=e.offset,"bytes="+t+"-"+i},l=function(e){var t={};return e.byterange&&(t.Range=u(e.byterange)),t},c=function(e){e.forEach((function(e){e.abort()}))},d=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},h=function(e){var t=e.target,i=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},p=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:o.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:o.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:o.FAILURE,xhr:t}:null},f=function(e,t){return function(i,n){var r=n.response,a=p(i,n);if(a)return t(a,e);if(16!==r.byteLength)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:o.FAILURE,xhr:n},e);var s=new DataView(r);return e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]),t(null,e)}},m=function(e,t){return function(i,n){var r=n.response,a=p(i,n);return a?t(a,e):0===r.byteLength?t({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:o.FAILURE,xhr:n},e):(e.map.bytes=new Uint8Array(n.response),t(null,e))}},g=function(e,t){return function(i,n){var r=n.response,a=p(i,n);return a?t(a,e):0===r.byteLength?t({status:n.status,message:"Empty HLS segment content at URL: "+n.uri,code:o.FAILURE,xhr:n},e):(e.stats=d(n),e.key?e.encryptedBytes=new Uint8Array(n.response):e.bytes=new Uint8Array(n.response),t(null,e))}},y=function(e,t,i){var n=function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var a=r.data.decrypted;return t.bytes=new Uint8Array(a.bytes,a.byteOffset,a.byteLength),i(null,t)}};e.addEventListener("message",n),e.postMessage((0,s.createTransferableMessage)({source:t.requestId,encrypted:t.encryptedBytes,key:t.key.bytes,iv:t.key.iv}),[t.encryptedBytes.buffer,t.key.bytes.buffer])},v=function(e){return e.reduce((function(e,t){return t.code>e.code?t:e}))},_=function(e,t,i){var n=[],r=0;return function(a,s){if(a&&(c(e),n.push(a)),r+=1,r===e.length){if(s.endOfAllRequests=Date.now(),n.length>0){var o=v(n);return i(o,s)}return s.encryptedBytes?y(t,s,i):i(null,s)}}},b=function(e,t){return function(i){return e.stats=a["default"].mergeOptions(e.stats,h(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)}},T=function(e,t,i,n,r,s){var o=[],u=_(o,i,s);if(n.key){var d=a["default"].mergeOptions(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),h=f(n,u),p=e(d,h);o.push(p)}if(n.map&&!n.map.bytes){var y=a["default"].mergeOptions(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:l(n.map)}),v=m(n,u),T=e(y,v);o.push(T)}var S=a["default"].mergeOptions(t,{uri:n.resolvedUri,responseType:"arraybuffer",headers:l(n)}),w=g(n,u),E=e(S,w);return E.addEventListener("progress",b(n,r)),o.push(E),function(){return c(o)}};t.mediaSegmentRequest=T},8362:function(e,t){e.exports=n;var i=Object.prototype.toString;function n(e){if(!e)return!1;var t=i.call(e);return"[object Function]"===t||"function"===typeof e&&"[object RegExp]"!==t||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}},"847a":function(e,t,i){"use strict";var n,r,a,s,o,u,l=i("4329"),c=i("d7ba"),d=i("0ea2"),h=i("4fcf"),p=i("631a").H264Stream,f=i("1c05"),m=i("ae54");s=function(e,t){"number"===typeof t.pts&&(void 0===e.timelineStartInfo.pts?e.timelineStartInfo.pts=t.pts:e.timelineStartInfo.pts=Math.min(e.timelineStartInfo.pts,t.pts)),"number"===typeof t.dts&&(void 0===e.timelineStartInfo.dts?e.timelineStartInfo.dts=t.dts:e.timelineStartInfo.dts=Math.min(e.timelineStartInfo.dts,t.dts))},o=function(e,t){var i=new c(c.METADATA_TAG);return i.dts=t,i.pts=t,i.writeMetaDataDouble("videocodecid",7),i.writeMetaDataDouble("width",e.width),i.writeMetaDataDouble("height",e.height),i},u=function(e,t){var i,n=new c(c.VIDEO_TAG,!0);for(n.dts=t,n.pts=t,n.writeByte(1),n.writeByte(e.profileIdc),n.writeByte(e.profileCompatibility),n.writeByte(e.levelIdc),n.writeByte(255),n.writeByte(225),n.writeShort(e.sps[0].length),n.writeBytes(e.sps[0]),n.writeByte(e.pps.length),i=0;i<e.pps.length;++i)n.writeShort(e.pps[i].length),n.writeBytes(e.pps[i]);return n},a=function(e){var t,i=[],n=[];a.prototype.init.call(this),this.push=function(t){s(e,t),e&&(e.audioobjecttype=t.audioobjecttype,e.channelcount=t.channelcount,e.samplerate=t.samplerate,e.samplingfrequencyindex=t.samplingfrequencyindex,e.samplesize=t.samplesize,e.extraData=e.audioobjecttype<<11|e.samplingfrequencyindex<<7|e.channelcount<<3),t.pts=Math.round(t.pts/90),t.dts=Math.round(t.dts/90),i.push(t)},this.flush=function(){var r,a,s,o=new m;if(0!==i.length){s=-1/0;while(i.length)r=i.shift(),n.length&&r.pts>=n[0]&&(s=n.shift(),this.writeMetaDataTags(o,s)),(e.extraData!==t||r.pts-s>=1e3)&&(this.writeMetaDataTags(o,r.pts),t=e.extraData,s=r.pts),a=new c(c.AUDIO_TAG),a.pts=r.pts,a.dts=r.dts,a.writeBytes(r.data),o.push(a.finalize());n.length=0,t=null,this.trigger("data",{track:e,tags:o.list}),this.trigger("done","AudioSegmentStream")}else this.trigger("done","AudioSegmentStream")},this.writeMetaDataTags=function(t,i){var n;n=new c(c.METADATA_TAG),n.pts=i,n.dts=i,n.writeMetaDataDouble("audiocodecid",10),n.writeMetaDataBoolean("stereo",2===e.channelcount),n.writeMetaDataDouble("audiosamplerate",e.samplerate),n.writeMetaDataDouble("audiosamplesize",16),t.push(n.finalize()),n=new c(c.AUDIO_TAG,!0),n.pts=i,n.dts=i,n.view.setUint16(n.position,e.extraData),n.position+=2,n.length=Math.max(n.length,n.position),t.push(n.finalize())},this.onVideoKeyFrame=function(e){n.push(e)}},a.prototype=new l,r=function(e){var t,i,n=[];r.prototype.init.call(this),this.finishFrame=function(n,r){if(r){if(t&&e&&e.newMetadata&&(r.keyFrame||0===n.length)){var a=o(t,r.dts).finalize(),s=u(e,r.dts).finalize();a.metaDataTag=s.metaDataTag=!0,n.push(a),n.push(s),e.newMetadata=!1,this.trigger("keyframe",r.dts)}r.endNalUnit(),n.push(r.finalize()),i=null}},this.push=function(t){s(e,t),t.pts=Math.round(t.pts/90),t.dts=Math.round(t.dts/90),n.push(t)},this.flush=function(){var r,a=new m;while(n.length){if("access_unit_delimiter_rbsp"===n[0].nalUnitType)break;n.shift()}if(0!==n.length){while(n.length)r=n.shift(),"seq_parameter_set_rbsp"===r.nalUnitType?(e.newMetadata=!0,t=r.config,e.width=t.width,e.height=t.height,e.sps=[r.data],e.profileIdc=t.profileIdc,e.levelIdc=t.levelIdc,e.profileCompatibility=t.profileCompatibility,i.endNalUnit()):"pic_parameter_set_rbsp"===r.nalUnitType?(e.newMetadata=!0,e.pps=[r.data],i.endNalUnit()):"access_unit_delimiter_rbsp"===r.nalUnitType?(i&&this.finishFrame(a,i),i=new c(c.VIDEO_TAG),i.pts=r.pts,i.dts=r.dts):("slice_layer_without_partitioning_rbsp_idr"===r.nalUnitType&&(i.keyFrame=!0),i.endNalUnit()),i.startNalUnit(),i.writeBytes(r.data);i&&this.finishFrame(a,i),this.trigger("data",{track:e,tags:a.list}),this.trigger("done","VideoSegmentStream")}else this.trigger("done","VideoSegmentStream")}},r.prototype=new l,n=function(e){var t,i,s,o,u,l,c,m,g,y,v,_,b=this;n.prototype.init.call(this),e=e||{},this.metadataStream=new d.MetadataStream,e.metadataStream=this.metadataStream,t=new d.TransportPacketStream,i=new d.TransportParseStream,s=new d.ElementaryStream,o=new d.TimestampRolloverStream("video"),u=new d.TimestampRolloverStream("audio"),l=new d.TimestampRolloverStream("timed-metadata"),c=new h,m=new p,_=new f(e),t.pipe(i).pipe(s),s.pipe(o).pipe(m),s.pipe(u).pipe(c),s.pipe(l).pipe(this.metadataStream).pipe(_),v=new d.CaptionStream,m.pipe(v).pipe(_),s.on("data",(function(e){var t,i,n;if("metadata"===e.type){t=e.tracks.length;while(t--)"video"===e.tracks[t].type?i=e.tracks[t]:"audio"===e.tracks[t].type&&(n=e.tracks[t]);i&&!g&&(_.numberOfTracks++,g=new r(i),m.pipe(g).pipe(_)),n&&!y&&(_.numberOfTracks++,y=new a(n),c.pipe(y).pipe(_),g&&g.on("keyframe",y.onVideoKeyFrame))}})),this.push=function(e){t.push(e)},this.flush=function(){t.flush()},this.resetCaptions=function(){v.reset()},_.on("data",(function(e){b.trigger("data",e)})),_.on("done",(function(){b.trigger("done")}))},n.prototype=new l,e.exports=n},8890:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("4491"),l=a(u),c=function(e){function t(){s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,l["default"]),this.jobs=[],this.delay=1,this.timeout_=null}return o(t,e),n(t,[{key:"processJob_",value:function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}},{key:"push",value:function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}]),t}(l["default"]);t["default"]=c,e.exports=t["default"]},"89a7":function(e,t,i){"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"===typeof t.freeze?t.freeze(e):e}var r=n({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),a=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===a.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.freeze=n,t.MIME_TYPE=r,t.NAMESPACE=a},"8c10":function(e,t){function i(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(r){n=r}return[n,i]}e.exports=i},"8c57":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("6be2"),l=a(u),c=i("3d33"),d=i("c795"),h=a(d),p=i("be09"),f=a(p),m=function(e,t,i){var n=t.slice();i=i||0;for(var r=Math.min(e.length,t.length+i),a=i;a<r;a++)n[a-i]=(0,c.mergeOptions)(e[a],n[a-i]);return n};t.updateSegments=m;var g=function(e,t){e.resolvedUri||(e.resolvedUri=(0,l["default"])(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=(0,l["default"])(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=(0,l["default"])(t,e.map.uri))};t.resolveSegmentUris=g;var y=function(e,t){var i=(0,c.mergeOptions)(e,{}),n=i.playlists.filter((function(e){return e.uri===t.uri}))[0];if(!n)return null;if(n.segments&&t.segments&&n.segments.length===t.segments.length&&n.mediaSequence===t.mediaSequence)return null;var r=(0,c.mergeOptions)(n,t);n.segments&&(r.segments=m(n.segments,t.segments,t.mediaSequence-n.mediaSequence)),r.segments.forEach((function(e){g(e,r.resolvedUri)}));for(var a=0;a<i.playlists.length;a++)i.playlists[a].uri===t.uri&&(i.playlists[a]=r);return i.playlists[t.uri]=r,i};t.updateMaster=y;var v=function(e){var t=e.playlists.length;while(t--){var i=e.playlists[t];e.playlists[i.uri]=i,i.resolvedUri=(0,l["default"])(e.uri,i.uri),i.attributes||(i.attributes={},c.log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}};t.setupMediaPlaylists=v;var _=function(e){["AUDIO","SUBTITLES"].forEach((function(t){for(var i in e.mediaGroups[t])for(var n in e.mediaGroups[t][i]){var r=e.mediaGroups[t][i][n];r.uri&&(r.resolvedUri=(0,l["default"])(e.uri,r.uri))}}))};t.resolveMediaGroupUris=_;var b=function(e,t){var i=e.segments[e.segments.length-1],n=void 0;return n=t&&i&&i.duration?1e3*i.duration:500*(e.targetDuration||10),n};t.refreshDelay=b;var T=function(e){function t(e,i,n){var a=this;if(s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),n=n||{},this.srcUrl=e,this.hls_=i,this.withCredentials=!!n.withCredentials,this.handleManifestRedirects=!!n.handleManifestRedirects,!this.srcUrl)throw new Error("A non-empty playlist URL is required");this.state="HAVE_NOTHING",this.on("mediaupdatetimeout",(function(){"HAVE_METADATA"===a.state&&(a.state="HAVE_CURRENT_METADATA",a.request=a.hls_.xhr({uri:(0,l["default"])(a.master.uri,a.media().uri),withCredentials:a.withCredentials},(function(e,t){if(a.request)return e?a.playlistRequestError(a.request,a.media().uri,"HAVE_METADATA"):void a.haveMetadata(a.request,a.media().uri)})))}))}return o(t,e),n(t,[{key:"playlistRequestError",value:function(e,t,i){this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+t,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(e,t){var i=this;this.request=null,this.state="HAVE_METADATA";var n=new h["default"].Parser;n.push(e.responseText),n.end(),n.manifest.uri=t,n.manifest.attributes=n.manifest.attributes||{};var r=y(this.master,n.manifest);this.targetDuration=n.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[n.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(f["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=f["default"].setTimeout((function(){i.trigger("mediaupdatetimeout")}),b(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),f["default"].clearTimeout(this.mediaUpdateTimeout)}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value:function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"===typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}var n=!this.media_||e.uri!==this.media_.uri;if(this.master.playlists[e.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(n){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.request=this.hls_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(n,r){if(t.request){if(e.resolvedUri=t.resolveManifestRedirect(e.resolvedUri,r),n)return t.playlistRequestError(t.request,e.uri,i);t.haveMetadata(r,e.uri),"HAVE_MASTER"===i?t.trigger("loadedmetadata"):t.trigger("mediachange")}}))}}},{key:"resolveManifestRedirect",value:function(e,t){return this.handleManifestRedirects&&t.responseURL&&e!==t.responseURL?t.responseURL:e}},{key:"pause",value:function(){this.stopRequest(),f["default"].clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}},{key:"load",value:function(e){var t=this;f["default"].clearTimeout(this.mediaUpdateTimeout);var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=f["default"].setTimeout((function(){return t.load()}),n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},(function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.srcUrl,responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");var n=new h["default"].Parser;return n.push(i.responseText),n.end(),e.state="HAVE_MASTER",e.srcUrl=e.resolveManifestRedirect(e.srcUrl,i),n.manifest.uri=e.srcUrl,n.manifest.playlists?(e.master=n.manifest,v(e.master),_(e.master),e.trigger("loadedplaylist"),void(e.request||e.media(n.manifest.playlists[0]))):(e.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:f["default"].location.href,playlists:[{uri:e.srcUrl,resolvedUri:e.srcUrl,attributes:{}}]},e.master.playlists[e.srcUrl]=e.master.playlists[0],e.haveMetadata(i,e.srcUrl),e.trigger("loadedmetadata"))}}))}}]),t}(c.EventTarget);t["default"]=T},9152:function(e,t){
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
- t.read=function(e,t,i,n,r){var a,s,o=8*r-n-1,u=(1<<o)-1,l=u>>1,c=-7,d=i?r-1:0,h=i?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=h,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),a-=l}return(p?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,i,n,r,a){var s,o,u,l=8*a-r-1,c=(1<<l)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+d>=1?h/u:h*Math.pow(2,1-d),t*u>=2&&(s++,u/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*u-1)*Math.pow(2,r),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[i+p]=255&o,p+=f,o/=256,r-=8);for(s=s<<r|o,l+=r;l>0;e[i+p]=255&s,p+=f,s/=256,l-=8);e[i+p-f]|=128*m}},"91c5":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("8c57"),l=a(u),c=i("d61a"),d=i("f7fd"),h=a(d),p=i("5496"),f=a(p),m=i("d3ae"),g=a(m),y=i("3d33"),v=a(y),_=i("ed4d"),b=a(_),T=i("c7ca"),S=a(T),w=i("0de0"),E=i("78d8"),k=a(E),C=i("a254"),O=a(C),A=i("56c8"),x=a(A),I=i("6066"),L=i("230d"),P=120,D=void 0,R={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},M=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],U=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},N=function(){var e=void 0;try{e="a254"}catch(t){}return e},j=function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return(0,w.translateLegacyCodecs)([e])[0]}))};t.mapLegacyAvcCodecs_=j;var B=function(e,t,i){return e+"/"+t+'; codecs="'+i.filter((function(e){return!!e})).join(", ")+'"'},F=function(e){return e.segments&&e.segments.length&&e.segments[0].map?"mp4":"mp2t"},q=function(e){var t=e.attributes||{};return t.CODECS?(0,I.parseCodecs)(t.CODECS):R},H=function(e,t){var i=F(t),n=q(t),r=t.attributes||{},a=!0,s=!1;if(!t)return[];if(e.mediaGroups.AUDIO&&r.AUDIO){var o=e.mediaGroups.AUDIO[r.AUDIO];if(o)for(var u in s=!0,a=!1,o)if(!o[u].uri){a=!0;break}}s&&!n.audioProfile&&(v["default"].log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),n.audioProfile=R.audioProfile);var l={};n.videoCodec&&(l.video=""+n.videoCodec+n.videoObjectTypeIndicator),n.audioProfile&&(l.audio="mp4a.40."+n.audioProfile);var c=B("audio",i,[l.audio]),d=B("video",i,[l.video]),h=B("video",i,[l.video,l.audio]);return s?!a&&l.video?[d,c]:[h,c]:l.video?[h]:[c]};t.mimeTypesForPlaylist_=H;var V=function(e){function t(e){var i=this;s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n=e.url,a=e.handleManifestRedirects,o=e.withCredentials,u=e.mode,c=e.tech,d=e.bandwidth,p=e.externHls,m=e.useCueTags,g=e.blacklistDuration,y=e.enableLowInitialPlaylist;if(!n)throw new Error("A non-empty playlist URL is required");D=p,this.tech_=c,this.hls_=c.hls,this.mode_=u,this.useCueTags_=m,this.blacklistDuration=g,this.enableLowInitialPlaylist=y,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:o,handleManifestRedirects:a,timeout:null},this.mediaTypes_=(0,L.createMediaTypes)(),this.mediaSource=new v["default"].MediaSource({mode:u}),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_.bind(this)),this.seekable_=v["default"].createTimeRanges(),this.hasPlayed_=function(){return!1},this.syncController_=new S["default"](e),this.segmentMetadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=(0,k["default"])(O["default"],N());var _={hls:this.hls_,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.mediaSource.duration},hasPlayed:function(){return i.hasPlayed_()},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:d,syncController:this.syncController_,decrypter:this.decrypter_};this.masterPlaylistLoader_=new l["default"](n,this.hls_,this.requestOptions_),this.setupMasterPlaylistLoaderListeners_(),this.mainSegmentLoader_=new h["default"](v["default"].mergeOptions(_,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new h["default"](v["default"].mergeOptions(_,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new f["default"](v["default"].mergeOptions(_,{loaderType:"vtt"}),e),this.setupSegmentLoaderListeners_(),M.forEach((function(e){i[e+"_"]=U.bind(i,e)})),this.masterPlaylistLoader_.load()}return o(t,e),n(t,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;(0,c.isLowestEnabledRendition)(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),(0,L.setupMediaGroups)({segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,mode:e.mode_,hls:e.hls_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t);try{e.setupSourceBuffers_()}catch(n){return v["default"].log.warn("Failed to create SourceBuffers",n),e.mediaSource.endOfStream("decode")}e.setupFirstPlay(),e.trigger("selectedinitialmedia")})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){var t=e.masterPlaylistLoader_.media();if(!t){var i=void 0;return e.enableLowInitialPlaylist&&(i=e.selectInitialPlaylist()),i||(i=e.selectPlaylist()),e.initialMedia_=i,void e.masterPlaylistLoader_.media(e.initialMedia_)}e.useCueTags_&&e.updateAdCues_(t),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.updateDuration(),e.tech_.paused()||e.mainSegmentLoader_.load(),t.endList||function(){var t=function(){var t=e.seekable();0!==t.length&&e.mediaSource.addSeekableRange_(t.start(0),t.end(0))};e.duration()!==1/0?function(){var i=function i(){e.duration()===1/0?t():e.tech_.one("durationchange",i)};e.tech_.one("durationchange",i)}():t()}()})),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(),i=1.5*e.masterPlaylistLoader_.targetDuration*1e3;(0,c.isLowestEnabledRendition)(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,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(),i=e.stuckAtPlaylistEnd_(t);i&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))}},{key:"triggerPresenceUsage_",value:function(e,t){var i=e.mediaGroups||{},n=!0,r=Object.keys(i.AUDIO);for(var a in i.AUDIO)for(var s in i.AUDIO[a]){var o=i.AUDIO[a][s];o.uri||(n=!1)}n&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),D.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),D.Playlist.isFmp4(t)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.length&&Object.keys(i.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist(),i=e.masterPlaylistLoader_.media(),n=e.tech_.buffered(),r=n.length?n.end(n.length-1)-e.tech_.currentTime():0,a=e.bufferLowWaterLine();(!i.endList||e.duration()<x["default"].MAX_BUFFER_LOW_WATER_LINE||t.attributes.BANDWIDTH<i.attributes.BANDWIDTH||r>=a)&&e.masterPlaylistLoader_.media(t),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("ended",(function(){e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},P)})),this.mainSegmentLoader_.on("reseteverything",(function(){e.tech_.trigger("hls-reset")})),this.mainSegmentLoader_.on("segmenttimemapping",(function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})})),this.audioSegmentLoader_.on("ended",(function(){e.onEndOfStream()}))}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"fastQualityChange_",value:function(){var e=this.selectPlaylist();e!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(e),this.mainSegmentLoader_.resetLoader())}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_()&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_())return!1;if(!t.endList){var i=function(){var t=e.seekable();return t.length?v["default"].browser.IE_VERSION&&"html5"===e.mode_&&0===e.tech_.readyState()?(e.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(t.end(0)),e.hasPlayed_=function(){return!0}})),{v:!1}):(e.trigger("firstplay"),void e.tech_.setCurrentTime(t.end(0))):{v:!1}}();if("object"===typeof i)return i.v}return this.hasPlayed_=function(){return!0},this.load(),!0}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(t){return v["default"].log.warn("Failed to create Source Buffers",t),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var e=this.tech_.play();"undefined"!==typeof e&&"function"===typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var e=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=e&&this.audioSegmentLoader_.ended_),e&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(e){var t=this.seekable();if(!t.length)return!1;var i=this.syncController_.getExpiredTime(e,this.mediaSource.duration);if(null===i)return!1;var n=D.Playlist.playlistEnd(e,i),r=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return n-r<=g["default"].SAFE_TIME_DELTA;var s=a.end(a.length-1);return s-r<=g["default"].SAFE_TIME_DELTA&&n-s<=g["default"].SAFE_TIME_DELTA}},{key:"blacklistCurrentPlaylist",value:function(e,t){void 0===e&&(e={});var i=void 0,n=void 0;if(i=e.playlist||this.masterPlaylistLoader_.media(),t=t||e.blacklistDuration||this.blacklistDuration,!i){this.error=e;try{return this.mediaSource.endOfStream("network")}catch(a){return this.trigger("error")}}var r=1===this.masterPlaylistLoader_.master.playlists.filter(c.isEnabled).length;return r?(v["default"].log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(r)):(i.excludeUntil=Date.now()+1e3*t,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),n=this.selectPlaylist(),v["default"].log.warn("Problem encountered with the current HLS playlist."+(e.message?" "+e.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(n))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(e){var t=g["default"].findRange(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length&&"flash"!==this.mode_?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()),void this.load()):0}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:D.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var e=void 0,t=void 0;if(this.masterPlaylistLoader_){var i=this.masterPlaylistLoader_.media();if(i){var n=this.syncController_.getExpiredTime(i,this.mediaSource.duration);if(null!==n&&(e=D.Playlist.seekable(i,n),0!==e.length)){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(i=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),n=this.syncController_.getExpiredTime(i,this.mediaSource.duration),null===n)return;if(t=D.Playlist.seekable(i,n),0===t.length)return}t?t.start(0)>e.end(0)||e.start(0)>t.end(0)?this.seekable_=e:this.seekable_=v["default"].createTimeRanges([[t.start(0)>e.start(0)?t.start(0):e.start(0),t.end(0)<e.end(0)?t.end(0):e.end(0)]]):this.seekable_=e,this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var e=this,t=this.mediaSource.duration,i=D.Playlist.duration(this.masterPlaylistLoader_.media()),n=this.tech_.buffered(),r=function t(){e.mediaSource.duration=i,e.tech_.trigger("durationchange"),e.mediaSource.removeEventListener("sourceopen",t)};n.length>0&&(i=Math.max(i,n.end(n.length-1))),t!==i&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",r):r())}},{key:"dispose",value:function(){var e=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var e=this.masterPlaylistLoader_.media(),t=void 0;if(e&&"open"===this.mediaSource.readyState){if(t=H(this.masterPlaylistLoader_.master,e),t.length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri,this.mediaSource.endOfStream("decode");this.mainSegmentLoader_.mimeType(t[0]),t[1]&&this.audioSegmentLoader_.mimeType(t[1]),this.excludeIncompatibleVariants_(e)}}},{key:"excludeIncompatibleVariants_",value:function(e){var t=this.masterPlaylistLoader_.master,i=2,n=null,r=void 0;e.attributes.CODECS&&(r=(0,I.parseCodecs)(e.attributes.CODECS),n=r.videoCodec,i=r.codecCount),t.playlists.forEach((function(e){var t={codecCount:2,videoCodec:null};if(e.attributes.CODECS){var r=e.attributes.CODECS;t=(0,I.parseCodecs)(r),window.MediaSource&&window.MediaSource.isTypeSupported&&!window.MediaSource.isTypeSupported('video/mp4; codecs="'+j(r)+'"')&&(e.excludeUntil=1/0)}t.codecCount!==i&&(e.excludeUntil=1/0),t.videoCodec!==n&&(e.excludeUntil=1/0)}))}},{key:"updateAdCues_",value:function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),b["default"].updateAdCues(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=x["default"].GOAL_BUFFER_LENGTH,i=x["default"].GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,x["default"].MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=x["default"].BUFFER_LOW_WATER_LINE,i=x["default"].BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,x["default"].MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,n)}}]),t}(v["default"].EventTarget);t.MasterPlaylistController=V},"92b0":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("ef34"),l=a(u),c=i("3d33"),d=a(c),h=i("672d"),p=a(h),f=i("e206"),m=a(f),g=i("0de0"),y=function(e){function t(){var e=this;s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.sourceBuffers=[],this.readyState="closed",this.on(["sourceopen","webkitsourceopen"],(function(t){e.swfObj=l["default"].getElementById(t.swfId),e.player_=(0,d["default"])(e.swfObj.parentNode),e.tech_=e.swfObj.tech,e.readyState="open",e.tech_.on("seeking",(function(){var t=e.sourceBuffers.length;while(t--)e.sourceBuffers[t].abort()})),e.swfObj&&e.swfObj.vjs_load()}))}return o(t,e),n(t,[{key:"addSeekableRange_",value:function(){}},{key:"addSourceBuffer",value:function(e){var t=(0,g.parseContentType)(e),i=void 0;if("video/mp2t"!==t.type&&"audio/mp2t"!==t.type)throw new Error("NotSupportedError (Video.js)");return i=new p["default"](this),this.sourceBuffers.push(i),i}},{key:"endOfStream",value:function(e){"network"===e?this.tech_.error(2):"decode"===e&&this.tech_.error(3),"ended"!==this.readyState&&(this.readyState="ended",this.swfObj.vjs_endOfStream())}}]),t}(d["default"].EventTarget);t["default"]=y;try{Object.defineProperty(y.prototype,"duration",{get:function(){return this.swfObj?this.swfObj.vjs_getProperty("duration"):NaN},set:function(e){var t=void 0,i=this.swfObj.vjs_getProperty("duration");if(this.swfObj.vjs_setProperty("duration",e),e<i)for(t=0;t<this.sourceBuffers.length;t++)this.sourceBuffers[t].remove(e,i);return e}})}catch(_){y.prototype.duration=NaN}for(var v in m["default"])y[v]=m["default"][v];e.exports=t["default"]},9417:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i){var n=t.player_;if(i.captions&&i.captions.length)for(var r in e.inbandTextTracks_||(e.inbandTextTracks_={}),i.captionStreams)if(!e.inbandTextTracks_[r]){n.tech_.trigger({type:"usage",name:"hls-608"});var a=n.textTracks().getTrackById(r);e.inbandTextTracks_[r]=a||n.addRemoteTextTrack({kind:"captions",id:r,label:r},!1).track}i.metadata&&i.metadata.length&&!e.metadataTrack_&&(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)};t["default"]=n,e.exports=t["default"]},9946:function(e,t,i){"use strict";var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},a=function(e,t,i){var n,r="";for(n=t;n<i;n++)r+="%"+("00"+e[n].toString(16)).slice(-2);return r},s=function(e,t,i){return unescape(a(e,t,i))},o=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return r?i+20:i+10},u=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},l=function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240===(240&e[t+1])?"audio":null},c=function(e){var t=0;while(t+5<e.length){if(255===e[t]&&240===(246&e[t+1]))return n[(60&e[t+2])>>>2];t++}return null},d=function(e){var t,i,n,a;t=10,64&e[5]&&(t+=4,t+=r(e.subarray(10,14)));do{if(i=r(e.subarray(t+4,t+8)),i<1)return null;if(a=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]),"PRIV"===a){n=e.subarray(t+10,t+i+10);for(var o=0;o<n.byteLength;o++)if(0===n[o]){var u=s(n,0,o);if("com.apple.streaming.transportStreamTimestamp"===u){var l=n.subarray(o+1),c=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;return c*=4,c+=3&l[7],c}break}}t+=10,t+=i}while(t<e.byteLength);return null};e.exports={parseId3TagSize:o,parseAdtsSize:u,parseType:l,parseSampleRate:c,parseAacTimestamp:d}},"9d56":function(e,t,i){"use strict";var n,r=i("4329");n=function(){var e=new Uint8Array,t=0;n.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.parseId3TagSize=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=e[t+5],r=(16&n)>>4;return r?i+20:i+10},this.parseAdtsSize=function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3,r=6144&e[t+3];return r|n|i},this.push=function(i){var n,r,a,s,o=0,u=0;e.length?(s=e.length,e=new Uint8Array(i.byteLength+s),e.set(e.subarray(0,s)),e.set(i,s)):e=i;while(e.length-u>=3)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(!0&e[u]&&240===(240&e[u+1])){if(e.length-u<7)break;if(o=this.parseAdtsSize(e,u),o>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else u++;else{if(e.length-u<10)break;if(o=this.parseId3TagSize(e,u),o>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array}},n.prototype=new r,e.exports=n},"9f7a":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("be09"),l=a(u),c=i("ef34"),d=a(c),h=i("3d33"),p=a(h),f=i("269f"),m=a(f),g=i("ba2d"),y=i("0de0"),v=function(e){function t(){var e=this;s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var i=void 0;for(i in this.nativeMediaSource_=new l["default"].MediaSource,this.nativeMediaSource_)i in t.prototype||"function"!==typeof this.nativeMediaSource_[i]||(this[i]=this.nativeMediaSource_[i].bind(this.nativeMediaSource_));this.duration_=NaN,Object.defineProperty(this,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(e){this.duration_=e,e===1/0||(this.nativeMediaSource_.duration=e)}}),Object.defineProperty(this,"seekable",{get:function(){return this.duration_===1/0?p["default"].createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(this,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(this,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),this.sourceBuffers=[],this.activeSourceBuffers_=[],this.updateActiveSourceBuffers_=function(){if(e.activeSourceBuffers_.length=0,1===e.sourceBuffers.length){var t=e.sourceBuffers[0];return t.appendAudioInitSegment_=!0,t.audioDisabled_=!t.audioCodec_,void e.activeSourceBuffers_.push(t)}for(var i=!1,n=!0,r=0;r<e.player_.audioTracks().length;r++){var a=e.player_.audioTracks()[r];if(a.enabled&&"main"!==a.kind){i=!0,n=!1;break}}e.sourceBuffers.forEach((function(t){if(t.appendAudioInitSegment_=!0,t.videoCodec_&&t.audioCodec_)t.audioDisabled_=i;else if(t.videoCodec_&&!t.audioCodec_)t.audioDisabled_=!0,n=!1;else if(!t.videoCodec_&&t.audioCodec_&&(t.audioDisabled_=n,n))return;e.activeSourceBuffers_.push(t)}))},this.onPlayerMediachange_=function(){e.sourceBuffers.forEach((function(e){e.appendAudioInitSegment_=!0}))},this.onHlsReset_=function(){e.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.postMessage({action:"resetCaptions"})}))},this.onHlsSegmentTimeMapping_=function(t){e.sourceBuffers.forEach((function(e){return e.timeMapping_=t.mapping}))},["sourceopen","sourceclose","sourceended"].forEach((function(e){this.nativeMediaSource_.addEventListener(e,this.trigger.bind(this))}),this),this.on("sourceopen",(function(t){var i=d["default"].querySelector('[src="'+e.url_+'"]');i&&(e.player_=(0,p["default"])(i.parentNode),e.player_.tech_.on("hls-reset",e.onHlsReset_),e.player_.tech_.on("hls-segment-time-mapping",e.onHlsSegmentTimeMapping_),e.player_.audioTracks&&e.player_.audioTracks()&&(e.player_.audioTracks().on("change",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("addtrack",e.updateActiveSourceBuffers_),e.player_.audioTracks().on("removetrack",e.updateActiveSourceBuffers_)),e.player_.on("mediachange",e.onPlayerMediachange_))})),this.on("sourceended",(function(t){for(var i=(0,g.durationOfVideo)(e.duration),n=0;n<e.sourceBuffers.length;n++){var r=e.sourceBuffers[n],a=r.metadataTrack_&&r.metadataTrack_.cues;a&&a.length&&(a[a.length-1].endTime=i)}})),this.on("sourceclose",(function(e){this.sourceBuffers.forEach((function(e){e.transmuxer_&&e.transmuxer_.terminate()})),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&(this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))}))}return o(t,e),n(t,[{key:"addSeekableRange_",value:function(e,t){var i=void 0;if(this.duration!==1/0)throw i=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),i.name="InvalidStateError",i.code=11,i;(t>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=t)}},{key:"addSourceBuffer",value:function(e){var t=void 0,i=(0,y.parseContentType)(e);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(0,y.translateLegacyCodecs)(n),n=n.filter((function(e){return(0,y.isAudioCodec)(e)||(0,y.isVideoCodec)(e)}))),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),t=new m["default"](this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),t.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else t=this.nativeMediaSource_.addSourceBuffer(e);return this.sourceBuffers.push(t),t}}]),t}(p["default"].EventTarget);t["default"]=v,e.exports=t["default"]},a151:function(e,t,i){"use strict";var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("ef34"),l=a(u),c=i("8c57"),d=a(c),h=i("d61a"),p=a(h),f=i("46af"),m=a(f),g=i("b483"),y=i("f24e"),v=a(y),_=i("80eb"),b=i("c795"),T=a(b),S=i("3d33"),w=a(S),E=i("91c5"),k=i("56c8"),C=a(k),O=i("e044"),A=a(O),x=i("be09"),I=a(x),L=i("f631"),P=a(L),D=i("140c"),R=a(D),M=i("57db"),U={PlaylistLoader:d["default"],Playlist:p["default"],Decrypter:g.Decrypter,AsyncStream:g.AsyncStream,decrypt:g.decrypt,utils:v["default"],STANDARD_PLAYLIST_SELECTOR:M.lastBandwidthSelector,INITIAL_PLAYLIST_SELECTOR:M.lowestBitrateCompatibleVariantSelector,comparePlaylistBandwidth:M.comparePlaylistBandwidth,comparePlaylistResolution:M.comparePlaylistResolution,xhr:(0,m["default"])()},N=4194304;["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach((function(e){Object.defineProperty(U,e,{get:function(){return w["default"].log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),C["default"][e]},set:function(t){w["default"].log.warn("using Hls."+e+" is UNSAFE be sure you know what you are doing"),"number"!==typeof t||t<0?w["default"].log.warn("value of Hls."+e+" must be greater than or equal to 0"):C["default"][e]=t}})}));var j=function(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.uri){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})},B=function(e,t){t.representations().forEach((function(t){e.addQualityLevel(t)})),j(e,t.playlists)};U.canPlaySource=function(){return w["default"].log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},U.supportsNativeHls=function(){var e=l["default"].createElement("video");if(!w["default"].getTech("Html5").isSupported())return!1;var t=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return t.some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),U.isSupported=function(){return w["default"].log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var F=w["default"].getComponent("Component"),q=function(e){function t(e,i,n){var a=this;if(s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,i,n.hls),i.options_&&i.options_.playerId){var o=(0,w["default"])(i.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return w["default"].log.warn("player.hls is deprecated. Use player.tech_.hls instead."),i.trigger({type:"usage",name:"hls-player-access"}),a}})}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");this.on(l["default"],["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=l["default"].fullscreenElement||l["default"].webkitFullscreenElement||l["default"].mozFullScreenElement||l["default"].msFullscreenElement;t&&t.contains(a.tech_.el())&&a.masterPlaylistController_.fastQualityChange_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}return o(t,e),n(t,[{key:"setOptions_",value:function(){var e=this;this.options_.withCredentials=this.options_.withCredentials||!1,"number"!==typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!==typeof this.options_.bandwidth&&(this.options_.bandwidth=N),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===N,["withCredentials","bandwidth","handleManifestRedirects"].forEach((function(t){"undefined"!==typeof e.source_[t]&&(e.options_[t]=e.source_[t])})),this.bandwidth=this.options_.bandwidth}},{key:"src",value:function(e){var t=this;e&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=U,this.masterPlaylistController_=new E.MasterPlaylistController(this.options_),this.playbackWatcher_=new P["default"](w["default"].mergeOptions(this.options_,{seekable:function(){return t.seekable()}})),this.masterPlaylistController_.on("error",(function(){var e=w["default"].players[t.tech_.options_.playerId];e.error(t.masterPlaylistController_.error)})),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):U.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=U.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(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=void 0;t=this.throughput>0?1/this.throughput:0;var i=Math.floor(1/(e+t));return i},set:function(){w["default"].log.error('The "systemBandwidth" property is read-only')}}}),Object.defineProperties(this.stats,{bandwidth:{get:function(){return t.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return t.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return t.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return t.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return t.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return t.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return t.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return t.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.masterPlaylistController_.on("selectedinitialmedia",(function(){(0,A["default"])(t)})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.tech_.ready((function(){return t.setupQualityLevels_()})),this.tech_.el()&&this.tech_.src(w["default"].URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var e=this,t=w["default"].players[this.tech_.options_.playerId];t&&t.qualityLevels&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){B(e.qualityLevels_,e)})),this.playlists.on("mediachange",(function(){j(e.qualityLevels_,e.playlists)})))}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(e){this.masterPlaylistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),r(Object.getPrototypeOf(t.prototype),"dispose",this).call(this)}}]),t}(F),H=function e(t){return{canHandleSource:function(i){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=w["default"].mergeOptions(w["default"].options,n);return(!r.hls||!r.hls.mode||r.hls.mode===t)&&e.canPlayType(i.type,r)},handleSource:function(e,i){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=w["default"].mergeOptions(w["default"].options,n,{hls:{mode:t}});return"flash"===t&&i.setTimeout((function(){i.trigger("loadstart")}),1),i.hls=new q(e,i,r),i.hls.xhr=(0,m["default"])(),i.hls.src(e.src),i.hls},canPlayType:function(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=w["default"].mergeOptions(w["default"].options,i);return e.canPlayType(t,n)?"maybe":""}}};H.canPlayType=function(e,t){if(w["default"].browser.IE_VERSION&&w["default"].browser.IE_VERSION<=10)return!1;var i=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;return!(!t.hls.overrideNative&&U.supportsNativeHls)&&i.test(e)},"undefined"!==typeof w["default"].MediaSource&&"undefined"!==typeof w["default"].URL||(w["default"].MediaSource=_.MediaSource,w["default"].URL=_.URL);var V=w["default"].getTech("Flash");_.MediaSource.supportsNativeMediaSources()&&w["default"].getTech("Html5").registerSourceHandler(H("html5"),0),I["default"].Uint8Array&&V&&V.registerSourceHandler(H("flash")),w["default"].HlsHandler=q,w["default"].HlsSourceHandler=H,w["default"].Hls=U,w["default"].use||w["default"].registerComponent("Hls",U),w["default"].m3u8=T["default"],w["default"].options.hls=w["default"].options.hls||{},w["default"].registerPlugin?w["default"].registerPlugin("reloadSourceOnError",R["default"]):w["default"].plugin("reloadSourceOnError",R["default"]),e.exports={Hls:U,HlsHandler:q,HlsSourceHandler:H}},a254:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),a=n(r),s=i("b483"),o=i("f24e"),u=function(e){e.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s.Decrypter(i,n,r,(function(e,i){a["default"].postMessage((0,o.createTransferableMessage)({source:t.source,decrypted:i}),[i.buffer])}))}};t["default"]=function(e){return new u(e)},e.exports=t["default"]},a344:function(e,t,i){"use strict";i("159b");t["a"]={data:function(){return{resizeTime:!0,windowWidth:8448,isVsFirePie:!1,distance:300,isVsTab:!1,leftBtn:!0,rightBtn:!0,current:1,size:20}},watch:{"$store.state.typeTime":function(e){this.getData&&this.getData(e)},"$store.state.timeList":function(e){this.getData&&this.getData(e)}},mounted:function(){},methods:{resizeTimeActions:function(e){var t=this;this.resizeTime&&(this.resizeTime=!1,setTimeout((function(){e.forEach((function(e){e&&e.resize()})),t.resizeTime=!0,t.windowWidth=document.documentElement.clientWidth+document.documentElement.clientHeight}),300))},vsClick:function(e){var t=this;this[e]=!this[e],"isVsFirePie"===e&&this.$nextTick((function(){t.$refs.firePie1&&t.$refs.firePie1.resize(),t.$refs.firePie2&&t.$refs.firePie2.resize()}))},leftBtnClick:function(){this.leftBtn=!this.leftBtn},rightBtnClick:function(){this.rightBtn=!this.rightBtn}},unmount:function(){window.removeEventListener("resize",this.resizeTimeActions,!0)}}},a542:function(e,t,i){"use strict";i("7e5c")},a559:function(e,t){function i(){return e.exports=i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports["default"]=e.exports,e.exports.__esModule=!0,i.apply(this,arguments)}e.exports=i,e.exports["default"]=e.exports,e.exports.__esModule=!0},a64c:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i("be09"),o=r(s),u=i("6d5a"),l=r(u),c=function(e){e.on("data",(function(e){o["default"].postMessage({action:"data",segment:e})})),e.on("done",(function(e){o["default"].postMessage({action:"done"})}))},d=function(){function e(t){a(this,e),this.options=t||{},this.init()}return n(e,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new l["default"].Transmuxer(this.options),c(this.transmuxer)}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.init()}},{key:"flush",value:function(){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}}]),e}(),h=function(e){e.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new d(e.data.options):(this.messageHandlers||(this.messageHandlers=new d),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}};t["default"]=function(e){return new h(e)},e.exports=t["default"]},ae54:function(e,t,i){"use strict";var n=function(){var e=this;this.list=[],this.push=function(e){this.list.push({bytes:e.bytes,dts:e.dts,pts:e.pts,keyFrame:e.keyFrame,metaDataTag:e.metaDataTag})},Object.defineProperty(this,"length",{get:function(){return e.list.length}})};e.exports=n},ae67:function(e,t,i){},ae75:function(e,t,i){"use strict";e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},b03c:function(e,t){var i="auto",n={"":!0,lr:!0,rl:!0},r={start:!0,middle:!0,end:!0,left:!0,right:!0};function a(e){if("string"!==typeof e)return!1;var t=n[e.toLowerCase()];return!!t&&e.toLowerCase()}function s(e){if("string"!==typeof e)return!1;var t=r[e.toLowerCase()];return!!t&&e.toLowerCase()}function o(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}function u(e,t,n){var r=this,u=/MSIE\s8\.0/.test(navigator.userAgent),l={};u?r=document.createElement("custom"):l.enumerable=!0,r.hasBeenReset=!1;var c="",d=!1,h=e,p=t,f=n,m=null,g="",y=!0,v="auto",_="start",b=50,T="middle",S=50,w="middle";if(Object.defineProperty(r,"id",o({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(r,"pauseOnExit",o({},l,{get:function(){return d},set:function(e){d=!!e}})),Object.defineProperty(r,"startTime",o({},l,{get:function(){return h},set:function(e){if("number"!==typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",o({},l,{get:function(){return p},set:function(e){if("number"!==typeof e)throw new TypeError("End time must be set to a number.");p=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",o({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",o({},l,{get:function(){return m},set:function(e){m=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",o({},l,{get:function(){return g},set:function(e){var t=a(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",o({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",o({},l,{get:function(){return v},set:function(e){if("number"!==typeof e&&e!==i)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",o({},l,{get:function(){return _},set:function(e){var t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",o({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",o({},l,{get:function(){return T},set:function(e){var t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",o({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",o({},l,{get:function(){return w},set:function(e){var t=s(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),r.displayState=void 0,u)return r}u.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=u},b046:function(e,t,i){"use strict";var n=i("d7ba"),r=function(e,t,i){var r,a,s,o=new Uint8Array(9),u=new DataView(o.buffer);return e=e||0,t=void 0===t||t,i=void 0===i||i,u.setUint8(0,70),u.setUint8(1,76),u.setUint8(2,86),u.setUint8(3,1),u.setUint8(4,(t?4:0)|(i?1:0)),u.setUint32(5,o.byteLength),e<=0?(a=new Uint8Array(o.byteLength+4),a.set(o),a.set([0,0,0,0],o.byteLength),a):(r=new n(n.METADATA_TAG),r.pts=r.dts=0,r.writeMetaDataDouble("duration",e),s=r.finalize().length,a=new Uint8Array(o.byteLength+s),a.set(o),a.set(u.byteLength,s),a)};e.exports=r},b074:function(e,t,i){var n=i("89a7"),r=i("e1c8"),a=i("b30f"),s=i("e003"),o=r.DOMImplementation,u=n.NAMESPACE,l=s.ParseError,c=s.XMLReader;function d(e){this.options=e||{locator:{}}}function h(e,t,i){if(!e){if(t instanceof p)return t;e=t}var n={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(i){e(t,i)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+m(i))}||function(){}}return i=i||{},a("warning"),a("error"),a("fatalError"),n}function p(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function m(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var i=this.options,n=new c,r=i.domBuilder||new p,s=i.errorHandler,o=i.locator,l=i.xmlns||{},d=/\/x?html?$/.test(t),f=d?a.HTML_ENTITIES:a.XML_ENTITIES;return o&&r.setDocumentLocator(o),n.errorHandler=h(s,r,o),n.domBuilder=i.domBuilder||r,d&&(l[""]=u.HTML),l.xml=l.xml||u.XML,e&&"string"===typeof e?n.parse(e,l,f):n.errorHandler.error("invalid doc source"),r.doc},p.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),s=n.length;y(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var o=0;o<s;o++){e=n.getURI(o);var u=n.getValue(o),l=(i=n.getQName(o),r.createAttributeNS(e,i));this.locator&&f(n.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,i),y(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=g.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&f(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=g.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&f(this.locator,n),y(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(e,t,i);this.locator&&f(this.locator,r),y(this,r),this.doc.doctype=r}},warning:function(e){},error:function(e){},fatalError:function(e){throw new l(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){p.prototype[e]=function(){return null}})),t.__DOMHandler=p,t.DOMParser=d,t.DOMImplementation=r.DOMImplementation,t.XMLSerializer=r.XMLSerializer},b30f:function(e,t,i){var n=i("89a7").freeze;t.XML_ENTITIES=n({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},b483:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("31ce"),a=i("8890"),s=n(a);t["default"]={decrypt:r.decrypt,Decrypter:r.Decrypter,AsyncStream:s["default"]},e.exports=t["default"]},b639:function(e,t,i){"use strict";(function(e){
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <http://feross.org>
- * @license MIT
- */
- var n=i("1fb5"),r=i("9152"),a=i("e3db");function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"===typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=l.prototype):(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,i){if(!l.TYPED_ARRAY_SUPPORT&&!(this instanceof l))return new l(e,t,i);if("number"===typeof e){if("string"===typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,i)}function c(e,t,i,n){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?g(e,t,i,n):"string"===typeof t?f(e,t,i):y(e,t)}function d(e){if("number"!==typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t,i,n){return d(t),t<=0?u(e,t):void 0!==i?"string"===typeof n?u(e,t).fill(i,n):u(e,t).fill(i):u(e,t)}function p(e,t){if(d(t),e=u(e,t<0?0:0|v(t)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function f(e,t,i){if("string"===typeof i&&""!==i||(i="utf8"),!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(t,i);e=u(e,n);var r=e.write(t,i);return r!==n&&(e=e.slice(0,r)),e}function m(e,t){var i=t.length<0?0:0|v(t.length);e=u(e,i);for(var n=0;n<i;n+=1)e[n]=255&t[n];return e}function g(e,t,i,n){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,i):new Uint8Array(t,i,n),l.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=l.prototype):e=m(e,t),e}function y(e,t){if(l.isBuffer(t)){var i=0|v(t.length);return e=u(e,i),0===e.length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!==typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!==typeof t.length||te(t.length)?u(e,0):m(e,t);if("Buffer"===t.type&&a(t.data))return m(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),l.alloc(+e)}function b(e,t){if(l.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Z(e).length;default:if(n)return K(e).length;t=(""+t).toLowerCase(),n=!0}}function T(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,t>>>=0,i<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return N(this,t,i);case"utf8":case"utf-8":return P(this,t,i);case"ascii":return M(this,t,i);case"latin1":case"binary":return U(this,t,i);case"base64":return L(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function w(e,t,i,n,r){if(0===e.length)return-1;if("string"===typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"===typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:E(e,t,i,n,r);if("number"===typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):E(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function E(e,t,i,n,r){var a,s=1,o=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,i/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var c=-1;for(a=i;a<o;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(i+u>o&&(i=o-u),a=i;a>=0;a--){for(var d=!0,h=0;h<u;h++)if(l(e,a+h)!==l(t,h)){d=!1;break}if(d)return a}return-1}function k(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[i+s]=o}return s}function C(e,t,i,n){return ee(K(t,e.length-i),e,i,n)}function O(e,t,i,n){return ee(Q(t),e,i,n)}function A(e,t,i,n){return O(e,t,i,n)}function x(e,t,i,n){return ee(Z(t),e,i,n)}function I(e,t,i,n){return ee(J(t,e.length-i),e,i,n)}function L(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function P(e,t,i){i=Math.min(e.length,i);var n=[],r=t;while(r<i){var a,s,o,u,l=e[r],c=null,d=l>239?4:l>223?3:l>191?2:1;if(r+d<=i)switch(d){case 1:l<128&&(c=l);break;case 2:a=e[r+1],128===(192&a)&&(u=(31&l)<<6|63&a,u>127&&(c=u));break;case 3:a=e[r+1],s=e[r+2],128===(192&a)&&128===(192&s)&&(u=(15&l)<<12|(63&a)<<6|63&s,u>2047&&(u<55296||u>57343)&&(c=u));break;case 4:a=e[r+1],s=e[r+2],o=e[r+3],128===(192&a)&&128===(192&s)&&128===(192&o)&&(u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o,u>65535&&u<1114112&&(c=u))}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=d}return R(n)}t.Buffer=l,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:s(),t.kMaxLength=o(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,i){return c(null,e,t,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,i){return h(null,e,t,i)},l.allocUnsafe=function(e){return p(null,e)},l.allocUnsafeSlow=function(e){return p(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,a=Math.min(i,n);r<a;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=l.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var s=e[i];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},l.byteLength=b,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)S(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?P(this,0,e):T.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,i,n,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,r>>>=0,this===e)return 0;for(var a=r-n,s=i-t,o=Math.min(a,s),u=this.slice(n,r),c=e.slice(t,i),d=0;d<o;++d)if(u[d]!==c[d]){a=u[d],s=c[d];break}return a<s?-1:s<a?1:0},l.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},l.prototype.indexOf=function(e,t,i){return w(this,e,t,i,!0)},l.prototype.lastIndexOf=function(e,t,i){return w(this,e,t,i,!1)},l.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"===typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return k(this,e,t,i);case"utf8":case"utf-8":return C(this,e,t,i);case"ascii":return O(this,e,t,i);case"latin1":case"binary":return A(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function R(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var i="",n=0;while(n<t)i+=String.fromCharCode.apply(String,e.slice(n,n+=D));return i}function M(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function U(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function N(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",a=t;a<i;++a)r+=$(e[a]);return r}function j(e,t,i){for(var n=e.slice(t,i),r="",a=0;a<n.length;a+=2)r+=String.fromCharCode(n[a]+256*n[a+1]);return r}function B(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,i,n,r,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function q(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,a=Math.min(e.length-i,2);r<a;++r)e[i+r]=(t&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function H(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,a=Math.min(e.length-i,4);r<a;++r)e[i+r]=t>>>8*(n?r:3-r)&255}function V(e,t,i,n,r,a){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function z(e,t,i,n,a){return a||V(e,t,i,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,i,n,23,4),i+4}function W(e,t,i,n,a){return a||V(e,t,i,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,i,n,52,8),i+8}l.prototype.slice=function(e,t){var i,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=l.prototype;else{var r=t-e;i=new l(r,void 0);for(var a=0;a<r;++a)i[a]=this[a+e]}return i},l.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);var n=this[e],r=1,a=0;while(++a<t&&(r*=256))n+=this[e+a]*r;return n},l.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);var n=this[e+--t],r=1;while(t>0&&(r*=256))n+=this[e+--t]*r;return n},l.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);var n=this[e],r=1,a=0;while(++a<t&&(r*=256))n+=this[e+a]*r;return r*=128,n>=r&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||B(e,t,this.length);var n=t,r=1,a=this[e+--n];while(n>0&&(r*=256))a+=this[e+--n]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t|=0,i|=0,!n){var r=Math.pow(2,8*i)-1;F(this,e,t,i,r,0)}var a=1,s=0;this[t]=255&e;while(++s<i&&(a*=256))this[t+s]=e/a&255;return t+i},l.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t|=0,i|=0,!n){var r=Math.pow(2,8*i)-1;F(this,e,t,i,r,0)}var a=i-1,s=1;this[t+a]=255&e;while(--a>=0&&(s*=256))this[t+a]=e/s&255;return t+i},l.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);F(this,e,t,i,r-1,-r)}var a=0,s=1,o=0;this[t]=255&e;while(++a<i&&(s*=256))e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+i},l.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);F(this,e,t,i,r-1,-r)}var a=i-1,s=1,o=0;this[t+a]=255&e;while(--a>=0&&(s*=256))e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+i},l.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,i){return z(this,e,t,!0,i)},l.prototype.writeFloatBE=function(e,t,i){return z(this,e,t,!1,i)},l.prototype.writeDoubleLE=function(e,t,i){return W(this,e,t,!0,i)},l.prototype.writeDoubleBE=function(e,t,i){return W(this,e,t,!1,i)},l.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r,a=n-i;if(this===e&&i<t&&t<n)for(r=a-1;r>=0;--r)e[r+t]=this[r+i];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<a;++r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},l.prototype.fill=function(e,t,i,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,i=this.length):"string"===typeof i&&(n=i,i=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"===typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"===typeof e)for(a=t;a<i;++a)this[a]=e;else{var s=l.isBuffer(e)?e:K(new l(e,n).toString()),o=s.length;for(a=0;a<i-t;++a)this[a+t]=s[a%o]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function X(e){if(e=Y(e).replace(G,""),e.length<2)return"";while(e.length%4!==0)e+="=";return e}function Y(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){var i;t=t||1/0;for(var n=e.length,r=null,a=[],s=0;s<n;++s){if(i=e.charCodeAt(s),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function Q(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function J(e,t){for(var i,n,r,a=[],s=0;s<e.length;++s){if((t-=2)<0)break;i=e.charCodeAt(s),n=i>>8,r=i%256,a.push(r),a.push(n)}return a}function Z(e){return n.toByteArray(X(e))}function ee(e,t,i,n){for(var r=0;r<n;++r){if(r+i>=t.length||r>=e.length)break;t[r+i]=e[r]}return r}function te(e){return e!==e}}).call(this,i("c8ba"))},b680:function(e,t,i){"use strict";var n=i("23e7"),r=i("a691"),a=i("408a"),s=i("1148"),o=i("d039"),u=1..toFixed,l=Math.floor,c=function(e,t,i){return 0===t?i:t%2===1?c(e,t-1,i*e):c(e*e,t/2,i)},d=function(e){var t=0,i=e;while(i>=4096)t+=12,i/=4096;while(i>=2)t+=1,i/=2;return t},h=function(e,t,i){var n=-1,r=i;while(++n<6)r+=t*e[n],e[n]=r%1e7,r=l(r/1e7)},p=function(e,t){var i=6,n=0;while(--i>=0)n+=e[i],e[i]=l(n/t),n=n%t*1e7},f=function(e){var t=6,i="";while(--t>=0)if(""!==i||0===t||0!==e[t]){var n=String(e[t]);i=""===i?n:i+s.call("0",7-n.length)+n}return i},m=u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!o((function(){u.call({})}));n({target:"Number",proto:!0,forced:m},{toFixed:function(e){var t,i,n,o,u=a(this),l=r(e),m=[0,0,0,0,0,0],g="",y="0";if(l<0||l>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(g="-",u=-u),u>1e-21)if(t=d(u*c(2,69,1))-69,i=t<0?u*c(2,-t,1):u/c(2,t,1),i*=4503599627370496,t=52-t,t>0){h(m,0,i),n=l;while(n>=7)h(m,1e7,0),n-=7;h(m,c(10,n,1),0),n=t-1;while(n>=23)p(m,1<<23),n-=23;p(m,1<<n),h(m,1,1),p(m,2),y=f(m)}else h(m,0,i),h(m,1<<-t,0),y=f(m)+s.call("0",l);return l>0?(o=y.length,y=g+(o<=l?"0."+s.call("0",l-o)+y:y.slice(0,o-l)+"."+y.slice(o-l))):y=g+y,y}})},ba2d:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("be09"),a=n(r),s=i("3d33"),o=n(s),u=function(e){Object.defineProperties(e.frame,{id:{get:function(){return o["default"].log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return o["default"].log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return o["default"].log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},l=function(e){var t=void 0;return t=isNaN(e)||Math.abs(e)===1/0?Number.MAX_VALUE:e,t},c=function(e,t,i){var n=a["default"].WebKitDataCue||a["default"].VTTCue;t&&t.forEach((function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new n(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))}),e),i&&function(){var t=l(e.mediaSource_.duration);i.forEach((function(e){var t=e.cueTime+this.timestampOffset;e.frames.forEach((function(e){var i=new n(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,u(i),this.metadataTrack_.addCue(i)}),this)}),e),e.metadataTrack_&&e.metadataTrack_.cues&&e.metadataTrack_.cues.length&&function(){for(var i=e.metadataTrack_.cues,n=[],r=0;r<i.length;r++)i[r]&&n.push(i[r]);var a=n.reduce((function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),s=Object.keys(a).sort((function(e,t){return Number(e)-Number(t)}));s.forEach((function(e,i){var n=a[e],r=Number(s[i+1])||t;n.forEach((function(e){e.endTime=r}))}))}()}()};t["default"]={addTextTrackData:c,durationOfVideo:l},e.exports=t["default"]},be09:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},c795:function(e,t,i){"use strict";var n=i("ddac"),r=l(n),a=i("59a0"),s=l(a),o=i("466b"),u=l(o);function l(e){return e&&e.__esModule?e:{default:e}}e.exports={LineStream:r["default"],ParseStream:s["default"],Parser:u["default"]}},c7ca:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("2806"),l=a(u),c=i("dc3e"),d=i("d61a"),h=i("3d33"),p=a(h),f=[{name:"VOD",run:function(e,t,i,n,r){if(i!==1/0){var a={time:0,segmentIndex:0};return a}return null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(e.datetimeToDisplayTime&&t.dateTimeObject){var a=t.dateTimeObject.getTime()/1e3,s=a+e.datetimeToDisplayTime,o={time:s,segmentIndex:0};return o}return null}},{name:"Segment",run:function(e,t,i,n,r){var a=t.segments||[],s=null,o=null;r=r||0;for(var u=0;u<a.length;u++){var l=a[u];if(l.timeline===n&&"undefined"!==typeof l.start){var c=Math.abs(r-l.start);if(null!==o&&o<c)break;(!s||null===o||o>=c)&&(o=c,s={time:l.start,segmentIndex:u})}}return s}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence};return a}return null}}];t.syncPointStrategies=f;var m=function(e){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.inspectCache_=void 0,this.timelines=[],this.discontinuities=[],this.datetimeToDisplayTime=null,e.debug&&(this.logger_=p["default"].log.bind(p["default"],"sync-controller ->"))}return o(t,e),n(t,[{key:"getSyncPoint",value:function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+(0,d.sumDurations)(e,n.segmentIndex,0))}},{key:"runStrategies_",value:function(e,t,i,n){for(var r=[],a=0;a<f.length;a++){var s=f[a],o=s.run(this,e,t,i,n);o&&(o.strategy=s.name,r.push({strategy:s.name,syncPoint:o}),this.logger_("syncPoint found via <"+s.name+">:",o))}return r}},{key:"selectSyncPoint_",value:function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<n&&(n=s,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint with strategy <"+r+"> chosen: ",i),i}},{key:"saveExpiredSegmentInfo",value:function(e,t){for(var i=t.mediaSequence-e.mediaSequence,n=i-1;n>=0;n--){var r=e.segments[n];if(r&&"undefined"!==typeof r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist sync:",t.syncInfo),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(e){if(!this.datetimeToDisplayTime&&e.dateTimeObject){var t=e.dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-t}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(e){var t=e.segment,i=e.playlist,n=void 0;return n=t.map?this.probeMp4Segment_(e):this.probeTsSegment_(e),n&&this.calculateSegmentTimeMapping_(e,n)&&(this.saveDiscontinuitySyncInfo_(e),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:t.start})),n}},{key:"probeMp4Segment_",value:function(e){var t=e.segment,i=l["default"].timescale(t.map.bytes),n=l["default"].startTime(i,e.bytes);return null!==e.timestampOffset&&(e.timestampOffset-=n),{start:n,end:n+t.duration}}},{key:"probeTsSegment_",value:function(e){var t=(0,c.inspect)(e.bytes,this.inspectCache_),i=void 0,n=void 0;return t?(t.video&&2===t.video.length?(this.inspectCache_=t.video[1].dts,i=t.video[0].dtsTime,n=t.video[1].dtsTime):t.audio&&2===t.audio.length&&(this.inspectCache_=t.audio[1].dts,i=t.audio[0].dtsTime,n=t.audio[1].dtsTime),{start:i,end:n,containsVideo:t.video&&2===t.video.length,containsAudio:t.audio&&2===t.audio.length}):null}},{key:"timestampOffsetForTimeline",value:function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return"undefined"===typeof this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t){var i=e.segment,n=this.timelines[e.timeline];if(null!==e.timestampOffset)this.logger_("tsO:",e.timestampOffset),n={time:e.startOfSegment,mapping:e.startOfSegment-t.start},this.timelines[e.timeline]=n,this.trigger("timestampoffset"),i.start=e.startOfSegment,i.end=t.end+n.mapping;else{if(!n)return!1;i.start=t.start+n.mapping,i.end=t.end+n.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r=t.discontinuityStarts[n],a=t.discontinuitySequence+n+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?i.start-(0,d.sumDurations)(t,e.mediaIndex,r):i.end+(0,d.sumDurations)(t,e.mediaIndex+1,r),this.discontinuities[a]={time:u,accuracy:o}}}}},{key:"logger_",value:function(){}}]),t}(p["default"].EventTarget);t["default"]=m},cc57:function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},a=i(1);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a)),e.exports=n}).call(this,i("c8ba"))},cdad:function(e,t,i){"use strict";t.pad=i("72a5"),t.unpad=i("e647")},d02c4:function(e,t){var i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function n(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function r(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function a(){this.values=i(null)}function s(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"===typeof r[a]){var s=r[a].split(i);if(2===s.length){var o=s[0],u=s[1];t(o,u)}}}function o(e,t,i){var o=e;function u(){var t=r(e);if(null===t)throw new n(n.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(e,t){var n=new a;s(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","middle","end","left","right"]);break}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical",""),t.line=n.get("line","auto"),t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align","middle"),t.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=n.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=u(),c(),"--\x3e"!==e.substr(0,3))throw new n(n.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),c(),t.endTime=u(),c(),l(e,t)}n.prototype=i(Error.prototype),n.prototype.constructor=n,n.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},a.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var u={"&":"&","<":"<",">":">","‎":"","‏":""," ":" "},l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={v:"title",lang:"lang"},d={rt:"ruby"};function h(e,t){function i(){if(!t)return null;function e(e){return t=t.substr(e.length),e}var i=t.match(/^([^<]*)(<[^>]*>?)?/);return e(i[1]?i[1]:i[2])}function n(e){return u[e]}function a(e){while(v=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/))e=e.replace(v[0],n);return e}function s(e,t){return!d[t.localName]||d[t.localName]===e.localName}function o(t,i){var n=l[t];if(!n)return null;var r=e.document.createElement(n);r.localName=n;var a=c[t];return a&&i&&(r[a]=i.trim()),r}var h,p=e.document.createElement("div"),f=p,m=[];while(null!==(h=i()))if("<"!==h[0])f.appendChild(e.document.createTextNode(a(h)));else{if("/"===h[1]){m.length&&m[m.length-1]===h.substr(2).replace(">","")&&(m.pop(),f=f.parentNode);continue}var g,y=r(h.substr(1,h.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),f.appendChild(g);continue}var v=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(g=o(v[1],v[3]),!g)continue;if(!s(f,g))continue;v[2]&&(g.className=v[2].substr(1).replace("."," ")),m.push(v[1]),f.appendChild(g),f=g}return p}var p=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function f(e){for(var t=0;t<p.length;t++){var i=p[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function m(e){var t,i=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?a(e):t.childNodes?(r(e,t),a(e)):void 0}r(i,e);while(n=a(i))for(var s=0;s<n.length;s++)if(t=n.charCodeAt(s),f(t))return"rtl";return"ltr"}function g(e){if("number"===typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}function y(){}function v(e,t,i){var n=/MSIE\s8\.0/.test(navigator.userAgent),r="rgba(255, 255, 255, 1)",a="rgba(0, 0, 0, 0.8)";n&&(r="rgb(255, 255, 255)",a="rgb(0, 0, 0)"),y.call(this),this.cue=t,this.cueDiv=h(e,t.text);var s={color:r,backgroundColor:a,position:"relative",left:0,right:0,top:0,bottom:0,display:"inline"};n||(s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",s.unicodeBidi="plaintext"),this.applyStyles(s,this.cueDiv),this.div=e.document.createElement("div"),s={textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},n||(s.direction=m(this.cueDiv),s.writingMode=""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl".stylesunicodeBidi="plaintext"),this.applyStyles(s),this.div.appendChild(this.cueDiv);var o=0;switch(t.positionAlign){case"start":o=t.position;break;case"middle":o=t.position-t.size/2;break;case"end":o=t.position-t.size;break}""===t.vertical?this.applyStyles({left:this.formatStyle(o,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(o,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function _(e){var t,i,n,r,a=/MSIE\s8\.0/.test(navigator.userAgent);if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,r=e.div.offsetTop;var s=(s=e.div.childNodes)&&(s=s[0])&&s.getClientRects&&s.getClientRects();e=e.div.getBoundingClientRect(),t=s?Math.max(s[0]&&s[0].height||0,e.height/s.length):0}this.left=e.left,this.right=e.right,this.top=e.top||r,this.height=e.height||i,this.bottom=e.bottom||r+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight,a&&!this.lineHeight&&(this.lineHeight=13)}function b(e,t,i,n){function r(e,t){for(var r,a=new _(e),s=1,o=0;o<t.length;o++){while(e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n))e.move(t[o]);if(e.within(i))return e;var u=e.intersectPercentage(i);s>u&&(r=new _(e),s=u),e=new _(a)}return r||a}var a=new _(t),s=t.cue,o=g(s),u=[];if(s.snapToLines){var l;switch(s.vertical){case"":u=["+y","-y"],l="height";break;case"rl":u=["+x","-x"],l="width";break;case"lr":u=["-x","+x"],l="width";break}var c=a.lineHeight,d=c*Math.round(o),h=i[l]+c,p=u[0];Math.abs(d)>h&&(d=d<0?-1:1,d*=Math.ceil(h/c)*c),o<0&&(d+=""===s.vertical?i.height:i.width,u=u.reverse()),a.move(p,d)}else{var f=a.lineHeight/i.height*100;switch(s.lineAlign){case"middle":o-=f/2;break;case"end":o-=f;break}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break}u=["+y","-x","+x","-y"],a=new _(t)}var m=r(a,u);t.move(m.toCSSCompatValues(i))}function T(){}y.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},y.prototype.formatStyle=function(e,t){return 0===e?0:e+t},v.prototype=i(y.prototype),v.prototype.constructor=v,_.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;break}},_.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},_.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},_.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},_.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},_.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)},_.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},_.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return r},T.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!==typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},T.convertCueToDOMTree=function(e,t){return e&&t?h(e,t):null};var S=.05,w="sans-serif",E="1.5%";T.processCues=function(e,t,i){if(!e||!t||!i)return null;while(i.firstChild)i.removeChild(i.firstChild);var n=e.document.createElement("div");function r(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=E,i.appendChild(n),r(t)){var a=[],s=_.getSimpleBoxPosition(n),o=Math.round(s.height*S*100)/100,u={font:o+"px "+w};(function(){for(var i,r,o=0;o<t.length;o++)r=t[o],i=new v(e,r,u),n.appendChild(i.div),b(e,i,s,a),r.displayState=i.div,a.push(_.getSimpleBoxPosition(i))})()}else for(var l=0;l<t.length;l++)n.appendChild(t[l].displayState)},T.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},T.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof n))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function i(){var e=t.buffer,i=0;while(i<e.length&&"\r"!==e[i]&&"\n"!==e[i])++i;var n=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),n}function u(e){var i=new a;if(s(e,(function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var n=t.split(",");if(2!==n.length)break;var r=new a;if(r.percent("x",n[0]),r.percent("y",n[1]),!r.has("x")||!r.has("y"))break;i.set(e+"X",r.get("x")),i.set(e+"Y",r.get("y"));break;case"scroll":i.alt(e,t,["up"]);break}}),/=/,/\s/),i.has("id")){var n=new(t.vttjs.VTTRegion||t.window.VTTRegion);n.width=i.get("width",100),n.lines=i.get("lines",3),n.regionAnchorX=i.get("regionanchorX",0),n.regionAnchorY=i.get("regionanchorY",100),n.viewportAnchorX=i.get("viewportanchorX",0),n.viewportAnchorY=i.get("viewportanchorY",100),n.scroll=i.get("scroll",""),t.onregion&&t.onregion(n),t.regionList.push({id:i.get("id"),region:n})}}function l(e){var i=new a;s(e,(function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",r(t));break}}),/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function c(e){e.match(/X-TIMESTAMP-MAP/)?s(e,(function(e,t){switch(e){case"X-TIMESTAMP-MAP":l(t);break}}),/=/):s(e,(function(e,t){switch(e){case"Region":u(t);break}}),/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var d;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;d=i();var h=d.match(/^WEBVTT([ \t].*)?$/);if(!h||!h[0])throw new n(n.Errors.BadSignature);t.state="HEADER"}var p=!1;while(t.buffer){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:d=i(),t.state){case"HEADER":/:/.test(d)?c(d):d||(t.state="ID");continue;case"NOTE":d||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(d)){t.state="NOTE";break}if(!d)continue;if(t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,""),t.state="CUE",-1===d.indexOf("--\x3e")){t.cue.id=d;continue}case"CUE":try{o(d,t.cue,t.regionList)}catch(m){t.reportOrThrowError(m),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var f=-1!==d.indexOf("--\x3e");if(!d||f&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=d;continue;case"BADCUE":d||(t.state="ID");continue}}}catch(m){t.reportOrThrowError(m),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new n(n.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=T},d136:function(e,t,i){(function(t){var i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),t=t.trim(),!t){if(!i.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return i.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=n.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=i.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){e=e.split("").reverse().join("").replace(r,"");while(e.length!==(e=e.replace(a,"")).length);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s})()},d3ae:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done);n=!0)if(i.push(s.value),t&&i.length===t)break}catch(u){r=!0,a=u}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw a}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function r(e){return e&&e.__esModule?e:{default:e}}var a=i("3d33"),s=r(a),o=1/30,u=3*o,l=function(e,t){var i=n(t,2),r=i[0],a=i[1];return Math.min(Math.max(r,e),a)},c=function(e,t){var i=[],n=void 0;if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return s["default"].createTimeRanges(i)},d=function(e,t){return c(e,(function(e,i){return e-o<=t&&i+o>=t}))},h=function(e,t){return c(e,(function(e){return e-o>=t}))},p=function(e){if(e.length<2)return s["default"].createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return s["default"].createTimeRanges(t)},f=function(e,t){var i=void 0,n=void 0,r=void 0,a=[],s=[],o=function(e){return e[0]<=r&&e[1]>=r};if(e)for(i=0;i<e.length;i++)n=e.start(i),r=e.end(i),s.push([n,r]);if(t)for(i=0;i<t.length;i++)n=t.start(i),r=t.end(i),s.some(o)||a.push(r);return 1!==a.length?null:a[0]},m=function(e,t){var i=null,n=null,r=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return s["default"].createTimeRange();var u=e.length;while(u--)a.push({time:e.start(u),type:"start"}),a.push({time:e.end(u),type:"end"});u=t.length;while(u--)a.push({time:t.start(u),type:"start"}),a.push({time:t.end(u),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),u=0;u<a.length;u++)"start"===a[u].type?(r++,2===r&&(i=a[u].time)):"end"===a[u].type&&(r--,1===r&&(n=a[u].time)),null!==i&&null!==n&&(o.push([i,n]),i=null,n=null);return s["default"].createTimeRanges(o)},g=function(e,t,i,n){var r=t.end(0)-t.start(0),a=e.end(0)-e.start(0),s=r-a,o=m(e,n),u=m(t,n),l=0,c=0,d=o.length;while(d--)l+=o.end(d)-o.start(d),o.start(d)===i&&(l+=s);d=u.length;while(d--)c+=u.end(d)-u.start(d);return Math.max(l,c)/r*100},y=function(e,t,i,n){var r=e+t,a=s["default"].createTimeRanges([[e,r]]),o=s["default"].createTimeRanges([[l(e,[i,r]),r]]);if(o.start(0)===o.end(0))return 0;var u=g(o,a,i,n);return isNaN(u)||u===1/0||u===-1/0?0:u},v=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},_=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2],n=e.length?e.end(e.length-1):0;return(n-t)/i};t["default"]={findRange:d,findNextRange:h,findGaps:p,findSoleUncommonTimeRangesEnd:f,getSegmentBufferedPercent:y,TIME_FUDGE_FACTOR:o,SAFE_TIME_DELTA:u,printableRange:v,timeUntilRebuffer:_},e.exports=t["default"]},d61a:function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=i("3d33"),a=i("be09"),s=n(a),o=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if("undefined"!==typeof r.start)return{result:r.start,precise:!0};if("undefined"!==typeof r.end)return{result:r.end-r.duration,precise:!0}}while(n--){if(r=e.segments[n],"undefined"!==typeof r.end)return{result:i+r.end,precise:!0};if(i+=r.duration,"undefined"!==typeof r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},u=function(e,t){for(var i=0,n=void 0,r=t-e.mediaSequence;r<e.segments.length;r++){if(n=e.segments[r],"undefined"!==typeof n.start)return{result:n.start-i,precise:!0};if(i+=n.duration,"undefined"!==typeof n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}},l=function(e,t,i){var n=void 0,r=void 0;return"undefined"===typeof t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence?0:(n=o(e,t),n.precise?n.result:(r=u(e,t),r.precise?r.result:n.result+i))},c=function(e,t,i){if(!e)return 0;if("number"!==typeof i&&(i=0),"undefined"===typeof t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return s["default"].Infinity}return l(e,t,i)};t.duration=c;var d=function(e,t,i){var n=0;if(t>i){var r=[i,t];t=r[0],i=r[1]}if(t<0){for(var a=t;a<Math.min(0,i);a++)n+=e.targetDuration;t=0}for(a=t;a<i;a++)n+=e.segments[a].duration;return n};t.sumDurations=d;var h=function(e){if(!e.segments.length)return 0;var t=e.segments.length-1,i=e.segments[t].duration||e.targetDuration,n=i+2*e.targetDuration;while(t--)if(i+=e.segments[t].duration,i>=n)break;return Math.max(0,t)};t.safeLiveIndex=h;var p=function(e,t,i){if(!e||!e.segments)return null;if(e.endList)return c(e);if(null===t)return null;t=t||0;var n=i?h(e):e.segments.length;return l(e,e.mediaSequence+n,t)};t.playlistEnd=p;var f=function(e,t){var i=!0,n=t||0,a=p(e,t,i);return null===a?(0,r.createTimeRange)():(0,r.createTimeRange)(n,a)};t.seekable=f;var m=function(e){return e-Math.floor(e)===0},g=function(e,t){if(m(t))return t+.1*e;for(var i=t.toString().split(".")[1].length,n=1;n<=i;n++){var r=Math.pow(10,n),a=t*r;if(m(a)||n===i)return(a+e)/r}},y=g.bind(null,1),v=g.bind(null,-1),_=function(e,t,i,n){var r=void 0,a=void 0,s=e.segments.length,o=t-n;if(o<0){if(i>0)for(r=i-1;r>=0;r--)if(a=e.segments[r],o+=v(a.duration),o>0)return{mediaIndex:r,startTime:n-d(e,i,r)};return{mediaIndex:0,startTime:t}}if(i<0){for(r=i;r<0;r++)if(o-=e.targetDuration,o<0)return{mediaIndex:0,startTime:t};i=0}for(r=i;r<s;r++)if(a=e.segments[r],o-=y(a.duration),o<0)return{mediaIndex:r,startTime:n+d(e,i,r)};return{mediaIndex:s-1,startTime:t}};t.getMediaInfoForTime=_;var b=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};t.isBlacklisted=b;var T=function(e){return e.excludeUntil&&e.excludeUntil===1/0};t.isIncompatible=T;var S=function(e){var t=b(e);return!e.disabled&&!t};t.isEnabled=S;var w=function(e){return e.disabled};t.isDisabled=w;var E=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1};t.isAes=E;var k=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].map)return!0;return!1};t.isFmp4=k;var C=function(e,t){return t.attributes&&t.attributes[e]};t.hasAttribute=C;var O=function(e,t,i){var n=arguments.length<=3||void 0===arguments[3]?0:arguments[3];if(!C("BANDWIDTH",i))return NaN;var r=e*i.attributes.BANDWIDTH;return(r-8*n)/t};t.estimateSegmentRequestTime=O;var A=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!S(e)&&(e.attributes.BANDWIDTH||0)<i})).length};t.isLowestEnabledRendition=A,t["default"]={duration:c,seekable:f,safeLiveIndex:h,getMediaInfoForTime:_,isEnabled:S,isDisabled:w,isBlacklisted:b,isIncompatible:T,playlistEnd:p,isAes:E,isFmp4:k,hasAttribute:C,estimateSegmentRequestTime:O,isLowestEnabledRendition:A}},d7ba:function(e,t,i){"use strict";var n;n=function(e,t){var i,r=0,a=16384,s=function(e,t){var i,n=e.position+t;n<e.bytes.byteLength||(i=new Uint8Array(2*n),i.set(e.bytes.subarray(0,e.position),0),e.bytes=i,e.view=new DataView(e.bytes.buffer))},o=n.widthBytes||new Uint8Array("width".length),u=n.heightBytes||new Uint8Array("height".length),l=n.videocodecidBytes||new Uint8Array("videocodecid".length);if(!n.widthBytes){for(i=0;i<"width".length;i++)o[i]="width".charCodeAt(i);for(i=0;i<"height".length;i++)u[i]="height".charCodeAt(i);for(i=0;i<"videocodecid".length;i++)l[i]="videocodecid".charCodeAt(i);n.widthBytes=o,n.heightBytes=u,n.videocodecidBytes=l}switch(this.keyFrame=!1,e){case n.VIDEO_TAG:this.length=16,a*=6;break;case n.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case n.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw new Error("Unknown FLV tag type")}this.bytes=new Uint8Array(a),this.view=new DataView(this.bytes.buffer),this.bytes[0]=e,this.position=this.length,this.keyFrame=t,this.pts=0,this.dts=0,this.writeBytes=function(e,t,i){var n,r=t||0;i=i||e.byteLength,n=r+i,s(this,i),this.bytes.set(e.subarray(r,n),this.position),this.position+=i,this.length=Math.max(this.length,this.position)},this.writeByte=function(e){s(this,1),this.bytes[this.position]=e,this.position++,this.length=Math.max(this.length,this.position)},this.writeShort=function(e){s(this,2),this.view.setUint16(this.position,e),this.position+=2,this.length=Math.max(this.length,this.position)},this.negIndex=function(e){return this.bytes[this.length-e]},this.nalUnitSize=function(){return 0===r?0:this.length-(r+4)},this.startNalUnit=function(){if(r>0)throw new Error("Attempted to create new NAL wihout closing the old one");r=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(e){var t,i;this.length===r+4?this.length-=4:r>0&&(t=r+4,i=this.length-t,this.position=r,this.view.setUint32(this.position,i),this.position=this.length,e&&e.push(this.bytes.subarray(t,t+i))),r=0},this.writeMetaDataDouble=function(e,t){var i;if(s(this,2+e.length+9),this.view.setUint16(this.position,e.length),this.position+=2,"width"===e)this.bytes.set(o,this.position),this.position+=5;else if("height"===e)this.bytes.set(u,this.position),this.position+=6;else if("videocodecid"===e)this.bytes.set(l,this.position),this.position+=12;else for(i=0;i<e.length;i++)this.bytes[this.position]=e.charCodeAt(i),this.position++;this.position++,this.view.setFloat64(this.position,t),this.position+=8,this.length=Math.max(this.length,this.position),++r},this.writeMetaDataBoolean=function(e,t){var i;for(s(this,2),this.view.setUint16(this.position,e.length),this.position+=2,i=0;i<e.length;i++)s(this,1),this.bytes[this.position]=e.charCodeAt(i),this.position++;s(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,t?1:0),this.position++,this.length=Math.max(this.length,this.position),++r},this.finalize=function(){var e,i;switch(this.bytes[0]){case n.VIDEO_TAG:this.bytes[11]=7|(this.keyFrame||t?16:32),this.bytes[12]=t?0:1,e=this.pts-this.dts,this.bytes[13]=(16711680&e)>>>16,this.bytes[14]=(65280&e)>>>8,this.bytes[15]=(255&e)>>>0;break;case n.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=t?0:1;break;case n.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,r),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position;break}return i=this.length-11,this.bytes[1]=(16711680&i)>>>16,this.bytes[2]=(65280&i)>>>8,this.bytes[3]=(255&i)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,s(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=n.frameTime(this.bytes),this}},n.AUDIO_TAG=8,n.VIDEO_TAG=9,n.METADATA_TAG=18,n.isAudioFrame=function(e){return n.AUDIO_TAG===e[0]},n.isVideoFrame=function(e){return n.VIDEO_TAG===e[0]},n.isMetaData=function(e){return n.METADATA_TAG===e[0]},n.isKeyFrame=function(e){return n.isVideoFrame(e)?23===e[11]:!!n.isAudioFrame(e)||!!n.isMetaData(e)},n.frameTime=function(e){var t=e[4]<<16;return t|=e[5]<<8,t|=e[6]<<0,t|=e[7]<<24,t},e.exports=n},dc3e:function(e,t,i){"use strict";var n=i("ae75"),r=i("256f").handleRollover,a={};a.ts=i("423e"),a.aac=i("9946");var s=9e4,o=188,u=71,l=function(e){return e[0]==="I".charCodeAt(0)&&e[1]==="D".charCodeAt(0)&&e[2]==="3".charCodeAt(0)},c=function(e,t){var i,n,r=0,s=o;while(s<e.byteLength)if(e[r]!==u||e[s]!==u)r++,s++;else{switch(i=e.subarray(r,s),n=a.ts.parseType(i,t.pid),n){case"pat":t.pid||(t.pid=a.ts.parsePat(i));break;case"pmt":t.table||(t.table=a.ts.parsePmt(i));break;default:break}if(t.pid&&t.table)return;r+=o,s+=o}},d=function(e,t,i){var n,r,s,l,c,d=0,h=o,p=!1;while(h<e.byteLength)if(e[d]!==u||e[h]!==u)d++,h++;else{switch(n=e.subarray(d,h),r=a.ts.parseType(n,t.pid),r){case"pes":s=a.ts.parsePesType(n,t.table),l=a.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&l&&(c=a.ts.parsePesTime(n),c&&(c.type="audio",i.audio.push(c),p=!0));break;default:break}if(p)break;d+=o,h+=o}h=e.byteLength,d=h-o,p=!1;while(d>=0)if(e[d]!==u||e[h]!==u)d--,h--;else{switch(n=e.subarray(d,h),r=a.ts.parseType(n,t.pid),r){case"pes":s=a.ts.parsePesType(n,t.table),l=a.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&l&&(c=a.ts.parsePesTime(n),c&&(c.type="audio",i.audio.push(c),p=!0));break;default:break}if(p)break;d-=o,h-=o}},h=function(e,t,i){var n,r,s,l,c,d,h,p,f=0,m=o,g=!1,y={data:[],size:0};while(m<e.byteLength)if(e[f]!==u||e[m]!==u)f++,m++;else{switch(n=e.subarray(f,m),r=a.ts.parseType(n,t.pid),r){case"pes":if(s=a.ts.parsePesType(n,t.table),l=a.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(l&&!g&&(c=a.ts.parsePesTime(n),c&&(c.type="video",i.video.push(c),g=!0)),!i.firstKeyFrame)){if(l&&0!==y.size){d=new Uint8Array(y.size),h=0;while(y.data.length)p=y.data.shift(),d.set(p,h),h+=p.byteLength;a.ts.videoPacketContainsKeyFrame(d)&&(i.firstKeyFrame=a.ts.parsePesTime(d),i.firstKeyFrame.type="video"),y.size=0}y.data.push(n),y.size+=n.byteLength}break;default:break}if(g&&i.firstKeyFrame)break;f+=o,m+=o}m=e.byteLength,f=m-o,g=!1;while(f>=0)if(e[f]!==u||e[m]!==u)f--,m--;else{switch(n=e.subarray(f,m),r=a.ts.parseType(n,t.pid),r){case"pes":s=a.ts.parsePesType(n,t.table),l=a.ts.parsePayloadUnitStartIndicator(n),"video"===s&&l&&(c=a.ts.parsePesTime(n),c&&(c.type="video",i.video.push(c),g=!0));break;default:break}if(g)break;f-=o,m-=o}},p=function(e,t){if(e.audio&&e.audio.length){var i=t;"undefined"===typeof i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=r(e.dts,i),e.pts=r(e.pts,i),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s}))}if(e.video&&e.video.length){var n=t;if("undefined"===typeof n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=r(e.dts,n),e.pts=r(e.pts,n),e.dtsTime=e.dts/s,e.ptsTime=e.pts/s})),e.firstKeyFrame){var a=e.firstKeyFrame;a.dts=r(a.dts,n),a.pts=r(a.pts,n),a.dtsTime=a.dts/s,a.ptsTime=a.dts/s}}},f=function(e){var t,i=!1,n=0,r=null,o=null,u=0,l=0;while(e.length-l>=3){var c=a.aac.parseType(e,l);switch(c){case"timed-metadata":if(e.length-l<10){i=!0;break}if(u=a.aac.parseId3TagSize(e,l),u>e.length){i=!0;break}null===o&&(t=e.subarray(l,l+u),o=a.aac.parseAacTimestamp(t)),l+=u;break;case"audio":if(e.length-l<7){i=!0;break}if(u=a.aac.parseAdtsSize(e,l),u>e.length){i=!0;break}null===r&&(t=e.subarray(l,l+u),r=a.aac.parseSampleRate(t)),n++,l+=u;break;default:l++;break}if(i)return null}if(null===r||null===o)return null;var d=s/r,h={audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*d,pts:o+1024*n*d}]};return h},m=function(e){var t={pid:null,table:null},i={};for(var r in c(e,t),t.table)if(t.table.hasOwnProperty(r)){var a=t.table[r];switch(a){case n.H264_STREAM_TYPE:i.video=[],h(e,t,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],d(e,t,i),0===i.audio.length&&delete i.audio;break;default:break}}return i},g=function(e,t){var i,n=l(e);return i=n?f(e):m(e),i&&(i.audio||i.video)?(p(i,t),i):null};e.exports={inspect:g}},ddac:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i("fc85"),a=s(r);function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function l(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){function t(){o(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.buffer="",e}return l(t,e),n(t,[{key:"push",value:function(e){var t=void 0;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}]),t}(a["default"]);t["default"]=c},e003:function(e,t,i){var n=i("89a7").NAMESPACE,r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s=new RegExp("^"+r.source+a.source+"*(?::"+r.source+a.source+"*)?$"),o=0,u=1,l=2,c=3,d=4,h=5,p=6,f=7;function m(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,m)}function g(){}function y(e,t,i,r,a){function s(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function o(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?s(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function u(t){if(t>y){var i=e.substring(y,t).replace(/&#?\w+;/g,o);p&&l(y),r.characters(i,0,t-y),y=t}}function l(t,i){while(t>=d&&(i=h.exec(e)))c=i.index,d=c+i[0].length,p.lineNumber++;p.columnNumber=t-c+1}var c=0,d=0,h=/.*(?:\r\n?|\n)|.*$/g,p=r.locator,f=[{currentNSMap:t}],g={},y=0;while(1){try{var w=e.indexOf("<",y);if(w<0){if(!e.substr(y).match(/^\s*$/)){var O=r.doc,A=O.createTextNode(e.substr(y));O.appendChild(A),r.currentElement=A}return}switch(w>y&&u(w),e.charAt(w+1)){case"/":var x=e.indexOf(">",w+3),I=e.substring(w+2,x).replace(/[ \t\n\r]+$/g,""),L=f.pop();x<0?(I=e.substring(w+2).replace(/[\s<].*/,""),a.error("end tag name: "+I+" is not complete:"+L.tagName),x=w+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),a.error("end tag name: "+I+" maybe not complete"),x=w+1+I.length);var P=L.localNSMap,D=L.tagName==I,R=D||L.tagName&&L.tagName.toLowerCase()==I.toLowerCase();if(R){if(r.endElement(L.uri,L.localName,I),P)for(var M in P)r.endPrefixMapping(M);D||a.fatalError("end tag name: "+I+" is not match the current start tagName:"+L.tagName)}else f.push(L);x++;break;case"?":p&&l(w),x=k(e,w,r);break;case"!":p&&l(w),x=E(e,w,r,a);break;default:p&&l(w);var U=new C,N=f[f.length-1].currentNSMap,j=(x=_(e,w,U,N,o,a),U.length);if(!U.closed&&S(e,x,U.tagName,g)&&(U.closed=!0,i.nbsp||a.warning("unclosed xml attribute")),p&&j){for(var B=v(p,{}),F=0;F<j;F++){var q=U[F];l(q.offset),q.locator=v(p,{})}r.locator=B,b(U,r,N)&&f.push(U),r.locator=p}else b(U,r,N)&&f.push(U);n.isHTML(U.uri)&&!U.closed?x=T(e,x,U.tagName,o,r):x++}}catch(H){if(H instanceof m)throw H;a.error("element parse error: "+H),x=-1}x>y?y=x:u(Math.max(w,y)+1)}}function v(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function _(e,t,i,r,a,s){function m(e,t,n){i.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}var g,y=++t,v=o;while(1){var _=e.charAt(y);switch(_){case"=":if(v===u)g=e.slice(t,y),v=c;else{if(v!==l)throw new Error("attribute equal must after attrName");v=c}break;case"'":case'"':if(v===c||v===u){if(v===u&&(s.warning('attribute value must after "="'),g=e.slice(t,y)),t=y+1,y=e.indexOf(_,t),!(y>0))throw new Error("attribute value no end '"+_+"' match");b=e.slice(t,y).replace(/&#?\w+;/g,a),m(g,b,t-1),v=h}else{if(v!=d)throw new Error('attribute value must after "="');b=e.slice(t,y).replace(/&#?\w+;/g,a),m(g,b,t),s.warning('attribute "'+g+'" missed start quot('+_+")!!"),t=y+1,v=h}break;case"/":switch(v){case o:i.setTagName(e.slice(t,y));case h:case p:case f:v=f,i.closed=!0;case d:case u:case l:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),v==o&&i.setTagName(e.slice(t,y)),y;case">":switch(v){case o:i.setTagName(e.slice(t,y));case h:case p:case f:break;case d:case u:b=e.slice(t,y),"/"===b.slice(-1)&&(i.closed=!0,b=b.slice(0,-1));case l:v===l&&(b=g),v==d?(s.warning('attribute "'+b+'" missed quot(")!'),m(g,b.replace(/&#?\w+;/g,a),t)):(n.isHTML(r[""])&&b.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+b+'" missed value!! "'+b+'" instead!!'),m(b,b,t));break;case c:throw new Error("attribute value missed!!")}return y;case"":_=" ";default:if(_<=" ")switch(v){case o:i.setTagName(e.slice(t,y)),v=p;break;case u:g=e.slice(t,y),v=l;break;case d:var b=e.slice(t,y).replace(/&#?\w+;/g,a);s.warning('attribute "'+b+'" missed quot(")!!'),m(g,b,t);case h:v=p;break}else switch(v){case l:i.tagName;n.isHTML(r[""])&&g.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+g+'" missed value!! "'+g+'" instead2!!'),m(g,g,t),t=y,v=u;break;case h:s.warning('attribute space is required"'+g+'"!!');case p:v=u,t=y;break;case c:v=d,t=y;break;case f:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function b(e,t,i){var r=e.tagName,a=null,s=e.length;while(s--){var o=e[s],u=o.qName,l=o.value,c=u.indexOf(":");if(c>0)var d=o.prefix=u.slice(0,c),h=u.slice(c+1),p="xmlns"===d&&h;else h=u,d=null,p="xmlns"===u&&"";o.localName=h,!1!==p&&(null==a&&(a={},w(i,i={})),i[p]=a[p]=l,o.uri=n.XMLNS,t.startPrefixMapping(p,l))}s=e.length;while(s--){o=e[s];d=o.prefix;d&&("xml"===d&&(o.uri=n.XML),"xmlns"!==d&&(o.uri=i[d||""]))}c=r.indexOf(":");c>0?(d=e.prefix=r.slice(0,c),h=e.localName=r.slice(c+1)):(d=null,h=e.localName=r);var f=e.uri=i[d||""];if(t.startElement(f,h,r,e),!e.closed)return e.currentNSMap=i,e.localNSMap=a,!0;if(t.endElement(f,h,r),a)for(d in a)t.endPrefixMapping(d)}function T(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("</"+i+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),a)}return t+1}function S(e,t,i,n){var r=n[i];return null==r&&(r=e.lastIndexOf("</"+i+">"),r<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}function w(e,t){for(var i in e)t[i]=e[i]}function E(e,t,i,n){var r=e.charAt(t+2);switch(r){case"-":if("-"===e.charAt(t+3)){var a=e.indexOf("--\x3e",t+4);return a>t?(i.comment(e,t+4,a-t-4),a+3):(n.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){a=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,a-t-9),i.endCDATA(),a+3}var s=O(e,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var d=s[o-1];return i.startDTD(u,l,c),i.endDTD(),d.index+d[0].length}}return-1}function k(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function C(){this.attributeNames={}}function O(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);while(i=r.exec(e))if(n.push(i),i[1])return n}m.prototype=new Error,m.prototype.name=m.name,g.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),w(t,t={}),y(e,t,i,n,this.errorHandler),n.endDocument()}},C.prototype={setTagName:function(e){if(!s.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!s.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=g,t.ParseError=m},e044:function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=i("d61a"),a=function(e,t,i){return function(n){var a=e.master.playlists[t],s=(0,r.isIncompatible)(a),o=(0,r.isEnabled)(a);return"undefined"===typeof n?o:(n?delete a.disabled:a.disabled=!0,n===o||s||(i(),n?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),n)}},s=function e(t,i,r){n(this,e);var s=t.masterPlaylistController_.fastQualityChange_.bind(t.masterPlaylistController_);if(i.attributes.RESOLUTION){var o=i.attributes.RESOLUTION;this.width=o.width,this.height=o.height}this.bandwidth=i.attributes.BANDWIDTH,this.id=r,this.enabled=a(t.playlists,i.uri,s)},o=function(e){var t=e.playlists;e.representations=function(){return t.master.playlists.filter((function(e){return!(0,r.isIncompatible)(e)})).map((function(t,i){return new s(e,t,t.uri)}))}};t["default"]=o,e.exports=t["default"]},e1c8:function(e,t,i){var n=i("89a7"),r=n.NAMESPACE;function a(e){return""!==e}function s(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function u(e){if(!e)return[];var t=s(e);return Object.keys(t.reduce(o,{}))}function l(e){return function(t){return e&&-1!==e.indexOf(t)}}function c(e,t){for(var i in e)t[i]=e[i]}function d(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,n=new n,c(i,n),e.prototype=i=n}i.constructor!=e&&(i.constructor=e)}var h={},p=h.ELEMENT_NODE=1,f=h.ATTRIBUTE_NODE=2,m=h.TEXT_NODE=3,g=h.CDATA_SECTION_NODE=4,y=h.ENTITY_REFERENCE_NODE=5,v=h.ENTITY_NODE=6,_=h.PROCESSING_INSTRUCTION_NODE=7,b=h.COMMENT_NODE=8,T=h.DOCUMENT_NODE=9,S=h.DOCUMENT_TYPE_NODE=10,w=h.DOCUMENT_FRAGMENT_NODE=11,E=h.NOTATION_NODE=12,k={},C={},O=(k.INDEX_SIZE_ERR=(C[1]="Index size error",1),k.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2),k.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3)),A=(k.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4),k.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5),k.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),k.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7),k.NOT_FOUND_ERR=(C[8]="Not found",8)),x=(k.NOT_SUPPORTED_ERR=(C[9]="Not supported",9),k.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10));k.INVALID_STATE_ERR=(C[11]="Invalid state",11),k.SYNTAX_ERR=(C[12]="Syntax error",12),k.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),k.NAMESPACE_ERR=(C[14]="Invalid namespace",14),k.INVALID_ACCESS_ERR=(C[15]="Invalid access",15);function I(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,I);return i.code=e,t&&(this.message=this.message+": "+t),i}function L(){}function P(e,t){this._node=e,this._refresh=t,D(this)}function D(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);fe(e,"length",i.length),c(i,e),e._inc=t}}function R(){}function M(e,t){var i=e.length;while(i--)if(e[i]===t)return i}function U(e,t,i,n){if(n?t[M(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&z(r,e,n),V(r,e,i))}}function N(e,t,i){var n=M(t,i);if(!(n>=0))throw I(A,new Error(e.tagName+"@"+i));var r=t.length-1;while(n<r)t[n]=t[++n];if(t.length=r,e){var a=e.ownerDocument;a&&(z(a,e,i),i.ownerElement=null)}}function j(){}function B(){}function F(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function q(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(q(e,t))return!0}while(e=e.nextSibling)}function H(){}function V(e,t,i){e&&e._inc++;var n=i.namespaceURI;n===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}function z(e,t,i,n){e&&e._inc++;var a=i.namespaceURI;a===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function W(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{var r=t.firstChild,a=0;while(r)n[a++]=r,r=r.nextSibling;n.length=a}}}function G(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,W(e.ownerDocument,e),t}function X(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===w){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=i?i.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=i,s?s.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return W(e.ownerDocument||e,e),t.nodeType==w&&(t.firstChild=t.lastChild=null),t}function Y(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t);n=e.lastChild}n=e.lastChild;return t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,W(e.ownerDocument,e,t),t}function $(){this._nsMap={}}function K(){}function Q(){}function J(){}function Z(){}function ee(){}function te(){}function ie(){}function ne(){}function re(){}function ae(){}function se(){}function oe(){}function ue(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,a=n.namespaceURI;if(a&&null==r){r=n.lookupPrefix(a);if(null==r)var s=[{namespace:a,prefix:null}]}return de(this,i,e,t,s),i.join("")}function le(e,t,i){var n=e.prefix||"",a=e.namespaceURI;if(!a)return!1;if("xml"===n&&a===r.XML||a===r.XMLNS)return!1;var s=i.length;while(s--){var o=i[s];if(o.prefix===n)return o.namespace!==a}return!0}function ce(e,t,i){e.push(" ",t,'="',i.replace(/[<&"]/g,F),'"')}function de(e,t,i,n,a){if(a||(a=[]),n){if(e=n(e),!e)return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case p:var s=e.attributes,o=s.length,u=e.firstChild,l=e.tagName;i=r.isHTML(e.namespaceURI)||i;var c=l;if(!i&&!e.prefix&&e.namespaceURI){for(var d,h=0;h<s.length;h++)if("xmlns"===s.item(h).name){d=s.item(h).value;break}if(!d)for(var v=a.length-1;v>=0;v--){var E=a[v];if(""===E.prefix&&E.namespace===e.namespaceURI){d=E.namespace;break}}if(d!==e.namespaceURI)for(v=a.length-1;v>=0;v--){E=a[v];if(E.namespace===e.namespaceURI){E.prefix&&(c=E.prefix+":"+l);break}}}t.push("<",c);for(var k=0;k<o;k++){var C=s.item(k);"xmlns"==C.prefix?a.push({prefix:C.localName,namespace:C.value}):"xmlns"==C.nodeName&&a.push({prefix:"",namespace:C.value})}for(k=0;k<o;k++){C=s.item(k);if(le(C,i,a)){var O=C.prefix||"",A=C.namespaceURI;ce(t,O?"xmlns:"+O:"xmlns",A),a.push({prefix:O,namespace:A})}de(C,t,i,n,a)}if(l===c&&le(e,i,a)){O=e.prefix||"",A=e.namespaceURI;ce(t,O?"xmlns:"+O:"xmlns",A),a.push({prefix:O,namespace:A})}if(u||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))while(u)u.data?t.push(u.data):de(u,t,i,n,a.slice()),u=u.nextSibling;else while(u)de(u,t,i,n,a.slice()),u=u.nextSibling;t.push("</",c,">")}else t.push("/>");return;case T:case w:u=e.firstChild;while(u)de(u,t,i,n,a.slice()),u=u.nextSibling;return;case f:return ce(t,e.name,e.value);case m:return t.push(e.data.replace(/[<&]/g,F).replace(/]]>/g,"]]>"));case g:return t.push("<![CDATA[",e.data,"]]>");case b:return t.push("\x3c!--",e.data,"--\x3e");case S:var x=e.publicId,I=e.systemId;if(t.push("<!DOCTYPE ",e.name),x)t.push(" PUBLIC ",x),I&&"."!=I&&t.push(" ",I),t.push(">");else if(I&&"."!=I)t.push(" SYSTEM ",I,">");else{var L=e.internalSubset;L&&t.push(" [",L,"]"),t.push(">")}return;case _:return t.push("<?",e.target," ",e.data,"?>");case y:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function he(e,t,i){var n;switch(t.nodeType){case p:n=t.cloneNode(!1),n.ownerDocument=e;case w:break;case f:i=!0;break}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i){var r=t.firstChild;while(r)n.appendChild(he(e,r,i)),r=r.nextSibling}return n}function pe(e,t,i){var n=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=n[r]&&(n[r]=a)}switch(t.childNodes&&(n.childNodes=new L),n.ownerDocument=e,n.nodeType){case p:var s=t.attributes,o=n.attributes=new R,u=s.length;o._ownerElement=n;for(var l=0;l<u;l++)n.setAttributeNode(pe(e,s.item(l),!0));break;case f:i=!0}if(i){var c=t.firstChild;while(c)n.appendChild(pe(e,c,i)),c=c.nextSibling}return n}function fe(e,t,i){e[t]=i}I.prototype=Error.prototype,c(k,I),L.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)de(this[n],i,e,t);return i.join("")}},P.prototype.item=function(e){return D(this),this[e]},d(P,L),R.prototype={length:0,item:L.prototype.item,getNamedItem:function(e){var t=this.length;while(t--){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new I(x);var i=this.getNamedItem(e.nodeName);return U(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new I(x);return t=this.getNamedItemNS(e.namespaceURI,e.localName),U(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return N(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return N(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){var i=this.length;while(i--){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},j.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new H;if(n.implementation=this,n.childNodes=new L,n.doctype=i||null,i&&n.appendChild(i),t){var r=n.createElementNS(e,t);n.appendChild(r)}return n},createDocumentType:function(e,t,i){var n=new te;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},B.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return X(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return G(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return pe(this.ownerDocument||this,this,e)},normalize:function(){var e=this.firstChild;while(e){var t=e.nextSibling;t&&t.nodeType==m&&e.nodeType==m?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==f?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return null==t}},c(h,B),c(h,B.prototype),H.prototype={nodeName:"#document",nodeType:T,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==w){var i=e.firstChild;while(i){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==p&&(this.documentElement=e),X(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},importNode:function(e,t){return he(this,e,t)},getElementById:function(e){var t=null;return q(this.documentElement,(function(i){if(i.nodeType==p&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=u(e);return new P(this,(function(i){var n=[];return t.length>0&&q(i.documentElement,(function(r){if(r!==i&&r.nodeType===p){var a=r.getAttribute("class");if(a){var s=e===a;if(!s){var o=u(a);s=t.every(l(o))}s&&n.push(r)}}})),n}))},createElement:function(e){var t=new $;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new L;var i=t.attributes=new R;return i._ownerElement=t,t},createDocumentFragment:function(){var e=new ae;return e.ownerDocument=this,e.childNodes=new L,e},createTextNode:function(e){var t=new J;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Z;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ee;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new se;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new K;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new re;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new $,n=t.split(":"),r=i.attributes=new R;return i.childNodes=new L,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new K,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},d(H,B),$.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===w?this.insertBefore(e,null):Y(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new P(this,(function(t){var i=[];return q(t,(function(n){n===t||n.nodeType!=p||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new P(this,(function(i){var n=[];return q(i,(function(r){r===i||r.nodeType!==p||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},H.prototype.getElementsByTagName=$.prototype.getElementsByTagName,H.prototype.getElementsByTagNameNS=$.prototype.getElementsByTagNameNS,d($,B),K.prototype.nodeType=f,d(K,B),Q.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[O])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),r=this.data.substring(e+t);i=n+i+r,this.nodeValue=this.data=i,this.length=i.length}},d(Q,B),J.prototype={nodeName:"#text",nodeType:m,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},d(J,Q),Z.prototype={nodeName:"#comment",nodeType:b},d(Z,Q),ee.prototype={nodeName:"#cdata-section",nodeType:g},d(ee,Q),te.prototype.nodeType=S,d(te,B),ie.prototype.nodeType=E,d(ie,B),ne.prototype.nodeType=v,d(ne,B),re.prototype.nodeType=y,d(re,B),ae.prototype.nodeName="#document-fragment",ae.prototype.nodeType=w,d(ae,B),se.prototype.nodeType=_,d(se,B),oe.prototype.serializeToString=function(e,t,i){return ue.call(e,t,i)},B.prototype.toString=ue;try{if(Object.defineProperty){function me(e){switch(e.nodeType){case p:case w:var t=[];e=e.firstChild;while(e)7!==e.nodeType&&8!==e.nodeType&&t.push(me(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(P.prototype,"length",{get:function(){return D(this),this.$$length}}),Object.defineProperty(B.prototype,"textContent",{get:function(){return me(this)},set:function(e){switch(this.nodeType){case p:case w:while(this.firstChild)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),fe=function(e,t,i){e["$$"+t]=i}}}catch(ge){}t.DocumentType=te,t.DOMException=I,t.DOMImplementation=j,t.Element=$,t.Node=B,t.NodeList=L,t.XMLSerializer=oe},e206:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={TIME_BETWEEN_CHUNKS:1,BYTES_PER_CHUNK:32768};t["default"]=n,e.exports=t["default"]},e3db:function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},e507:function(e,t,i){"use strict";i("5f65")},e647:function(e,t,i){"use strict";e.exports=function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}},e9b3:function(e,t,i){(function(t){var i;i="undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},e.exports=i}).call(this,i("c8ba"))},ed4d:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){var i=[],n=!0,r=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(n=(s=o.next()).done);n=!0)if(i.push(s.value),t&&i.length===t)break}catch(u){r=!0,a=u}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw a}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function r(e){return e&&e.__esModule?e:{default:e}}var a=i("be09"),s=r(a),o=function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},u=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];if(e.segments)for(var r=i,a=void 0,u=0;u<e.segments.length;u++){var l=e.segments[u];if(a||(a=o(t,r+l.duration/2)),a){if("cueIn"in l){a.endTime=r,a.adEndTime=r,r+=l.duration,a=null;continue}if(r<a.endTime){r+=l.duration;continue}a.endTime+=l.duration}else if("cueOut"in l&&(a=new s["default"].VTTCue(r,r+l.duration,l.cueOut),a.adStartTime=r,a.adEndTime=r+parseFloat(l.cueOut),t.addCue(a)),"cueOutCont"in l){var c=void 0,d=void 0,h=l.cueOutCont.split("/").map(parseFloat),p=n(h,2);c=p[0],d=p[1],a=new s["default"].VTTCue(r,r+l.duration,""),a.adStartTime=r-c,a.adEndTime=a.adStartTime+d,t.addCue(a)}r+=l.duration}};t["default"]={updateAdCues:u,findAdCue:o},e.exports=t["default"]},eec7:function(e,t,i){"use strict";var n=i("e9b3"),r=i("8362"),a=i("6444"),s=i("53a8");function o(e,t){for(var i=0;i<e.length;i++)t(e[i])}function u(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function l(e,t,i){var n=e;return r(t)?(i=t,"string"===typeof e&&(n={uri:e})):n=s(t,{uri:e}),n.callback=i,n}function c(e,t,i){return t=l(e,t,i),d(t)}function d(e){if("undefined"===typeof e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(){4===p.readyState&&setTimeout(o,0)}function r(){var e=void 0;if(e=p.response?p.response:p.responseText||h(p),b)try{e=JSON.parse(e)}catch(t){}return e}function s(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,T)}function o(){if(!d){var t;clearTimeout(f),t=e.useXDR&&void 0===p.status?200:1223===p.status?204:p.status;var n=T,s=null;return 0!==t?(n={body:r(),statusCode:t,method:g,headers:{},url:m,rawRequest:p},p.getAllResponseHeaders&&(n.headers=a(p.getAllResponseHeaders()))):s=new Error("Internal XMLHttpRequest Error"),i(s,n,n.body)}}var l,d,p=e.xhr||null;p||(p=e.cors||e.useXDR?new c.XDomainRequest:new c.XMLHttpRequest);var f,m=p.url=e.uri||e.url,g=p.method=e.method||"GET",y=e.body||e.data,v=p.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:p};if("json"in e&&!1!==e.json&&(b=!0,v["accept"]||v["Accept"]||(v["Accept"]="application/json"),"GET"!==g&&"HEAD"!==g&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),p.onreadystatechange=n,p.onload=o,p.onerror=s,p.onprogress=function(){},p.onabort=function(){d=!0},p.ontimeout=s,p.open(g,m,!_,e.username,e.password),_||(p.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(f=setTimeout((function(){if(!d){d=!0,p.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",s(e)}}),e.timeout)),p.setRequestHeader)for(l in v)v.hasOwnProperty(l)&&p.setRequestHeader(l,v[l]);else if(e.headers&&!u(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(p.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(p),p.send(y||null),p}function h(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function p(){}e.exports=c,c.XMLHttpRequest=n.XMLHttpRequest||p,c.XDomainRequest="withCredentials"in new c.XMLHttpRequest?c.XMLHttpRequest:n.XDomainRequest,o(["get","put","post","patch","head","delete"],(function(e){c["delete"===e?"del":e]=function(t,i,n){return i=l(t,i,n),i.method=e.toUpperCase(),d(i)}}))},ef34:function(e,t,i){(function(t){var n,r="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},a=i(2);"undefined"!==typeof document?n=document:(n=r["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=r["__GLOBAL_DOCUMENT_CACHE@4"]=a)),e.exports=n}).call(this,i("c8ba"))},f24e:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return e.start(t)+"-"+e.end(t)},r=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},a=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},s=function(e){var t={};return Object.keys(e).forEach((function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},o=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},u={hexDump:function(e){for(var t=Array.prototype.slice.call(e),i=16,n="",s=void 0,o=void 0,u=0;u<t.length/i;u++)s=t.slice(u*i,u*i+i).map(r).join(""),o=t.slice(u*i,u*i+i).map(a).join(""),n+=s+" "+o+"\n";return n},tagDump:function(e){return u.hexDump(e.bytes)},textRanges:function(e){var t="",i=void 0;for(i=0;i<e.length;i++)t+=n(e,i)+" ";return t},createTransferableMessage:s,initSegmentId:o};t["default"]=u,e.exports=t["default"]},f631:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=i("be09"),o=r(s),u=i("d3ae"),l=r(u),c=i("3d33"),d=r(c),h=["seeking","seeked","pause","playing","error"],p=function(){function e(t){var i=this;a(this,e),this.tech_=t.tech,this.seekable=t.seekable,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,t.debug&&(this.logger_=d["default"].log.bind(d["default"],"playback-watcher ->")),this.logger_("initialize");var n=function(){return i.monitorCurrentTime_()},r=function(){return i.techWaiting_()},s=function(){return i.cancelTimer_()},u=function(){return i.fixesBadSeeks_()};this.tech_.on("seekablechanged",u),this.tech_.on("waiting",r),this.tech_.on(h,s),this.tech_.on("canplay",n),this.dispose=function(){i.logger_("dispose"),i.tech_.off("seekablechanged",u),i.tech_.off("waiting",r),i.tech_.off(h,s),i.tech_.off("canplay",n),i.checkCurrentTimeTimeout_&&o["default"].clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}return n(e,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&o["default"].clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=o["default"].setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+l["default"].SAFE_TIME_DELTA>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking(),t=this.seekable(),i=this.tech_.currentTime(),n=void 0;if(e&&this.afterSeekableWindow_(t,i)){var r=t.end(t.length-1);n=r}if(e&&this.beforeSeekableWindow_(t,i)){var a=t.start(0);n=a+l["default"].SAFE_TIME_DELTA}return"undefined"!==typeof n&&(this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+l["default"].printableRange(t)+". Seeking to "+n+"."),this.tech_.setCurrentTime(n),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),i=l["default"].findRange(t,e);return i.length&&e+3<=i.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+i.start(0)+" -> "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),r=l["default"].findNextRange(n,t);if(this.videoUnderflow_(r,n,t))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(r.length>0){var a=r.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+a+", seeking to "+r.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,t),!0}return!1}},{key:"afterSeekableWindow_",value:function(e,t){return!!e.length&&t>e.end(e.length-1)+l["default"].SAFE_TIME_DELTA}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-l["default"].SAFE_TIME_DELTA)}},{key:"videoUnderflow_",value:function(e,t,i){if(0===e.length){var n=this.gapFromVideoUnderflow_(t,i);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+i),!0}return!1}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),n=l["default"].findNextRange(t,i);this.cancelTimer_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+l["default"].TIME_FUDGE_FACTOR),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var i=l["default"].findGaps(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&t-r>2)return{start:r,end:a}}return null}},{key:"logger_",value:function(){}}]),e}();t["default"]=p,e.exports=t["default"]},f7fd:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=function(e,t,i){var n=!0;while(n){var r=e,a=t,s=i;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,a);if(void 0!==o){if("value"in o)return o.value;var u=o.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;e=l,t=a,i=s,n=!0,o=l=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=i("d61a"),l=a(u),c=i("3d33"),d=a(c),h=i("6e1b"),p=a(h),f=i("56c8"),m=a(f),g=i("be09"),y=a(g),v=i("4ea2"),_=a(v),b=i("f24e"),T=i("81bc"),S=i("d3ae"),w=i("57db"),E=500,k=function(e,t,i){if(!e||!t)return!1;var n=e.segments,r=i===n.length;return e.endList&&"open"===t.readyState&&r},C=function(e){return"number"===typeof e&&isFinite(e)},O=function(e,t,i){return"main"===e&&t&&i?i.containsAudio||i.containsVideo?t.containsVideo&&!i.containsVideo?"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.":!t.containsVideo&&i.containsVideo?"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:"Neither audio nor video found in segment.":null};t.illegalMediaSwitch=O;var A=function(e,t,i){var n=void 0;return n=e.length&&e.start(0)>0&&e.start(0)<t?e.start(0):t-30,Math.min(n,t-i)};t.safeBackBufferTrimTime=A;var x=function(e){function t(e){var i=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(s(this,t),r(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),!e)throw new TypeError("Initialization settings are required");if("function"!==typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.state="INIT",this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.hls_=e.hls,this.loaderType_=e.loaderType,this.startingMedia_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.mimeType_=null,this.sourceUpdater_=null,this.xhrOptions_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.syncController_.on("syncinfoupdate",(function(){return i.trigger("syncinfoupdate")})),this.mediaSource_.addEventListener("sourceopen",(function(){return i.ended_=!1})),this.fetchAtBuffer_=!1,n.debug&&(this.logger_=d["default"].log.bind(d["default"],"segment-loader",this.loaderType_,"->"))}return o(t,e),n(t,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_()}},{key:"abort",value:function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(e){return"undefined"!==typeof e&&(this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():d["default"].createTimeRanges()}},{key:"initSegment",value:function(e){var t=!(arguments.length<=1||void 0===arguments[1])&&arguments[1];if(!e)return null;var i=(0,b.initSegmentId)(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes}),n||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new p["default"](this.mediaSource_,this.mimeType_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(e){var i=this.playlist_,n=this.pendingSegment_;if(this.playlist_=e,this.xhrOptions_=t,this.hasPlayed_()||(e.syncInfo={mediaSequence:e.mediaSequence,time:0}),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(i&&i.uri===e.uri){var r=e.mediaSequence-i.mediaSequence;this.logger_("mediaSequenceDiff",r),null!==this.mediaIndex&&(this.mediaIndex-=r),n&&(n.mediaIndex-=r,n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(i,e)}else null!==this.mediaIndex&&this.resyncLoader()}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e){this.mimeType_||(this.mimeType_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_()),this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(e,t){this.sourceUpdater_&&this.sourceUpdater_.remove(e,t),(0,_["default"])(e,t,this.segmentMetadataTrack_)}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=y["default"].setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&y["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=y["default"].setTimeout(this.monitorBufferTick_.bind(this),E)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(e){var t=k(this.playlist_,this.mediaSource_,e.mediaIndex);t?this.endOfStream():(e.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((e.timeline!==this.currentTimeline_||null!==e.startOfSegment&&e.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),e.timestampOffset=e.startOfSegment),this.loadSegment_(e))}}}},{key:"checkBuffer_",value:function(e,t,i,n,r,a){var s=0,o=void 0;e.length&&(s=e.end(e.length-1));var u=Math.max(0,s-r);if(!t.segments.length)return null;if(u>=this.goalBufferLength_())return null;if(!n&&u>=1)return null;if(this.logger_("checkBuffer_","mediaIndex:",i,"hasPlayed:",n,"currentTime:",r,"syncPoint:",a,"fetchAtBuffer:",this.fetchAtBuffer_,"bufferedTime:",u),null===a)return i=this.getSyncSegmentCandidate_(t),this.logger_("getSync","mediaIndex:",i),this.generateSegmentInfo_(t,i,null,!0);if(null!==i){this.logger_("walkForward","mediaIndex:",i+1);var c=t.segments[i];return o=c&&c.end?c.end:s,this.generateSegmentInfo_(t,i+1,o,!1)}if(this.fetchAtBuffer_){var d=l["default"].getMediaInfoForTime(t,s,a.segmentIndex,a.time);i=d.mediaIndex,o=d.startTime}else{d=l["default"].getMediaInfoForTime(t,r,a.segmentIndex,a.time);i=d.mediaIndex,o=d.startTime}return this.logger_("getMediaIndexForTime","mediaIndex:",i,"startOfSegment:",o),this.generateSegmentInfo_(t,i,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_)return 0;var i=e.segments.map((function(e,t){return{timeline:e.timeline,segmentIndex:t}})).filter((function(e){return e.timeline===t.currentTimeline_}));return i.length?i[Math.min(i.length-1,1)].segmentIndex:Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,i,n){if(t<0||t>=e.segments.length)return null;var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:i,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return!1;var t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,r=l["default"].estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),a=(0,S.timeUntilRebuffer)(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=a)return!1;var s=(0,w.minRebufferMaxBandwidthSelector)({master:this.hls_.playlists.master,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a,u=o-s.rebufferingImpact,c=.5;return a<=S.TIME_FUDGE_FACTOR&&(c=1),!s.playlist||s.playlist.uri===this.playlist_.uri||u<c?!1:(this.bandwidth=s.playlist.attributes.BANDWIDTH*m["default"].BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}}},{key:"handleProgress_",value:function(e,t){this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(t.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),e.abortRequests=(0,T.mediaSegmentRequest)(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.createSimplifiedSegmentObj_(e),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(e){var t=A(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,i={resolvedUri:t.resolvedUri,byterange:t.byterange,requestId:e.requestId};if(t.key){var n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);i.key={resolvedUri:t.key.resolvedUri,iv:n}}return t.map&&(i.map=this.initSegment(t.map)),i}},{key:"segmentRequestFinished_",value:function(e,t){if(this.mediaRequests+=1,t.stats&&(this.mediaBytesTransferred+=t.stats.bytesReceived,this.mediaTransferDuration+=t.stats.roundTripTime),this.pendingSegment_){if(t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===T.REQUEST_ERRORS.ABORTED?void(this.mediaRequestsAborted+=1):(this.pause(),e.code===T.REQUEST_ERRORS.TIMEOUT?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));this.bandwidth=t.stats.bandwidth,this.roundTrip=t.stats.roundTripTime,t.map&&(t.map=this.initSegment(t.map,!0)),this.processSegmentResponse_(t)}}else this.mediaRequestsAborted+=1}},{key:"processSegmentResponse_",value:function(e){var t=this.pendingSegment_;t.bytes=e.bytes,e.map&&(t.segment.map.bytes=e.map.bytes),t.endOfAllRequests=e.endOfAllRequests,this.handleSegment_()}},{key:"handleSegment_",value:function(){var e=this;if(this.pendingSegment_){var t=this.pendingSegment_,i=t.segment,n=this.syncController_.probeSegmentInfo(t);"undefined"===typeof this.startingMedia_&&n&&(n.containsAudio||n.containsVideo)&&(this.startingMedia_={containsAudio:n.containsAudio,containsVideo:n.containsVideo});var r=O(this.loaderType_,this.startingMedia_,n);if(r)return this.error({message:r,blacklistDuration:1/0}),void this.trigger("error");if(t.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==t.timestampOffset&&t.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(t.timestampOffset),this.trigger("timestampoffset"));var a=this.syncController_.mappingForTimeline(t.timeline);null!==a&&this.trigger({type:"segmenttimemapping",mapping:a}),this.state="APPENDING",i.map&&function(){var t=(0,b.initSegmentId)(i.map);if(!e.activeInitSegmentId_||e.activeInitSegmentId_!==t){var n=e.initSegment(i.map);e.sourceUpdater_.appendBuffer(n.bytes,(function(){e.activeInitSegmentId_=t}))}}(),t.byteLength=t.bytes.byteLength,"number"===typeof i.start&&"number"===typeof i.end?this.mediaSecondsLoaded+=i.end-i.start:this.mediaSecondsLoaded+=i.duration,this.sourceUpdater_.appendBuffer(t.bytes,this.handleUpdateEnd_.bind(this))}else this.state="READY"}},{key:"handleUpdateEnd_",value:function(){if(this.logger_("handleUpdateEnd_","segmentInfo:",this.pendingSegment_),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_,t=e.segment,i=null!==this.mediaIndex;if(this.pendingSegment_=null,this.recordThroughput_(e),this.addSegmentMetadataCue_(e),this.state="READY",this.mediaIndex=e.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),t.end&&this.currentTime_()-t.end>3*e.playlist.targetDuration)this.resetEverything();else{i&&this.trigger("bandwidthupdate"),this.trigger("progress");var n=k(e.playlist,this.mediaSource_,e.mediaIndex+1);n&&this.endOfStream(),this.paused()||this.monitorBuffer_()}}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"logger_",value:function(){}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(C(i)&&C(n)){(0,_["default"])(i,n,this.segmentMetadataTrack_);var r=y["default"].WebKitDataCue||y["default"].VTTCue,a={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.uri,start:i,end:n},s=JSON.stringify(a),o=new r(i,n,s);o.value=a,this.segmentMetadataTrack_.addCue(o)}}}}]),t}(d["default"].EventTarget);t["default"]=x},f97d:function(e,t){var i={"":!0,up:!0};function n(e){if("string"!==typeof e)return!1;var t=i[e.toLowerCase()];return!!t&&e.toLowerCase()}function r(e){return"number"===typeof e&&e>=0&&e<=100}function a(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!==typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=n(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");u=t}}})}e.exports=a},fc85:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(){r(this,e),this.listeners={}}return n(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"off",value:function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e].splice(i,1),i>-1}},{key:"trigger",value:function(e){var t=this.listeners[e],i=void 0,n=void 0,r=void 0;if(t)if(2===arguments.length)for(n=t.length,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(r=Array.prototype.slice.call(arguments,1),n=t.length,i=0;i<n;++i)t[i].apply(this,r)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(e){this.on("data",(function(t){e.push(t)}))}}]),e}();t["default"]=a},fda2:function(e,t,i){},ffdf:function(e,t,i){"use strict";(function(e){i.d(t,"a",(function(){return s}));var n=i("be09"),r=i.n(n),a=function(t){return r.a.atob?r.a.atob(t):e.from(t,"base64").toString("binary")};function s(e){for(var t=a(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}}).call(this,i("b639").Buffer)}}]);
|